OSDN Git Service

various cleanups, mostly win/mac leftovers and default reimplementations
authorIvailo Monev <xakepa10@laimg.moc>
Fri, 30 Sep 2016 00:42:20 +0000 (00:42 +0000)
committerIvailo Monev <xakepa10@laimg.moc>
Fri, 30 Sep 2016 00:42:20 +0000 (00:42 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
58 files changed:
src/designer/shared/qdesigner_propertysheet.cpp
src/gui/dialogs/qfiledialog.cpp
src/gui/dialogs/qfiledialog_p.h
src/gui/dialogs/qprintpreviewdialog.cpp
src/gui/dialogs/qprogressdialog.cpp
src/gui/kernel/qapplication.cpp
src/gui/kernel/qapplication_p.h
src/gui/kernel/qapplication_x11.cpp
src/gui/kernel/qgesturemanager.cpp
src/gui/kernel/qt_x11_p.h
src/gui/kernel/qtooltip.cpp
src/gui/kernel/qwidget.cpp
src/gui/kernel/qwidget_p.h
src/gui/painting/qtextureglyphcache.cpp
src/gui/painting/qwindowsurface_raster.cpp
src/gui/painting/qwindowsurface_raster_p.h
src/gui/text/qtextengine.cpp
src/gui/text/qtextlayout.cpp
src/gui/util/qcompleter.cpp
src/gui/util/qsystemtrayicon.cpp
src/gui/util/qsystemtrayicon_p.h
src/gui/widgets/qabstractbutton.cpp
src/gui/widgets/qabstractbutton.h
src/gui/widgets/qbuttongroup.h
src/gui/widgets/qdockarealayout.cpp
src/gui/widgets/qdockwidget.cpp
src/gui/widgets/qfocusframe.cpp
src/gui/widgets/qfocusframe.h
src/gui/widgets/qgroupbox.cpp
src/gui/widgets/qgroupbox.h
src/gui/widgets/qlcdnumber.h
src/gui/widgets/qmainwindow.cpp
src/gui/widgets/qmainwindow.h
src/gui/widgets/qmainwindowlayout.cpp
src/gui/widgets/qmainwindowlayout_p.h
src/gui/widgets/qmenu.cpp
src/gui/widgets/qpushbutton.cpp
src/gui/widgets/qrubberband.cpp
src/gui/widgets/qrubberband.h
src/gui/widgets/qscrollbar.cpp
src/gui/widgets/qscrollbar.h
src/gui/widgets/qsizegrip.cpp
src/gui/widgets/qsizegrip.h
src/gui/widgets/qstatusbar.cpp
src/gui/widgets/qstatusbar.h
src/gui/widgets/qtabbar.cpp
src/gui/widgets/qtabbar.h
src/gui/widgets/qtabbar_p.h
src/gui/widgets/qtextbrowser.cpp
src/gui/widgets/qtextbrowser.h
src/gui/widgets/qtoolbararealayout.cpp
src/gui/widgets/qtoolbarlayout.cpp
src/gui/widgets/qtoolbox.cpp
src/gui/widgets/qtoolbox.h
src/scripttools/debugging/qscriptenginedebugger.cpp
src/test/qtestcase.cpp
src/test/qtestmouse.h
src/tools/designer/qdesigner_workbench.cpp

index 0aa8ab8..3e28ca0 100644 (file)
@@ -632,11 +632,6 @@ QDesignerPropertySheet::QDesignerPropertySheet(QObject *object, QObject *parent)
 
         if (d->m_objectType == ObjectLabel)
             createFakeProperty(QLatin1String("buddy"), QVariant(QByteArray()));
-        /* We need to create a fake property since the property does not work
-         * for non-toplevel windows or on other systems than Mac and only if
-         * it is above a certain Mac OS version. */
-        if (qobject_cast<const QMainWindow *>(d->m_object))
-            createFakeProperty(QLatin1String("unifiedTitleAndToolBarOnMac"), false);
     }
 
     if (qobject_cast<const QDialog*>(object)) {
index 1e9ef29..624ca5d 100644 (file)
@@ -531,14 +531,6 @@ QFileDialogPrivate::QFileDialogPrivate()
         defaultFileTypes(true),
         fileNameLabelExplicitlySat(false),
         nativeDialogInUse(false),
-#ifdef Q_WS_MAC
-        mDelegate(0),
-#ifndef QT_MAC_USE_COCOA
-        mDialog(0),
-        mDialogStarted(false),
-        mDialogClosed(true),
-#endif
-#endif
         qFileDialogUi(0)
 {
 }
index 96ac4a2..9dd4059 100644 (file)
@@ -245,47 +245,6 @@ public:
     QString selectedNameFilter_sys() const;
     //////////////////////////////////////////////
 
-#if defined(Q_WS_MAC)
-    void *mDelegate;
-#ifndef QT_MAC_USE_COCOA
-    NavDialogRef mDialog;
-    bool mDialogStarted;
-    bool mDialogClosed;
-    QString mCurrentLocation;
-    QString mCurrentSelection;
-    QStringList mCurrentSelectionList;
-
-    struct QtMacFilterName {
-        QString description;
-        QString regexp;
-        QString filter;
-    };
-    struct QtMacNavFilterInfo {
-        QtMacNavFilterInfo() : currentSelection(-1) {}
-        int currentSelection;
-        QList<QtMacFilterName> filters;
-    } filterInfo;
-
-    static void qt_mac_filedialog_event_proc(const NavEventCallbackMessage msg, NavCBRecPtr p,
-                                             NavCallBackUserData data);
-    static Boolean qt_mac_filedialog_filter_proc(AEDesc *theItem, void *info, void *data,
-                                                 NavFilterModes);
-    bool showCarbonNavServicesDialog();
-    bool hideCarbonNavServicesDialog();
-    void createNavServicesDialog();
-#else
-    bool showCocoaFilePanel();
-    bool hideCocoaFilePanel();
-#endif
-    void createNSOpenSavePanelDelegate();
-    void QNSOpenSavePanelDelegate_selectionChanged(const QString &newPath);
-    void QNSOpenSavePanelDelegate_panelClosed(bool accepted);
-    void QNSOpenSavePanelDelegate_directoryEntered(const QString &newDir);
-    void QNSOpenSavePanelDelegate_filterSelected(int menuIndex);
-    void _q_macRunNativeAppModalPanel();
-    void mac_nativeDialogModalHelp();
-#endif
-
     QScopedPointer<Ui_QFileDialog> qFileDialogUi;
 
     QString acceptLabel;
index 8e50881..a236509 100644 (file)
@@ -207,9 +207,6 @@ public:
     QActionGroup *printerGroup;
     QAction *printAction;
     QAction *pageSetupAction;
-#if defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA)
-    QAction *closeAction;
-#endif
 
     QPointer<QObject> receiverToDisconnectOnClose;
     QByteArray memberToDisconnectOnClose;
@@ -303,9 +300,6 @@ void QPrintPreviewDialogPrivate::init(QPrinter *_printer)
     toolbar->addSeparator();
     toolbar->addAction(pageSetupAction);
     toolbar->addAction(printAction);
-#if defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA)
-    toolbar->addAction(closeAction);
-#endif
 
     // Cannot use the actions' triggered signal here, since it doesn't autorepeat
     QToolButton *zoomInButton = static_cast<QToolButton *>(toolbar->widgetForAction(zoomInAction));
@@ -425,10 +419,6 @@ void QPrintPreviewDialogPrivate::setupActions()
     qt_setupActionIcon(pageSetupAction, QLatin1String("page-setup"));
     QObject::connect(printAction, SIGNAL(triggered(bool)), q, SLOT(_q_print()));
     QObject::connect(pageSetupAction, SIGNAL(triggered(bool)), q, SLOT(_q_pageSetup()));
-#if defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA)
-    closeAction = printerGroup->addAction(QCoreApplication::translate("QPrintPreviewDialog", "Close"));
-    QObject::connect(closeAction, SIGNAL(triggered(bool)), q, SLOT(reject()));
-#endif
 
     // Initial state:
     fitPageAction->setChecked(true);
index 27058ba..8279faa 100644 (file)
@@ -679,9 +679,6 @@ void QProgressDialog::setValue(int progress)
                 d->shown_once = true;
             }
         }
-#ifdef Q_WS_MAC
-        QApplication::flush();
-#endif
     }
 
     if (progress == d->bar->maximum() && d->autoReset)
index f3c4058..73d41d4 100644 (file)
@@ -1336,7 +1336,6 @@ void QApplication::setStyle(QStyle *style)
     if (QApplicationPrivate::set_pal) {
         QApplication::setPalette(*QApplicationPrivate::set_pal);
     } else if (QApplicationPrivate::sys_pal) {
-        QApplicationPrivate::initializeWidgetPaletteHash();
         QApplicationPrivate::setPalette_helper(*QApplicationPrivate::sys_pal, /*className=*/0, /*clearWidgetPaletteHash=*/false);
     } else if (!QApplicationPrivate::sys_pal) {
         // Initialize the sys_pal if it hasn't happened yet...
@@ -4044,24 +4043,6 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
         break;
     }
 #endif // QT_NO_GESTURES
-#ifdef QT_MAC_USE_COCOA
-    case QEvent::Enter:
-        if (receiver->isWidgetType()) {
-            QWidget *w = static_cast<QWidget *>(receiver);
-            if (w->testAttribute(Qt::WA_AcceptTouchEvents))
-                qt_widget_private(w)->registerTouchWindow(true);
-        }
-        res = d->notify_helper(receiver, e);
-    break;
-    case QEvent::Leave:
-        if (receiver->isWidgetType()) {
-            QWidget *w = static_cast<QWidget *>(receiver);
-            if (w->testAttribute(Qt::WA_AcceptTouchEvents))
-                qt_widget_private(w)->registerTouchWindow(false);
-        }
-        res = d->notify_helper(receiver, e);
-    break;
-#endif
     default:
         res = d->notify_helper(receiver, e);
         break;
index 865d95b..97c2ade 100644 (file)
@@ -284,7 +284,6 @@ public:
 
     static void setSystemPalette(const QPalette &pal);
     static void setPalette_helper(const QPalette &palette, const char* className, bool clearWidgetPaletteHash);
-    static void initializeWidgetPaletteHash();
     static void setSystemFont(const QFont &font);
 
 #if defined(Q_WS_X11)
index fcf6ec2..c5af5fa 100644 (file)
@@ -206,7 +206,6 @@ static const char * x11_atomnames = {
     "DTWM_IS_RUNNING\0"
     "ENLIGHTENMENT_DESKTOP\0"
     "_DT_SAVE_MODE\0"
-    "_SGI_DESKS_MANAGER\0"
 
     // EWMH (aka NETWM)
     "_NET_SUPPORTED\0"
@@ -2343,38 +2342,6 @@ void qt_init(QApplicationPrivate *priv, int,
                 X11->desktopEnvironment = DE_CDE;
                 break;
             }
-
-            rc = XGetWindowProperty(X11->display, QX11Info::appRootWindow(),
-                                    ATOM(_SGI_DESKS_MANAGER), 0, 1, False, XA_WINDOW,
-                                    &type, &format, &length, &after, &data);
-            if (rc == Success && length) {
-                X11->desktopEnvironment = DE_4DWM;
-                break;
-            }
-
-            if (XGetWindowProperty(X11->display, QX11Info::appRootWindow(),
-                               ATOM(_NET_SUPPORTING_WM_CHECK),
-                               0, 1024, False, XA_WINDOW, &type,
-                               &format, &length, &after, &data) == Success) {
-                if (type == XA_WINDOW && format == 32) {
-                    Window windowManagerWindow = *((Window*) data);
-                    XFree(data);
-                    data = 0;
-
-                    if (windowManagerWindow != XNone) {
-                        Atom utf8atom = ATOM(UTF8_STRING);
-                        if (XGetWindowProperty(QX11Info::display(), windowManagerWindow, ATOM(_NET_WM_NAME),
-                                               0, 1024, False, utf8atom, &type,
-                                               &format, &length, &after, &data) == Success) {
-                            if (type == utf8atom && format == 8) {
-                                if (qstrcmp((const char *)data, "MCompositor") == 0)
-                                    X11->desktopEnvironment = DE_MEEGO_COMPOSITOR;
-                            }
-                        }
-                    }
-                }
-            }
-
         } while(0);
 
         if (data)
@@ -2645,10 +2612,6 @@ void qt_init(QApplicationPrivate *priv, int,
 #endif
 }
 
-void QApplicationPrivate::initializeWidgetPaletteHash()
-{
-}
-
 /*****************************************************************************
   qt_cleanup() - cleans up when the application is finished
  *****************************************************************************/
