diff options
Diffstat (limited to 'src/widgets/widgets')
29 files changed, 105 insertions, 105 deletions
diff --git a/src/widgets/widgets/qabstractscrollarea.cpp b/src/widgets/widgets/qabstractscrollarea.cpp index bcf0bbe1fc..62234cf125 100644 --- a/src/widgets/widgets/qabstractscrollarea.cpp +++ b/src/widgets/widgets/qabstractscrollarea.cpp @@ -54,7 +54,7 @@ #include <private/qapplication_p.h> -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC #include <private/qt_mac_p.h> #include <private/qt_cocoa_helpers_mac_p.h> #endif @@ -162,7 +162,7 @@ QAbstractScrollAreaPrivate::QAbstractScrollAreaPrivate() shownOnce(false), inResize(false), sizeAdjustPolicy(QAbstractScrollArea::AdjustIgnored), viewport(0), cornerWidget(0), left(0), top(0), right(0), bottom(0), xoffset(0), yoffset(0), viewportFilter(0) -#ifdef Q_WS_WIN +#ifdef Q_DEAD_CODE_FROM_QT4_WIN , singleFingerPanEnabled(false) #endif { @@ -308,7 +308,7 @@ void QAbstractScrollAreaPrivate::init() #endif } -#ifdef Q_WS_WIN +#ifdef Q_DEAD_CODE_FROM_QT4_WIN void QAbstractScrollAreaPrivate::setSingleFingerPanEnabled(bool on) { singleFingerPanEnabled = on; @@ -316,7 +316,7 @@ void QAbstractScrollAreaPrivate::setSingleFingerPanEnabled(bool on) if (dd) dd->winSetupGestures(); } -#endif // Q_WS_WIN +#endif // Q_DEAD_CODE_FROM_QT4_WIN void QAbstractScrollAreaPrivate::layoutChildren() { @@ -337,7 +337,7 @@ void QAbstractScrollAreaPrivate::layoutChildren() const int hscrollOverlap = hbar->style()->pixelMetric(QStyle::PM_ScrollView_ScrollBarOverlap, &opt, hbar); const int vscrollOverlap = vbar->style()->pixelMetric(QStyle::PM_ScrollView_ScrollBarOverlap, &opt, vbar); -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC QWidget * const window = q->window(); // Use small scroll bars for tool windows, to match the native size grip. @@ -380,7 +380,7 @@ void QAbstractScrollAreaPrivate::layoutChildren() // If the scroll bars are at the very right and bottom of the window we // move their positions to be aligned with the size grip. -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC // Check if a native sizegrip is present. bool hasMacReverseSizeGrip = false; bool hasMacSizeGrip = false; @@ -433,7 +433,7 @@ void QAbstractScrollAreaPrivate::layoutChildren() if (hasCornerWidget && ((needv && vscrollOverlap == 0) || (needh && hscrollOverlap == 0))) cornerOffset = extPoint; -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC // Also move the scroll bars if they are covered by the native Mac size grip. if (hasMacSizeGrip) cornerOffset = extPoint; @@ -448,7 +448,7 @@ void QAbstractScrollAreaPrivate::layoutChildren() // (transparent) sizegrip in the area where a corner widget would be. if ((needv && needh && hasCornerWidget == false && hscrollOverlap == 0 && vscrollOverlap == 0) || ((needv || needh) -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC && hasMacSizeGrip #endif ) @@ -458,7 +458,7 @@ void QAbstractScrollAreaPrivate::layoutChildren() cornerPaintingRect = QRect(); } -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC if (hasMacReverseSizeGrip) reverseCornerPaintingRect = QRect(controlsRect.bottomRight() + QPoint(1, 1) - extPoint, extSize); else @@ -483,7 +483,7 @@ void QAbstractScrollAreaPrivate::layoutChildren() if (needh) { QRect horizontalScrollBarRect(QPoint(controlsRect.left() + vHeaderRight, cornerPoint.y()), QPoint(cornerPoint.x() - 1, controlsRect.bottom())); -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC if (hasMacReverseSizeGrip) horizontalScrollBarRect.adjust(vsbExt, 0, 0, 0); #endif @@ -603,7 +603,7 @@ void QAbstractScrollArea::setViewport(QWidget *widget) d->viewport->setParent(this); d->viewport->setFocusProxy(this); d->viewport->installEventFilter(d->viewportFilter.data()); -#ifndef Q_WS_MAC +#ifndef Q_DEAD_CODE_FROM_QT4_MAC #ifndef QT_NO_GESTURES d->viewport->grabGesture(Qt::PanGesture); #endif @@ -1030,7 +1030,7 @@ bool QAbstractScrollArea::event(QEvent *e) QPainter p(this); style()->drawPrimitive(QStyle::PE_PanelScrollAreaCorner, &option, &p, this); } -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC if (d->reverseCornerPaintingRect.isValid()) { option.rect = d->reverseCornerPaintingRect; QPainter p(this); @@ -1109,7 +1109,7 @@ bool QAbstractScrollArea::event(QEvent *e) hBar->setValue(se->contentPos().x()); vBar->setValue(se->contentPos().y()); -#ifdef Q_WS_WIN +#ifdef Q_DEAD_CODE_FROM_QT4_WIN typedef BOOL (*PtrBeginPanningFeedback)(HWND); typedef BOOL (*PtrUpdatePanningFeedback)(HWND, LONG, LONG, BOOL); typedef BOOL (*PtrEndPanningFeedback)(HWND, BOOL); @@ -1533,13 +1533,13 @@ void QAbstractScrollAreaPrivate::_q_vslide(int y) void QAbstractScrollAreaPrivate::_q_showOrHideScrollBars() { layoutChildren(); -#ifdef Q_WS_WIN +#ifdef Q_DEAD_CODE_FROM_QT4_WIN // Need to re-subscribe to gestures as the content changes to make sure we // enable/disable panning when needed. QWidgetPrivate *dd = static_cast<QWidgetPrivate *>(QObjectPrivate::get(viewport)); if (dd) dd->winSetupGestures(); -#endif // Q_WS_WIN +#endif // Q_DEAD_CODE_FROM_QT4_WIN } QPoint QAbstractScrollAreaPrivate::contentsOffset() const diff --git a/src/widgets/widgets/qabstractscrollarea_p.h b/src/widgets/widgets/qabstractscrollarea_p.h index a70b4df5eb..fbc542ee02 100644 --- a/src/widgets/widgets/qabstractscrollarea_p.h +++ b/src/widgets/widgets/qabstractscrollarea_p.h @@ -75,7 +75,7 @@ public: QWidget *viewport; QWidget *cornerWidget; QRect cornerPaintingRect; -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC QRect reverseCornerPaintingRect; #endif int left, top, right, bottom; // viewport margin @@ -102,7 +102,7 @@ public: { return q_func()->viewportEvent(event); } QScopedPointer<QObject> viewportFilter; -#ifdef Q_WS_WIN +#ifdef Q_DEAD_CODE_FROM_QT4_WIN bool singleFingerPanEnabled; void setSingleFingerPanEnabled(bool on = true); #endif diff --git a/src/widgets/widgets/qabstractslider.cpp b/src/widgets/widgets/qabstractslider.cpp index fccdd24c39..f0b59471bc 100644 --- a/src/widgets/widgets/qabstractslider.cpp +++ b/src/widgets/widgets/qabstractslider.cpp @@ -710,7 +710,7 @@ bool QAbstractSliderPrivate::scrollByDelta(Qt::Orientation orientation, Qt::Keyb offset_accumulated = 0; offset_accumulated += stepsToScrollF; -#ifndef Q_WS_MAC +#ifndef Q_DEAD_CODE_FROM_QT4_MAC // Don't scroll more than one page in any case: stepsToScroll = qBound(-pageStep, int(offset_accumulated), pageStep); #else diff --git a/src/widgets/widgets/qcalendarwidget.cpp b/src/widgets/widgets/qcalendarwidget.cpp index 2f9c87ad7e..673c8e7cb8 100644 --- a/src/widgets/widgets/qcalendarwidget.cpp +++ b/src/widgets/widgets/qcalendarwidget.cpp @@ -1558,7 +1558,7 @@ protected: { Q_UNUSED(e) -#ifndef Q_WS_MAC +#ifndef Q_DEAD_CODE_FROM_QT4_MAC QStyleOptionToolButton opt; initStyleOption(&opt); diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index 24aef5254f..16e1024085 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -59,7 +59,7 @@ #include <private/qabstractitemmodel_p.h> #include <private/qabstractscrollarea_p.h> #include <qdebug.h> -#if defined(Q_WS_MAC) && !defined(QT_NO_EFFECTS) && !defined(QT_NO_STYLE_MAC) +#if defined(Q_DEAD_CODE_FROM_QT4_MAC) && !defined(QT_NO_EFFECTS) && !defined(QT_NO_STYLE_MAC) #include <private/qcore_mac_p.h> #include <private/qmacstyle_mac_p.h> #include <private/qt_cocoa_helpers_mac_p.h> @@ -397,7 +397,7 @@ void QComboBoxPrivateContainer::leaveEvent(QEvent *) { // On Mac using the Mac style we want to clear the selection // when the mouse moves outside the popup. -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC QStyleOptionComboBox opt = comboStyleOption(); if (combo->style()->styleHint(QStyle::SH_ComboBox_Popup, &opt, combo)) view->clearSelection(); diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp index 7b73fd8bdc..3f6b5102cf 100644 --- a/src/widgets/widgets/qdatetimeedit.cpp +++ b/src/widgets/widgets/qdatetimeedit.cpp @@ -1125,7 +1125,7 @@ void QDateTimeEdit::keyPressEvent(QKeyEvent *event) select = false; break; } -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC else #ifdef QT_KEYPAD_NAVIGATION if (!QApplication::keypadNavigationEnabled()) diff --git a/src/widgets/widgets/qdialogbuttonbox.cpp b/src/widgets/widgets/qdialogbuttonbox.cpp index 1ca02a594b..e3b1668fa7 100644 --- a/src/widgets/widgets/qdialogbuttonbox.cpp +++ b/src/widgets/widgets/qdialogbuttonbox.cpp @@ -411,7 +411,7 @@ QPushButton *QDialogButtonBoxPrivate::createButton(QDialogButtonBox::StandardBut qWarning("QDialogButtonBox::createButton: Invalid ButtonRole, button not added"); } -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC // Since mnemonics is off by default on Mac, we add a Cmd-D // shortcut here to e.g. make the "Don't Save" button work nativly: if (sbutton == QDialogButtonBox::Discard) diff --git a/src/widgets/widgets/qdockarealayout.cpp b/src/widgets/widgets/qdockarealayout.cpp index 702cd8bac9..cbeee236d0 100644 --- a/src/widgets/widgets/qdockarealayout.cpp +++ b/src/widgets/widgets/qdockarealayout.cpp @@ -1934,7 +1934,7 @@ bool QDockAreaLayoutInfo::restoreState(QDataStream &stream, QList<QDockWidget*> QDockAreaLayoutItem item(new QDockWidgetItem(widget)); if (flags & StateFlagFloating) { bool drawer = false; -#ifdef Q_WS_MAC // drawer support +#ifdef Q_DEAD_CODE_FROM_QT4_MAC // drawer support extern bool qt_mac_is_macdrawer(const QWidget *); //qwidget_mac.cpp extern bool qt_mac_set_drawer_preferred_edge(QWidget *, Qt::DockWidgetArea); //qwidget_mac.cpp drawer = qt_mac_is_macdrawer(widget); @@ -1949,7 +1949,7 @@ bool QDockAreaLayoutInfo::restoreState(QDataStream &stream, QList<QDockWidget*> int x, y, w, h; stream >> x >> y >> w >> h; -#ifdef Q_WS_MAC // drawer support +#ifdef Q_DEAD_CODE_FROM_QT4_MAC // drawer support if (drawer) { mainWindow->window()->createWinId(); widget->window()->createWinId(); @@ -2057,7 +2057,7 @@ void QDockAreaLayoutInfo::updateSeparatorWidgets() const } j++; -#ifndef Q_WS_MAC +#ifndef Q_DEAD_CODE_FROM_QT4_MAC sepWidget->raise(); #endif QRect sepRect = separatorRect(i).adjusted(-2, -2, 2, 2); @@ -2979,7 +2979,7 @@ bool QDockAreaLayout::restoreDockWidget(QDockWidget *dockWidget) dockWidget->d_func()->setWindowState(true, true, r); } dockWidget->setVisible(!placeHolder->hidden); -#ifdef Q_WS_X11 +#ifdef Q_DEAD_CODE_FROM_QT4_X11 if (placeHolder->window) // gets rid of the X11BypassWindowManager window flag dockWidget->d_func()->setWindowState(true); #endif @@ -3169,7 +3169,7 @@ void QDockAreaLayout::updateSeparatorWidgets() const } j++; -#ifndef Q_WS_MAC +#ifndef Q_DEAD_CODE_FROM_QT4_MAC sepWidget->raise(); #endif QRect sepRect = separatorRect(i).adjusted(-2, -2, 2, 2); diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp index 37355a3712..24c0323691 100644 --- a/src/widgets/widgets/qdockwidget.cpp +++ b/src/widgets/widgets/qdockwidget.cpp @@ -52,7 +52,7 @@ #include "qdockwidget_p.h" #include "qmainwindowlayout_p.h" -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC #include <private/qapplication_p.h> #include <private/qt_mac_p.h> #include <private/qmacstyle_mac_p.h> @@ -860,7 +860,7 @@ bool QDockWidgetPrivate::mouseMoveEvent(QMouseEvent *event) && (event->pos() - state->pressPos).manhattanLength() > QApplication::startDragDistance()) { startDrag(); -#ifdef Q_WS_WIN +#ifdef Q_DEAD_CODE_FROM_QT4_WIN grabMouseWhileInWindow(); #else q->grabMouse(); @@ -904,7 +904,7 @@ void QDockWidgetPrivate::nonClientAreaMouseEvent(QMouseEvent *event) QRect geo = q->geometry(); QRect titleRect = q->frameGeometry(); -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC if ((features & QDockWidget::DockWidgetVerticalTitleBar)) { titleRect.setTop(geo.top()); titleRect.setBottom(geo.bottom()); @@ -1437,7 +1437,7 @@ bool QDockWidget::event(QEvent *event) if (d->mouseMoveEvent(static_cast<QMouseEvent *>(event))) return true; break; -#ifdef Q_WS_WIN +#ifdef Q_DEAD_CODE_FROM_QT4_WIN case QEvent::Leave: if (d->state != 0 && d->state->dragging && !d->state->nca) { // This is a workaround for loosing the mouse on Vista. diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp index f10608a8be..c027155f86 100644 --- a/src/widgets/widgets/qlineedit.cpp +++ b/src/widgets/widgets/qlineedit.cpp @@ -81,7 +81,7 @@ QT_BEGIN_NAMESPACE -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC extern void qt_mac_secure_keyboard(bool); //qapplication_mac.cpp #endif @@ -575,7 +575,7 @@ void QLineEdit::setEchoMode(EchoMode mode) setInputMethodHints(imHints); d->control->setEchoMode(mode); update(); -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC if (hasFocus()) qt_mac_secure_keyboard(mode == Password || mode == NoEcho); #endif @@ -1800,7 +1800,7 @@ void QLineEdit::focusInEvent(QFocusEvent *e) if((!hasSelectedText() && d->control->preeditAreaText().isEmpty()) || style()->styleHint(QStyle::SH_BlinkCursorWhenTextSelected, &opt, this)) d->setCursorVisible(true); -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC if (d->control->echoMode() == Password || d->control->echoMode() == NoEcho) qt_mac_secure_keyboard(true); #endif @@ -1848,7 +1848,7 @@ void QLineEdit::focusOutEvent(QFocusEvent *e) if (hasAcceptableInput() || d->control->fixup()) emit editingFinished(); } -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC if (d->control->echoMode() == Password || d->control->echoMode() == NoEcho) qt_mac_secure_keyboard(false); #endif diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp index ddecea81bf..439fda9dd4 100644 --- a/src/widgets/widgets/qmainwindow.cpp +++ b/src/widgets/widgets/qmainwindow.cpp @@ -55,7 +55,7 @@ #ifdef Q_OS_OSX #include <qpa/qplatformnativeinterface.h> #endif -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC #include <private/qt_mac_p.h> #include <private/qt_cocoa_helpers_mac_p.h> QT_BEGIN_NAMESPACE @@ -74,7 +74,7 @@ public: #ifdef Q_OS_OSX , useUnifiedToolBar(false) #endif -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC , useHIToolBar(false) , activateUnifiedToolbarAfterFullScreen(false) #endif @@ -89,7 +89,7 @@ public: #ifdef Q_OS_OSX bool useUnifiedToolBar; #endif -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC bool useHIToolBar; bool activateUnifiedToolbarAfterFullScreen; #endif @@ -1079,7 +1079,7 @@ void QMainWindow::addDockWidget(Qt::DockWidgetArea area, QDockWidget *dockwidget d_func()->layout->removeWidget(dockwidget); // in case it was already in here addDockWidget(area, dockwidget, orientation); -#ifdef Q_WS_MAC //drawer support +#ifdef Q_DEAD_CODE_FROM_QT4_MAC //drawer support QMacCocoaAutoReleasePool pool; extern bool qt_mac_is_macdrawer(const QWidget *); //qwidget_mac.cpp if (qt_mac_is_macdrawer(dockwidget)) { @@ -1454,7 +1454,7 @@ bool QMainWindow::event(QEvent *event) if (!d->explicitIconSize) setIconSize(QSize()); break; -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC case QEvent::Show: if (unifiedTitleAndToolBarOnMac()) d->layout->syncUnifiedToolbarVisibility(); @@ -1473,7 +1473,7 @@ bool QMainWindow::event(QEvent *event) } } break; -#endif // Q_WS_MAC +#endif // Q_DEAD_CODE_FROM_QT4_MAC #if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_CURSOR) case QEvent::CursorChange: // CursorChange events are triggered as mouse moves to new widgets even @@ -1529,7 +1529,7 @@ void QMainWindow::setUnifiedTitleAndToolBarOnMac(bool set) } #endif -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC Q_D(QMainWindow); if (!isWindow() || d->useHIToolBar == set || QSysInfo::MacintoshVersion < QSysInfo::MV_10_3) return; @@ -1564,7 +1564,7 @@ bool QMainWindow::unifiedTitleAndToolBarOnMac() const #ifdef Q_OS_OSX return d_func()->useUnifiedToolBar; #endif -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC return d_func()->useHIToolBar && !testAttribute(Qt::WA_MacBrushedMetal) && !(windowFlags() & Qt::FramelessWindowHint); #endif return false; diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp index 75fef35968..65d8141a5f 100644 --- a/src/widgets/widgets/qmainwindowlayout.cpp +++ b/src/widgets/widgets/qmainwindowlayout.cpp @@ -61,7 +61,7 @@ #include <private/qapplication_p.h> #include <private/qlayoutengine_p.h> -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC # include <private/qcore_mac_p.h> # include <private/qt_cocoa_helpers_mac_p.h> #endif @@ -830,11 +830,11 @@ void QMainWindowLayout::removeToolBar(QToolBar *toolbar) QObject::disconnect(parentWidget(), SIGNAL(toolButtonStyleChanged(Qt::ToolButtonStyle)), toolbar, SLOT(_q_updateToolButtonStyle(Qt::ToolButtonStyle))); -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC if (usesHIToolBar(toolbar)) { removeFromMacToolbar(toolbar); } else -#endif // Q_WS_MAC +#endif // Q_DEAD_CODE_FROM_QT4_MAC { removeWidget(toolbar); } @@ -849,7 +849,7 @@ void QMainWindowLayout::addToolBar(Qt::ToolBarArea area, bool) { validateToolBarArea(area); -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC if ((area == Qt::TopToolBarArea) && layoutState.mainWindow->unifiedTitleAndToolBarOnMac()) { insertIntoMacToolbar(0, toolbar); @@ -875,11 +875,11 @@ void QMainWindowLayout::addToolBar(Qt::ToolBarArea area, */ void QMainWindowLayout::insertToolBar(QToolBar *before, QToolBar *toolbar) { -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC if (usesHIToolBar(before)) { insertIntoMacToolbar(before, toolbar); } else -#endif // Q_WS_MAC +#endif // Q_DEAD_CODE_FROM_QT4_MAC { addChildWidget(toolbar); QLayoutItem * item = layoutState.toolBarAreaLayout.insertToolBar(before, toolbar); @@ -908,7 +908,7 @@ Qt::ToolBarArea QMainWindowLayout::toolBarArea(QToolBar *toolbar) const case QInternal::BottomDock: return Qt::BottomToolBarArea; default: break; } -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC if (pos == QInternal::DockCount) { if (qtoolbarsInUnifiedToolbarList.contains(toolbar)) return Qt::TopToolBarArea; @@ -931,7 +931,7 @@ void QMainWindowLayout::getStyleOptionInfo(QStyleOptionToolBar *option, QToolBar void QMainWindowLayout::toggleToolBarsVisible() { bool updateNonUnifiedParts = true; -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_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. @@ -1475,7 +1475,7 @@ 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 +#ifdef Q_DEAD_CODE_FROM_QT4_MAC const QSize storedSize = minSize; int minWidth = 0; foreach (QToolBar *toolbar, qtoolbarsInUnifiedToolbarList) { @@ -1676,7 +1676,7 @@ QMainWindowLayout::QMainWindowLayout(QMainWindow *mainwindow, QLayout *parentLay #ifndef QT_NO_RUBBERBAND , gapIndicator(new QRubberBand(QRubberBand::Rectangle, mainwindow)) #endif //QT_NO_RUBBERBAND -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC , blockVisiblityCheck(false) #endif { @@ -1709,7 +1709,7 @@ QMainWindowLayout::~QMainWindowLayout() layoutState.deleteAllLayoutItems(); layoutState.deleteCentralWidgetItem(); -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC cleanUpMacToolbarItems(); #endif @@ -1956,7 +1956,7 @@ bool QMainWindowLayout::restoreState(QDataStream &stream) // HIToolbar. bool QMainWindowLayout::usesHIToolBar(QToolBar *toolbar) const { -#ifndef Q_WS_MAC +#ifndef Q_DEAD_CODE_FROM_QT4_MAC Q_UNUSED(toolbar); return false; #else diff --git a/src/widgets/widgets/qmainwindowlayout_p.h b/src/widgets/widgets/qmainwindowlayout_p.h index 4e10aef891..2985a996cf 100644 --- a/src/widgets/widgets/qmainwindowlayout_p.h +++ b/src/widgets/widgets/qmainwindowlayout_p.h @@ -60,7 +60,7 @@ #include "qdockarealayout_p.h" #include "qtoolbararealayout_p.h" -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC // Forward defs to make avoid including Carbon.h (faster compile you know ;). struct OpaqueHIObjectRef; typedef struct OpaqueHIObjectRef* HIObjectRef; @@ -70,7 +70,7 @@ typedef const struct __CFString * CFStringRef; #include <private/qunifiedtoolbarsurface_mac_p.h> -#endif // Q_WS_MAC +#endif // Q_DEAD_CODE_FROM_QT4_MAC QT_BEGIN_NAMESPACE @@ -292,7 +292,7 @@ private: #ifndef QT_NO_TABBAR void updateTabBarShapes(); #endif -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC static OSStatus qtmacToolbarDelegate(EventHandlerCallRef, EventRef , void *); static OSStatus qtoolbarInHIToolbarHandler(EventHandlerCallRef inCallRef, EventRef event, void *data); @@ -325,7 +325,7 @@ public: QUnifiedToolbarSurface *unifiedSurface; void updateUnifiedToolbarOffset(); -#endif // Q_WS_MAC +#endif // Q_DEAD_CODE_FROM_QT4_MAC }; #if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_DEBUG_STREAM) diff --git a/src/widgets/widgets/qmdiarea.cpp b/src/widgets/widgets/qmdiarea.cpp index e104a3511b..4be85ca3dd 100644 --- a/src/widgets/widgets/qmdiarea.cpp +++ b/src/widgets/widgets/qmdiarea.cpp @@ -154,7 +154,7 @@ #include <QApplication> #include <QStyle> -#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC) +#if defined(Q_DEAD_CODE_FROM_QT4_MAC) && !defined(QT_NO_STYLE_MAC) #include <private/qmacstyle_mac_p.h> #endif #include <QChildEvent> @@ -2491,7 +2491,7 @@ bool QMdiArea::event(QEvent *event) { Q_D(QMdiArea); switch (event->type()) { -#ifdef Q_WS_WIN +#ifdef Q_DEAD_CODE_FROM_QT4_WIN // QWidgetPrivate::hide_helper activates another sub-window when closing a // modal dialog on Windows (see activateWindow() inside the ifdef). case QEvent::WindowUnblocked: @@ -2555,7 +2555,7 @@ bool QMdiArea::eventFilter(QObject *object, QEvent *event) QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event); // Ingore key events without a Ctrl modifier (except for press/release on the modifier itself). -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC if (!(keyEvent->modifiers() & Qt::MetaModifier) && keyEvent->key() != Qt::Key_Meta) #else if (!(keyEvent->modifiers() & Qt::ControlModifier) && keyEvent->key() != Qt::Key_Control) @@ -2574,7 +2574,7 @@ bool QMdiArea::eventFilter(QObject *object, QEvent *event) // 3) Ctrl-Shift-Tab (Tab, Tab, ...) -> iterate through all windows in the opposite // direction (activatePreviousSubWindow()) switch (keyEvent->key()) { -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC case Qt::Key_Meta: #else case Qt::Key_Control: diff --git a/src/widgets/widgets/qmdisubwindow.cpp b/src/widgets/widgets/qmdisubwindow.cpp index d656c0abb7..8b2e6ee808 100644 --- a/src/widgets/widgets/qmdisubwindow.cpp +++ b/src/widgets/widgets/qmdisubwindow.cpp @@ -274,7 +274,7 @@ static inline bool isHoverControl(QStyle::SubControl control) return control != QStyle::SC_None && control != QStyle::SC_TitleBarLabel; } -#if defined(Q_WS_WIN) +#if defined(Q_DEAD_CODE_FROM_QT4_WIN) static inline QRgb colorref2qrgb(COLORREF col) { return qRgb(GetRValue(col),GetGValue(col),GetBValue(col)); @@ -1921,7 +1921,7 @@ QPalette QMdiSubWindowPrivate::desktopPalette() const QPalette newPalette = q->palette(); bool colorsInitialized = false; -#ifdef Q_WS_WIN // ask system properties on windows +#ifdef Q_DEAD_CODE_FROM_QT4_WIN // ask system properties on windows #ifndef SPI_GETGRADIENTCAPTIONS #define SPI_GETGRADIENTCAPTIONS 0x1008 #endif @@ -1957,7 +1957,7 @@ QPalette QMdiSubWindowPrivate::desktopPalette() const newPalette.color(QPalette::Inactive, QPalette::Highlight)); } } -#endif // Q_WS_WIN +#endif // Q_DEAD_CODE_FROM_QT4_WIN if (!colorsInitialized) { newPalette.setColor(QPalette::Active, QPalette::Highlight, newPalette.color(QPalette::Active, QPalette::Highlight)); diff --git a/src/widgets/widgets/qplaintextedit.cpp b/src/widgets/widgets/qplaintextedit.cpp index 7f51eaf683..b7bf4974d0 100644 --- a/src/widgets/widgets/qplaintextedit.cpp +++ b/src/widgets/widgets/qplaintextedit.cpp @@ -804,7 +804,7 @@ void QPlainTextEditPrivate::init(const QString &txt) viewport->setCursor(Qt::IBeamCursor); #endif originalOffsetY = 0; -#ifdef Q_WS_WIN +#ifdef Q_DEAD_CODE_FROM_QT4_WIN setSingleFingerPanEnabled(true); #endif } diff --git a/src/widgets/widgets/qpushbutton.cpp b/src/widgets/widgets/qpushbutton.cpp index 84a0afd0b8..ff1c0a1abe 100644 --- a/src/widgets/widgets/qpushbutton.cpp +++ b/src/widgets/widgets/qpushbutton.cpp @@ -50,10 +50,10 @@ #include "qdebug.h" #include "qlayoutitem.h" #include "qdialogbuttonbox.h" -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC #include "private/qmacstyle_mac_p.h" #include "private/qmacstyle_mac_p_p.h" -#endif // Q_WS_MAC +#endif // Q_DEAD_CODE_FROM_QT4_MAC #ifndef QT_NO_ACCESSIBILITY #include "qaccessible.h" @@ -673,7 +673,7 @@ bool QPushButton::event(QEvent *e) return QAbstractButton::event(e); } -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC /*! \reimp */ bool QPushButton::hitButton(const QPoint &pos) const { @@ -702,7 +702,7 @@ bool QPushButtonPrivate::hitButton(const QPoint &pos) q->rect().height() - QMacStylePrivate::PushButtonBottomOffset); return roundedRect.contains(pos); } -#endif // Q_WS_MAC +#endif // Q_DEAD_CODE_FROM_QT4_MAC QT_END_NAMESPACE diff --git a/src/widgets/widgets/qpushbutton.h b/src/widgets/widgets/qpushbutton.h index 5063651658..9a52a7eb99 100644 --- a/src/widgets/widgets/qpushbutton.h +++ b/src/widgets/widgets/qpushbutton.h @@ -80,9 +80,9 @@ public Q_SLOTS: protected: bool event(QEvent *e) Q_DECL_OVERRIDE; -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC bool hitButton(const QPoint &pos) const; -#endif // Q_WS_MAC +#endif // Q_DEAD_CODE_FROM_QT4_MAC void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE; void keyPressEvent(QKeyEvent *) Q_DECL_OVERRIDE; void focusInEvent(QFocusEvent *) Q_DECL_OVERRIDE; diff --git a/src/widgets/widgets/qpushbutton_p.h b/src/widgets/widgets/qpushbutton_p.h index 0f5e9a9796..ac6e1efbfa 100644 --- a/src/widgets/widgets/qpushbutton_p.h +++ b/src/widgets/widgets/qpushbutton_p.h @@ -64,7 +64,7 @@ public: inline void init() { resetLayoutItemMargins(); } static QPushButtonPrivate* get(QPushButton *b) { return b->d_func(); } -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC bool hitButton(const QPoint &pos); #endif #ifndef QT_NO_MENU diff --git a/src/widgets/widgets/qrubberband.cpp b/src/widgets/widgets/qrubberband.cpp index 2a425c27db..107fa7c629 100644 --- a/src/widgets/widgets/qrubberband.cpp +++ b/src/widgets/widgets/qrubberband.cpp @@ -41,7 +41,7 @@ #include "qstyle.h" #include "qstyleoption.h" -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC # include <private/qt_mac_p.h> # include <private/qt_cocoa_helpers_mac_p.h> #endif @@ -136,12 +136,12 @@ QRubberBand::QRubberBand(Shape s, QWidget *p) Q_D(QRubberBand); d->shape = s; setAttribute(Qt::WA_TransparentForMouseEvents); -#ifndef Q_WS_WIN +#ifndef Q_DEAD_CODE_FROM_QT4_WIN setAttribute(Qt::WA_NoSystemBackground); -#endif //Q_WS_WIN +#endif //Q_DEAD_CODE_FROM_QT4_WIN setAttribute(Qt::WA_WState_ExplicitShowHide); setVisible(false); -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC if (isWindow()) { createWinId(); extern OSWindowRef qt_mac_window_for(const QWidget *); //qwidget_mac.cpp diff --git a/src/widgets/widgets/qsizegrip.cpp b/src/widgets/widgets/qsizegrip.cpp index 184aa37806..ee6a4e3815 100644 --- a/src/widgets/widgets/qsizegrip.cpp +++ b/src/widgets/widgets/qsizegrip.cpp @@ -46,7 +46,7 @@ #include "qdebug.h" #include <QDesktopWidget> -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC #include <private/qt_mac_p.h> #endif @@ -76,7 +76,7 @@ public: Qt::Corner m_corner; bool gotMousePress; QPointer<QWidget> tlw; -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC void updateMacSizer(bool hide) const; #endif Qt::Corner corner() const; @@ -114,7 +114,7 @@ public: updateTopLevelWidget(); if (tlw && showSizeGrip) { Qt::WindowStates sizeGripNotVisibleState = Qt::WindowFullScreen; -#ifndef Q_WS_MAC +#ifndef Q_DEAD_CODE_FROM_QT4_MAC sizeGripNotVisibleState |= Qt::WindowMaximized; #endif // Don't show the size grip if the tlw is maximized or in full screen mode. @@ -136,7 +136,7 @@ QSizeGripPrivate::QSizeGripPrivate() { } -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC void QSizeGripPrivate::updateMacSizer(bool hide) const { Q_Q(const QSizeGrip); @@ -219,7 +219,7 @@ void QSizeGripPrivate::init() Q_Q(QSizeGrip); m_corner = q->isLeftToRight() ? Qt::BottomRightCorner : Qt::BottomLeftCorner; -#if !defined(QT_NO_CURSOR) && !defined(Q_WS_MAC) +#if !defined(QT_NO_CURSOR) && !defined(Q_DEAD_CODE_FROM_QT4_MAC) q->setCursor(m_corner == Qt::TopLeftCorner || m_corner == Qt::BottomRightCorner ? Qt::SizeFDiagCursor : Qt::SizeBDiagCursor); #endif @@ -432,7 +432,7 @@ void QSizeGrip::moveEvent(QMoveEvent * /*moveEvent*/) return; d->m_corner = d->corner(); -#if !defined(QT_NO_CURSOR) && !defined(Q_WS_MAC) +#if !defined(QT_NO_CURSOR) && !defined(Q_DEAD_CODE_FROM_QT4_MAC) setCursor(d->m_corner == Qt::TopLeftCorner || d->m_corner == Qt::BottomRightCorner ? Qt::SizeFDiagCursor : Qt::SizeBDiagCursor); #endif @@ -443,7 +443,7 @@ void QSizeGrip::moveEvent(QMoveEvent * /*moveEvent*/) */ void QSizeGrip::showEvent(QShowEvent *showEvent) { -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC d_func()->updateMacSizer(false); #endif QWidget::showEvent(showEvent); @@ -454,7 +454,7 @@ void QSizeGrip::showEvent(QShowEvent *showEvent) */ void QSizeGrip::hideEvent(QHideEvent *hideEvent) { -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC d_func()->updateMacSizer(true); #endif QWidget::hideEvent(hideEvent); @@ -478,7 +478,7 @@ bool QSizeGrip::eventFilter(QObject *o, QEvent *e) return QWidget::eventFilter(o, e); } Qt::WindowStates sizeGripNotVisibleState = Qt::WindowFullScreen; -#ifndef Q_WS_MAC +#ifndef Q_DEAD_CODE_FROM_QT4_MAC sizeGripNotVisibleState |= Qt::WindowMaximized; #endif // Don't show the size grip if the tlw is maximized or in full screen mode. diff --git a/src/widgets/widgets/qstatusbar.cpp b/src/widgets/widgets/qstatusbar.cpp index e4a2df15e7..a658a5714e 100644 --- a/src/widgets/widgets/qstatusbar.cpp +++ b/src/widgets/widgets/qstatusbar.cpp @@ -81,7 +81,7 @@ public: int savedStrut; -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC QPoint dragStart; #endif @@ -740,7 +740,7 @@ 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 +#ifndef Q_DEAD_CODE_FROM_QT4_MAC return QWidget::event(e); #else if (QSysInfo::MacintoshVersion <= QSysInfo::MV_10_4) diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp index 871bf1eba1..29dd3efeb1 100644 --- a/src/widgets/widgets/qtabbar.cpp +++ b/src/widgets/widgets/qtabbar.cpp @@ -57,7 +57,7 @@ #ifndef QT_NO_TABBAR -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC #include <private/qt_mac_p.h> #include <private/qt_cocoa_helpers_mac_p.h> #endif @@ -1802,7 +1802,7 @@ void QTabBar::mousePressEvent(QMouseEvent *event) d->moveTabFinished(d->pressedIndex); d->pressedIndex = d->indexAtPos(event->pos()); -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC d->previousPressedIndex = d->pressedIndex; #endif if (d->validIndex(d->pressedIndex)) { @@ -1885,7 +1885,7 @@ void QTabBar::mouseMoveEvent(QMouseEvent *event) update(); } -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_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) { @@ -1988,7 +1988,7 @@ void QTabBar::mouseReleaseEvent(QMouseEvent *event) event->ignore(); return; } -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC d->previousPressedIndex = -1; #endif if (d->movable && d->dragInProgress && d->validIndex(d->pressedIndex)) { diff --git a/src/widgets/widgets/qtabbar_p.h b/src/widgets/widgets/qtabbar_p.h index 9393c94c9e..747dcd3a58 100644 --- a/src/widgets/widgets/qtabbar_p.h +++ b/src/widgets/widgets/qtabbar_p.h @@ -71,7 +71,7 @@ public: selectionBehaviorOnRemove(QTabBar::SelectRightTab), paintWithOffsets(true), movable(false), dragInProgress(false), documentMode(false), autoHide(false), changeCurrentOnDrag(false), switchTabCurrentIndex(-1), switchTabTimerId(0), movingTab(0) -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC , previousPressedIndex(-1) #endif {} @@ -202,7 +202,7 @@ public: int switchTabTimerId; QWidget *movingTab; -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC int previousPressedIndex; #endif // shared by tabwidget and qtabbar diff --git a/src/widgets/widgets/qtextedit.cpp b/src/widgets/widgets/qtextedit.cpp index a432a82ec0..b6b156ad63 100644 --- a/src/widgets/widgets/qtextedit.cpp +++ b/src/widgets/widgets/qtextedit.cpp @@ -178,7 +178,7 @@ void QTextEditPrivate::init(const QString &html) #ifndef QT_NO_CURSOR viewport->setCursor(Qt::IBeamCursor); #endif -#ifdef Q_WS_WIN +#ifdef Q_DEAD_CODE_FROM_QT4_WIN setSingleFingerPanEnabled(true); #endif } diff --git a/src/widgets/widgets/qtoolbar.cpp b/src/widgets/widgets/qtoolbar.cpp index c07c3dac8c..3f5bbf1fc7 100644 --- a/src/widgets/widgets/qtoolbar.cpp +++ b/src/widgets/widgets/qtoolbar.cpp @@ -316,7 +316,7 @@ bool QToolBarPrivate::mouseMoveEvent(QMouseEvent *event) startDrag(moving); if (!moving && !wasDragging) { -#ifdef Q_WS_WIN +#ifdef Q_DEAD_CODE_FROM_QT4_WIN grabMouseWhileInWindow(); #else q->grabMouse(); diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp index 7033eeea22..a73e085633 100644 --- a/src/widgets/widgets/qwidgetlinecontrol.cpp +++ b/src/widgets/widgets/qwidgetlinecontrol.cpp @@ -66,7 +66,7 @@ int QWidgetLineControl::redoTextLayout() const QTextLine l = m_textLayout.createLine(); m_textLayout.endLayout(); -#if defined(Q_WS_MAC) +#if defined(Q_DEAD_CODE_FROM_QT4_MAC) if (m_threadChecks) m_textLayoutThread = QThread::currentThread(); #endif diff --git a/src/widgets/widgets/qwidgetlinecontrol_p.h b/src/widgets/widgets/qwidgetlinecontrol_p.h index 1baceb9cc2..382ed1c3c0 100644 --- a/src/widgets/widgets/qwidgetlinecontrol_p.h +++ b/src/widgets/widgets/qwidgetlinecontrol_p.h @@ -83,7 +83,7 @@ public: m_selstart(0), m_selend(0), m_passwordEchoEditing(false) , m_passwordEchoTimer(0) , m_passwordMaskDelay(-1) -#if defined(Q_WS_MAC) +#if defined(Q_DEAD_CODE_FROM_QT4_MAC) , m_threadChecks(false) , m_textLayoutThread(0) #endif @@ -372,14 +372,14 @@ public: QTextLayout *textLayout() const { -#if defined(Q_WS_MAC) +#if defined(Q_DEAD_CODE_FROM_QT4_MAC) if (m_threadChecks && QThread::currentThread() != m_textLayoutThread) redoTextLayout(); #endif return &m_textLayout; } -#if defined(Q_WS_MAC) +#if defined(Q_DEAD_CODE_FROM_QT4_MAC) void setThreadChecks(bool threadChecks) { m_threadChecks = threadChecks; @@ -503,7 +503,7 @@ private: } int redoTextLayout() const; -#if defined(Q_WS_MAC) +#if defined(Q_DEAD_CODE_FROM_QT4_MAC) bool m_threadChecks; mutable QThread *m_textLayoutThread; #endif diff --git a/src/widgets/widgets/qwidgetresizehandler.cpp b/src/widgets/widgets/qwidgetresizehandler.cpp index 13ec0fba7a..f4d26aadb2 100644 --- a/src/widgets/widgets/qwidgetresizehandler.cpp +++ b/src/widgets/widgets/qwidgetresizehandler.cpp @@ -114,7 +114,7 @@ bool QWidgetResizeHandler::eventFilter(QObject *o, QEvent *ee) if (!widget->rect().contains(widget->mapFromGlobal(e->globalPos()))) return false; if (e->button() == Qt::LeftButton) { -#if defined(Q_WS_X11) +#if defined(Q_DEAD_CODE_FROM_QT4_X11) /* Implicit grabs do not stop the X server from changing the cursor in children, which looks *really* bad when @@ -128,7 +128,7 @@ bool QWidgetResizeHandler::eventFilter(QObject *o, QEvent *ee) # else widget->grabMouse(); # endif // QT_NO_CURSOR -#endif // Q_WS_X11 +#endif // Q_DEAD_CODE_FROM_QT4_X11 buttonDown = false; emit activate(); bool me = movingEnabled; |