diff options
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r-- | src/widgets/kernel/qapplication_p.h | 47 | ||||
-rw-r--r-- | src/widgets/kernel/qgesturemanager.cpp | 10 | ||||
-rw-r--r-- | src/widgets/kernel/qtooltip.cpp | 45 | ||||
-rw-r--r-- | src/widgets/kernel/qwhatsthis.cpp | 16 | ||||
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 402 | ||||
-rw-r--r-- | src/widgets/kernel/qwidget_p.h | 153 |
6 files changed, 24 insertions, 649 deletions
diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h index 36c0ba8739..3167bd423f 100644 --- a/src/widgets/kernel/qapplication_p.h +++ b/src/widgets/kernel/qapplication_p.h @@ -112,16 +112,9 @@ public: virtual bool shouldQuit() override; bool tryCloseAllWindows() override; -#if 0 // Used to be included in Qt4 for Q_WS_X11 -#if QT_CONFIG(settings) - static bool x11_apply_settings(); -#endif - static void reset_instance_pointer(); -#endif static bool autoSipEnabled; static QString desktopStyleKey(); - void createEventDispatcher() override; static void dispatchEnterLeave(QWidget *enter, QWidget *leave, const QPointF &globalPosF); @@ -132,10 +125,7 @@ public: static bool isBlockedByModal(QWidget *widget); static bool modalState(); static bool tryModalHelper(QWidget *widget, QWidget **rettop = nullptr); -#if 0 // Used to be included in Qt4 for Q_WS_MAC - static QWidget *tryModalHelper_sys(QWidget *top); - bool canQuit(); -#endif + #ifdef QT_KEYPAD_NAVIGATION static bool keypadNavigationEnabled() { @@ -146,18 +136,10 @@ public: bool notify_helper(QObject *receiver, QEvent * e); - void init( -#if 0 // Used to be included in Qt4 for Q_WS_X11 - Display *dpy = 0, Qt::HANDLE visual = 0, Qt::HANDLE cmap = 0 -#endif - ); + void init(); void initialize(); void process_cmdline(); -#if 0 // Used to be included in Qt4 for Q_WS_X11 - static void x11_initialize_style(); -#endif - static bool inPopupMode(); bool popupActive() override { return inPopupMode(); } void closePopup(QWidget *popup); @@ -212,10 +194,6 @@ public: static void initializeWidgetFontHash(); static void setSystemFont(const QFont &font); -#if 0 // Used to be included in Qt4 for Q_WS_X11 - static void applyX11SpecificCommandLineArguments(QWidget *main_widget); -#endif - static QApplicationPrivate *instance() { return self; } #ifdef QT_KEYPAD_NAVIGATION @@ -223,10 +201,6 @@ public: static Qt::NavigationMode navigationMode; #endif -#if 0 /* Used to be included in Qt4 for Q_WS_MAC */ || 0 /* Used to be included in Qt4 for Q_WS_X11 */ - void _q_alertTimeOut(); - QHash<QWidget *, QTimer *> alertTimerHash; -#endif #ifndef QT_NO_STYLE_STYLESHEET static QString styleSheet; #endif @@ -263,14 +237,6 @@ public: QGestureManager *gestureManager; QWidget *gestureWidget; #endif -#if 0 /* Used to be included in Qt4 for Q_WS_X11 */ || 0 /* Used to be included in Qt4 for Q_WS_WIN */ - QPixmap *move_cursor; - QPixmap *copy_cursor; - QPixmap *link_cursor; -#endif -#if 0 // Used to be included in Qt4 for Q_WS_WIN - QPixmap *ignore_cursor; -#endif static bool updateTouchPointsForWidget(QWidget *widget, QTouchEvent *touchEvent); void initializeMultitouch(); @@ -299,14 +265,7 @@ private: static bool isAlien(QWidget *); }; -#if 0 // Used to be included in Qt4 for Q_WS_WIN - extern void qt_win_set_cursor(QWidget *, bool); -#elif 0 // Used to be included in Qt4 for Q_WS_X11 - extern void qt_x11_enforce_cursor(QWidget *, bool); - extern void qt_x11_enforce_cursor(QWidget *); -#else - extern void qt_qpa_set_cursor(QWidget * w, bool force); -#endif +extern void qt_qpa_set_cursor(QWidget * w, bool force); QT_END_NAMESPACE diff --git a/src/widgets/kernel/qgesturemanager.cpp b/src/widgets/kernel/qgesturemanager.cpp index 1555c2a73a..d9d071a31a 100644 --- a/src/widgets/kernel/qgesturemanager.cpp +++ b/src/widgets/kernel/qgesturemanager.cpp @@ -54,9 +54,6 @@ #ifdef Q_OS_OSX #include "qmacgesturerecognizer_p.h" #endif -#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ && !defined(QT_NO_NATIVE_GESTURES) -#include "qwinnativepangesturerecognizer_win_p.h" -#endif #include "qdebug.h" #include <QtCore/QLoggingCategory> @@ -102,14 +99,7 @@ QGestureManager::QGestureManager(QObject *parent) registerGestureRecognizer(new QSwipeGestureRecognizer); registerGestureRecognizer(new QTapGestureRecognizer); #endif -#if 0 // Used to be included in Qt4 for Q_WS_WIN - #if !defined(QT_NO_NATIVE_GESTURES) - if (QApplicationPrivate::HasTouchSupport) - registerGestureRecognizer(new QWinNativePanGestureRecognizer); - #endif -#else registerGestureRecognizer(new QTapAndHoldGestureRecognizer); -#endif } QGestureManager::~QGestureManager() diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp index d030a28356..97a279d65d 100644 --- a/src/widgets/kernel/qtooltip.cpp +++ b/src/widgets/kernel/qtooltip.cpp @@ -36,9 +36,6 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#if 0 // Used to be included in Qt4 for Q_WS_MAC -# include <private/qcore_mac_p.h> -#endif #include <QtWidgets/private/qtwidgetsglobal_p.h> @@ -63,11 +60,6 @@ #include <QtWidgets/private/qlabel_p.h> #include <qtooltip.h> -#if 0 // Used to be included in Qt4 for Q_WS_MAC -# include <private/qcore_mac_p.h> -#include <private/qt_cocoa_helpers_mac_p.h> -#endif - QT_BEGIN_NAMESPACE /*! @@ -317,20 +309,7 @@ void QTipLabel::timerEvent(QTimerEvent *e) || e->timerId() == expireTimer.timerId()){ hideTimer.stop(); expireTimer.stop(); -#if 0 /* Used to be included in Qt4 for Q_WS_MAC */ && QT_CONFIG(effects) - if (QApplication::isEffectEnabled(Qt::UI_FadeTooltip)){ - // Fade out tip on mac (makes it invisible). - // The tip will not be deleted until a new tip is shown. - - // DRSWAT - Cocoa - macWindowFade(qt_mac_window_for(this)); - QTipLabel::instance->fadingOut = true; // will never be false again. - } - else - hideTipImmediately(); -#else hideTipImmediately(); -#endif } } @@ -420,29 +399,11 @@ void QTipLabel::placeTip(const QPoint &pos, QWidget *w) #endif //QT_NO_STYLE_STYLESHEET -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // When in full screen mode, there is no Dock nor Menu so we can use - // the whole screen for displaying the tooltip. However when not in - // full screen mode we need to save space for the dock, so we use - // availableGeometry instead. - extern bool qt_mac_app_fullscreen; //qapplication_mac.mm - QRect screen; - if(qt_mac_app_fullscreen) - screen = QDesktopWidgetPrivate::screenGeometry(getTipScreen(pos, w)); - else - screen = QDesktopWidgetPrivate::availableGeometry(getTipScreen(pos, w)); -#else QRect screen = QDesktopWidgetPrivate::screenGeometry(getTipScreen(pos, w)); -#endif QPoint p = pos; - p += QPoint(2, -#if 0 // Used to be included in Qt4 for Q_WS_WIN - 21 -#else - 16 -#endif - ); + p += QPoint(2, 16); + if (p.x() + this->width() > screen.x() + screen.width()) p.rx() -= 4 + this->width(); if (p.y() + this->height() > screen.y() + screen.height()) @@ -541,7 +502,7 @@ QT_WARNING_POP QTipLabel::instance->setObjectName(QLatin1String("qtooltip_label")); -#if QT_CONFIG(effects) && !0 /* Used to be included in Qt4 for Q_WS_MAC */ +#if QT_CONFIG(effects) if (QApplication::isEffectEnabled(Qt::UI_FadeTooltip)) qFadeEffect(QTipLabel::instance); else if (QApplication::isEffectEnabled(Qt::UI_AnimateTooltip)) diff --git a/src/widgets/kernel/qwhatsthis.cpp b/src/widgets/kernel/qwhatsthis.cpp index a48eae6628..228ca4d38a 100644 --- a/src/widgets/kernel/qwhatsthis.cpp +++ b/src/widgets/kernel/qwhatsthis.cpp @@ -577,26 +577,12 @@ void QWhatsThisPrivate::say(QWidget * widget, const QString &text, int x, int y) if (text.size() == 0) return; // make a fresh widget, and set it up - QWhatsThat *whatsThat = new QWhatsThat( - text, -#if 0 /* Used to be included in Qt4 for Q_WS_X11 */ && !defined(QT_NO_CURSOR) - QApplication::desktop()->screen(widget ? widget->x11Info().screen() : QCursor::x11Screen()), -#else - 0, -#endif - widget - ); - + QWhatsThat *whatsThat = new QWhatsThat(text, 0, widget); // okay, now to find a suitable location - int scr = (widget ? QDesktopWidgetPrivate::screenNumber(widget) : -#if 0 /* Used to be included in Qt4 for Q_WS_X11 */ && !defined(QT_NO_CURSOR) - QCursor::x11Screen() -#else QDesktopWidgetPrivate::screenNumber(QPoint(x,y)) -#endif ); QRect screen = QDesktopWidgetPrivate::screenGeometry(scr); diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 113c569591..0a7566614b 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -61,13 +61,6 @@ #ifndef QT_NO_ACCESSIBILITY # include "qaccessible.h" #endif -#if 0 // Used to be included in Qt4 for Q_WS_MAC -# include "qt_mac_p.h" -# include "qt_cocoa_helpers_mac_p.h" -# include "qmainwindow.h" -# include "qtoolbar.h" -# include <private/qmainwindowlayout_p.h> -#endif #include <qpa/qplatformwindow.h> #include "private/qwidgetwindow_p.h" #include "qpainter.h" @@ -91,9 +84,6 @@ #endif #include <qbackingstore.h> #include <private/qwidgetrepaintmanager_p.h> -#if 0 // Used to be included in Qt4 for Q_WS_MAC -# include <private/qpaintengine_mac_p.h> -#endif #include <private/qpaintengine_raster_p.h> #include "qwidget_p.h" @@ -129,20 +119,12 @@ QT_BEGIN_NAMESPACE -#if 0 // Used to be included in Qt4 for Q_WS_MAC -bool qt_mac_clearDirtyOnWidgetInsideDrawWidget = false; -#endif - static inline bool qRectIntersects(const QRect &r1, const QRect &r2) { return (qMax(r1.left(), r2.left()) <= qMin(r1.right(), r2.right()) && qMax(r1.top(), r2.top()) <= qMin(r1.bottom(), r2.bottom())); } -#if 0 // Used to be included in Qt4 for Q_WS_MAC -# define QT_NO_PAINT_DEBUG -#endif - extern bool qt_sendSpontaneousEvent(QObject*, QEvent*); // qapplication.cpp extern QDesktopWidget *qt_desktopWidget; // qapplication.cpp @@ -202,17 +184,6 @@ QWidgetPrivate::QWidgetPrivate(int version) #if defined(Q_OS_WIN) , noPaintOnScreen(0) #endif -#if 0 // Used to be included in Qt4 for Q_WS_X11 - , picture(0) -#elif 0 // Used to be included in Qt4 for Q_WS_WIN - #ifndef QT_NO_GESTURES - , nativeGesturePanEnabled(0) - #endif -#elif 0 // Used to be included in Qt4 for Q_WS_MAC - , needWindowChange(0) - , window_event(0) - , qd_hd(0) -#endif { if (Q_UNLIKELY(!qApp)) { qFatal("QWidget: Must construct a QApplication before a QWidget"); @@ -231,16 +202,7 @@ QWidgetPrivate::QWidgetPrivate(int version) isWidget = true; memset(high_attributes, 0, sizeof(high_attributes)); -#if 0 // Used to be included in Qt4 for Q_WS_MAC - drawRectOriginalAdded = false; - originalDrawMethod = true; - changeMethods = false; - isInUnifiedToolbar = false; - unifiedSurface = 0; - toolbar_ancestor = 0; - flushRequested = false; - touchEventsEnabled = false; -#endif + #ifdef QWIDGET_EXTRA_DEBUG static int count = 0; qDebug() << "widgets" << ++count; @@ -985,17 +947,12 @@ void QWidgetPrivate::adjustFlags(Qt::WindowFlags &flags, QWidget *w) // Only enable this on non-Mac platforms. Since the old way of doing this would // interpret WindowSystemMenuHint as a close button and we can't change that behavior // we can't just add this in. -#if 1 // Used to be excluded in Qt4 for Q_WS_MAC if ((flags & (Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint | Qt::WindowContextHelpButtonHint)) # ifdef Q_OS_WIN && type != Qt::Dialog // QTBUG-2027, allow for menu-less dialogs. # endif ) { flags |= Qt::WindowSystemMenuHint; -#else - if (flags & (Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint - | Qt::WindowSystemMenuHint)) { -#endif flags |= Qt::WindowTitleHint; flags &= ~Qt::FramelessWindowHint; } @@ -1050,13 +1007,6 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f) } #endif -#if 0 // Used to be included in Qt4 for Q_WS_X11 - if (desktopWidget) { - // make sure the widget is created on the same screen as the - // programmer specified desktop widget - xinfo = desktopWidget->d_func()->xinfo; - } -#endif if (targetScreen >= 0) { topData()->initialScreenIndex = targetScreen; if (QWindow *window = q->windowHandle()) @@ -1084,9 +1034,6 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f) mustHaveWindowHandle = 1; q->setAttribute(Qt::WA_NativeWindow); } -//#if 0 // Used to be included in Qt4 for Q_WS_MAC -// q->setAttribute(Qt::WA_NativeWindow); -//#endif q->setAttribute(Qt::WA_QuitOnClose); // might be cleared in adjustQuitOnCloseAttribute() adjustQuitOnCloseAttribute(); @@ -1110,9 +1057,6 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f) setOpaque(q->isWindow() && background.style() != Qt::NoBrush && background.isOpaque()); } data.fnt = QFont(data.fnt, q); -#if 0 // Used to be included in Qt4 for Q_WS_X11 - data.fnt.x11SetScreen(xinfo.screen()); -#endif q->setAttribute(Qt::WA_PendingMoveEvent); q->setAttribute(Qt::WA_PendingResizeEvent); @@ -1128,20 +1072,8 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f) QCoreApplication::postEvent(q, new QEvent(QEvent::PolishRequest)); extraPaintEngine = 0; - -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // If we add a child to the unified toolbar, we have to redirect the painting. - if (parentWidget && parentWidget->d_func() && parentWidget->d_func()->isInUnifiedToolbar) { - if (parentWidget->d_func()->unifiedSurface) { - QWidget *toolbar = parentWidget->d_func()->toolbar_ancestor; - parentWidget->d_func()->unifiedSurface->recursiveRedirect(toolbar, toolbar, toolbar->d_func()->toolbar_offset); - } - } -#endif } - - void QWidgetPrivate::createRecursively() { Q_Q(QWidget); @@ -1248,15 +1180,6 @@ void QWidget::create(WId window, bool initializeWindow, bool destroyOldWindow) << "Alien?" << !testAttribute(Qt::WA_NativeWindow); #endif -#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ && QT_CONFIG(draganddrop) - // Unregister the dropsite (if already registered) before we - // re-create the widget with a native window. - if (testAttribute(Qt::WA_WState_Created) && !internalWinId() && testAttribute(Qt::WA_NativeWindow) - && d->extra && d->extra->dropTarget) { - d->registerDropSite(false); - } -#endif - d->updateIsOpaque(); setAttribute(Qt::WA_WState_Created); // set created flag @@ -1558,14 +1481,7 @@ QWidget::~QWidget() // and if that also doesn't work, then give up } } - } - -#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ || 0 /* Used to be included in Qt4 for Q_WS_X11 */|| 0 /* Used to be included in Qt4 for Q_WS_MAC */ - else if (!internalWinId() && isVisible()) { - qApp->d_func()->sendSyntheticEnterLeave(this); - } -#endif - else if (isVisible()) { + } else if (isVisible()) { qApp->d_func()->sendSyntheticEnterLeave(this); } @@ -1609,15 +1525,6 @@ QWidget::~QWidget() d->blockSig = blocked; -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // QCocoaView holds a pointer back to this widget. Clear it now - // to make sure it's not followed later on. The lifetime of the - // QCocoaView might exceed the lifetime of this widget in cases - // where Cocoa itself holds references to it. - extern void qt_mac_clearCocoaViewQWidgetPointers(QWidget *); - qt_mac_clearCocoaViewQWidgetPointers(this); -#endif - if (!d->children.isEmpty()) d->deleteChildren(); @@ -1664,9 +1571,6 @@ void QWidgetPrivate::setWinId(WId id) // set widget identifier const WId oldWinId = data.winid; data.winid = id; -#if 0 // Used to be included in Qt4 for Q_WS_X11 - hd = id; // X11: hd == ident -#endif if (mapper && id && !userDesktopWidget) { mapper->insert(data.winid, q); } @@ -1698,9 +1602,7 @@ void QWidgetPrivate::createTLExtra() x->embedded = 0; x->window = 0; x->initialScreenIndex = -1; -#if 0 // Used to be included in Qt4 for Q_WS_MAC - x->wasMaximized = false; -#endif + #ifdef QWIDGET_EXTRA_DEBUG static int count = 0; qDebug() << "tlextra" << ++count; @@ -2097,11 +1999,6 @@ void QWidgetPrivate::subtractOpaqueSiblings(QRegion &sourceRegion, bool *hasDirt if (disableSubtractOpaqueSiblings || q->isWindow()) return; -#if 0 // Used to be included in Qt4 for Q_WS_MAC - if (q->d_func()->isInUnifiedToolbar) - return; -#endif - QRect clipBoundingRect; bool dirtyClipBoundingRect = true; @@ -2234,13 +2131,6 @@ void QWidgetPrivate::updateIsOpaque() #endif // QT_CONFIG(graphicseffect) Q_Q(QWidget); -#if 0 // Used to be included in Qt4 for Q_WS_X11 - if (q->testAttribute(Qt::WA_X11OpenGLOverlay)) { - setOpaque(false); - return; - } -#endif - if (q->testAttribute(Qt::WA_OpaquePaintEvent) || q->testAttribute(Qt::WA_PaintOnScreen)) { setOpaque(true); return; @@ -2293,20 +2183,9 @@ static inline void fillRegion(QPainter *painter, const QRegion &rgn, const QBrus Q_ASSERT(painter); if (brush.style() == Qt::TexturePattern) { -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // Optimize pattern filling on mac by using HITheme directly - // when filling with the standard widget background. - // Defined in qmacstyle_mac.cpp - extern void qt_mac_fill_background(QPainter *painter, const QRegion &rgn, const QBrush &brush); - qt_mac_fill_background(painter, rgn, brush); -#else - { - const QRect rect(rgn.boundingRect()); - painter->setClipRegion(rgn); - painter->drawTiledPixmap(rect, brush.texture(), rect.topLeft()); - } -#endif - + const QRect rect(rgn.boundingRect()); + painter->setClipRegion(rgn); + painter->drawTiledPixmap(rect, brush.texture(), rect.topLeft()); } else if (brush.gradient() && (brush.gradient()->coordinateMode() == QGradient::ObjectBoundingMode || brush.gradient()->coordinateMode() == QGradient::ObjectMode)) { @@ -2380,11 +2259,7 @@ void QWidgetPrivate::paintBackground(QPainter *painter, const QRegion &rgn, Draw visible widgets. */ -#if 0 // Used to be included in Qt4 for Q_WS_MAC - extern QPointer<QWidget> qt_button_down; -#else - extern QWidget *qt_button_down; -#endif +extern QWidget *qt_button_down; void QWidgetPrivate::deactivateWidgetCleanup() { @@ -3053,15 +2928,6 @@ bool QWidget::isFullScreen() const */ void QWidget::showFullScreen() { -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // If the unified toolbar is enabled, we have to disable it before going fullscreen. - QMainWindow *mainWindow = qobject_cast<QMainWindow*>(this); - if (mainWindow && mainWindow->unifiedTitleAndToolBarOnMac()) { - mainWindow->setUnifiedTitleAndToolBarOnMac(false); - QMainWindowLayout *mainLayout = qobject_cast<QMainWindowLayout*>(mainWindow->layout()); - mainLayout->activateUnifiedToolbarAfterFullScreen = true; - } -#endif ensurePolished(); setWindowState((windowState() & ~(Qt::WindowMinimized | Qt::WindowMaximized)) @@ -3089,18 +2955,6 @@ void QWidget::showMaximized() setWindowState((windowState() & ~(Qt::WindowMinimized | Qt::WindowFullScreen)) | Qt::WindowMaximized); -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // If the unified toolbar was enabled before going fullscreen, we have to enable it back. - QMainWindow *mainWindow = qobject_cast<QMainWindow*>(this); - if (mainWindow) - { - QMainWindowLayout *mainLayout = qobject_cast<QMainWindowLayout*>(mainWindow->layout()); - if (mainLayout->activateUnifiedToolbarAfterFullScreen) { - mainWindow->setUnifiedTitleAndToolBarOnMac(true); - mainLayout->activateUnifiedToolbarAfterFullScreen = false; - } - } -#endif setVisible(true); } @@ -3118,18 +2972,6 @@ void QWidget::showNormal() setWindowState(windowState() & ~(Qt::WindowMinimized | Qt::WindowMaximized | Qt::WindowFullScreen)); -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // If the unified toolbar was enabled before going fullscreen, we have to enable it back. - QMainWindow *mainWindow = qobject_cast<QMainWindow*>(this); - if (mainWindow) - { - QMainWindowLayout *mainLayout = qobject_cast<QMainWindowLayout*>(mainWindow->layout()); - if (mainLayout->activateUnifiedToolbarAfterFullScreen) { - mainWindow->setUnifiedTitleAndToolBarOnMac(true); - mainLayout->activateUnifiedToolbarAfterFullScreen = false; - } - } -#endif setVisible(true); } @@ -3345,13 +3187,6 @@ void QWidgetPrivate::setEnabled_helper(bool enable) if (w && !w->testAttribute(attribute)) w->d_func()->setEnabled_helper(enable); } -#if 0 // Used to be included in Qt4 for Q_WS_X11 - if (q->testAttribute(Qt::WA_SetCursor) || q->isWindow()) { - // enforce the windows behavior of clearing the cursor on - // disabled widgets - qt_x11_enforce_cursor(q); - } -#endif #ifndef QT_NO_CURSOR if (q->testAttribute(Qt::WA_SetCursor) || q->isWindow()) { // enforce the windows behavior of clearing the cursor on @@ -3359,9 +3194,6 @@ void QWidgetPrivate::setEnabled_helper(bool enable) qt_qpa_set_cursor(q, false); } #endif -#if 0 // Used to be included in Qt4 for Q_WS_MAC - setEnabled_helper_sys(enable); -#endif #ifndef QT_NO_IM if (q->testAttribute(Qt::WA_InputMethodEnabled) && q->hasFocus()) { QWidget *focusWidget = effectiveFocusWidget(); @@ -4456,13 +4288,7 @@ const QPalette &QWidget::palette() const ) { data->pal.setCurrentColorGroup(QPalette::Active); } else { -#if 0 // Used to be included in Qt4 for Q_WS_MAC - extern bool qt_mac_can_clickThrough(const QWidget *); //qwidget_mac.cpp - if (qt_mac_can_clickThrough(this)) - data->pal.setCurrentColorGroup(QPalette::Active); - else -#endif - data->pal.setCurrentColorGroup(QPalette::Inactive); + data->pal.setCurrentColorGroup(QPalette::Inactive); } return data->pal; } @@ -4725,10 +4551,7 @@ void QWidgetPrivate::updateFont(const QFont &font) #endif data.fnt = QFont(font, q); -#if 0 // Used to be included in Qt4 for Q_WS_X11 - // make sure the font set on this widget is associated with the correct screen - data.fnt.x11SetScreen(xinfo.screen()); -#endif + // Combine new mask with natural mask and propagate to children. #if QT_CONFIG(graphicsview) if (!q->parentWidget() && extra && extra->proxyWidget) { @@ -4902,11 +4725,8 @@ QCursor QWidget::cursor() const void QWidget::setCursor(const QCursor &cursor) { Q_D(QWidget); -// On Mac we must set the cursor even if it is the ArrowCursor. -#if 1 // Used to be excluded in Qt4 for Q_WS_MAC if (cursor.shape() != Qt::ArrowCursor || (d->extra && d->extra->curs)) -#endif { d->createExtra(); d->extra->curs = qt_make_unique<QCursor>(cursor); @@ -5333,11 +5153,9 @@ void QWidgetPrivate::render_helper(QPainter *painter, const QPoint &targetOffset Q_ASSERT(!toBePainted.isEmpty()); Q_Q(QWidget); -#if 1 // Used to be excluded in Qt4 for Q_WS_MAC const QTransform originalTransform = painter->worldTransform(); const bool useDeviceCoordinates = originalTransform.isScaling(); if (!useDeviceCoordinates) { -#endif // Render via a pixmap. const QRect rect = toBePainted.boundingRect(); const QSize size = rect.size(); @@ -5360,7 +5178,6 @@ void QWidgetPrivate::render_helper(QPainter *painter, const QPoint &targetOffset if (restore) painter->setRenderHints(QPainter::SmoothPixmapTransform, false); -#if 1 // Used to be excluded in Qt4 for Q_WS_MAC } else { // Render via a pixmap in device coordinates (to avoid pixmap scaling). QTransform transform = originalTransform; @@ -5391,7 +5208,6 @@ void QWidgetPrivate::render_helper(QPainter *painter, const QPoint &targetOffset painter->drawPixmap(deviceRect.topLeft(), pixmap); painter->setTransform(originalTransform); } -#endif } void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QPoint &offset, DrawWidgetFlags flags, @@ -5471,15 +5287,6 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP if (paintEngine) { setRedirected(pdev, -offset); -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // (Alien support) Special case for Mac when redirecting: If the paint device - // is of the Widget type we need to set WA_WState_InPaintEvent since painting - // outside the paint event is not supported on QWidgets. The attributeis - // restored further down. - if (pdev->devType() == QInternal::Widget) - static_cast<QWidget *>(pdev)->setAttribute(Qt::WA_WState_InPaintEvent); - -#endif if (sharedPainter) setSystemClip(pdev->paintEngine(), pdev->devicePixelRatioF(), toBePainted); else @@ -5561,10 +5368,6 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP //restore if (paintEngine) { -#if 0 // Used to be included in Qt4 for Q_WS_MAC - if (pdev->devType() == QInternal::Widget) - static_cast<QWidget *>(pdev)->setAttribute(Qt::WA_WState_InPaintEvent, false); -#endif restoreRedirected(); if (!sharedPainter) paintEngine->d_func()->systemRect = QRect(); @@ -5635,7 +5438,6 @@ void QWidgetPrivate::render(QPaintDevice *target, const QPoint &targetOffset, if (paintRegion.isEmpty()) return; -#if 1 // Used to be excluded in Qt4 for Q_WS_MAC QPainter *oldSharedPainter = inRenderWithPainter ? sharedPainter() : 0; // Use the target's shared painter if set (typically set when doing @@ -5648,7 +5450,6 @@ void QWidgetPrivate::render(QPaintDevice *target, const QPoint &targetOffset, setSharedPainter(targetPainter); } } -#endif // Use the target's redirected device if set and adjust offset and paint // region accordingly. This is typically the case when people call render @@ -6440,11 +6241,7 @@ void QWidget::setFocus(Qt::FocusReason reason) if (!f) f = this; - if (QApplication::focusWidget() == f -#if 0 // Used to be included in Qt4 for Q_WS_WIN - && GetFocus() == f->internalWinId() -#endif - ) + if (QApplication::focusWidget() == f) return; #if QT_CONFIG(graphicsview) @@ -6661,17 +6458,10 @@ void QWidget::clearFocus() if (hasFocus()) { // Update proxy state QApplicationPrivate::setFocusWidget(0, Qt::OtherFocusReason); -#if 0 // Used to be included in Qt4 for Q_WS_WIN - if (!(windowType() == Qt::Popup) && GetFocus() == internalWinId()) - SetFocus(0); - else -#endif - { #ifndef QT_NO_ACCESSIBILITY - QAccessibleEvent event(this, QAccessible::Focus); - QAccessible::updateAccessibility(&event); + QAccessibleEvent event(this, QAccessible::Focus); + QAccessible::updateAccessibility(&event); #endif - } } } @@ -7315,18 +7105,6 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) */ QByteArray QWidget::saveGeometry() const { -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // We check if the window was maximized during this invocation. If so, we need to record the - // starting position as 0,0. - Q_D(const QWidget); - QRect newFramePosition = frameGeometry(); - QRect newNormalPosition = normalGeometry(); - if(d->topData()->wasMaximized && !(windowState() & Qt::WindowMaximized)) { - // Change the starting position - newFramePosition.moveTo(0, 0); - newNormalPosition.moveTo(0, 0); - } -#endif QByteArray array; QDataStream stream(&array, QIODevice::WriteOnly); stream.setVersion(QDataStream::Qt_4_0); @@ -7341,13 +7119,8 @@ QByteArray QWidget::saveGeometry() const stream << magicNumber << majorVersion << minorVersion -#if 0 // Used to be included in Qt4 for Q_WS_MAC - << newFramePosition - << newNormalPosition -#else << frameGeometry() << normalGeometry() -#endif << qint32(screenNumber) << quint8(windowState() & Qt::WindowMaximized) << quint8(windowState() & Qt::WindowFullScreen) @@ -7467,11 +7240,6 @@ bool QWidget::restoreGeometry(const QByteArray &geometry) // that would make the window "lost". This happens if: // - The restored geometry is completely oustside the available geometry // - The title bar is outside the available geometry. - // - (Mac only) The window is higher than the available geometry. It must - // be possible to bring the size grip on screen by moving the window. -#if 0 // Used to be included in Qt4 for Q_WS_MAC - restoredNormalGeometry.setHeight(qMin(restoredNormalGeometry.height(), availableGeometry.height() - frameHeight)); -#endif checkRestoredGeometry(availableGeometry, &restoredGeometry, frameHeight); checkRestoredGeometry(availableGeometry, &restoredNormalGeometry, frameHeight); @@ -7991,14 +7759,6 @@ void QWidgetPrivate::show_helper() Q_UNUSED(isEmbedded); #endif - // On Windows, show the popup now so that our own focus handling - // stores the correct old focus widget even if it's stolen in the - // showevent -#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ || 0 /* Used to be included in Qt4 for Q_WS_MAC */ - if (!isEmbedded && q->windowType() == Qt::Popup) - qApp->d_func()->openPopup(q); -#endif - // send the show event before showing the window QShowEvent showEvent; QCoreApplication::sendEvent(q, &showEvent); @@ -8123,12 +7883,6 @@ void QWidgetPrivate::hide_helper() if (!isEmbedded && (q->windowType() == Qt::Popup)) qApp->d_func()->closePopup(q); -#if 0 // Used to be included in Qt4 for Q_WS_WIN - if (q->isWindow() && !(q->windowType() == Qt::Popup) && q->parentWidget() - && !q->parentWidget()->isHidden() && q->isActiveWindow()) - q->parentWidget()->activateWindow(); // Activate parent -#endif - q->setAttribute(Qt::WA_Mapped, false); hide_sys(); @@ -8313,16 +8067,6 @@ void QWidgetPrivate::setVisible(bool visible) QEvent showToParentEvent(QEvent::ShowToParent); QCoreApplication::sendEvent(q, &showToParentEvent); } else { // hide -#if 0 // Used to be included in Qt4 for Q_WS_WIN - // reset WS_DISABLED style in a Blocked window - if(isWindow() && testAttribute(Qt::WA_WState_Created) - && QApplicationPrivate::isBlockedByModal(this)) - { - LONG dwStyle = GetWindowLong(winId(), GWL_STYLE); - dwStyle &= ~WS_DISABLED; - SetWindowLong(winId(), GWL_STYLE, dwStyle); - } -#endif if (QApplicationPrivate::hidden_focus_widget == q) QApplicationPrivate::hidden_focus_widget = 0; @@ -8395,23 +8139,7 @@ void QWidgetPrivate::hideChildren(bool spontaneous) QWidget *widget = qobject_cast<QWidget*>(childList.at(i)); if (!widget || widget->isWindow() || widget->testAttribute(Qt::WA_WState_Hidden)) continue; -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // Before doing anything we need to make sure that we don't leave anything in a non-consistent state. - // When hiding a widget we need to make sure that no mouse_down events are active, because - // the mouse_up event will never be received by a hidden widget or one of its descendants. - // The solution is simple, before going through with this we check if there are any mouse_down events in - // progress, if so we check if it is related to this widget or not. If so, we just reset the mouse_down and - // then we continue. - // In X11 and Windows we send a mouse_release event, however we don't do that here because we were already - // ignoring that from before. I.e. Carbon did not send the mouse release event, so we will not send the - // mouse release event. There are two ways to interpret this: - // 1. If we don't send the mouse release event, the widget might get into an inconsistent state, i.e. it - // might be waiting for a release event that will never arrive. - // 2. If we send the mouse release event, then the widget might decide to trigger an action that is not - // supposed to trigger because it is not visible. - if(widget == qt_button_down) - qt_button_down = 0; -#endif + if (spontaneous) widget->setAttribute(Qt::WA_Mapped, false); else @@ -8646,11 +8374,9 @@ QSize QWidgetPrivate::adjustedSize() const s.setWidth(qMax(s.width(), 200)); if (exp & Qt::Vertical) s.setHeight(qMax(s.height(), 100)); -#if 0 // Used to be included in Qt4 for Q_WS_X11 - QRect screen = QDesktopWidgetPrivate::screenGeometry(q->x11Info().screen()); -#else // all others + QRect screen = QDesktopWidgetPrivate::screenGeometry(q->pos()); -#endif + s.setWidth(qMin(s.width(), screen.width()*2/3)); s.setHeight(qMin(s.height(), screen.height()*2/3)); @@ -8775,26 +8501,6 @@ bool QWidget::isAncestorOf(const QWidget *child) const return false; } -#if 0 // Used to be included in Qt4 for Q_WS_WIN -inline void setDisabledStyle(QWidget *w, bool setStyle) -{ - // set/reset WS_DISABLED style. - if(w && w->isWindow() && w->isVisible() && w->isEnabled()) { - LONG dwStyle = GetWindowLong(w->winId(), GWL_STYLE); - LONG newStyle = dwStyle; - if (setStyle) - newStyle |= WS_DISABLED; - else - newStyle &= ~WS_DISABLED; - if (newStyle != dwStyle) { - SetWindowLong(w->winId(), GWL_STYLE, newStyle); - // we might need to repaint in some situations (eg. menu) - w->repaint(); - } - } -} -#endif - /***************************************************************************** QWidget event handling *****************************************************************************/ @@ -9211,9 +8917,6 @@ bool QWidget::event(QEvent *event) } } } -#if 0 // Used to be included in Qt4 for Q_WS_WIN - setDisabledStyle(this, (event->type() == QEvent::WindowBlocked)); -#endif break; #ifndef QT_NO_TOOLTIP case QEvent::ToolTip: @@ -9238,9 +8941,6 @@ bool QWidget::event(QEvent *event) case QEvent::EmbeddingControl: d->topData()->frameStrut.setCoords(0 ,0, 0, 0); data->fstrut_dirty = false; -#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ || 0 /* Used to be included in Qt4 for Q_WS_X11 */ - d->topData()->embedded = 1; -#endif break; #ifndef QT_NO_ACTION case QEvent::ActionAdded: @@ -9263,11 +8963,6 @@ bool QWidget::event(QEvent *event) } break; } -#if 0 // Used to be included in Qt4 for Q_WS_MAC - case QEvent::MacGLWindowChange: - d->needWindowChange = false; - break; -#endif case QEvent::TouchBegin: case QEvent::TouchUpdate: case QEvent::TouchEnd: @@ -9379,11 +9074,6 @@ void QWidget::changeEvent(QEvent * event) case QEvent::MacSizeChange: updateGeometry(); break; -#elif 0 // Used to be included in Qt4 for Q_WS_MAC - case QEvent::ToolTipChange: - case QEvent::MouseTrackingChange: - qt_mac_update_mouseTracking(this); - break; #endif default: @@ -10695,7 +10385,7 @@ void QWidget::setParent(QWidget *parent, Qt::WindowFlags f) // (f & Qt::MSWindowsOwnDC) clause (which is set on QGLWidgets on all // platforms). if (newParent -#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ || defined(QT_OPENGL_ES) +#if defined(QT_OPENGL_ES) || (f & Qt::MSWindowsOwnDC) #endif ) { @@ -10714,15 +10404,6 @@ void QWidget::setParent(QWidget *parent, Qt::WindowFlags f) QCoreApplication::sendEvent(parent, &e); } -//### already hidden above ---> must probably do something smart on the mac -// #if 0 // Used to be included in Qt4 for Q_WS_MAC -// extern bool qt_mac_is_macdrawer(const QWidget *); //qwidget_mac.cpp -// if(!qt_mac_is_macdrawer(q)) //special case -// q->setAttribute(Qt::WA_WState_Hidden); -// #else -// q->setAttribute(Qt::WA_WState_Hidden); -//#endif - if (parent && d->sendChildEvents && d->polished) { QChildEvent e(QEvent::ChildPolished, this); QCoreApplication::sendEvent(parent, &e); @@ -11204,23 +10885,6 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) case Qt::WA_NoChildEventsFromChildren: d->receiveChildEvents = !on; break; -#if 0 // Used to be included in Qt4 for Q_WS_MAC - case Qt::WA_MacOpaqueSizeGrip: - d->macUpdateOpaqueSizeGrip(); - break; - case Qt::WA_MacShowFocusRect: - if (hasFocus()) { - clearFocus(); - setFocus(); - } - break; - case Qt::WA_Hover: - qt_mac_update_mouseTracking(this); - break; - case Qt::WA_MacAlwaysShowToolWindow: - d->macUpdateHideOnSuspend(); - break; -#endif case Qt::WA_MacNormalSize: case Qt::WA_MacSmallSize: case Qt::WA_MacMiniSize: @@ -11298,15 +10962,6 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) } case Qt::WA_PaintOnScreen: d->updateIsOpaque(); -#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ || 0 /* Used to be included in Qt4 for Q_WS_X11 */ || 0 /* Used to be included in Qt4 for Q_WS_MAC */ - // Recreate the widget if it's already created as an alien widget and - // WA_PaintOnScreen is enabled. Paint on screen widgets must have win id. - // So must their children. - if (on) { - setAttribute(Qt::WA_NativeWindow); - d->enforceNativeChildren(); - } -#endif Q_FALLTHROUGH(); case Qt::WA_OpaquePaintEvent: d->updateIsOpaque(); @@ -11318,9 +10973,6 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) d->updateSystemBackground(); break; case Qt::WA_TransparentForMouseEvents: -#if 0 // Used to be included in Qt4 for Q_WS_MAC - d->macUpdateIgnoreMouseEvents(); -#endif break; case Qt::WA_InputMethodEnabled: { #ifndef QT_NO_IM @@ -11337,20 +10989,6 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) d->resolveFont(); d->resolveLocale(); break; -#if 0 // Used to be included in Qt4 for Q_WS_X11 - case Qt::WA_NoX11EventCompression: - if (!d->extra) - d->createExtra(); - d->extra->compress_events = on; - break; - case Qt::WA_X11OpenGLOverlay: - d->updateIsOpaque(); - break; - case Qt::WA_X11DoNotAcceptFocus: - if (testAttribute(Qt::WA_WState_Created)) - d->updateX11AcceptFocus(); - break; -#endif case Qt::WA_DontShowOnScreen: { if (on && isVisible()) { // Make sure we keep the current state and only hide the widget @@ -11393,10 +11031,6 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) break; case Qt::WA_AcceptTouchEvents: -#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ || 0 /* Used to be included in Qt4 for Q_WS_MAC */ - if (on) - d->registerTouchWindow(); -#endif break; default: break; @@ -12012,10 +11646,8 @@ QRect QWidgetPrivate::frameStrut() const } if (data.fstrut_dirty -#if 1 // Used to be excluded in Qt4 for Q_WS_WIN // ### Fix properly for 4.3 && q->isVisible() -#endif && q->testAttribute(Qt::WA_WState_Created)) const_cast<QWidgetPrivate *>(this)->updateFrameStrut(); @@ -12942,10 +12574,8 @@ void QWidget::setMask(const QRegion &newMask) d->extra->mask = newMask; d->extra->hasMask = !newMask.isEmpty(); -#if 1 // Used to be excluded in Qt4 for Q_WS_MAC if (!testAttribute(Qt::WA_WState_Created)) return; -#endif d->setMask_sys(newMask); diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h index 941f92c062..6fd9c2d273 100644 --- a/src/widgets/kernel/qwidget_p.h +++ b/src/widgets/kernel/qwidget_p.h @@ -155,41 +155,6 @@ struct QTLWExtra { uint sizeAdjusted : 1; uint inTopLevelResize : 1; uint embedded : 1; - - // *************************** Platform specific values (bit fields first) ********** -#if 0 /* Used to be included in Qt4 for Q_WS_X11 */ // <----------------------------------------------------------- X11 - uint spont_unmapped: 1; // window was spontaneously unmapped - uint dnd : 1; // DND properties installed - uint validWMState : 1; // is WM_STATE valid? - uint waitingForMapNotify : 1; // show() has been called, haven't got the MapNotify yet - WId parentWinId; // parent window Id (valid after reparenting) - WId userTimeWindow; // window id that contains user-time timestamp when WM supports a _NET_WM_USER_TIME_WINDOW atom - QPoint fullScreenOffset; -#ifndef QT_NO_XSYNC - WId syncUpdateCounter; - ulong syncRequestTimestamp; - qint32 newCounterValueHi; - quint32 newCounterValueLo; -#endif -#elif 0 /* Used to be included in Qt4 for Q_WS_WIN */ // <--------------------------------------------------------- WIN - uint hotkeyRegistered: 1; // Hot key from the STARTUPINFO has been registered. - HICON winIconBig; // internal big Windows icon - HICON winIconSmall; // internal small Windows icon -#elif 0 /* Used to be included in Qt4 for Q_WS_MAC */ // <--------------------------------------------------------- MAC - uint resizer : 4; - uint isSetGeometry : 1; - uint isMove : 1; - quint32 wattr; - quint32 wclass; - WindowGroupRef group; - IconRef windowIcon; // the current window icon, if set with setWindowIcon_sys. - quint32 savedWindowAttributesFromMaximized; // Saved attributes from when the calling updateMaximizeButton_sys() - // This value is just to make sure we maximize and restore to the right location, yet we allow apps to be maximized and - // manually resized. - // The name is misleading, since this is set when maximizing the window. It is a hint to saveGeometry(..) to record the - // starting position as 0,0 instead of the normal starting position. - bool wasMaximized; -#endif }; struct QWExtra { @@ -228,21 +193,6 @@ struct QWExtra { uint inRenderWithPainter : 1; uint hasMask : 1; uint hasWindowContainer : 1; - - // *************************** Platform specific values (bit fields first) ********** -#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ // <----------------------------------------------------------- WIN -#if QT_CONFIG(draganddrop) - QOleDropTarget *dropTarget; // drop target - QList<QPointer<QWidget> > oleDropWidgets; -#endif -#elif 0 /* Used to be included in Qt4 for Q_WS_X11 */ // <--------------------------------------------------------- X11 - uint compress_events : 1; - WId xDndProxy; // XDND forwarding to embedded windows -#elif 0 /* Used to be included in Qt4 for Q_WS_MAC */ // <------------------------------------------------------ MAC - // Cocoa Mask stuff - QImage maskBits; - CGImageRef imageMask; -#endif }; /*! @@ -770,109 +720,8 @@ public: // *************************** Platform specific ************************************ #if defined(Q_OS_WIN) uint noPaintOnScreen : 1; // see qwidget.cpp ::paintEngine() -#endif -#if 0 /* Used to be included in Qt4 for Q_WS_X11 */ // <----------------------------------------------------------- X11 - Qt::HANDLE picture; - static QWidget *mouseGrabber; - static QWidget *keyboardGrabber; - - void setWindowRole(); - void sendStartupMessage(const char *message) const; - void x11UpdateIsOpaque(); - bool isBackgroundInherited() const; - void updateX11AcceptFocus(); - QPoint mapToGlobal(const QPoint &pos) const; - QPoint mapFromGlobal(const QPoint &pos) const; -#elif 0 /* Used to be included in Qt4 for Q_WS_WIN */ // <--------------------------------------------------------- WIN -#ifndef QT_NO_GESTURES - uint nativeGesturePanEnabled : 1; -#endif - bool shouldShowMaximizeButton(); - void winUpdateIsOpaque(); - void reparentChildren(); -#if QT_CONFIG(draganddrop) - QOleDropTarget *registerOleDnd(QWidget *widget); - void unregisterOleDnd(QWidget *widget, QOleDropTarget *target); -#endif - void grabMouseWhileInWindow(); - void registerTouchWindow(); - void winSetupGestures(); -#elif defined(Q_OS_MAC) // <--------------------------------------------------------- MAC +#elif defined(Q_OS_MAC) void macUpdateSizeAttribute(); -#elif 0 /* Used to be included in Qt4 for Q_WS_MAC */ // <--------------------------------------------------------- MAC (old stuff) - // This is new stuff - uint needWindowChange : 1; - - // Each wiget keeps a list of all its child and grandchild OpenGL widgets. - // This list is used to update the gl context whenever a parent and a granparent - // moves, and also to check for intersections with gl widgets within the window - // when a widget moves. - struct GlWidgetInfo - { - GlWidgetInfo(QWidget *widget) : widget(widget), lastUpdateWidget(0) { } - bool operator==(const GlWidgetInfo &other) const { return (widget == other.widget); } - QWidget * widget; - QWidget * lastUpdateWidget; - }; - - // dirtyOnWidget contains the areas in the widget that needs to be repained, - // in the same way as dirtyOnScreen does for the window. Areas are added in - // dirtyWidget_sys and cleared in the paint event. In scroll_sys we then use - // this information repaint invalid areas when widgets are scrolled. - QRegion dirtyOnWidget; - EventHandlerRef window_event; - QList<GlWidgetInfo> glWidgets; - - //these are here just for code compat (HIViews) - Qt::HANDLE qd_hd; - - void macUpdateHideOnSuspend(); - void macUpdateOpaqueSizeGrip(); - void macUpdateIgnoreMouseEvents(); - void macUpdateMetalAttribute(); - void macUpdateIsOpaque(); - void macSetNeedsDisplay(QRegion region); - void setEnabled_helper_sys(bool enable); - bool isRealWindow() const; - void adjustWithinMaxAndMinSize(int &w, int &h); - void applyMaxAndMinSizeOnWindow(); - void update_sys(const QRect &rect); - void update_sys(const QRegion &rgn); - void setGeometry_sys_helper(int, int, int, int, bool); - void updateMaximizeButton_sys(); - void createWindow_sys(); - void recreateMacWindow(); - void setSubWindowStacking(bool set); - void setWindowLevel(); - void finishCreateWindow_sys_Cocoa(void * /*NSWindow * */ windowRef); - void syncCocoaMask(); - void finishCocoaMaskSetup(); - // Did we add the drawRectOriginal method? - bool drawRectOriginalAdded; - // Is the original drawRect method available? - bool originalDrawMethod; - // Do we need to change the methods? - bool changeMethods; - - // Unified toolbar variables - bool isInUnifiedToolbar; - QUnifiedToolbarSurface *unifiedSurface; - QPoint toolbar_offset; - QWidget *toolbar_ancestor; - bool flushRequested; - bool touchEventsEnabled; - void determineWindowClass(); - void transferChildren(); - bool qt_mac_dnd_event(uint, DragRef); - void toggleDrawers(bool); - //mac event functions - static bool qt_create_root_win(); - static void qt_clean_root_win(); - static bool qt_mac_update_sizer(QWidget *, int up = 0); - static OSStatus qt_window_event(EventHandlerCallRef er, EventRef event, void *); - static OSStatus qt_widget_event(EventHandlerCallRef er, EventRef event, void *); - static bool qt_widget_rgn(QWidget *, short, RgnHandle, bool); - void registerTouchWindow(bool enable = true); #endif void setNetWmWindowTypes(bool skipIfMissing = false); |