[PATCH] Some renames to keep up with recent API changes on Qt5.

36 views
Skip to first unread message

Marcelo Lira

unread,
Jul 26, 2012, 9:02:20 AM7/26/12
to snowsh...@googlegroups.com
QQuickCanvas became QQuickWindow, and its method setClearColor
became setColor.

See http://lists.qt-project.org/pipermail/development/2012-July/005009.html
and qtdeclarative/feb996e3.

Reviewed by: ?
---
src/core/PopupWindow.cpp | 10 +++++-----
src/core/PopupWindow.h | 4 ++--
src/desktop/BrowserWindow.cpp | 2 +-
3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/core/PopupWindow.cpp b/src/core/PopupWindow.cpp
index 6978b56..1146033 100644
--- a/src/core/PopupWindow.cpp
+++ b/src/core/PopupWindow.cpp
@@ -19,19 +19,19 @@
#include <QtCore/QTimer>

PopupWindow::PopupWindow(QWindow* parent)
- : QQuickCanvas(parent)
+ : QQuickWindow(parent)
{
setWindowFlags(Qt::Popup);
QSurfaceFormat surfaceFormat;
surfaceFormat.setAlphaBufferSize(8);
setFormat(surfaceFormat);
setClearBeforeRendering(true);
- setClearColor(QColor(Qt::transparent));
+ setColor(QColor(Qt::transparent));
}

void PopupWindow::showEvent(QShowEvent* ev)
{
- QQuickCanvas::showEvent(ev);
+ QQuickWindow::showEvent(ev);
// In XCB, we are only guaranteed to grab the mouse if there's a platformWindow
// created. This happens right after this event is sent.
QTimer::singleShot(0, this, SLOT(setMouseGrab()));
@@ -39,13 +39,13 @@ void PopupWindow::showEvent(QShowEvent* ev)

void PopupWindow::hideEvent(QHideEvent* ev)
{
- QQuickCanvas::hideEvent(ev);
+ QQuickWindow::hideEvent(ev);
setMouseGrabEnabled(false);
}

void PopupWindow::mousePressEvent(QMouseEvent* ev)
{
- QQuickCanvas::mousePressEvent(ev);
+ QQuickWindow::mousePressEvent(ev);
const bool outsideWindow = ev->x() < 0 || ev->x() > width() || ev->y() < 0 || ev->y() > height();
if (outsideWindow)
hide();
diff --git a/src/core/PopupWindow.h b/src/core/PopupWindow.h
index 189adb3..8b44ccf 100644
--- a/src/core/PopupWindow.h
+++ b/src/core/PopupWindow.h
@@ -17,9 +17,9 @@
#ifndef PopupWindow_h
#define PopupWindow_h

-#include <QtQuick/QQuickCanvas>
+#include <QtQuick/QQuickWindow>

-class PopupWindow : public QQuickCanvas {
+class PopupWindow : public QQuickWindow {
Q_OBJECT

public:
diff --git a/src/desktop/BrowserWindow.cpp b/src/desktop/BrowserWindow.cpp
index 522f44c..8bda7f9 100644
--- a/src/desktop/BrowserWindow.cpp
+++ b/src/desktop/BrowserWindow.cpp
@@ -43,7 +43,7 @@ BrowserWindow::BrowserWindow(const QStringList& arguments)
surfaceFormat.setAlphaBufferSize(8);
setFormat(surfaceFormat);
setClearBeforeRendering(true);
- setClearColor(QColor(Qt::transparent));
+ setColor(QColor(Qt::transparent));
qmlRegisterType<Shortcut>("Snowshoe", 1, 0, "Shortcut");
restoreWindowGeometry();
setupDeclarativeEnvironment();
--
1.7.9.5

Rafael Brandao

unread,
Jul 26, 2012, 9:18:01 AM7/26/12
to snowsh...@googlegroups.com
r=me
--
Rafael Brandao @ INdT

Alexis Menard

unread,
Jul 26, 2012, 9:58:04 AM7/26/12
to snowsh...@googlegroups.com
Already landed :)
--
Alexis Menard (darktears)
Software Engineer
openBossa @ INdT - Instituto Nokia de Tecnologia
Reply all
Reply to author
Forward
0 new messages