From a3f90fd44f822ae9d77c9d115934e18a9c7466fd Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 11 Apr 2012 17:07:28 -0300 Subject: Remove private classes in QEvent-derived classes. QEventPrivate doesn't exist, so these classes were technically abusing the d pointer. Move the contents of the private classes into the main event classes. Change-Id: If2e894c1fa05f468221a0b43f3ebdf90769298eb Reviewed-by: Gunnar Sletta Reviewed-by: Lars Knoll --- src/gui/kernel/qevent.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'src/gui/kernel/qevent.h') diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index 7761bab944..de4befb64c 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -53,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -646,10 +647,11 @@ public: ~QFileOpenEvent(); inline QString file() const { return f; } - QUrl url() const; + QUrl url() const { return m_url; } bool openFile(QFile &file, QIODevice::OpenMode flags) const; private: QString f; + QUrl m_url; }; #ifndef QT_NO_TOOLBAR @@ -847,7 +849,6 @@ protected: Q_DECLARE_TYPEINFO(QTouchEvent::TouchPoint, Q_MOVABLE_TYPE); Q_DECLARE_OPERATORS_FOR_FLAGS(QTouchEvent::TouchPoint::InfoFlags) -class QScrollPrepareEventPrivate; class Q_GUI_EXPORT QScrollPrepareEvent : public QEvent { public: @@ -865,12 +866,14 @@ public: void setContentPos(const QPointF &pos); private: - QScrollPrepareEventPrivate *d_func(); - const QScrollPrepareEventPrivate *d_func() const; + QObject* m_target; + QPointF m_startPos; + QSizeF m_viewportSize; + QRectF m_contentPosRange; + QPointF m_contentPos; }; -class QScrollEventPrivate; class Q_GUI_EXPORT QScrollEvent : public QEvent { public: @@ -889,11 +892,11 @@ public: ScrollState scrollState() const; private: - QScrollEventPrivate *d_func(); - const QScrollEventPrivate *d_func() const; + QPointF m_contentPos; + QPointF m_overshoot; + QScrollEvent::ScrollState m_state; }; -class QScreenOrientationChangeEventPrivate; class Q_GUI_EXPORT QScreenOrientationChangeEvent : public QEvent { public: @@ -904,8 +907,8 @@ public: Qt::ScreenOrientation orientation() const; private: - QScreenOrientationChangeEventPrivate *d_func(); - const QScreenOrientationChangeEventPrivate *d_func() const; + QScreen *m_screen; + Qt::ScreenOrientation m_orientation; }; QT_END_NAMESPACE -- cgit v1.2.3 From 80ad5938ea20f1dc91636cee10ca04bba94929e8 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 19 Apr 2012 21:24:22 +0200 Subject: Stop using QEventPrivate::d in QWindowStateChangeEvent We can add a boolean and avoid using the d pointer (which QEvent now checks to be unused). Change-Id: I7367d5410d10ed06441fe9037cac0e3473d62498 Reviewed-by: Olivier Goffart --- src/gui/kernel/qevent.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gui/kernel/qevent.h') diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index de4befb64c..176747aa95 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -698,8 +698,7 @@ public: class Q_GUI_EXPORT QWindowStateChangeEvent: public QEvent { public: - explicit QWindowStateChangeEvent(Qt::WindowStates aOldState); - QWindowStateChangeEvent(Qt::WindowStates aOldState, bool isOverride); + explicit QWindowStateChangeEvent(Qt::WindowStates aOldState, bool isOverride = false); ~QWindowStateChangeEvent(); inline Qt::WindowStates oldState() const { return ostate; } @@ -707,6 +706,7 @@ public: private: Qt::WindowStates ostate; + bool m_override; }; #ifndef QT_NO_DEBUG_STREAM -- cgit v1.2.3