index acd3a33..0ea57cc 100644 (file)
@@ -74,27 +74,11 @@ QGestureManager::QGestureManager(QObject *parent)
     : QObject(parent), state(NotGesture), m_lastCustomGestureId(Qt::CustomGesture)
 {
     qRegisterMetaType<Qt::GestureState>();
-
-#if defined(Q_WS_MAC)
-    registerGestureRecognizer(new QMacSwipeGestureRecognizer);
-    registerGestureRecognizer(new QMacPinchGestureRecognizer);
-  #if defined(QT_MAC_USE_COCOA)
-    registerGestureRecognizer(new QMacPanGestureRecognizer);
-  #endif
-#else
     registerGestureRecognizer(new QPanGestureRecognizer);
     registerGestureRecognizer(new QPinchGestureRecognizer);
     registerGestureRecognizer(new QSwipeGestureRecognizer);
     registerGestureRecognizer(new QTapGestureRecognizer);
-#endif
-#if defined(Q_OS_WIN)
-  #if !defined(QT_NO_NATIVE_GESTURES)
-    if (QApplicationPrivate::HasTouchSupport)
-        registerGestureRecognizer(new QWinNativePanGestureRecognizer);
-  #endif
-#else
     registerGestureRecognizer(new QTapAndHoldGestureRecognizer);
-#endif
 }
 
 QGestureManager::~QGestureManager()
index 30e4e19..c7d7ab0 100644 (file)
@@ -340,7 +340,6 @@ enum DesktopEnvironment {
     DE_KDE,
     DE_GNOME,
     DE_CDE,
-    DE_MEEGO_COMPOSITOR,
     DE_4DWM
 };
 
@@ -577,7 +576,6 @@ struct QX11Data
         DTWM_IS_RUNNING,
         ENLIGHTENMENT_DESKTOP,
         _DT_SAVE_MODE,
-        _SGI_DESKS_MANAGER,
 
         // EWMH (aka NETWM)
         _NET_SUPPORTED,
