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.cpp | 13 ++----------- src/gui/kernel/qevent.h | 4 ++-- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 7f1a850cda..52880a231d 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -3277,27 +3277,18 @@ QClipboardEvent::~QClipboardEvent() Returns the state of the window before the change. */ -/*! \internal - */ -QWindowStateChangeEvent::QWindowStateChangeEvent(Qt::WindowStates s) - : QEvent(WindowStateChange), ostate(s) -{ -} - /*! \internal */ QWindowStateChangeEvent::QWindowStateChangeEvent(Qt::WindowStates s, bool isOverride) - : QEvent(WindowStateChange), ostate(s) + : QEvent(WindowStateChange), ostate(s), m_override(isOverride) { - if (isOverride) - d = (QEventPrivate*)(this); } /*! \internal */ bool QWindowStateChangeEvent::isOverride() const { - return (d != 0); + return m_override; } /*! \internal 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