index d458565..3e33d08 100644 (file)
@@ -286,38 +286,13 @@ void QTipLabel::timerEvent(QTimerEvent *e)
         || e->timerId() == expireTimer.timerId()){
         hideTimer.stop();
         expireTimer.stop();
-#if defined(Q_WS_MAC) && !defined(QT_NO_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
     }
 }
 
 bool QTipLabel::eventFilter(QObject *o, QEvent *e)
 {
     switch (e->type()) {
-#ifdef Q_WS_MAC
-    case QEvent::KeyPress:
-    case QEvent::KeyRelease: {
-        int key = static_cast<QKeyEvent *>(e)->key();
-        Qt::KeyboardModifiers mody = static_cast<QKeyEvent *>(e)->modifiers();
-        if (!(mody & Qt::KeyboardModifierMask)
-            && key != Qt::Key_Shift && key != Qt::Key_Control
-            && key != Qt::Key_Alt && key != Qt::Key_Meta)
-            hideTip();
-        break;
-    }
-#endif
     case QEvent::Leave:
         hideTip();
         break;
@@ -367,21 +342,7 @@ void QTipLabel::placeTip(const QPoint &pos, QWidget *w)
     }
 #endif //QT_NO_STYLE_STYLESHEET
 
-
-#ifdef 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 = QApplication::desktop()->screenGeometry(getTipScreen(pos, w));
-    else
-        screen = QApplication::desktop()->availableGeometry(getTipScreen(pos, w));
-#else
-    QRect screen = QApplication::desktop()->screenGeometry(getTipScreen(pos, w));
-#endif
+    const QRect screen = QApplication::desktop()->screenGeometry(getTipScreen(pos, w));
 
     QPoint p = pos;
     p += QPoint(2,
@@ -462,13 +423,7 @@ void QToolTip::showText(const QPoint &pos, const QString &text, QWidget *w, cons
     }
 
     if (!text.isEmpty()){ // no tip can be reused, create new tip:
-#ifndef Q_WS_WIN
         new QTipLabel(text, w); // sets QTipLabel::instance to itself
-#else
-        // On windows, we can't use the widget as parent otherwise the window will be
-        // raised when the tooltip will be shown
-        new QTipLabel(text, QApplication::desktop()->screen(QTipLabel::getTipScreen(pos, w)));
-#endif
         QTipLabel::instance->setTipRect(w, rect);
         QTipLabel::instance->placeTip(pos, w);
         QTipLabel::instance->setObjectName(QLatin1String("qtooltip_label"));
index 2bd27e8..64e2f9a 100644 (file)
@@ -251,16 +251,6 @@ QWidgetPrivate::QWidgetPrivate(int version)
 
     isWidget = true;
     memset(high_attributes, 0, sizeof(high_attributes));
-#ifdef QT_MAC_USE_COCOA
-    drawRectOriginalAdded = false;
-    originalDrawMethod = true;
-    changeMethods = false;
-    isInUnifiedToolbar = false;
-    unifiedSurface = 0;
-    toolbar_ancestor = 0;
-    flushRequested = false;
-    touchEventsEnabled = false;
-#endif // QT_MAC_USE_COCOA
 #ifdef QWIDGET_EXTRA_DEBUG
     static int count = 0;
     qDebug() << "widgets" << ++count;
@@ -1473,15 +1463,6 @@ QWidget::~QWidget()
 
     d->blockSig = blocked;
 
-#ifdef QT_MAC_USE_COCOA
-    // 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();
 
@@ -1562,9 +1543,7 @@ void QWidgetPrivate::createTLExtra()
         x->inTopLevelResize = false;
         x->inRepaint = false;
         x->embedded = 0;
-#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
-        x->wasMaximized = false;
-#endif // Q_WS_MAC && QT_MAC_USE_COCOA
+
         createTLSysExtra();
 #ifdef QWIDGET_EXTRA_DEBUG
         static int count = 0;
@@ -1911,11 +1890,6 @@ void QWidgetPrivate::subtractOpaqueSiblings(QRegion &sourceRegion, bool *hasDirt
     if (disableSubtractOpaqueSiblings || q->isWindow())
         return;
 
-#ifdef QT_MAC_USE_COCOA
-    if (q->d_func()->isInUnifiedToolbar)
-        return;
-#endif // QT_MAC_USE_COCOA
-
     QRect clipBoundingRect;
     bool dirtyClipBoundingRect = true;
 
@@ -2829,15 +2803,6 @@ bool QWidget::isFullScreen() const
 */
 void QWidget::showFullScreen()
 {
-#ifdef 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 // Q_WS_MAC
     ensurePolished();
 
     setWindowState((windowState() & ~(Qt::WindowMinimized | Qt::WindowMaximized))
@@ -2862,18 +2827,6 @@ void QWidget::showMaximized()
 
     setWindowState((windowState() & ~(Qt::WindowMinimized | Qt::WindowFullScreen))
                    | Qt::WindowMaximized);
-#ifdef 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 // Q_WS_MAC
     show();
 }
 
@@ -2891,18 +2844,6 @@ void QWidget::showNormal()
     setWindowState(windowState() & ~(Qt::WindowMinimized
                                      | Qt::WindowMaximized
                                      | Qt::WindowFullScreen));
-#ifdef 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 // Q_WS_MAC
     show();
 }
 
@@ -5002,19 +4943,8 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
     if (rgn.isEmpty())
         return;
 
-#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
-    if (qt_mac_clearDirtyOnWidgetInsideDrawWidget)
-        dirtyOnWidget = QRegion();
-
-    // We disable the rendering of QToolBar in the backingStore if
-    // it's supposed to be in the unified toolbar on Mac OS X.
-    if (backingStore && isInUnifiedToolbar)
-        return;
-#endif // Q_WS_MAC && QT_MAC_USE_COCOA
-
-
     Q_Q(QWidget);
-#if !defined(QT_NO_GRAPHICSEFFECT) && !defined(Q_WS_MAC)
+#if !defined(QT_NO_GRAPHICSEFFECT)
     if (graphicsEffect && graphicsEffect->isEnabled()) {
         QGraphicsEffectSource *source = graphicsEffect->d_func()->source;
         QWidgetEffectSourcePrivate *sourced = static_cast<QWidgetEffectSourcePrivate *>
@@ -6502,18 +6432,6 @@ void QWidget::setGeometry(const QRect &r)
 */
 QByteArray QWidget::saveGeometry() const
 {
-#ifdef QT_MAC_USE_COCOA
-    // 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 // QT_MAC_USE_COCOA
     QByteArray array;
     QDataStream stream(&array, QIODevice::WriteOnly);
     stream.setVersion(QDataStream::Qt_4_0);
@@ -6523,13 +6441,8 @@ QByteArray QWidget::saveGeometry() const
     stream << magicNumber
            << majorVersion
            << minorVersion
-#ifdef QT_MAC_USE_COCOA
-           << newFramePosition
-           << newNormalPosition
-#else
            << frameGeometry()
            << normalGeometry()
-#endif // QT_MAC_USE_COCOA
            << qint32(QApplication::desktop()->screenNumber(this))
            << quint8(windowState() & Qt::WindowMaximized)
            << quint8(windowState() & Qt::WindowFullScreen);
@@ -7369,23 +7282,6 @@ void QWidgetPrivate::hideChildren(bool spontaneous)
         QWidget *widget = qobject_cast<QWidget*>(childList.at(i));
         if (!widget || widget->isWindow() || widget->testAttribute(Qt::WA_WState_Hidden))
             continue;
-#ifdef QT_MAC_USE_COCOA
-        // 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 // QT_MAC_USE_COCOA
         if (spontaneous)
             widget->setAttribute(Qt::WA_Mapped, false);
         else
@@ -7403,7 +7299,7 @@ void QWidgetPrivate::hideChildren(bool spontaneous)
                 widget->d_func()->hide_sys();
             }
         }
-#if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined(Q_WS_MAC)
+#if defined(Q_WS_X11)
         qApp->d_func()->sendSyntheticEnterLeave(widget);
 #endif
 #ifndef QT_NO_ACCESSIBILITY
@@ -9376,26 +9272,13 @@ QWidget *QWidgetPrivate::childAt_helper(const QPoint &p, bool ignoreChildrenInDe
     if (children.isEmpty())
         return 0;
 
-#ifdef Q_WS_MAC
-    Q_Q(const QWidget);
-    // Unified tool bars on the Mac require special handling since they live outside
-    // QMainWindow's geometry(). See commit: 35667fd45ada49269a5987c235fdedfc43e92bb8
-    bool includeFrame = q->isWindow() && qobject_cast<const QMainWindow *>(q)
-                        && static_cast<const QMainWindow *>(q)->unifiedTitleAndToolBarOnMac();
-    if (includeFrame)
-        return childAtRecursiveHelper(p, ignoreChildrenInDestructor, includeFrame);
-#endif
-
     if (!pointInsideRectAndMask(p))
         return 0;
     return childAtRecursiveHelper(p, ignoreChildrenInDestructor);
 }
 
-QWidget *QWidgetPrivate::childAtRecursiveHelper(const QPoint &p, bool ignoreChildrenInDestructor, bool includeFrame) const
+QWidget *QWidgetPrivate::childAtRecursiveHelper(const QPoint &p, bool ignoreChildrenInDestructor) const
 {
-#ifndef Q_WS_MAC
-    Q_UNUSED(includeFrame);
-#endif
     for (int i = children.size() - 1; i >= 0; --i) {
         QWidget *child = qobject_cast<QWidget *>(children.at(i));
         if (!child || child->isWindow() || child->isHidden() || child->testAttribute(Qt::WA_TransparentForMouseEvents)
@@ -9405,14 +9288,6 @@ QWidget *QWidgetPrivate::childAtRecursiveHelper(const QPoint &p, bool ignoreChil
 
         // Map the point 'p' from parent coordinates to child coordinates.
         QPoint childPoint = p;
-#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
-        // 'includeFrame' is true if the child's parent is a top-level QMainWindow with an unified tool bar.
-        // An unified tool bar on the Mac lives outside QMainWindow's geometry(), so a normal
-        // QWidget::mapFromParent won't do the trick.
-        if (includeFrame && qobject_cast<QToolBar *>(child) && qt_widget_private(child)->isInUnifiedToolbar)
-            childPoint = qt_mac_nativeMapFromParent(child, p);
-        else
-#endif
         childPoint -= child->data->crect.topLeft();
 
         // Check if the point hits the child.
@@ -9582,15 +9457,9 @@ void QWidget::setParent(QWidget *parent, Qt::WindowFlags f)
         desktopWidget = parent;
     bool newParent = (parent != parentWidget()) || !wasCreated || desktopWidget;
 
-#if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_MAC)
+#if defined(Q_WS_X11)
     if (newParent && parent && !desktopWidget) {
-        if (testAttribute(Qt::WA_NativeWindow) && !qApp->testAttribute(Qt::AA_DontCreateNativeWidgetSiblings)
-#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
-            // On Mac, toolbars inside the unified title bar will never overlap with
-            // siblings in the content view. So we skip enforce native siblings in that case
-            && !d->isInUnifiedToolbar && parentWidget() && parentWidget()->isWindow()
-#endif // Q_WS_MAC && QT_MAC_USE_COCOA
-        )
+        if (testAttribute(Qt::WA_NativeWindow) && !qApp->testAttribute(Qt::AA_DontCreateNativeWidgetSiblings))
             parent->d_func()->enforceNativeChildren();
         else if (parent->d_func()->nativeChildrenForced() || parent->testAttribute(Qt::WA_PaintOnScreen))
             setAttribute(Qt::WA_NativeWindow);
@@ -10145,13 +10014,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
                 ic->setFocusWidget(0);
             }
         }
-        if (!qApp->testAttribute(Qt::AA_DontCreateNativeWidgetSiblings) && parentWidget()
-#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
-            // On Mac, toolbars inside the unified title bar will never overlap with
-            // siblings in the content view. So we skip enforce native siblings in that case
-            && !d->isInUnifiedToolbar && parentWidget()->isWindow()
-#endif // Q_WS_MAC && QT_MAC_USE_COCOA
-        )
+        if (!qApp->testAttribute(Qt::AA_DontCreateNativeWidgetSiblings) && parentWidget())
             parentWidget()->d_func()->enforceNativeChildren();
         if (on && !internalWinId() && testAttribute(Qt::WA_WState_Created))
             d->createWinId();
@@ -11861,10 +11724,8 @@ void QWidget::setMask(const QRegion &newMask)
     d->extra->mask = newMask;
     d->extra->hasMask = !newMask.isEmpty();
 
-#ifndef QT_MAC_USE_COCOA
     if (!testAttribute(Qt::WA_WState_Created))
         return;
-#endif
 
     d->setMask_sys(newMask);
 
@@ -11957,29 +11818,6 @@ void QWidget::clearMask()
     handle could not be created.
 */
 
-
-#ifdef QT_MAC_USE_COCOA
-void QWidgetPrivate::syncUnifiedMode() {
-    // The whole purpose of this method is to keep the unifiedToolbar in sync.
-    // That means making sure we either exchange the drawing methods or we let
-    // the toolbar know that it does not require to draw the baseline.
-    Q_Q(QWidget);
-    // This function makes sense only if this is a top level
-    if(!q->isWindow())
-        return;
-    OSWindowRef window = qt_mac_window_for(q);
-    if(changeMethods) {
-        // Ok, we are in documentMode.
-        if(originalDrawMethod)
-            qt_mac_replaceDrawRect(window, this);
-    } else {
-        if(!originalDrawMethod)
-            qt_mac_replaceDrawRectOriginal(window, this);
-    }
-}
-
-#endif // QT_MAC_USE_COCOA
-
 QT_END_NAMESPACE
 
 #include "moc_qwidget.h"
index e22e4bf..30351e8 100644 (file)
@@ -443,7 +443,7 @@ public:
     void setConstraints_sys();
     bool pointInsideRectAndMask(const QPoint &) const;
     QWidget *childAt_helper(const QPoint &, bool) const;
-    QWidget *childAtRecursiveHelper(const QPoint &p, bool, bool includeFrame = false) const;
+    QWidget *childAtRecursiveHelper(const QPoint &p, bool) const;
     void updateGeometry_helper(bool forceUpdate);
 
     void getLayoutItemMargins(int *left, int *top, int *right, int *bottom) const;
index 814fe5e..b4b77c7 100644 (file)
@@ -364,7 +364,7 @@ void QImageTextureGlyphCache::createTextureData(int width, int height)
 
 int QImageTextureGlyphCache::glyphMargin() const
 {
-#if (defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)) || defined(Q_WS_X11)
+#if defined(Q_WS_X11)
     return 0;
 #else
     return m_type == QFontEngineGlyphCache::Raster_RGBMask ? 2 : 0;
index 8df183e..b8f9b4e 100644 (file)
 ****************************************************************************/
 
 #include <qdebug.h>
-
-#include <qglobal.h> // for Q_WS_WIN define (non-PCH)
-#ifdef Q_WS_WIN
-#include <qlibrary.h>
-#include <qt_windows.h>
-#endif
-
-#include <QtGui/qpaintdevice.h>
-#include <QtGui/qwidget.h>
+#include <qpaintdevice.h>
+#include <qwidget.h>
 
 #include "qwindowsurface_raster_p.h"
 #include "qimage.h"
 #endif
 #include "qdrawhelper_p.h"
 
-#ifdef Q_WS_MAC
-#include <qt_cocoa_helpers_mac_p.h>
-#include <QMainWindow>
-#include <qmainwindowlayout_p.h>
-#include <QToolBar>
-#endif
-
 QT_BEGIN_NAMESPACE
 
 class QRasterWindowSurfacePrivate
@@ -103,11 +89,6 @@ QRasterWindowSurface::QRasterWindowSurface(QWidget *window, bool setDefaultSurfa
 #endif
     d_ptr->image = 0;
     d_ptr->inSetGeometry = false;
-
-#ifdef QT_MAC_USE_COCOA
-    needsFlush = false;
-    regionToFlush = QRegion();
-#endif // QT_MAC_USE_COCOA
 }
 
 
@@ -142,12 +123,8 @@ void QRasterWindowSurface::beginPaint(const QRegion &rgn)
     syncX();
 #endif
 
-#if (defined(Q_WS_X11) && !defined(QT_NO_XRENDER)) || (defined(Q_WS_WIN) && !defined(Q_WS_WINCE))
+#if defined(Q_WS_X11) && !defined(QT_NO_XRENDER)
     if (!qt_widget_private(window())->isOpaque && window()->testAttribute(Qt::WA_TranslucentBackground)) {
-#if defined(Q_WS_WIN) && !defined(Q_WS_WINCE)
-        if (d_ptr->image->format() != QImage::Format_ARGB32_Premultiplied)
-            prepareBuffer(QImage::Format_ARGB32_Premultiplied, window());
-#endif
         QPainter p(d_ptr->image);
         p.setCompositionMode(QPainter::CompositionMode_Source);
         const QVector<QRect> rects = rgn.rects();
@@ -170,51 +147,6 @@ void QRasterWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoi
     if (!d->image || rgn.rectCount() == 0)
         return;
 
-#ifdef Q_WS_WIN
-    QRect br = rgn.boundingRect();
-
-#ifndef Q_WS_WINCE
-    if (!qt_widget_private(window())->isOpaque
-        && window()->testAttribute(Qt::WA_TranslucentBackground)
-        && (qt_widget_private(window())->data.window_flags & Qt::FramelessWindowHint))
-    {
-        QRect r = window()->frameGeometry();
-        QPoint frameOffset = qt_widget_private(window())->frameStrut().topLeft();
-        QRect dirtyRect = br.translated(offset + frameOffset);
-
-        SIZE size = {r.width(), r.height()};
-        POINT ptDst = {r.x(), r.y()};
-        POINT ptSrc = {0, 0};
-        BLENDFUNCTION blend = {AC_SRC_OVER, 0, (BYTE)(255.0 * window()->windowOpacity()), Q_AC_SRC_ALPHA};
-        RECT dirty = {dirtyRect.x(), dirtyRect.y(),
-            dirtyRect.x() + dirtyRect.width(), dirtyRect.y() + dirtyRect.height()};
-        Q_UPDATELAYEREDWINDOWINFO info = {sizeof(info), NULL, &ptDst, &size, d->image->hdc, &ptSrc, 0, &blend, Q_ULW_ALPHA, &dirty};
-        ptrUpdateLayeredWindowIndirect(window()->internalWinId(), &info);
-    } else
-#endif
-    {
-        QPoint wOffset = qt_qwidget_data(widget)->wrect.topLeft();
-
-        HDC widget_dc = widget->getDC();
-
-        QRect wbr = br.translated(-wOffset);
-        BitBlt(widget_dc, wbr.x(), wbr.y(), wbr.width(), wbr.height(),
-               d->image->hdc, br.x() + offset.x(), br.y() + offset.y(), SRCCOPY);
-        widget->releaseDC(widget_dc);
-    }
-
-#ifndef QT_NO_DEBUG
-    static bool flush = !qgetenv("QT_FLUSH_WINDOWSURFACE").isEmpty();
-    if (flush) {
-        SelectObject(qt_win_display_dc(), GetStockObject(BLACK_BRUSH));
-        Rectangle(qt_win_display_dc(), 0, 0, d->image->width() + 2, d->image->height() + 2);
-        BitBlt(qt_win_display_dc(), 1, 1, d->image->width(), d->image->height(),
-               d->image->hdc, 0, 0, SRCCOPY);
-    }
-#endif
-
-#endif
-
 #ifdef Q_WS_X11
     extern void *qt_getClipRects(const QRegion &r, int &num); // in qpaintengine_x11.cpp
     QPoint wOffset = qt_qwidget_data(widget)->wrect.topLeft();
@@ -260,63 +192,6 @@ void QRasterWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoi
     if (wrgn.rectCount() != 1)
         XSetClipMask(X11->display, d_ptr->gc, XNone);
 #endif // Q_WS_X11
-
-#ifdef Q_WS_MAC
-
-    Q_UNUSED(offset);
-
-    // This is mainly done for native components like native "open file" dialog.
-    if (widget->testAttribute(Qt::WA_DontShowOnScreen)) {
-        return;
-    }
-
-#ifdef QT_MAC_USE_COCOA
-
-    this->needsFlush = true;
-    this->regionToFlush += rgn;
-
-    // The actual flushing will be processed in [view drawRect:rect]
-    qt_mac_setNeedsDisplay(widget);
-
-#else
-    // Get a context for the widget.
-    CGContextRef context;
-    CGrafPtr port = GetWindowPort(qt_mac_window_for(widget));
-    QDBeginCGContext(port, &context);
-    CGContextRetain(context);
-    CGContextSaveGState(context);
-
-    // Flip context.
-    CGContextTranslateCTM(context, 0, widget->height());
-    CGContextScaleCTM(context, 1, -1);
-
-    // Clip to region.
-    const QVector<QRect> &rects = rgn.rects();
-    for (int i = 0; i < rects.size(); ++i) {
-        const QRect &rect = rects.at(i);
-        CGContextAddRect(context, CGRectMake(rect.x(), rect.y(), rect.width(), rect.height()));
-    }
-    CGContextClip(context);
-
-    QRect r = rgn.boundingRect().intersected(d->image->rect());
-    const CGRect area = CGRectMake(r.x(), r.y(), r.width(), r.height());
-    CGImageRef image = CGBitmapContextCreateImage(d->image->cg);
-    CGImageRef subImage = CGImageCreateWithImageInRect(image, area);
-
-    qt_mac_drawCGImage(context, &area, subImage);
-
-    CGImageRelease(subImage);
-    CGImageRelease(image);
-
-    QDEndCGContext(port, &context);
-
-    // Restore context.
-    CGContextRestoreGState(context);
-    CGContextRelease(context);
-#endif // QT_MAC_USE_COCOA
-
-#endif // Q_WS_MAC
-
 }
 
 void QRasterWindowSurface::setGeometry(const QRect &rect)
@@ -325,37 +200,14 @@ void QRasterWindowSurface::setGeometry(const QRect &rect)
     Q_D(QRasterWindowSurface);
     d->inSetGeometry = true;
     if (d->image == 0 || d->image->width() < rect.width() || d->image->height() < rect.height()) {
-#if (defined(Q_WS_X11) && !defined(QT_NO_XRENDER)) || (defined(Q_WS_WIN) && !defined(Q_WS_WINCE))
-#ifndef Q_WS_WIN
+#if defined(Q_WS_X11) && !defined(QT_NO_XRENDER)
         if (d_ptr->translucentBackground)
-#else
-        if (!qt_widget_private(window())->isOpaque)
-#endif
             prepareBuffer(QImage::Format_ARGB32_Premultiplied, window());
         else
 #endif
             prepareBuffer(QImage::systemFormat(), window());
     }
     d->inSetGeometry = false;
-
-#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
-    QMainWindow* mWindow = qobject_cast<QMainWindow*>(window());
-    if (mWindow) {
-        QMainWindowLayout *mLayout = qobject_cast<QMainWindowLayout*>(mWindow->layout());
-        QList<QToolBar *> toolbarList = mLayout->qtoolbarsInUnifiedToolbarList;
-
-        for (int i = 0; i < toolbarList.size(); ++i) {
-            QToolBar* toolbar = toolbarList.at(i);
-            if (mLayout->toolBarArea(toolbar) == Qt::TopToolBarArea) {
-                QWidget* tbWidget = (QWidget*) toolbar;
-                if (tbWidget->d_func()->unifiedSurface) {
-                    tbWidget->d_func()->unifiedSurface->setGeometry(rect);
-                }
-            }
-        }
-    }
-#endif // Q_WS_MAC && QT_MAC_USE_COCOA
-
 }
 
 // from qwindowsurface.cpp
@@ -363,18 +215,6 @@ extern void qt_scrollRectInImage(const QImage *img, const QRect &rect, const QPo
 
 bool QRasterWindowSurface::scroll(const QRegion &area, int dx, int dy)
 {
-#ifdef Q_WS_WIN
-    Q_D(QRasterWindowSurface);
-
-    if (!d->image || !d->image->hdc)
-        return false;
-
-    QRect rect = area.boundingRect();
-    BitBlt(d->image->hdc, rect.x()+dx, rect.y()+dy, rect.width(), rect.height(),
-           d->image->hdc, rect.x(), rect.y(), SRCCOPY);
-
-    return true;
-#else
     Q_D(QRasterWindowSurface);
 
     if (!d->image || d->image->isNull())
@@ -389,7 +229,6 @@ bool QRasterWindowSurface::scroll(const QRegion &area, int dx, int dy)
         qt_scrollRectInImage(d->image, rects.at(i), QPoint(dx, dy));
 
     return true;
-#endif
 }
 
 QWindowSurface::WindowSurfaceFeatures QRasterWindowSurface::features() const
@@ -457,14 +296,6 @@ void QRasterWindowSurface::prepareBuffer(QImage::Format format, QWidget *widget)
     delete oldImage;
 }
 
-#ifdef QT_MAC_USE_COCOA
-CGContextRef QRasterWindowSurface::imageContext()
-{
-    Q_D(QRasterWindowSurface);
-    return d->image->cg;
-}
-#endif // QT_MAC_USE_COCOA
-
 QT_END_NAMESPACE
 
 
index 7f32c86..a3019a3 100644 (file)
 #include <qglobal.h>
 #include "qwindowsurface_p.h"
 
-#ifdef QT_MAC_USE_COCOA
-# include <qt_cocoa_helpers_mac_p.h>
-#endif // QT_MAC_USE_COCOA
-
 QT_BEGIN_NAMESPACE
 
-#ifdef Q_WS_WIN
-#define Q_WS_EX_LAYERED           0x00080000 // copied from WS_EX_LAYERED in winuser.h
-#define Q_LWA_ALPHA               0x00000002 // copied from LWA_ALPHA in winuser.h
-#define Q_ULW_ALPHA               0x00000002 // copied from ULW_ALPHA in winuser.h
-#define Q_AC_SRC_ALPHA            0x00000001 // copied from AC_SRC_ALPHA in winuser.h
-
-struct Q_UPDATELAYEREDWINDOWINFO {
-    DWORD cbSize;
-    HDC hdcDst;
-    const POINT *pptDst;
-    const SIZE *psize;
-    HDC hdcSrc;
-    const POINT *pptSrc;
-    COLORREF crKey;
-    const BLENDFUNCTION *pblend;
-    DWORD dwFlags;
-    const RECT *prcDirty;
-};
-
-typedef BOOL (WINAPI *PtrUpdateLayeredWindow)(HWND hwnd, HDC hdcDst, const POINT *pptDst,
-             const SIZE *psize, HDC hdcSrc, const POINT *pptSrc, COLORREF crKey,
-             const BLENDFUNCTION *pblend, DWORD dwflags);
-typedef BOOL (WINAPI *PtrUpdateLayeredWindowIndirect)(HWND hwnd, const Q_UPDATELAYEREDWINDOWINFO *pULWInfo);
-extern PtrUpdateLayeredWindow ptrUpdateLayeredWindow;
-extern PtrUpdateLayeredWindowIndirect ptrUpdateLayeredWindowIndirect;
-#endif
-
 class QPaintDevice;
 class QPoint;
 class QRegion;
@@ -110,13 +79,6 @@ public:
     bool scroll(const QRegion &area, int dx, int dy);
     WindowSurfaceFeatures features() const;
 
-#ifdef QT_MAC_USE_COCOA
-    CGContextRef imageContext();
-
-    bool needsFlush;
-    QRegion regionToFlush;
-#endif // QT_MAC_USE_COCOA
-
 private:
 #if defined(Q_WS_X11) && !defined(QT_NO_XSHM)
     void syncX();
index 9a4bc33..395d7eb 100644 (file)
@@ -1466,15 +1466,9 @@ void QTextEngine::itemize() const
     int length = layoutData->string.length();
     if (!length)
         return;
-#if defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA)
-    // ATSUI requires RTL flags to correctly identify the character stops.
-    bool ignore = false;
-#else
-    bool ignore = ignoreBidi;
-#endif
 
+    bool ignore = ignoreBidi;
     bool rtl = isRightToLeft();
-
     if (!ignore && !rtl) {
         ignore = true;
         const QChar *start = layoutData->string.unicode();
index ec2190c..37268da 100644 (file)
@@ -1266,10 +1266,6 @@ void QTextLayout::drawCursor(QPainter *p, const QPointF &pos, int cursorPosition
                               && (p->transform().type() > QTransform::TxTranslate);
     if (toggleAntialiasing)
         p->setRenderHint(QPainter::Antialiasing);
-#if defined(QT_MAC_USE_COCOA)
-    // Always draw the cursor aligned to pixel boundary.
-    x = qRound(x);
-#endif
     p->fillRect(QRectF(x, y, qreal(width), (base + descent + 1).toReal()), p->pen().brush());
     if (toggleAntialiasing)
         p->setRenderHint(QPainter::Antialiasing, false);
index 942184c..e79e829 100644 (file)
@@ -1133,11 +1133,7 @@ void QCompleter::setPopup(QAbstractItemView *popup)
         delete d->popup;
     if (popup->model() != d->proxy)
         popup->setModel(d->proxy);
-#if defined(Q_OS_MAC) && !defined(QT_MAC_USE_COCOA)
-     popup->show();
-#else
      popup->hide();
-#endif
 
     Qt::FocusPolicy origPolicy = Qt::NoFocus;
     if (d->widget)
index f0da06f..5299246 100644 (file)
@@ -433,19 +433,11 @@ QBalloonTip::QBalloonTip(QSystemTrayIcon::MessageIcon icon, const QString& title
     titleLabel->setText(title);
     QFont f = titleLabel->font();
     f.setBold(true);
-#ifdef Q_WS_WINCE
-    f.setPointSize(f.pointSize() - 2);
-#endif
     titleLabel->setFont(f);
     titleLabel->setTextFormat(Qt::PlainText); // to maintain compat with windows
 
-#ifdef Q_WS_WINCE
-    const int iconSize = style()->pixelMetric(QStyle::PM_SmallIconSize);
-    const int closeButtonSize = style()->pixelMetric(QStyle::PM_SmallIconSize) - 2;
-#else
     const int iconSize = 18;
     const int closeButtonSize = 15;
-#endif
 
     QPushButton *closeButton = new QPushButton;
     closeButton->setIcon(style()->standardIcon(QStyle::SP_TitleBarCloseButton));
@@ -455,21 +447,13 @@ QBalloonTip::QBalloonTip(QSystemTrayIcon::MessageIcon icon, const QString& title
     QObject::connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
 
     QLabel *msgLabel = new QLabel;
-#ifdef Q_WS_WINCE
-    f.setBold(false);
-    msgLabel->setFont(f);
-#endif
     msgLabel->installEventFilter(this);
     msgLabel->setText(message);
     msgLabel->setTextFormat(Qt::PlainText);
     msgLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft);
 
     // smart size for the message label
-#ifdef Q_WS_WINCE
-    int limit = QApplication::desktop()->availableGeometry(msgLabel).size().width() / 2;
-#else
-    int limit = QApplication::desktop()->availableGeometry(msgLabel).size().width() / 3;
-#endif
+    const int limit = QApplication::desktop()->availableGeometry(msgLabel).size().width() / 3;
     if (msgLabel->sizeHint().width() > limit) {
         msgLabel->setWordWrap(true);
         if (msgLabel->sizeHint().width() > limit) {
@@ -480,15 +464,9 @@ QBalloonTip::QBalloonTip(QSystemTrayIcon::MessageIcon icon, const QString& title
                 control->document()->setDefaultTextOption(opt);
             }
         }
-#ifdef Q_WS_WINCE
-        // Make sure that the text isn't wrapped "somewhere" in the balloon widget
-        // in the case that we have a long title label.
-        setMaximumWidth(limit);
-#else
         // Here we allow the text being much smaller than the balloon widget
         // to emulate the weird standard windows behavior.
         msgLabel->setFixedSize(limit, msgLabel->heightForWidth(limit));
-#endif
     }
 
     QIcon si;
@@ -542,11 +520,6 @@ void QBalloonTip::paintEvent(QPaintEvent *)
     painter.drawPixmap(rect(), pixmap);
 }
 
-void QBalloonTip::resizeEvent(QResizeEvent *ev)
-{
-    QWidget::resizeEvent(ev);
-}
-
 void QBalloonTip::balloon(const QPoint& pos, int msecs, bool showArrow)
 {
     QRect scr = QApplication::desktop()->screenGeometry(pos);
index bec071d..b0dd227 100644 (file)
@@ -110,7 +110,6 @@ private:
 
 protected:
     void paintEvent(QPaintEvent *);
-    void resizeEvent(QResizeEvent *);
     void mousePressEvent(QMouseEvent *e);
     void timerEvent(QTimerEvent *e);
 
index e5f6e17..e196f61 100644 (file)
@@ -217,13 +217,6 @@ void QButtonGroup::setExclusive(bool exclusive)
     d->exclusive = exclusive;
 }
 
-
-// TODO: Qt 5: Merge with addButton(QAbstractButton *button, int id)
-void QButtonGroup::addButton(QAbstractButton *button)
-{
-    addButton(button, -1);
-}
-
 void QButtonGroup::addButton(QAbstractButton *button, int id)
 {
     Q_D(QButtonGroup);
@@ -1298,11 +1291,6 @@ void QAbstractButton::changeEvent(QEvent *e)
 }
 
 /*!
-    \fn void QAbstractButton::paintEvent(QPaintEvent *e)
-    \reimp
-*/
-
-/*!
     \fn void QAbstractButton::pressed()
 
     This signal is emitted when the button is pressed down.
index b1745e5..bd7ef7c 100644 (file)
@@ -127,7 +127,6 @@ Q_SIGNALS:
     void toggled(bool checked);
 
 protected:
-    virtual void paintEvent(QPaintEvent *e) = 0;
     virtual bool hitButton(const QPoint &pos) const;
     virtual void checkStateSet();
     virtual void nextCheckState();
index e56c1d7..da89358 100644 (file)
@@ -67,8 +67,7 @@ public:
     void setExclusive(bool);
     bool exclusive() const;
 
-    void addButton(QAbstractButton *);
-    void addButton(QAbstractButton *, int id);
+    void addButton(QAbstractButton *, int id = -1);
     void removeButton(QAbstractButton *);
 
     QList<QAbstractButton*> buttons() const;
index 1a815d7..9e2d771 100644 (file)
@@ -2064,9 +2064,7 @@ void QDockAreaLayoutInfo::updateSeparatorWidgets() const
         }
         j++;
 
-#ifndef QT_MAC_USE_COCOA
         sepWidget->raise();
-#endif
         QRect sepRect = separatorRect(i).adjusted(-2, -2, 2, 2);
         sepWidget->setGeometry(sepRect);
         sepWidget->setMask( QRegion(separatorRect(i).translated( - sepRect.topLeft())));
@@ -3177,9 +3175,7 @@ void QDockAreaLayout::updateSeparatorWidgets() const
         }
         j++;
 
-#ifndef QT_MAC_USE_COCOA
         sepWidget->raise();
-#endif
         QRect sepRect = separatorRect(i).adjusted(-2, -2, 2, 2);
         sepWidget->setGeometry(sepRect);
         sepWidget->setMask( QRegion(separatorRect(i).translated( - sepRect.topLeft())));
index 8efd92c..506bef8 100644 (file)
@@ -1051,12 +1051,6 @@ void QDockWidgetPrivate::setWindowState(bool floating, bool unplug, const QRect
 
     q->setWindowFlags(flags);
 
-#if defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA)
-    if (floating && nativeDeco && (q->features() & QDockWidget::DockWidgetVerticalTitleBar)) {
-        ChangeWindowAttributes(HIViewGetWindow(HIViewRef(q->winId())), kWindowSideTitlebarAttribute, 0);
-    }
-#endif
-
     if (!rect.isNull())
         q->setGeometry(rect);
 
index 4e5ffff..5ebd0c4 100644 (file)
@@ -330,11 +330,6 @@ QFocusFrame::eventFilter(QObject *o, QEvent *e)
     return false;
 }
 
-/*! \reimp */
-bool QFocusFrame::event(QEvent *e)
-{
-    return QWidget::event(e);
-}
 
 QT_END_NAMESPACE
 
index f39345d..b2bde9d 100644 (file)
@@ -63,8 +63,6 @@ public:
     QWidget *widget() const;
 
 protected:
-    bool event(QEvent *e);
-
     bool eventFilter(QObject *, QEvent *);
     void paintEvent(QPaintEvent *);
     void initStyleOption(QStyleOption *option) const;
index f049d15..097318d 100644 (file)
@@ -310,13 +310,6 @@ void QGroupBox::setAlignment(int alignment)
 
 /*! \reimp
 */
-void QGroupBox::resizeEvent(QResizeEvent *e)
-{
-    QWidget::resizeEvent(e);
-}
-
-/*! \reimp
-*/
 
 void QGroupBox::paintEvent(QPaintEvent *)
 {
index a2e331d..d810749 100644 (file)
@@ -91,7 +91,6 @@ Q_SIGNALS:
 protected:
     bool event(QEvent *event);
     void childEvent(QChildEvent *event);
-    void resizeEvent(QResizeEvent *event);
     void paintEvent(QPaintEvent *event);
     void focusInEvent(QFocusEvent *event);
     void changeEvent(QEvent *event);
index 3d22f90..933045c 100644 (file)
@@ -111,8 +111,6 @@ protected:
     bool event(QEvent *e);
     void paintEvent(QPaintEvent *);
 
-public:
-
 private:
     Q_DISABLE_COPY(QLCDNumber)
     Q_DECLARE_PRIVATE(QLCDNumber)
index 310b6ed..4a4b4f3 100644 (file)
@@ -742,11 +742,7 @@ void QMainWindow::addToolBar(Qt::ToolBarArea area, QToolBar *toolbar)
 #endif
     }
 
-    if (!d->layout->usesHIToolBar(toolbar)) {
-        d->layout->removeWidget(toolbar);
-    } else {
-        d->layout->removeToolBar(toolbar);
-    }
+    d->layout->removeWidget(toolbar);
 
     toolbar->d_func()->_q_updateIconSize(d->iconSize);
     toolbar->d_func()->_q_updateToolButtonStyle(d->toolButtonStyle);
@@ -1428,28 +1424,6 @@ bool QMainWindow::event(QEvent *event)
             if (!d->explicitIconSize)
                 setIconSize(QSize());
             break;
-#ifdef Q_WS_MAC
-        case QEvent::Show:
-            d->layout->blockVisiblityCheck = false;
-            if (unifiedTitleAndToolBarOnMac())
-                d->layout->syncUnifiedToolbarVisibility();
-            break;
-       case QEvent::WindowStateChange:
-            {
-                if (isHidden()) {
-                    // We are coming out of a minimize, leave things as is.
-                    d->layout->blockVisiblityCheck = true;
-                }
-#  ifdef QT_MAC_USE_COCOA
-                // We need to update the HIToolbar status when we go out of or into fullscreen.
-                QWindowStateChangeEvent *wce = static_cast<QWindowStateChangeEvent *>(event);
-                if ((windowState() & Qt::WindowFullScreen) || (wce->oldState() & Qt::WindowFullScreen)) {
-                    d->layout->updateHIToolBarStatus();
-                }
-#  endif // Cocoa
-            }
-            break;
-#endif // Q_WS_MAC
 #if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_CURSOR)
        case QEvent::CursorChange:
            if (d->cursorAdjusted) {
@@ -1465,81 +1439,6 @@ bool QMainWindow::event(QEvent *event)
     return QWidget::event(event);
 }
 
-#ifndef QT_NO_TOOLBAR
-
-/*!
-    \property QMainWindow::unifiedTitleAndToolBarOnMac
-    \brief whether the window uses the unified title and toolbar look on Mac OS X
-    \since 4.3
-
-    This property is false by default and only has any effect on Mac OS X 10.4 or higher.
-
-    If set to true, then the top toolbar area is replaced with a Carbon HIToolbar
-    or a Cocoa NSToolbar (depending on whether Qt was built with Carbon or Cocoa).
-    All toolbars in the top toolbar area and any toolbars added afterwards are
-    moved to that. This means a couple of things.
-
-    \list
-    \i QToolBars in this toolbar area are not movable and you cannot drag other
-        toolbars to it
-    \i Toolbar breaks are not respected or preserved
-    \i Any custom widgets in the toolbar will not be shown if the toolbar
-        becomes too small (only actions will be shown)
-    \i Before Qt 4.5, if you called showFullScreen() on the main window, the QToolbar would
-        disappear since it is considered to be part of the title bar. Qt 4.5 and up will now work around this by pulling
-        the toolbars out and back into the regular toolbar and vice versa when you swap out.
-    \endlist
-
-    Setting this back to false will remove these restrictions.
-
-    The Qt::WA_MacBrushedMetal attribute takes precedence over this property.
-*/
-void QMainWindow::setUnifiedTitleAndToolBarOnMac(bool set)
-{
-#ifdef Q_WS_MAC
-    Q_D(QMainWindow);
-    if (!isWindow() || d->useHIToolBar == set || QSysInfo::MacintoshVersion < QSysInfo::MV_10_3)
-        return;
-
-    d->useHIToolBar = set;
-    createWinId(); // We need the hiview for down below.
-
-#ifdef QT_MAC_USE_COCOA
-    // Activate the unified toolbar with the raster engine.
-    if (windowSurface() && set) {
-        d->layout->unifiedSurface = new QUnifiedToolbarSurface(this);
-    }
-#endif // QT_MAC_USE_COCOA
-
-    d->layout->updateHIToolBarStatus();
-
-#ifdef QT_MAC_USE_COCOA
-    // Deactivate the unified toolbar with the raster engine.
-    if (windowSurface() && !set) {
-        if (d->layout->unifiedSurface) {
-            delete d->layout->unifiedSurface;
-            d->layout->unifiedSurface = 0;
-        }
-    }
-#endif // QT_MAC_USE_COCOA
-
-    // Enabling the unified toolbar clears the opaque size grip setting, update it.
-    d->macUpdateOpaqueSizeGrip();
-#else
-    Q_UNUSED(set)
-#endif
-}
-
-bool QMainWindow::unifiedTitleAndToolBarOnMac() const
-{
-#ifdef Q_WS_MAC
-    return d_func()->useHIToolBar && !testAttribute(Qt::WA_MacBrushedMetal) && !(windowFlags() & Qt::FramelessWindowHint);
-#endif
-    return false;
-}
-
-#endif // QT_NO_TOOLBAR
-
 /*!
     \internal
 */
@@ -1653,9 +1552,7 @@ QMenu *QMainWindow::createPopupMenu()
         for (int i = 0; i < toolbars.size(); ++i) {
             QToolBar *toolBar = toolbars.at(i);
             if (toolBar->parentWidget() == this
-                && (!d->layout->layoutState.toolBarAreaLayout.indexOf(toolBar).isEmpty()
-                    || (unifiedTitleAndToolBarOnMac()
-                        && toolBarArea(toolBar) == Qt::TopToolBarArea))) {
+                && !d->layout->layoutState.toolBarAreaLayout.indexOf(toolBar).isEmpty()) {
                 menu->addAction(toolbars.at(i)->toggleViewAction());
             }
         }
index ac4c6fc..f18aca3 100644 (file)
@@ -78,9 +78,6 @@ class Q_GUI_EXPORT QMainWindow : public QWidget
     Q_PROPERTY(bool dockNestingEnabled READ isDockNestingEnabled WRITE setDockNestingEnabled)
 #endif // QT_NO_DOCKWIDGET
     Q_PROPERTY(DockOptions dockOptions READ dockOptions WRITE setDockOptions)
-#ifndef QT_NO_TOOLBAR
-    Q_PROPERTY(bool unifiedTitleAndToolBarOnMac READ unifiedTitleAndToolBarOnMac WRITE setUnifiedTitleAndToolBarOnMac)
-#endif
 
 public:
     enum DockOption {
@@ -155,9 +152,6 @@ public:
     void removeToolBar(QToolBar *toolbar);
     void removeToolBarBreak(QToolBar *before);
 
-    void setUnifiedTitleAndToolBarOnMac(bool set);
-    bool unifiedTitleAndToolBarOnMac() const;
-
     Qt::ToolBarArea toolBarArea(QToolBar *toolbar) const;
     bool toolBarBreak(QToolBar *toolbar) const;
 #endif
index 9fe333a..6a36965 100644 (file)
@@ -845,14 +845,7 @@ void QMainWindowLayout::removeToolBar(QToolBar *toolbar)
         QObject::disconnect(parentWidget(), SIGNAL(toolButtonStyleChanged(Qt::ToolButtonStyle)),
                    toolbar, SLOT(_q_updateToolButtonStyle(Qt::ToolButtonStyle)));
 
-#ifdef Q_WS_MAC
-        if (usesHIToolBar(toolbar)) {
-            removeFromMacToolbar(toolbar);
-        } else
-#endif // Q_WS_MAC
-        {
-            removeWidget(toolbar);
-        }
+        removeWidget(toolbar);
     }
 }
 
@@ -864,25 +857,17 @@ void QMainWindowLayout::addToolBar(Qt::ToolBarArea area,
                                    bool)
 {
     validateToolBarArea(area);
-#ifdef Q_WS_MAC
-    if ((area == Qt::TopToolBarArea)
-            && layoutState.mainWindow->unifiedTitleAndToolBarOnMac()) {
-        insertIntoMacToolbar(0, toolbar);
-    } else
-#endif
-    {
-        //let's add the toolbar to the layout
-        addChildWidget(toolbar);
-        QLayoutItem * item = layoutState.toolBarAreaLayout.addToolBar(toDockPos(area), toolbar);
-        if (savedState.isValid() && item) {
-            // copy the toolbar also in the saved state
-            savedState.toolBarAreaLayout.insertItem(toDockPos(area), item);
-        }
-        invalidate();
-
-        //this ensures that the toolbar has the right window flags (not floating any more)
-        toolbar->d_func()->updateWindowFlags(false /*floating*/);
+    //let's add the toolbar to the layout
+    addChildWidget(toolbar);
+    QLayoutItem * item = layoutState.toolBarAreaLayout.addToolBar(toDockPos(area), toolbar);
+    if (savedState.isValid() && item) {
+        // copy the toolbar also in the saved state
+        savedState.toolBarAreaLayout.insertItem(toDockPos(area), item);
     }
+    invalidate();
+
+    //this ensures that the toolbar has the right window flags (not floating any more)
+    toolbar->d_func()->updateWindowFlags(false /*floating*/);
 }
 
 /*!
@@ -890,27 +875,20 @@ void QMainWindowLayout::addToolBar(Qt::ToolBarArea area,
 */
 void QMainWindowLayout::insertToolBar(QToolBar *before, QToolBar *toolbar)
 {
-#ifdef Q_WS_MAC
-    if (usesHIToolBar(before)) {
-        insertIntoMacToolbar(before, toolbar);
-    } else
-#endif // Q_WS_MAC
-    {
-        addChildWidget(toolbar);
-        QLayoutItem * item = layoutState.toolBarAreaLayout.insertToolBar(before, toolbar);
-        if (savedState.isValid() && item) {
-            // copy the toolbar also in the saved state
-            savedState.toolBarAreaLayout.insertItem(before, item);
-        }
-        if (!currentGapPos.isEmpty() && currentGapPos.first() == 0) {
-            currentGapPos = layoutState.toolBarAreaLayout.currentGapIndex();
-            if (!currentGapPos.isEmpty()) {
-                currentGapPos.prepend(0);
-                currentGapRect = layoutState.itemRect(currentGapPos);
-            }
+    addChildWidget(toolbar);
+    QLayoutItem * item = layoutState.toolBarAreaLayout.insertToolBar(before, toolbar);
+    if (savedState.isValid() && item) {
+        // copy the toolbar also in the saved state
+        savedState.toolBarAreaLayout.insertItem(before, item);
+    }
+    if (!currentGapPos.isEmpty() && currentGapPos.first() == 0) {
+        currentGapPos = layoutState.toolBarAreaLayout.currentGapIndex();
+        if (!currentGapPos.isEmpty()) {
+            currentGapPos.prepend(0);
+            currentGapRect = layoutState.itemRect(currentGapPos);
         }
-        invalidate();
     }
+    invalidate();
 }
 
 Qt::ToolBarArea QMainWindowLayout::toolBarArea(QToolBar *toolbar) const
@@ -923,12 +901,6 @@ Qt::ToolBarArea QMainWindowLayout::toolBarArea(QToolBar *toolbar) const
         case QInternal::BottomDock: return Qt::BottomToolBarArea;
         default: break;
     }
-#ifdef Q_WS_MAC
-    if (pos == QInternal::DockCount) {
-        if (qtoolbarsInUnifiedToolbarList.contains(toolbar))
-            return Qt::TopToolBarArea;
-    }
-#endif
     return Qt::NoToolBarArea;
 }
 
@@ -945,70 +917,15 @@ void QMainWindowLayout::getStyleOptionInfo(QStyleOptionToolBar *option, QToolBar
 
 void QMainWindowLayout::toggleToolBarsVisible()
 {
-    bool updateNonUnifiedParts = true;
-#ifdef Q_WS_MAC
-    if (layoutState.mainWindow->unifiedTitleAndToolBarOnMac()) {
-        // If we hit this case, someone has pressed the "toolbar button" which will
-        // toggle the unified toolbar visibility, because that's what the user wants.
-        // We might be in a situation where someone has hidden all the toolbars
-        // beforehand (maybe in construction), but now they've hit this button and
-        // and are expecting the items to show. What do we do?
-        // 1) Check the visibility of all the toolbars, if one is visible, do nothing, this
-        //    preserves what people would expect (these toolbars were visible when I clicked last time).
-        // 2) If NONE are visible, then show them all. Again, this preserves the user expectation
-        //    of, "I want to see the toolbars." The user may get more toolbars than expected, but this
-        //    is better seeing nothing.
-        // Don't worry about any of this if we are going invisible. This does mean we may get
-        // into issues when switching into and out of fullscreen mode, but this is probably minor.
-        // If we ever need to do hiding, that would have to be taken care of after the unified toolbar
-        // has finished hiding.
-        // People can of course handle the QEvent::ToolBarChange event themselves and do
-        // WHATEVER they want if they don't like what we are doing (though the unified toolbar
-        // will fire regardless).
-
-        // Check if we REALLY need to update the geometry below. If we only have items in the
-        // unified toolbar, all the docks will be empty, so there's very little point
-        // in doing the geometry as Apple will do it (we also avoid flicker in Cocoa as well).
-        // FWIW, layoutState.toolBarAreaLayout.visible and the state of the unified toolbar
-        // visibility can get out of sync. I really don't think it's a big issue. It is kept
-        // to a minimum because we only change the visibility if we absolutely must.
-        // update the "non unified parts."
-        updateNonUnifiedParts = !layoutState.toolBarAreaLayout.isEmpty();
-
-        // We get this function before the unified toolbar does its thing.
-        // So, the value will be opposite of what we expect.
-        bool goingVisible = !macWindowToolbarIsVisible(qt_mac_window_for(layoutState.mainWindow));
-        if (goingVisible) {
-            const int ToolBarCount = qtoolbarsInUnifiedToolbarList.size();
-            bool needAllVisible = true;
-            for (int i = 0; i < ToolBarCount; ++i) {
-                if (!qtoolbarsInUnifiedToolbarList.at(i)->isHidden()) {
-                    needAllVisible = false;
-                    break;
-                }
-            }
-            if (needAllVisible) {
-                QBoolBlocker blocker(blockVisiblityCheck);  // Disable the visibilty check because
-                                                            // the toggle has already happened.
-                for (int i = 0; i < ToolBarCount; ++i)
-                    qtoolbarsInUnifiedToolbarList.at(i)->setVisible(true);
-            }
-        }
-        if (!updateNonUnifiedParts)
-            layoutState.toolBarAreaLayout.visible = goingVisible;
-    }
-#endif
-    if (updateNonUnifiedParts) {
-        layoutState.toolBarAreaLayout.visible = !layoutState.toolBarAreaLayout.visible;
-        if (!layoutState.mainWindow->isMaximized()) {
-            QPoint topLeft = parentWidget()->geometry().topLeft();
-            QRect r = parentWidget()->geometry();
-            r = layoutState.toolBarAreaLayout.rectHint(r);
-            r.moveTo(topLeft);
-            parentWidget()->setGeometry(r);
-        } else {
-            update();
-        }
+    layoutState.toolBarAreaLayout.visible = !layoutState.toolBarAreaLayout.visible;
+    if (!layoutState.mainWindow->isMaximized()) {
+        QPoint topLeft = parentWidget()->geometry().topLeft();
+        QRect r = parentWidget()->geometry();
+        r = layoutState.toolBarAreaLayout.rectHint(r);
+        r.moveTo(topLeft);
+        parentWidget()->setGeometry(r);
+    } else {
+        update();
     }
 }
 
@@ -1487,14 +1404,6 @@ QSize QMainWindowLayout::minimumSize() const
         const QSize sbMin = statusbar ? statusbar->minimumSize() : QSize(0, 0);
         minSize = QSize(qMax(sbMin.width(), minSize.width()),
                         sbMin.height() + minSize.height());
-#ifdef Q_WS_MAC
-        const QSize storedSize = minSize;
-        int minWidth = 0;
-        foreach (QToolBar *toolbar, qtoolbarsInUnifiedToolbarList) {
-            minWidth += toolbar->sizeHint().width() + 20;
-        }
-        minSize = QSize(qMax(minWidth, storedSize.width()), storedSize.height());
-#endif
     }
     return minSize;
 }
@@ -1688,10 +1597,6 @@ QMainWindowLayout::QMainWindowLayout(QMainWindow *mainwindow, QLayout *parentLay
 #ifndef QT_NO_RUBBERBAND
     , gapIndicator(new QRubberBand(QRubberBand::Rectangle, mainwindow))
 #endif //QT_NO_RUBBERBAND
-#ifdef Q_WS_MAC
-    , activateUnifiedToolbarAfterFullScreen(false)
-    , blockVisiblityCheck(false)
-#endif
 {
     if (parentLayout)
         setParent(parentLayout);
@@ -1963,22 +1868,6 @@ bool QMainWindowLayout::restoreState(QDataStream &stream)
     return true;
 }
 
-
-// Returns if this toolbar *should* be using HIToolbar. Won't work for all in between cases
-// for example, you have a toolbar in the top area and then you suddenly turn on
-// HIToolbar.
-bool QMainWindowLayout::usesHIToolBar(QToolBar *toolbar) const
-{
-#ifndef Q_WS_MAC
-    Q_UNUSED(toolbar);
-    return false;
-#else
-    return qtoolbarsInUnifiedToolbarList.contains(toolbar)
-           || ((toolBarArea(toolbar) == Qt::TopToolBarArea)
-                && layoutState.mainWindow->unifiedTitleAndToolBarOnMac());
-#endif
-}
-
 void QMainWindowLayout::timerEvent(QTimerEvent *e)
 {
 #ifndef QT_NO_DOCKWIDGET
index c1a6fb1..cdb24cc 100644 (file)
@@ -154,7 +154,6 @@ public:
 
     QMainWindow::DockOptions dockOptions;
     void setDockOptions(QMainWindow::DockOptions opts);
-    bool usesHIToolBar(QToolBar *toolbar) const;
 
     void timerEvent(QTimerEvent *e);
 
index cad13e9..5d585b6 100644 (file)
@@ -2303,10 +2303,6 @@ void QMenu::changeEvent(QEvent *e)
         if (d->tornPopup) // torn-off menu
             d->tornPopup->setEnabled(isEnabled());
         d->menuAction->setEnabled(isEnabled());
-#if defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA)
-        if (d->mac_menu)
-            d->setMacMenuEnabled(isEnabled());
-#endif
     }
     QWidget::changeEvent(e);
 }
index 0de8f3f..ffba3a5 100644 (file)
@@ -678,38 +678,6 @@ bool QPushButton::event(QEvent *e)
     return QAbstractButton::event(e);
 }
 
-#ifdef Q_WS_MAC
-/*! \reimp */
-bool QPushButton::hitButton(const QPoint &pos) const
-{
-    QStyleOptionButton opt;
-    initStyleOption(&opt);
-    if (qt_mac_buttonIsRenderedFlat(this, &opt))
-        return QAbstractButton::hitButton(pos);
-
-    // Now that we know we are using the native style, let's proceed.
-    Q_D(const QPushButton);
-    QPushButtonPrivate *nonConst = const_cast<QPushButtonPrivate *>(d);
-    // In OSX buttons are round, which causes the hit method to be special.
-    // We cannot simply relay on detecting if something is inside the rect or not,
-    // we need to check if it is inside the "rounded area" or not. A point might
-    // be inside the rect but not inside the rounded area.
-    // Notice this method is only reimplemented for OSX.
-    return nonConst->hitButton(pos);
-}
-
-bool QPushButtonPrivate::hitButton(const QPoint &pos)
-{
-    Q_Q(QPushButton);
-    QRect roundedRect(q->rect().left() + QMacStylePrivate::PushButtonLeftOffset,
-                      q->rect().top() + QMacStylePrivate::PushButtonContentPadding,
-                      q->rect().width() - QMacStylePrivate::PushButtonRightOffset,
-                      q->rect().height() - QMacStylePrivate::PushButtonBottomOffset);
-    return roundedRect.contains(pos);
-}
-#endif // Q_WS_MAC
-
-
 /*!
     \fn void QPushButton::openPopup()
 
index b04b3d1..62cca8c 100644 (file)
@@ -284,34 +284,6 @@ void QRubberBand::moveEvent(QMoveEvent *)
     \sa move()
 */
 
-/*!
-    \fn void QRubberBand::setGeometry(const QRect &rect)
-
-    Sets the geometry of the rubber band to \a rect, specified in the coordinate system
-    of its parent widget.
-
-    \sa QWidget::geometry
-*/
-void QRubberBand::setGeometry(const QRect &geom)
-{
-    QWidget::setGeometry(geom);
-}
-
-/*!
-    \fn void QRubberBand::setGeometry(int x, int y, int width, int height)
-    \overload
-
-    Sets the geometry of the rubberband to the rectangle whose top-left corner lies at
-    the point (\a x, \a y), and with dimensions specified by \a width and \a height.
-    The geometry is specified in the parent widget's coordinate system.
-*/
-
-/*! \reimp */
-bool QRubberBand::event(QEvent *e)
-{
-    return QWidget::event(e);
-}
-
 QT_END_NAMESPACE
 
 #include "moc_qrubberband.h"
index 75871ff..575bf7b 100644 (file)
@@ -65,9 +65,6 @@ public:
 
     Shape shape() const;
 
-    void setGeometry(const QRect &r);
-
-    inline void setGeometry(int x, int y, int w, int h);
     inline void move(int x, int y);
     inline void move(const QPoint &p)
     { move(p.x(), p.y()); }
@@ -77,7 +74,6 @@ public:
     { resize(s.width(), s.height()); }
 
 protected:
-    bool event(QEvent *e);
     void paintEvent(QPaintEvent *);
     void changeEvent(QEvent *);
     void showEvent(QShowEvent *);
@@ -89,8 +85,6 @@ private:
     Q_DECLARE_PRIVATE(QRubberBand)
 };
 
-inline void QRubberBand::setGeometry(int ax, int ay, int aw, int ah)
-{ setGeometry(QRect(ax, ay, aw, ah)); }
 inline void QRubberBand::move(int ax, int ay)
 { setGeometry(ax, ay, width(), height()); }
 
index 171f446..e77336b 100644 (file)
@@ -455,12 +455,6 @@ QSize QScrollBar::sizeHint() const
 
     return style()->sizeFromContents(QStyle::CT_ScrollBar, &opt, size, this)
         .expandedTo(QApplication::globalStrut());
- }
-
-/*!\reimp */
-void QScrollBar::sliderChange(SliderChange change)
-{
-    QAbstractSlider::sliderChange(change);
 }
 
 /*!
index 8834d59..cb332cd 100644 (file)
@@ -72,7 +72,6 @@ protected:
     void mouseReleaseEvent(QMouseEvent *);
     void mouseMoveEvent(QMouseEvent *);
     void hideEvent(QHideEvent*);
-    void sliderChange(SliderChange change);
 #ifndef QT_NO_CONTEXTMENU
     void contextMenuEvent(QContextMenuEvent *);
 #endif
index cac718a..b81ba5b 100644 (file)
 
 #if defined(Q_WS_X11)
 #include <qt_x11_p.h>
-#elif defined (Q_WS_WIN)
-#include "qt_windows.h"
-#endif
-#ifdef Q_WS_MAC
-#include <qt_mac_p.h>
 #endif
 
 #include <qwidget_p.h>
@@ -91,9 +86,6 @@ public:
     Qt::Corner m_corner;
     bool gotMousePress;
     QWidget *tlw;
-#ifdef Q_WS_MAC
-    void updateMacSizer(bool hide) const;
-#endif
     Qt::Corner corner() const;
     inline bool atBottom() const
     {
@@ -128,10 +120,7 @@ public:
         bool showSizeGrip = !(q->isHidden() && q->testAttribute(Qt::WA_WState_ExplicitShowHide));
         updateTopLevelWidget();
         if (tlw && showSizeGrip) {
-            Qt::WindowStates sizeGripNotVisibleState = Qt::WindowFullScreen;
-#ifndef Q_WS_MAC
-            sizeGripNotVisibleState |= Qt::WindowMaximized;
-#endif
+            const Qt::WindowStates sizeGripNotVisibleState = Qt::WindowFullScreen | Qt::WindowMaximized;
             // Don't show the size grip if the tlw is maximized or in full screen mode.
             showSizeGrip = !(tlw->windowState() & sizeGripNotVisibleState);
         }
@@ -140,18 +129,6 @@ public:
     }
 };
 
-#ifdef Q_WS_MAC
-void QSizeGripPrivate::updateMacSizer(bool hide) const
-{
-    Q_Q(const QSizeGrip);
-    if (QApplication::closingDown() || !parent)
-        return;
-    QWidget *topLevelWindow = qt_sizegrip_topLevelWidget(const_cast<QSizeGrip *>(q));
-    if(topLevelWindow && topLevelWindow->isWindow())
-        QWidgetPrivate::qt_mac_update_sizer(topLevelWindow, hide ? -1 : 1);
-}
-#endif
-
 Qt::Corner QSizeGripPrivate::corner() const
 {
     Q_Q(const QSizeGrip);
@@ -316,19 +293,6 @@ void QSizeGrip::mousePressEvent(QMouseEvent * e)
         return;
     }
 #endif // Q_WS_X11
-#ifdef Q_WS_WIN
-    if (tlw->isWindow() && !tlw->testAttribute(Qt::WA_DontShowOnScreen) && !qt_widget_private(tlw)->hasHeightForWidth()) {
-        uint orientation = 0;
-        if (d->atBottom())
-            orientation = d->atLeft() ? SZ_SIZEBOTTOMLEFT : SZ_SIZEBOTTOMRIGHT;
-        else
-            orientation = d->atLeft() ? SZ_SIZETOPLEFT : SZ_SIZETOPRIGHT;
-
-        ReleaseCapture();
-        PostMessage(tlw->winId(), WM_SYSCOMMAND, orientation, 0);
-        return;
-    }
-#endif // Q_WS_WIN
 
     // Find available desktop/workspace geometry.
     QRect availableGeometry;
@@ -410,14 +374,6 @@ void QSizeGrip::mouseMoveEvent(QMouseEvent * e)
         && !tlw->testAttribute(Qt::WA_DontShowOnScreen) && !qt_widget_private(tlw)->hasHeightForWidth())
         return;
 #endif
-#ifdef Q_WS_WIN
-    if (tlw->isWindow() && GetSystemMenu(tlw->winId(), FALSE) != 0 && internalWinId()
-        && !tlw->testAttribute(Qt::WA_DontShowOnScreen) && !qt_widget_private(tlw)->hasHeightForWidth()) {
-        MSG msg;
-        while(PeekMessage(&msg, winId(), WM_MOUSEMOVE, WM_MOUSEMOVE, PM_REMOVE));
-        return;
-    }
-#endif
 
     QPoint np(e->globalPos());
 
@@ -483,36 +439,6 @@ void QSizeGrip::moveEvent(QMoveEvent * /*moveEvent*/)
 #endif
 }
 
-/*!
-  \reimp
-*/
-void QSizeGrip::showEvent(QShowEvent *showEvent)
-{
-#ifdef Q_WS_MAC
-    d_func()->updateMacSizer(false);
-#endif
-    QWidget::showEvent(showEvent);
-}
-
-/*!
-  \reimp
-*/
-void QSizeGrip::hideEvent(QHideEvent *hideEvent)
-{
-#ifdef Q_WS_MAC
-    d_func()->updateMacSizer(true);
-#endif
-    QWidget::hideEvent(hideEvent);
-}
-
-/*!
-    \reimp
-*/
-void QSizeGrip::setVisible(bool visible)
-{
-    QWidget::setVisible(visible);
-}
-
 /*! \reimp */
 bool QSizeGrip::eventFilter(QObject *o, QEvent *e)
 {
@@ -522,31 +448,13 @@ bool QSizeGrip::eventFilter(QObject *o, QEvent *e)
                || o != d->tlw) {
         return QWidget::eventFilter(o, e);
     }
-    Qt::WindowStates sizeGripNotVisibleState = Qt::WindowFullScreen;
-#ifndef Q_WS_MAC
-    sizeGripNotVisibleState |= Qt::WindowMaximized;
-#endif
+    const Qt::WindowStates sizeGripNotVisibleState = Qt::WindowFullScreen | Qt::WindowMaximized;
     // Don't show the size grip if the tlw is maximized or in full screen mode.
     setVisible(!(d->tlw->windowState() & sizeGripNotVisibleState));
     setAttribute(Qt::WA_WState_ExplicitShowHide, false);
     return QWidget::eventFilter(o, e);
 }
 
-/*!
-    \reimp
-*/
-bool QSizeGrip::event(QEvent *event)
-{
-    return QWidget::event(event);
-}
-
-#ifdef Q_WS_WIN
-/*! \reimp */
-bool QSizeGrip::winEvent( MSG *m, long *result )
-{
-    return QWidget::winEvent(m, result);
-}
-#endif
 
 QT_END_NAMESPACE
 
index 79ec24b..11e3cd0 100644 (file)
@@ -59,7 +59,6 @@ public:
     ~QSizeGrip();
 
     QSize sizeHint() const;
-    void setVisible(bool);
 
 protected:
     void paintEvent(QPaintEvent *);
@@ -67,15 +66,7 @@ protected:
     void mouseMoveEvent(QMouseEvent *);
     void mouseReleaseEvent(QMouseEvent *mouseEvent);
     void moveEvent(QMoveEvent *moveEvent);
-    void showEvent(QShowEvent *showEvent);
-    void hideEvent(QHideEvent *hideEvent);
     bool eventFilter(QObject *, QEvent *);
-    bool event(QEvent *);
-#ifdef Q_WS_WIN
-    bool winEvent(MSG *m, long *result);
-#endif
-
-public:
 
 private:
     Q_DECLARE_PRIVATE(QSizeGrip)
index 5c6a605..51c97ed 100644 (file)
@@ -705,14 +705,6 @@ void QStatusBar::paintEvent(QPaintEvent *event)
 /*!
     \reimp
 */
-void QStatusBar::resizeEvent(QResizeEvent * e)
-{
-    QWidget::resizeEvent(e);
-}
-
-/*!
-    \reimp
-*/
 
 bool QStatusBar::event(QEvent *e)
 {
@@ -754,48 +746,8 @@ bool QStatusBar::event(QEvent *e)
             }
         }
     }
-    
-// On Mac OS X Leopard it is possible to drag the window by clicking
-// on the tool bar on most applications.
-#ifndef Q_WS_MAC
-    return QWidget::event(e);
-#else
-    if (QSysInfo::MacintoshVersion <= QSysInfo::MV_10_4)
-        return QWidget::event(e);
-
-    // Enable drag-click only if the status bar is the status bar for a
-    // QMainWindow with a unifed toolbar.
-    if (parent() == 0 || qobject_cast<QMainWindow *>(parent()) == 0 || 
-        qobject_cast<QMainWindow *>(parent())->unifiedTitleAndToolBarOnMac() == false )
-        return QWidget::event(e);
-
-    // Check for mouse events.
-    QMouseEvent *mouseEvent;
-    if (e->type() == QEvent::MouseButtonPress ||
-        e->type() == QEvent::MouseMove ||
-        e->type() == QEvent::MouseButtonRelease) {
-        mouseEvent = static_cast <QMouseEvent*>(e);
-    } else {
-        return QWidget::event(e);
-    }
-
-    // The following is a standard mouse drag handler.
-    if (e->type() == QEvent::MouseButtonPress && (mouseEvent->button() == Qt::LeftButton)) {
-        d->dragStart = mouseEvent->pos();
-    } else if (e->type() == QEvent::MouseMove){
-        if (d->dragStart == QPoint())
-            return QWidget::event(e);
-        QPoint pos = mouseEvent->pos();
-        QPoint delta = (pos - d->dragStart);
-        window()->move(window()->pos() + delta);
-    } else if (e->type() == QEvent::MouseButtonRelease && (mouseEvent->button() == Qt::LeftButton)){
-        d->dragStart = QPoint();
-    } else {
-        return QWidget::event(e);
-    }
 
-    return true;
-#endif
+    return QWidget::event(e);
 }
 
 QT_END_NAMESPACE
index a91ba55..1cbc66d 100644 (file)
@@ -85,7 +85,6 @@ Q_SIGNALS:
 protected:
     void showEvent(QShowEvent *);
     void paintEvent(QPaintEvent *);
-    void resizeEvent(QResizeEvent *);
 
     // ### Qt 5: consider making reformat() and hideOrShow() private
     void reformat();
index 7f02cb5..d93d815 100644 (file)
@@ -78,42 +78,6 @@ inline static bool verticalTabs(QTabBar::Shape shape)
            || shape == QTabBar::TriangularEast;
 }
 
-void QTabBarPrivate::updateMacBorderMetrics()
-{
-#if (defined Q_WS_MAC) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
-    if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5) {
-        Q_Q(QTabBar);
-        ::HIContentBorderMetrics metrics;
-
-        // TODO: get metrics to preserve the bottom value
-        // TODO: test tab bar position
-
-        OSWindowRef window = qt_mac_window_for(q);
-
-        // push base line separator down to the client are so we can paint over it (Carbon)
-        metrics.top = (documentMode && q->isVisible()) ? 1 : 0;
-        metrics.bottom = 0;
-        metrics.left = 0;
-        metrics.right = 0;
-        qt_mac_updateContentBorderMetricts(window, metrics);
-#ifdef QT_MAC_USE_COCOA
-        // In Cocoa we need to keep track of the drawRect method.
-        // If documentMode is enabled we need to change it, unless
-        // a toolbar is present.
-        // Notice that all the information is kept in the window,
-        // that's why we get the private widget for it instead of
-        // the private widget for this widget.
-        QWidgetPrivate *privateWidget = qt_widget_private(q->window());
-        if(privateWidget)
-            privateWidget->changeMethods = documentMode;
-        // Since in Cocoa there is no simple way to remove the baseline, so we just ask the
-        // top level to do the magic for us.
-        privateWidget->syncUnifiedMode();
-#endif // QT_MAC_USE_COCOA
-    }
-#endif
-}
-
 /*!
     Initialize \a option with the values from the tab at \a tabIndex. This method
     is useful for subclasses when they need a QStyleOptionTab, QStyleOptionTabV2,
@@ -1395,15 +1359,6 @@ void QTabBar::showEvent(QShowEvent *)
         d->refresh();
     if (!d->validIndex(d->currentIndex))
         setCurrentIndex(0);
-    d->updateMacBorderMetrics();
-}
-
-/*!\reimp
- */
-void QTabBar::hideEvent(QHideEvent *)
-{
-    Q_D(QTabBar);
-    d->updateMacBorderMetrics();
 }
 
 /*!\reimp
@@ -1709,9 +1664,6 @@ void QTabBar::mousePressEvent(QMouseEvent *event)
         d->moveTabFinished(d->pressedIndex);
 
     d->pressedIndex = d->indexAtPos(event->pos());
-#ifdef Q_WS_MAC
-    d->previousPressedIndex = d->pressedIndex;
-#endif
     if (d->validIndex(d->pressedIndex)) {
         QStyleOptionTabBarBaseV2 optTabBase;
         optTabBase.init(this);
@@ -1736,7 +1688,7 @@ void QTabBar::mouseMoveEvent(QMouseEvent *event)
         if (d->pressedIndex != -1
             && event->buttons() == Qt::NoButton)
             d->moveTabFinished(d->pressedIndex);
-        
+
         // Start drag
         if (!d->dragInProgress && d->pressedIndex != -1) {
             if ((event->pos() - d->dragStartPosition).manhattanLength() > QApplication::startDragDistance()) {
@@ -1792,17 +1744,6 @@ void QTabBar::mouseMoveEvent(QMouseEvent *event)
 
             update();
         }
-#ifdef Q_WS_MAC
-    } else if (!d->documentMode && event->buttons() == Qt::LeftButton && d->previousPressedIndex != -1) {
-        int newPressedIndex = d->indexAtPos(event->pos());
-        if (d->pressedIndex == -1 && d->previousPressedIndex == newPressedIndex) {
-            d->pressedIndex = d->previousPressedIndex;
-            update(tabRect(d->pressedIndex));
-        } else if(d->pressedIndex != newPressedIndex) {
-            d->pressedIndex = -1;
-            update(tabRect(d->previousPressedIndex));
-        }
-#endif
     }
 
     if (event->buttons() != Qt::LeftButton) {
@@ -1895,9 +1836,6 @@ void QTabBar::mouseReleaseEvent(QMouseEvent *event)
         event->ignore();
         return;
     }
-#ifdef Q_WS_MAC
-    d->previousPressedIndex = -1;
-#endif
     if (d->movable && d->dragInProgress && d->validIndex(d->pressedIndex)) {
         int length = d->tabList[d->pressedIndex].dragOffset;
         int width = verticalTabs(d->shape)
@@ -2215,7 +2153,6 @@ void QTabBar::setDocumentMode(bool enabled)
     Q_D(QTabBar);
 
     d->documentMode = enabled;
-    d->updateMacBorderMetrics();
 }
 
 /*!
index afbe9cf..a4639c2 100644 (file)
@@ -185,7 +185,6 @@ protected:
     bool event(QEvent *);
     void resizeEvent(QResizeEvent *);
     void showEvent(QShowEvent *);
-    void hideEvent(QHideEvent *);
     void paintEvent(QPaintEvent *);
     void mousePressEvent (QMouseEvent *);
     void mouseMoveEvent (QMouseEvent *);
index a3b07c9..41d400a 100644 (file)
@@ -177,7 +177,6 @@ public:
     void layoutTabs();
     void layoutWidgets(int start = 0);
     void layoutTab(int index);
-    void updateMacBorderMetrics();
     void setupMovableTab();
 
     void makeVisible(int index);
index 1b8f427..5b0f1eb 100644 (file)
@@ -979,30 +979,6 @@ void QTextBrowser::keyPressEvent(QKeyEvent *ev)
 /*!
     \reimp
 */
-void QTextBrowser::mouseMoveEvent(QMouseEvent *e)
-{
-    QTextEdit::mouseMoveEvent(e);
-}
-
-/*!
-    \reimp
-*/
-void QTextBrowser::mousePressEvent(QMouseEvent *e)
-{
-    QTextEdit::mousePressEvent(e);
-}
-
-/*!
-    \reimp
-*/
-void QTextBrowser::mouseReleaseEvent(QMouseEvent *e)
-{
-    QTextEdit::mouseReleaseEvent(e);
-}
-
-/*!
-    \reimp
-*/
 void QTextBrowser::focusOutEvent(QFocusEvent *ev)
 {
 #ifndef QT_NO_CURSOR
@@ -1250,12 +1226,6 @@ void QTextBrowser::setOpenLinks(bool open)
     d->openLinks = open;
 }
 
-/*! \reimp */
-bool QTextBrowser::event(QEvent *e)
-{
-    return QTextEdit::event(e);
-}
-
 QT_END_NAMESPACE
 
 
index 27ddc83..1477419 100644 (file)
@@ -108,11 +108,7 @@ Q_SIGNALS:
     void anchorClicked(const QUrl &);
 
 protected:
-    bool event(QEvent *e);
     virtual void keyPressEvent(QKeyEvent *ev);
-    virtual void mouseMoveEvent(QMouseEvent *ev);
-    virtual void mousePressEvent(QMouseEvent *ev);
-    virtual void mouseReleaseEvent(QMouseEvent *ev);
     virtual void focusOutEvent(QFocusEvent *ev);
     virtual bool focusNextPrevChild(bool next);
     virtual void paintEvent(QPaintEvent *e);
index d4c1733..ab3237a 100644 (file)
@@ -652,9 +652,7 @@ QRect QToolBarAreaLayout::fitLayout()
     docks[QInternal::BottomDock].rect = QRect(rect.left(), center.bottom() + 1,
                                     rect.width(), bottom_hint.height());
 
-    if (!mainWindow->unifiedTitleAndToolBarOnMac()) {
-        docks[QInternal::TopDock].fitLayout();
-    }
+    docks[QInternal::TopDock].fitLayout();
     docks[QInternal::LeftDock].fitLayout();
     docks[QInternal::RightDock].fitLayout();
     docks[QInternal::BottomDock].fitLayout();
@@ -1312,8 +1310,6 @@ bool QToolBarAreaLayout::restoreState(QDataStream &stream, const QList<QToolBar*
     QList<QToolBar*> toolBars = _toolBars;
     int lines;
     stream >> lines;
-       if (!testing)
-       testing = mainWindow->unifiedTitleAndToolBarOnMac();
 
     for (int j = 0; j < lines; ++j) {
         int pos;
@@ -1324,7 +1320,7 @@ bool QToolBarAreaLayout::restoreState(QDataStream &stream, const QList<QToolBar*
         stream >> cnt;
 
         QToolBarAreaLayoutInfo &dock = docks[pos];
-               const bool applyingLayout = !testing && !(pos == QInternal::TopDock && mainWindow->unifiedTitleAndToolBarOnMac());
+        const bool applyingLayout = !testing && !pos == QInternal::TopDock;
         QToolBarAreaLayoutLine line(dock.o);
 
         for (int k = 0; k < cnt; ++k) {
index d1b7ad4..d1a65d4 100644 (file)
@@ -333,20 +333,6 @@ void QToolBarLayout::updateGeomArray() const
     rpick(o, that->hint) += handleExtent;
     that->hint += QSize(2*margin, 2*margin);
     that->dirty = false;
-#ifdef Q_WS_MAC
-    if (QMainWindow *mw = qobject_cast<QMainWindow *>(parentWidget()->parentWidget())) {
-        if (mw->unifiedTitleAndToolBarOnMac()
-                && mw->toolBarArea(static_cast<QToolBar *>(parentWidget())) == Qt::TopToolBarArea) {
-            if (expandFlag) {
-                tb->setMaximumSize(0xFFFFFF, 0xFFFFFF);
-            } else {
-               tb->setMaximumSize(hint);
-            }
-        }
-    }
-#endif
-
-    that->dirty = false;
 }
 
 static bool defaultWidgetAction(QToolBarItem *item)
@@ -401,18 +387,6 @@ void QToolBarLayout::setGeometry(const QRect &rect)
         if (!extension->isHidden())
             extension->hide();
     }
-#ifdef Q_WS_MAC
-    // Nothing to do for Carbon... probably   
-#  ifdef QT_MAC_USE_COCOA
-    if (QMainWindow *win = qobject_cast<QMainWindow*>(tb->parentWidget())) {
-        Qt::ToolBarArea area = win->toolBarArea(tb);
-        if (win->unifiedTitleAndToolBarOnMac() && area == Qt::TopToolBarArea) {
-            qt_mainwindow_layout(win)->fixSizeInUnifiedToolbar(tb);
-        }
-    }
-#  endif
-#endif
-    
 }
 
 bool QToolBarLayout::layoutActions(const QSize &size)
index ac2ec8c..1637b9d 100644 (file)
@@ -794,12 +794,6 @@ void QToolBox::itemRemoved(int index)
     \sa setMargin(), QWidget::getContentsMargins()
 */
 
-/*! \reimp */
-bool QToolBox::event(QEvent *e)
-{
-    return QFrame::event(e);
-}
-
 QT_END_NAMESPACE
 
 #include "moc_qtoolbox.cpp"
index ebbebc9..acf7d7c 100644 (file)
@@ -99,7 +99,6 @@ Q_SIGNALS:
     void currentChanged(int index);
 
 protected:
-    bool event(QEvent *e);
     virtual void itemInserted(int index);
     virtual void itemRemoved(int index);
     void showEvent(QShowEvent *e);
index fb07167..3c9bb7b 100644 (file)
@@ -594,7 +594,6 @@ QMainWindow *QScriptEngineDebugger::standardWindow() const
     win->setCentralWidget(central);
 
     win->setWindowTitle(tr("Qt Script Debugger"));
-    win->setUnifiedTitleAndToolBarOnMac(true);
 
     QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
     QVariant geometry = settings.value(QLatin1String("Qt/scripttools/debugging/mainWindowGeometry"));
index 451ed58..db77999 100644 (file)
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
-
-#ifdef Q_OS_WIN
-#include <windows.h> // for Sleep
-#endif
-#ifdef Q_OS_UNIX
 #include <errno.h>
 #include <signal.h>
 #include <time.h>
-#endif
-
-#ifdef Q_WS_MAC
-#include <Carbon/Carbon.h> // for SetFrontProcess
-#ifdef QT_MAC_USE_COCOA
-#include <IOKit/pwr_mgt/IOPMLib.h>
-#else
-#include <Security/AuthSession.h>
-#endif
-#undef verify
-#endif
 
 QT_BEGIN_NAMESPACE
 
@@ -1844,38 +1828,10 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
     int callgrindChildExitCode = 0;
 #endif
 
-#ifdef Q_WS_MAC
-     bool macNeedsActivate = qApp && (qstrcmp(qApp->metaObject()->className(), "QApplication") == 0);
-#ifdef QT_MAC_USE_COCOA
-     IOPMAssertionID powerID;
-#endif
-#endif
 #ifndef QT_NO_EXCEPTIONS
     try {
 #endif
 
- #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
-     SetErrorMode(SetErrorMode(0) | SEM_NOGPFAULTERRORBOX);
- #endif
-
-#ifdef Q_WS_MAC
-    // Starting with Qt 4.4, applications launched from the command line
-    // no longer get focus automatically. Since some tests might depend
-    // on this, call SetFrontProcess here to get the pre 4.4 behavior.
-    if (macNeedsActivate) {
-        ProcessSerialNumber psn = { 0, kCurrentProcess };
-        SetFrontProcess(&psn);
-#  ifdef QT_MAC_USE_COCOA
-        IOReturn ok = IOPMAssertionCreate(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, &powerID);
-        if (ok != kIOReturnSuccess)
-            macNeedsActivate = false; // no need to release the assertion on exit.
-#  else
-        UpdateSystemActivity(1); // Wake the display.
-#  endif
-    }
-#endif
-
-
     QTestResult::reset();
 
     QTEST_ASSERT(testObject);
@@ -1913,33 +1869,23 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
     }
 
 #ifndef QT_NO_EXCEPTIONS
-     } catch (...) {
-         QTestResult::addFailure("Caught unhandled exception", __FILE__, __LINE__);
-         if (QTestResult::currentTestFunction()) {
+    } catch (...) {
+        QTestResult::addFailure("Caught unhandled exception", __FILE__, __LINE__);
+        if (QTestResult::currentTestFunction()) {
              QTestResult::finishedCurrentTestFunction();
              QTestResult::setCurrentTestFunction(0);
-         }
+        }
 
         QTestLog::stopLogging();
-#ifdef QT_MAC_USE_COCOA
-         if (macNeedsActivate) {
-             IOPMAssertionRelease(powerID);
-         }
-#endif
-         currentTestObject = 0;
+        currentTestObject = 0;
 
-         // Rethrow exception to make debugging easier.
-         throw;
-         return 1;
-     }
+        // Rethrow exception to make debugging easier.
+        throw;
+        return 1;
+    }
 #  endif
 
     currentTestObject = 0;
-#ifdef QT_MAC_USE_COCOA
-     if (macNeedsActivate) {
-         IOPMAssertionRelease(powerID);
-     }
-#endif
 
 #if defined(QTEST_NOEXITCODE)
     return 0;
index 428db12..1cf538d 100644 (file)
@@ -101,11 +101,7 @@ namespace QTest
                 break;
             case MouseMove:
                 QCursor::setPos(widget->mapToGlobal(pos));
-#ifdef QT_MAC_USE_COCOA
-                QTest::qWait(20);
-#else
                 qApp->processEvents();
-#endif
                 return;
             default:
                 QTEST_ASSERT(false);
index 3364cfa..b98748f 100644 (file)
@@ -413,16 +413,13 @@ void QDesignerWorkbench::switchToDockedMode()
 #ifdef Q_WS_X11
     QApplication::setAttribute(Qt::AA_DontUseNativeMenuBar, false);
 #endif
-#ifndef Q_WS_MAC
     QDesignerToolWindow *widgetBoxWrapper = widgetBoxToolWindow();
     widgetBoxWrapper->action()->setVisible(true);
     widgetBoxWrapper->setWindowTitle(tr("Widget Box"));
-#endif
 
     m_mode = DockedMode;
     const QDesignerSettings settings(m_core);
     m_dockedMainWindow = new DockedMainWindow(this, m_toolbarMenu, m_toolWindows);
-    m_dockedMainWindow->setUnifiedTitleAndToolBarOnMac(true);
     m_dockedMainWindow->setCloseEventPolicy(MainWindowBase::EmitCloseEventSignal);
     connect(m_dockedMainWindow, SIGNAL(closeEventReceived(QCloseEvent*)), this, SLOT(handleCloseEvent(QCloseEvent*)));
     connect(m_dockedMainWindow, SIGNAL(fileDropped(QString)), this, SLOT(slotFileDropped(QString)));
@@ -431,10 +428,8 @@ void QDesignerWorkbench::switchToDockedMode()
 
     m_core->setTopLevel(m_dockedMainWindow);
 
-#ifndef Q_WS_MAC
     m_dockedMainWindow->setMenuBar(m_globalMenuBar);
     m_globalMenuBar->show();
-#endif
     qDesigner->setMainWindow(m_dockedMainWindow);
 
     foreach (QDesignerFormWindow *fw, m_formWindows) {