From ce73b4db62574fc966192e6a4f65b7e2b2280e38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 20 Aug 2019 14:26:05 +0200 Subject: [PATCH] Remove dead code from Qt 4 times MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The benefit of keeping this code around was to inspire or inform changes in the areas to take into account possibly missing features in Qt 5, but at this point that benefit is questionable. We can always use the history to learn about missing pieces if needed. Change-Id: I87a02dc451e9027be9b97554427bf8a1c6b2c025 Reviewed-by: Tor Arne Vestbø --- doc/src/images/macmainwindow.png | Bin 39579 -> 0 bytes examples/widgets/graphicsview/boxes/scene.cpp | 4 - .../widgets/tools/i18n/languagechooser.cpp | 10 - src/printsupport/dialogs/qpagesetupdialog.cpp | 2 - .../doc/snippets/code/doc_src_styles.cpp | 5 - src/widgets/doc/snippets/macmainwindow.mm | 290 ------------- src/widgets/graphicsview/qgraphicsitem.cpp | 13 - src/widgets/graphicsview/qgraphicsscene.cpp | 15 +- src/widgets/graphicsview/qgraphicsview.cpp | 12 +- src/widgets/graphicsview/qgraphicsview_p.h | 22 +- src/widgets/graphicsview/qgraphicswidget.cpp | 16 - .../graphicsview/qgraphicswidget_p.cpp | 7 - src/widgets/itemviews/qabstractitemview.cpp | 2 - src/widgets/itemviews/qheaderview.cpp | 2 - src/widgets/itemviews/qtreeview.cpp | 29 -- src/widgets/kernel/qapplication_p.h | 47 +- src/widgets/kernel/qgesturemanager.cpp | 10 - src/widgets/kernel/qtooltip.cpp | 45 +- src/widgets/kernel/qwhatsthis.cpp | 16 +- src/widgets/kernel/qwidget.cpp | 402 +----------------- src/widgets/kernel/qwidget_p.h | 153 +------ src/widgets/styles/qpixmapstyle.cpp | 8 - src/widgets/styles/qstyleoption.cpp | 5 - src/widgets/styles/qstylesheetstyle.cpp | 7 - src/widgets/util/qflickgesture.cpp | 15 - src/widgets/util/qscroller_mac.mm | 72 ---- src/widgets/util/qscrollerproperties.cpp | 7 - src/widgets/util/qsystemtrayicon.cpp | 11 - src/widgets/util/util.pri | 4 - src/widgets/widgets/qabstractscrollarea.cpp | 141 +----- src/widgets/widgets/qabstractscrollarea_p.h | 9 +- src/widgets/widgets/qabstractslider.cpp | 9 +- src/widgets/widgets/qcalendarwidget.cpp | 3 +- src/widgets/widgets/qcombobox.cpp | 7 - src/widgets/widgets/qdatetimeedit.cpp | 10 - src/widgets/widgets/qdockarealayout.cpp | 22 +- src/widgets/widgets/qdockwidget.cpp | 22 - .../widgets/qmaccocoaviewcontainer_mac.mm | 26 +- src/widgets/widgets/qmdiarea.cpp | 15 - src/widgets/widgets/qmdisubwindow.cpp | 43 -- src/widgets/widgets/qplaintextedit.cpp | 3 - src/widgets/widgets/qpushbutton.cpp | 32 -- src/widgets/widgets/qpushbutton_p.h | 3 - src/widgets/widgets/qrubberband.cpp | 13 - src/widgets/widgets/qsizegrip.cpp | 34 +- src/widgets/widgets/qstatusbar.cpp | 41 -- src/widgets/widgets/qtabbar.cpp | 24 +- src/widgets/widgets/qtabbar_p.h | 6 - src/widgets/widgets/qtextedit.cpp | 3 - src/widgets/widgets/qtoolbar.cpp | 7 +- src/widgets/widgets/qwidgetlinecontrol.cpp | 5 - src/widgets/widgets/qwidgetlinecontrol_p.h | 24 -- src/widgets/widgets/qwidgetresizehandler.cpp | 15 - tests/auto/gui/image/qpixmap/tst_qpixmap.cpp | 13 - tests/auto/gui/painting/qcolor/tst_qcolor.cpp | 60 --- .../gui/painting/qpainter/tst_qpainter.cpp | 5 - .../auto/gui/painting/qregion/tst_qregion.cpp | 24 -- .../auto/opengl/qglthreads/tst_qglthreads.cpp | 3 - tests/auto/other/lancelot/paintcommands.cpp | 11 - .../tst_qgraphicsproxywidget.cpp | 3 - .../tst_qabstractitemview.cpp | 3 - .../widgets/widgets/qmdiarea/tst_qmdiarea.cpp | 3 - .../qmdisubwindow/tst_qmdisubwindow.cpp | 2 - .../qgraphicsview/benchapps/chipTest/view.cpp | 5 - .../benchapps/moveItems/main.cpp | 12 - .../benchapps/scrolltest/main.cpp | 5 - tests/manual/lance/main.cpp | 13 - .../textrendering/glyphshaping/main.cpp | 2 - 68 files changed, 72 insertions(+), 1840 deletions(-) delete mode 100644 doc/src/images/macmainwindow.png delete mode 100644 src/widgets/doc/snippets/macmainwindow.mm delete mode 100644 src/widgets/util/qscroller_mac.mm diff --git a/doc/src/images/macmainwindow.png b/doc/src/images/macmainwindow.png deleted file mode 100644 index 84eb11ca5e38f55c4759df603e7e27c335d948b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 39579 zcmZ6y1yq#X_s2`u&>fP}jUe414N^+O(A_n3my`%dx0I-)bPO%s-QC@NAANuSyY9LR zSj;dyb@n;??EU%f9i^%wi-AUp1_J|wAulJb4g&*M1^j5EzyW{3>H5MAyuq}Vl2VnI zlA=;|akQ|uGlzkJWX67xu*Flu?hSAZ;mPlkDv-RYNckkmtSFhsAg`=0uebgs*7{2{ zZPNm6y7Jeh6z%Si)$aFHkSkU1(^WRZP&A5W2)0B>@GUu7i<}PD0X-F=(CI2)XLFj@ zix>98oZC`19KYXQvg4Ab?NzuSpG2-xI)6%f(aEpaDyi3<5dz(YqDsZ`$7_-Zd=?*I%VvyU2bpQpe_Pslq1@nU>kd```DEg_iu51>N^E zQ=ah=B(M=AP&yRvQUATdW&_>=-!J!^5>+nLbaXm&bMC6#_2bC#Nui=SYZ1{s^4NHNH0<#bZ5>9cGO=(ORGph9?0ERidMPd zPh=_VjwBKoV35hK?783vMxaV`+DP!Sy5Kal3U1;6xEQQ(Jl~5UzUCJtEq>?VGdy}T zxvWOhmV4Ws;U=f`%@Dmhisc5^y~)zIt~+-#WjS2#`>2L(9}|1xIWn%7jNM5O?|hek zPcTp}HHPU6xqn&8b0q?j^1 zube>h?w5YUk0rCdFGq9L4ASJE2vLGP!EzyUGv7b3cpfk6RGIZ{!(gff*=TxHwdDO! zn`3mCtTRSpblb257vUZv!8_JKQ_*4+VH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*a0{|4!;5`abw?**lhaLRsR82b9eo$rTU|QhSU%W?KaK~L*oG+@9OggF zcUUZOSkd@GaRmpk_5%i-TWWwH@CXEsP5~{&7N^Glsz9|Jif%J2o4cE*H!pVP4PkMN z5;i%}w8=>0h-0k0h>&6kP?<7FS)$9#R_-jmW$RWqZcxtU&A#(CgB^Q>#$7cDDRTw?$NPgg&ebxsLQ0FbR>>i_@% diff --git a/examples/widgets/graphicsview/boxes/scene.cpp b/examples/widgets/graphicsview/boxes/scene.cpp index d51124aed7a..a9995efa270 100644 --- a/examples/widgets/graphicsview/boxes/scene.cpp +++ b/examples/widgets/graphicsview/boxes/scene.cpp @@ -128,10 +128,6 @@ void ColorEdit::mousePressEvent(QMouseEvent *event) QColor color(m_color); QColorDialog dialog(color, 0); dialog.setOption(QColorDialog::ShowAlphaChannel, true); -// The ifdef block is a workaround for the beta, TODO: remove when bug 238525 is fixed -#if 0 // Used to be included in Qt4 for Q_WS_MAC - dialog.setOption(QColorDialog::DontUseNativeDialog, true); -#endif dialog.move(280, 120); if (dialog.exec() == QDialog::Rejected) return; diff --git a/examples/widgets/tools/i18n/languagechooser.cpp b/examples/widgets/tools/i18n/languagechooser.cpp index 963165ff814..e61e4432e4d 100644 --- a/examples/widgets/tools/i18n/languagechooser.cpp +++ b/examples/widgets/tools/i18n/languagechooser.cpp @@ -53,12 +53,6 @@ #include "languagechooser.h" #include "mainwindow.h" -#if 0 // Used to be included in Qt4 for Q_WS_MAC -QT_BEGIN_NAMESPACE -extern void qt_mac_set_menubar_merge(bool merge); -QT_END_NAMESPACE -#endif - LanguageChooser::LanguageChooser(const QString& defaultLang, QWidget *parent) : QDialog(parent, Qt::WindowStaysOnTopHint) { @@ -95,10 +89,6 @@ LanguageChooser::LanguageChooser(const QString& defaultLang, QWidget *parent) mainLayout->addWidget(buttonBox); setLayout(mainLayout); -#if 0 // Used to be included in Qt4 for Q_WS_MAC - qt_mac_set_menubar_merge(false); -#endif - setWindowTitle("I18N"); } diff --git a/src/printsupport/dialogs/qpagesetupdialog.cpp b/src/printsupport/dialogs/qpagesetupdialog.cpp index dc0457d20d5..ce2a0416c87 100644 --- a/src/printsupport/dialogs/qpagesetupdialog.cpp +++ b/src/printsupport/dialogs/qpagesetupdialog.cpp @@ -114,10 +114,8 @@ void QPageSetupDialogPrivate::setPrinter(QPrinter *newPrinter) printer = new QPrinter; ownsPrinter = true; } -#if 1 // Used to be excluded in Qt4 for Q_WS_X11 if (printer->outputFormat() != QPrinter::NativeFormat) qWarning("QPageSetupDialog: Cannot be used on non-native printers"); -#endif } /*! diff --git a/src/widgets/doc/snippets/code/doc_src_styles.cpp b/src/widgets/doc/snippets/code/doc_src_styles.cpp index a70ed6b11d0..3536be6e7bd 100644 --- a/src/widgets/doc/snippets/code/doc_src_styles.cpp +++ b/src/widgets/doc/snippets/code/doc_src_styles.cpp @@ -81,11 +81,6 @@ state |= QStyle::State_MouseOver; if (widget->window()->isActiveWindow()) state |= QStyle::State_Active; -#if 0 // Used to be included in Qt4 for Q_WS_MAC - extern bool qt_mac_can_clickThrough(const QWidget *w); //qwidget_mac.cpp - if (!(state & QStyle::State_Active) && !qt_mac_can_clickThrough(widget)) - state &= ~QStyle::State_Enabled; -#endif #ifdef QT_KEYPAD_NAVIGATION if (widget->hasEditFocus()) state |= QStyle::State_HasEditFocus; diff --git a/src/widgets/doc/snippets/macmainwindow.mm b/src/widgets/doc/snippets/macmainwindow.mm deleted file mode 100644 index c63796a3f2d..00000000000 --- a/src/widgets/doc/snippets/macmainwindow.mm +++ /dev/null @@ -1,290 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "macmainwindow.h" -#import -#include - - -#if 0 // Used to be included in Qt4 for Q_WS_MAC - -//![0] -SearchWidget::SearchWidget(QWidget *parent) - : QMacCocoaViewContainer(0, parent) -{ - // Many Cocoa objects create temporary autorelease objects, - // so create a pool to catch them. - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - // Create the NSSearchField, set it on the QCocoaViewContainer. - NSSearchField *search = [[NSSearchField alloc] init]; - setCocoaView(search); - - // Use a Qt menu for the search field menu. - QMenu *qtMenu = createMenu(this); - NSMenu *nsMenu = qtMenu->macMenu(0); - [[search cell] setSearchMenuTemplate:nsMenu]; - - // Release our reference, since our super class takes ownership and we - // don't need it anymore. - [search release]; - - // Clean up our pool as we no longer need it. - [pool release]; -} -//![0] - -SearchWidget::~SearchWidget() -{ -} - -QSize SearchWidget::sizeHint() const -{ - return QSize(150, 40); -} - -QMenu *createMenu(QWidget *parent) -{ - QMenu *searchMenu = new QMenu(parent); - - QAction * indexAction = searchMenu->addAction("Index Search"); - indexAction->setCheckable(true); - indexAction->setChecked(true); - - QAction * fulltextAction = searchMenu->addAction("Full Text Search"); - fulltextAction->setCheckable(true); - - QActionGroup *searchActionGroup = new QActionGroup(parent); - searchActionGroup->addAction(indexAction); - searchActionGroup->addAction(fulltextAction); - searchActionGroup->setExclusive(true); - - return searchMenu; -} - -SearchWrapper::SearchWrapper(QWidget *parent) -:QWidget(parent) -{ - s = new SearchWidget(this); - s->move(2,2); - setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); -} - -QSize SearchWrapper::sizeHint() const -{ - return s->sizeHint() + QSize(6, 2); -} - -Spacer::Spacer(QWidget *parent) -:QWidget(parent) -{ - QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - setSizePolicy(sizePolicy); -} - -QSize Spacer::sizeHint() const -{ - return QSize(1, 1); -} - -MacSplitterHandle::MacSplitterHandle(Qt::Orientation orientation, QSplitter *parent) -: QSplitterHandle(orientation, parent) { } - -// Paint the horizontal handle as a gradient, paint -// the vertical handle as a line. -void MacSplitterHandle::paintEvent(QPaintEvent *) -{ - QPainter painter(this); - - QColor topColor(145, 145, 145); - QColor bottomColor(142, 142, 142); - QColor gradientStart(252, 252, 252); - QColor gradientStop(223, 223, 223); - - if (orientation() == Qt::Vertical) { - painter.setPen(topColor); - painter.drawLine(0, 0, width(), 0); - painter.setPen(bottomColor); - painter.drawLine(0, height() - 1, width(), height() - 1); - - QLinearGradient linearGrad(QPointF(0, 0), QPointF(0, height() -3)); - linearGrad.setColorAt(0, gradientStart); - linearGrad.setColorAt(1, gradientStop); - painter.fillRect(QRect(QPoint(0,1), size() - QSize(0, 2)), QBrush(linearGrad)); - } else { - painter.setPen(topColor); - painter.drawLine(0, 0, 0, height()); - } -} - -QSize MacSplitterHandle::sizeHint() const -{ - QSize parent = QSplitterHandle::sizeHint(); - if (orientation() == Qt::Vertical) { - return parent + QSize(0, 3); - } else { - return QSize(1, parent.height()); - } -} - -QSplitterHandle *MacSplitter::createHandle() -{ - return new MacSplitterHandle(orientation(), this); -} - -MacMainWindow::MacMainWindow() -{ - QSettings settings; - restoreGeometry(settings.value("Geometry").toByteArray()); - - setWindowTitle("Mac Main Window"); - - splitter = new MacSplitter(); - - // Set up the left-hand side blue side bar. - sidebar = new QTreeView(); - sidebar->setFrameStyle(QFrame::NoFrame); - sidebar->setAttribute(Qt::WA_MacShowFocusRect, false); - sidebar->setAutoFillBackground(true); - - // Set the palette. - QPalette palette = sidebar->palette(); - QColor macSidebarColor(231, 237, 246); - QColor macSidebarHighlightColor(168, 183, 205); - palette.setColor(QPalette::Base, macSidebarColor); - palette.setColor(QPalette::Highlight, macSidebarHighlightColor); - sidebar->setPalette(palette); - - sidebar->setModel(createItemModel()); - sidebar->header()->hide(); - sidebar->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - sidebar->setTextElideMode(Qt::ElideMiddle); - - splitter->addWidget(sidebar); - - horizontalSplitter = new MacSplitter(); - horizontalSplitter->setOrientation(Qt::Vertical); - splitter->addWidget(horizontalSplitter); - - splitter->setStretchFactor(0, 0); - splitter->setStretchFactor(1, 1); - - // Set up the top document list view. - documents = new QListView(); - documents->setFrameStyle(QFrame::NoFrame); - documents->setAttribute(Qt::WA_MacShowFocusRect, false); - documents->setModel(createDocumentModel()); - documents->setAlternatingRowColors(true); - documents->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); - horizontalSplitter->addWidget(documents); - horizontalSplitter->setStretchFactor(0, 0); - - // Set up the text view. - textedit = new QTextEdit(); - textedit->setFrameStyle(QFrame::NoFrame); - textedit->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); - textedit->setText("





This demo shows how to create a \ - Qt main window application that has the same appearance as other \ - OS X applications such as Mail or iTunes. This includes \ - customizing the item views and QSplitter and wrapping native widgets \ - such as the search field.
"); - - horizontalSplitter->addWidget(textedit); - - setCentralWidget(splitter); - - toolBar = addToolBar(tr("Search")); - toolBar->addWidget(new Spacer()); - toolBar->addWidget(new SearchWrapper()); - - setUnifiedTitleAndToolBarOnMac(true); -} - -MacMainWindow::~MacMainWindow() -{ - QSettings settings; - settings.setValue("Geometry", saveGeometry()); -} - -QAbstractItemModel *MacMainWindow::createItemModel() -{ - QStandardItemModel *model = new QStandardItemModel(); - QStandardItem *parentItem = model->invisibleRootItem(); - - QStandardItem *documentationItem = new QStandardItem("Documentation"); - parentItem->appendRow(documentationItem); - - QStandardItem *assistantItem = new QStandardItem("Qt MainWindow Manual"); - documentationItem->appendRow(assistantItem); - - QStandardItem *designerItem = new QStandardItem("Qt Designer Manual"); - documentationItem->appendRow(designerItem); - - QStandardItem *qtItem = new QStandardItem("Qt Reference Documentation"); - qtItem->appendRow(new QStandardItem("Classes")); - qtItem->appendRow(new QStandardItem("Overviews")); - qtItem->appendRow(new QStandardItem("Tutorial & Examples")); - documentationItem->appendRow(qtItem); - - QStandardItem *bookmarksItem = new QStandardItem("Bookmarks"); - parentItem->appendRow(bookmarksItem); - bookmarksItem->appendRow(new QStandardItem("QWidget")); - bookmarksItem->appendRow(new QStandardItem("QObject")); - bookmarksItem->appendRow(new QStandardItem("QWizard")); - - return model; -} - -void MacMainWindow::resizeEvent(QResizeEvent *) -{ - if (toolBar) - toolBar->updateGeometry(); -} - -QAbstractItemModel *MacMainWindow::createDocumentModel() -{ - QStandardItemModel *model = new QStandardItemModel(); - QStandardItem *parentItem = model->invisibleRootItem(); - parentItem->appendRow(new QStandardItem("QWidget Class Reference")); - parentItem->appendRow(new QStandardItem("QObject Class Reference")); - parentItem->appendRow(new QStandardItem("QListView Class Reference")); - - return model; -} - -#endif diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp index ca30c72db5f..6273de56a6c 100644 --- a/src/widgets/graphicsview/qgraphicsitem.cpp +++ b/src/widgets/graphicsview/qgraphicsitem.cpp @@ -7566,19 +7566,6 @@ void QGraphicsItem::setInputMethodHints(Qt::InputMethodHints hints) */ void QGraphicsItem::updateMicroFocus() { -#if !defined(QT_NO_IM) && 0 /* Used to be included in Qt4 for Q_WS_X11 */ - if (QWidget *fw = QApplication::focusWidget()) { - if (scene()) { - for (int i = 0 ; i < scene()->views().count() ; ++i) { - if (scene()->views().at(i) == fw) { - if (qApp) - QGuiApplication::inputMethod()->update(Qt::ImQueryAll); - break; - } - } - } - } -#endif } /*! diff --git a/src/widgets/graphicsview/qgraphicsscene.cpp b/src/widgets/graphicsview/qgraphicsscene.cpp index 313939e6380..1208adfd178 100644 --- a/src/widgets/graphicsview/qgraphicsscene.cpp +++ b/src/widgets/graphicsview/qgraphicsscene.cpp @@ -4170,14 +4170,6 @@ void QGraphicsScene::wheelEvent(QGraphicsSceneWheelEvent *wheelEvent) wheelEvent->scenePos(), wheelEvent->widget()); -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // On Mac, ignore the event if the first item under the mouse is not the last opened - // popup (or one of its descendant) - if (!d->popupWidgets.isEmpty() && !wheelCandidates.isEmpty() && wheelCandidates.first() != d->popupWidgets.back() && !d->popupWidgets.back()->isAncestorOf(wheelCandidates.first())) { - wheelEvent->accept(); - return; - } -#else // Find the first popup under the mouse (including the popup's descendants) starting from the last. // Remove all popups after the one found, or all or them if no popup is under the mouse. // Then continue with the event. @@ -4187,7 +4179,6 @@ void QGraphicsScene::wheelEvent(QGraphicsSceneWheelEvent *wheelEvent) break; d->removePopup(*iter); } -#endif bool hasSetFocus = false; for (QGraphicsItem *item : wheelCandidates) { @@ -4409,11 +4400,7 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte QGraphicsItem::CacheMode cacheMode = QGraphicsItem::CacheMode(itemd->cacheMode); // Render directly, using no cache. - if (cacheMode == QGraphicsItem::NoCache -#if 0 // Used to be included in Qt4 for Q_WS_X11 - || !X11->use_xrender -#endif - ) { + if (cacheMode == QGraphicsItem::NoCache) { _q_paintItem(static_cast(item), painter, option, widget, true, painterStateProtection); return; } diff --git a/src/widgets/graphicsview/qgraphicsview.cpp b/src/widgets/graphicsview/qgraphicsview.cpp index 7f142187209..57be8508295 100644 --- a/src/widgets/graphicsview/qgraphicsview.cpp +++ b/src/widgets/graphicsview/qgraphicsview.cpp @@ -3476,11 +3476,7 @@ void QGraphicsView::paintEvent(QPaintEvent *event) const QTransform viewTransform = painter.worldTransform(); // Draw background - if ((d->cacheMode & CacheBackground) -#if 0 // Used to be included in Qt4 for Q_WS_X11 - && X11->use_xrender -#endif - ) { + if (d->cacheMode & CacheBackground) { // Recreate the background pixmap, and flag the whole background as // exposed. if (d->mustResizeBackgroundPixmap) { @@ -3677,11 +3673,7 @@ void QGraphicsView::scrollContentsBy(int dx, int dy) d->updateLastCenterPoint(); - if ((d->cacheMode & CacheBackground) -#if 0 // Used to be included in Qt4 for Q_WS_X11 - && X11->use_xrender -#endif - ) { + if (d->cacheMode & CacheBackground) { // Below, QPixmap::scroll() works in device pixels, while the delta values // and backgroundPixmapExposed are in device independent pixels. const qreal dpr = d->backgroundPixmap.devicePixelRatio(); diff --git a/src/widgets/graphicsview/qgraphicsview_p.h b/src/widgets/graphicsview/qgraphicsview_p.h index 0428b9ce70f..b5340045872 100644 --- a/src/widgets/graphicsview/qgraphicsview_p.h +++ b/src/widgets/graphicsview/qgraphicsview_p.h @@ -184,24 +184,10 @@ public: inline void dispatchPendingUpdateRequests() { -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // QWidget::update() works slightly different on the Mac without the raster engine; - // it's not part of our backing store so it needs special threatment. - if (QApplicationPrivate::graphics_system_name != QLatin1String("raster")) { - // At this point either HIViewSetNeedsDisplay (Carbon) or setNeedsDisplay: YES (Cocoa) - // is called, which means there's a pending update request. We want to dispatch it - // now because otherwise graphics view updates would require two - // round-trips in the event loop before the item is painted. - extern void qt_mac_dispatchPendingUpdateRequests(QWidget *); - qt_mac_dispatchPendingUpdateRequests(viewport->window()); - } else -#endif - { - if (qt_widget_private(viewport)->paintOnScreen()) - QCoreApplication::sendPostedEvents(viewport, QEvent::UpdateRequest); - else - QCoreApplication::sendPostedEvents(viewport->window(), QEvent::UpdateRequest); - } + if (qt_widget_private(viewport)->paintOnScreen()) + QCoreApplication::sendPostedEvents(viewport, QEvent::UpdateRequest); + else + QCoreApplication::sendPostedEvents(viewport->window(), QEvent::UpdateRequest); } void setUpdateClip(QGraphicsItem *); diff --git a/src/widgets/graphicsview/qgraphicswidget.cpp b/src/widgets/graphicsview/qgraphicswidget.cpp index 643f0730857..cf041b9817e 100644 --- a/src/widgets/graphicsview/qgraphicswidget.cpp +++ b/src/widgets/graphicsview/qgraphicswidget.cpp @@ -716,22 +716,6 @@ void QGraphicsWidget::initStyleOption(QStyleOption *option) const option->state |= QStyle::State_Window; /* ### -#if 0 // Used to be included in Qt4 for Q_WS_MAC - extern bool qt_mac_can_clickThrough(const QGraphicsWidget *w); //qwidget_mac.cpp - if (!(option->state & QStyle::State_Active) && !qt_mac_can_clickThrough(widget)) - option->state &= ~QStyle::State_Enabled; - - switch (QMacStyle::widgetSizePolicy(widget)) { - case QMacStyle::SizeSmall: - option->state |= QStyle::State_Small; - break; - case QMacStyle::SizeMini: - option->state |= QStyle::State_Mini; - break; - default: - ; - } -#endif #ifdef QT_KEYPAD_NAVIGATION if (widget->hasEditFocus()) state |= QStyle::State_HasEditFocus; diff --git a/src/widgets/graphicsview/qgraphicswidget_p.cpp b/src/widgets/graphicsview/qgraphicswidget_p.cpp index fd47f444ea9..0156faf8e44 100644 --- a/src/widgets/graphicsview/qgraphicswidget_p.cpp +++ b/src/widgets/graphicsview/qgraphicswidget_p.cpp @@ -691,13 +691,6 @@ void QGraphicsWidgetPrivate::windowFrameHoverMoveEvent(QGraphicsSceneHoverEvent case Qt::TitleBarArea: windowData->buttonRect = q->style()->subControlRect( QStyle::CC_TitleBar, &bar, QStyle::SC_TitleBarCloseButton, 0); -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // On mac we should hover if we are in the 'area' of the buttons - windowData->buttonRect |= q->style()->subControlRect( - QStyle::CC_TitleBar, &bar, QStyle::SC_TitleBarMinButton, 0); - windowData->buttonRect |= q->style()->subControlRect( - QStyle::CC_TitleBar, &bar, QStyle::SC_TitleBarMaxButton, 0); -#endif if (windowData->buttonRect.contains(pos.toPoint())) windowData->buttonMouseOver = true; event->ignore(); diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp index d4c83cb82c3..2ed5df46b8c 100644 --- a/src/widgets/itemviews/qabstractitemview.cpp +++ b/src/widgets/itemviews/qabstractitemview.cpp @@ -3727,12 +3727,10 @@ QStyleOptionViewItem QAbstractItemView::viewOptions() const option.state &= ~QStyle::State_MouseOver; option.font = font(); -#if 1 // Used to be excluded in Qt4 for Q_WS_MAC // On mac the focus appearance follows window activation // not widget activation if (!hasFocus()) option.state &= ~QStyle::State_Active; -#endif option.state &= ~QStyle::State_HasFocus; if (d->iconSize.isValid()) { diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp index c4766a74bdb..d7bdf6aa4c2 100644 --- a/src/widgets/itemviews/qheaderview.cpp +++ b/src/widgets/itemviews/qheaderview.cpp @@ -2570,7 +2570,6 @@ void QHeaderView::mouseMoveEvent(QMouseEvent *e) if (pos < 0 && d->state != QHeaderViewPrivate::SelectSections) return; if (e->buttons() == Qt::NoButton) { -#if 1 // Used to be excluded in Qt4 for Q_WS_MAC // Under Cocoa, when the mouse button is released, may include an extra // simulated mouse moved event. The state of the buttons when this event // is generated is already "no button" and the code below gets executed @@ -2578,7 +2577,6 @@ void QHeaderView::mouseMoveEvent(QMouseEvent *e) // column dragging from working. So this code is disabled under Cocoa. d->state = QHeaderViewPrivate::NoState; d->pressed = -1; -#endif } switch (d->state) { case QHeaderViewPrivate::ResizeSection: { diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp index 53e546bb4db..823be1ca088 100644 --- a/src/widgets/itemviews/qtreeview.cpp +++ b/src/widgets/itemviews/qtreeview.cpp @@ -2173,35 +2173,6 @@ QModelIndex QTreeView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifie return QModelIndex(); } int vi = -1; -#if 0 /* Used to be included in Qt4 for Q_WS_MAC */ && QT_CONFIG(style_mac) - // Selection behavior is slightly different on the Mac. - if (d->selectionMode == QAbstractItemView::ExtendedSelection - && d->selectionModel - && d->selectionModel->hasSelection()) { - - const bool moveUpDown = (cursorAction == MoveUp || cursorAction == MoveDown); - const bool moveNextPrev = (cursorAction == MoveNext || cursorAction == MovePrevious); - const bool contiguousSelection = moveUpDown && (modifiers & Qt::ShiftModifier); - - // Use the outermost index in the selection as the current index - if (!contiguousSelection && (moveUpDown || moveNextPrev)) { - - // Find outermost index. - const bool useTopIndex = (cursorAction == MoveUp || cursorAction == MovePrevious); - int index = useTopIndex ? INT_MAX : INT_MIN; - const QItemSelection selection = d->selectionModel->selection(); - for (int i = 0; i < selection.count(); ++i) { - const QItemSelectionRange &range = selection.at(i); - int candidate = d->viewIndex(useTopIndex ? range.topLeft() : range.bottomRight()); - if (candidate >= 0) - index = useTopIndex ? qMin(index, candidate) : qMax(index, candidate); - } - - if (index >= 0 && index < INT_MAX) - vi = index; - } - } -#endif if (vi < 0) vi = qMax(0, d->viewIndex(current)); diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h index 36c0ba87393..3167bd423fb 100644 --- a/src/widgets/kernel/qapplication_p.h +++ b/src/widgets/kernel/qapplication_p.h @@ -112,16 +112,9 @@ public: virtual bool shouldQuit() override; bool tryCloseAllWindows() override; -#if 0 // Used to be included in Qt4 for Q_WS_X11 -#if QT_CONFIG(settings) - static bool x11_apply_settings(); -#endif - static void reset_instance_pointer(); -#endif static bool autoSipEnabled; static QString desktopStyleKey(); - void createEventDispatcher() override; static void dispatchEnterLeave(QWidget *enter, QWidget *leave, const QPointF &globalPosF); @@ -132,10 +125,7 @@ public: static bool isBlockedByModal(QWidget *widget); static bool modalState(); static bool tryModalHelper(QWidget *widget, QWidget **rettop = nullptr); -#if 0 // Used to be included in Qt4 for Q_WS_MAC - static QWidget *tryModalHelper_sys(QWidget *top); - bool canQuit(); -#endif + #ifdef QT_KEYPAD_NAVIGATION static bool keypadNavigationEnabled() { @@ -146,18 +136,10 @@ public: bool notify_helper(QObject *receiver, QEvent * e); - void init( -#if 0 // Used to be included in Qt4 for Q_WS_X11 - Display *dpy = 0, Qt::HANDLE visual = 0, Qt::HANDLE cmap = 0 -#endif - ); + void init(); void initialize(); void process_cmdline(); -#if 0 // Used to be included in Qt4 for Q_WS_X11 - static void x11_initialize_style(); -#endif - static bool inPopupMode(); bool popupActive() override { return inPopupMode(); } void closePopup(QWidget *popup); @@ -212,10 +194,6 @@ public: static void initializeWidgetFontHash(); static void setSystemFont(const QFont &font); -#if 0 // Used to be included in Qt4 for Q_WS_X11 - static void applyX11SpecificCommandLineArguments(QWidget *main_widget); -#endif - static QApplicationPrivate *instance() { return self; } #ifdef QT_KEYPAD_NAVIGATION @@ -223,10 +201,6 @@ public: static Qt::NavigationMode navigationMode; #endif -#if 0 /* Used to be included in Qt4 for Q_WS_MAC */ || 0 /* Used to be included in Qt4 for Q_WS_X11 */ - void _q_alertTimeOut(); - QHash alertTimerHash; -#endif #ifndef QT_NO_STYLE_STYLESHEET static QString styleSheet; #endif @@ -263,14 +237,6 @@ public: QGestureManager *gestureManager; QWidget *gestureWidget; #endif -#if 0 /* Used to be included in Qt4 for Q_WS_X11 */ || 0 /* Used to be included in Qt4 for Q_WS_WIN */ - QPixmap *move_cursor; - QPixmap *copy_cursor; - QPixmap *link_cursor; -#endif -#if 0 // Used to be included in Qt4 for Q_WS_WIN - QPixmap *ignore_cursor; -#endif static bool updateTouchPointsForWidget(QWidget *widget, QTouchEvent *touchEvent); void initializeMultitouch(); @@ -299,14 +265,7 @@ private: static bool isAlien(QWidget *); }; -#if 0 // Used to be included in Qt4 for Q_WS_WIN - extern void qt_win_set_cursor(QWidget *, bool); -#elif 0 // Used to be included in Qt4 for Q_WS_X11 - extern void qt_x11_enforce_cursor(QWidget *, bool); - extern void qt_x11_enforce_cursor(QWidget *); -#else - extern void qt_qpa_set_cursor(QWidget * w, bool force); -#endif +extern void qt_qpa_set_cursor(QWidget * w, bool force); QT_END_NAMESPACE diff --git a/src/widgets/kernel/qgesturemanager.cpp b/src/widgets/kernel/qgesturemanager.cpp index 1555c2a73a7..d9d071a31a2 100644 --- a/src/widgets/kernel/qgesturemanager.cpp +++ b/src/widgets/kernel/qgesturemanager.cpp @@ -54,9 +54,6 @@ #ifdef Q_OS_OSX #include "qmacgesturerecognizer_p.h" #endif -#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ && !defined(QT_NO_NATIVE_GESTURES) -#include "qwinnativepangesturerecognizer_win_p.h" -#endif #include "qdebug.h" #include @@ -102,14 +99,7 @@ QGestureManager::QGestureManager(QObject *parent) registerGestureRecognizer(new QSwipeGestureRecognizer); registerGestureRecognizer(new QTapGestureRecognizer); #endif -#if 0 // Used to be included in Qt4 for Q_WS_WIN - #if !defined(QT_NO_NATIVE_GESTURES) - if (QApplicationPrivate::HasTouchSupport) - registerGestureRecognizer(new QWinNativePanGestureRecognizer); - #endif -#else registerGestureRecognizer(new QTapAndHoldGestureRecognizer); -#endif } QGestureManager::~QGestureManager() diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp index d030a283567..97a279d65d9 100644 --- a/src/widgets/kernel/qtooltip.cpp +++ b/src/widgets/kernel/qtooltip.cpp @@ -36,9 +36,6 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#if 0 // Used to be included in Qt4 for Q_WS_MAC -# include -#endif #include @@ -63,11 +60,6 @@ #include #include -#if 0 // Used to be included in Qt4 for Q_WS_MAC -# include -#include -#endif - QT_BEGIN_NAMESPACE /*! @@ -317,20 +309,7 @@ void QTipLabel::timerEvent(QTimerEvent *e) || e->timerId() == expireTimer.timerId()){ hideTimer.stop(); expireTimer.stop(); -#if 0 /* Used to be included in Qt4 for Q_WS_MAC */ && QT_CONFIG(effects) - if (QApplication::isEffectEnabled(Qt::UI_FadeTooltip)){ - // Fade out tip on mac (makes it invisible). - // The tip will not be deleted until a new tip is shown. - - // DRSWAT - Cocoa - macWindowFade(qt_mac_window_for(this)); - QTipLabel::instance->fadingOut = true; // will never be false again. - } - else - hideTipImmediately(); -#else hideTipImmediately(); -#endif } } @@ -420,29 +399,11 @@ void QTipLabel::placeTip(const QPoint &pos, QWidget *w) #endif //QT_NO_STYLE_STYLESHEET -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // When in full screen mode, there is no Dock nor Menu so we can use - // the whole screen for displaying the tooltip. However when not in - // full screen mode we need to save space for the dock, so we use - // availableGeometry instead. - extern bool qt_mac_app_fullscreen; //qapplication_mac.mm - QRect screen; - if(qt_mac_app_fullscreen) - screen = QDesktopWidgetPrivate::screenGeometry(getTipScreen(pos, w)); - else - screen = QDesktopWidgetPrivate::availableGeometry(getTipScreen(pos, w)); -#else QRect screen = QDesktopWidgetPrivate::screenGeometry(getTipScreen(pos, w)); -#endif QPoint p = pos; - p += QPoint(2, -#if 0 // Used to be included in Qt4 for Q_WS_WIN - 21 -#else - 16 -#endif - ); + p += QPoint(2, 16); + if (p.x() + this->width() > screen.x() + screen.width()) p.rx() -= 4 + this->width(); if (p.y() + this->height() > screen.y() + screen.height()) @@ -541,7 +502,7 @@ QT_WARNING_POP QTipLabel::instance->setObjectName(QLatin1String("qtooltip_label")); -#if QT_CONFIG(effects) && !0 /* Used to be included in Qt4 for Q_WS_MAC */ +#if QT_CONFIG(effects) if (QApplication::isEffectEnabled(Qt::UI_FadeTooltip)) qFadeEffect(QTipLabel::instance); else if (QApplication::isEffectEnabled(Qt::UI_AnimateTooltip)) diff --git a/src/widgets/kernel/qwhatsthis.cpp b/src/widgets/kernel/qwhatsthis.cpp index a48eae6628e..228ca4d38ab 100644 --- a/src/widgets/kernel/qwhatsthis.cpp +++ b/src/widgets/kernel/qwhatsthis.cpp @@ -577,26 +577,12 @@ void QWhatsThisPrivate::say(QWidget * widget, const QString &text, int x, int y) if (text.size() == 0) return; // make a fresh widget, and set it up - QWhatsThat *whatsThat = new QWhatsThat( - text, -#if 0 /* Used to be included in Qt4 for Q_WS_X11 */ && !defined(QT_NO_CURSOR) - QApplication::desktop()->screen(widget ? widget->x11Info().screen() : QCursor::x11Screen()), -#else - 0, -#endif - widget - ); - + QWhatsThat *whatsThat = new QWhatsThat(text, 0, widget); // okay, now to find a suitable location - int scr = (widget ? QDesktopWidgetPrivate::screenNumber(widget) : -#if 0 /* Used to be included in Qt4 for Q_WS_X11 */ && !defined(QT_NO_CURSOR) - QCursor::x11Screen() -#else QDesktopWidgetPrivate::screenNumber(QPoint(x,y)) -#endif ); QRect screen = QDesktopWidgetPrivate::screenGeometry(scr); diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 113c5695912..0a7566614ba 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -61,13 +61,6 @@ #ifndef QT_NO_ACCESSIBILITY # include "qaccessible.h" #endif -#if 0 // Used to be included in Qt4 for Q_WS_MAC -# include "qt_mac_p.h" -# include "qt_cocoa_helpers_mac_p.h" -# include "qmainwindow.h" -# include "qtoolbar.h" -# include -#endif #include #include "private/qwidgetwindow_p.h" #include "qpainter.h" @@ -91,9 +84,6 @@ #endif #include #include -#if 0 // Used to be included in Qt4 for Q_WS_MAC -# include -#endif #include #include "qwidget_p.h" @@ -129,20 +119,12 @@ QT_BEGIN_NAMESPACE -#if 0 // Used to be included in Qt4 for Q_WS_MAC -bool qt_mac_clearDirtyOnWidgetInsideDrawWidget = false; -#endif - static inline bool qRectIntersects(const QRect &r1, const QRect &r2) { return (qMax(r1.left(), r2.left()) <= qMin(r1.right(), r2.right()) && qMax(r1.top(), r2.top()) <= qMin(r1.bottom(), r2.bottom())); } -#if 0 // Used to be included in Qt4 for Q_WS_MAC -# define QT_NO_PAINT_DEBUG -#endif - extern bool qt_sendSpontaneousEvent(QObject*, QEvent*); // qapplication.cpp extern QDesktopWidget *qt_desktopWidget; // qapplication.cpp @@ -202,17 +184,6 @@ QWidgetPrivate::QWidgetPrivate(int version) #if defined(Q_OS_WIN) , noPaintOnScreen(0) #endif -#if 0 // Used to be included in Qt4 for Q_WS_X11 - , picture(0) -#elif 0 // Used to be included in Qt4 for Q_WS_WIN - #ifndef QT_NO_GESTURES - , nativeGesturePanEnabled(0) - #endif -#elif 0 // Used to be included in Qt4 for Q_WS_MAC - , needWindowChange(0) - , window_event(0) - , qd_hd(0) -#endif { if (Q_UNLIKELY(!qApp)) { qFatal("QWidget: Must construct a QApplication before a QWidget"); @@ -231,16 +202,7 @@ QWidgetPrivate::QWidgetPrivate(int version) isWidget = true; memset(high_attributes, 0, sizeof(high_attributes)); -#if 0 // Used to be included in Qt4 for Q_WS_MAC - drawRectOriginalAdded = false; - originalDrawMethod = true; - changeMethods = false; - isInUnifiedToolbar = false; - unifiedSurface = 0; - toolbar_ancestor = 0; - flushRequested = false; - touchEventsEnabled = false; -#endif + #ifdef QWIDGET_EXTRA_DEBUG static int count = 0; qDebug() << "widgets" << ++count; @@ -985,17 +947,12 @@ void QWidgetPrivate::adjustFlags(Qt::WindowFlags &flags, QWidget *w) // Only enable this on non-Mac platforms. Since the old way of doing this would // interpret WindowSystemMenuHint as a close button and we can't change that behavior // we can't just add this in. -#if 1 // Used to be excluded in Qt4 for Q_WS_MAC if ((flags & (Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint | Qt::WindowContextHelpButtonHint)) # ifdef Q_OS_WIN && type != Qt::Dialog // QTBUG-2027, allow for menu-less dialogs. # endif ) { flags |= Qt::WindowSystemMenuHint; -#else - if (flags & (Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint - | Qt::WindowSystemMenuHint)) { -#endif flags |= Qt::WindowTitleHint; flags &= ~Qt::FramelessWindowHint; } @@ -1050,13 +1007,6 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f) } #endif -#if 0 // Used to be included in Qt4 for Q_WS_X11 - if (desktopWidget) { - // make sure the widget is created on the same screen as the - // programmer specified desktop widget - xinfo = desktopWidget->d_func()->xinfo; - } -#endif if (targetScreen >= 0) { topData()->initialScreenIndex = targetScreen; if (QWindow *window = q->windowHandle()) @@ -1084,9 +1034,6 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f) mustHaveWindowHandle = 1; q->setAttribute(Qt::WA_NativeWindow); } -//#if 0 // Used to be included in Qt4 for Q_WS_MAC -// q->setAttribute(Qt::WA_NativeWindow); -//#endif q->setAttribute(Qt::WA_QuitOnClose); // might be cleared in adjustQuitOnCloseAttribute() adjustQuitOnCloseAttribute(); @@ -1110,9 +1057,6 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f) setOpaque(q->isWindow() && background.style() != Qt::NoBrush && background.isOpaque()); } data.fnt = QFont(data.fnt, q); -#if 0 // Used to be included in Qt4 for Q_WS_X11 - data.fnt.x11SetScreen(xinfo.screen()); -#endif q->setAttribute(Qt::WA_PendingMoveEvent); q->setAttribute(Qt::WA_PendingResizeEvent); @@ -1128,20 +1072,8 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f) QCoreApplication::postEvent(q, new QEvent(QEvent::PolishRequest)); extraPaintEngine = 0; - -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // If we add a child to the unified toolbar, we have to redirect the painting. - if (parentWidget && parentWidget->d_func() && parentWidget->d_func()->isInUnifiedToolbar) { - if (parentWidget->d_func()->unifiedSurface) { - QWidget *toolbar = parentWidget->d_func()->toolbar_ancestor; - parentWidget->d_func()->unifiedSurface->recursiveRedirect(toolbar, toolbar, toolbar->d_func()->toolbar_offset); - } - } -#endif } - - void QWidgetPrivate::createRecursively() { Q_Q(QWidget); @@ -1248,15 +1180,6 @@ void QWidget::create(WId window, bool initializeWindow, bool destroyOldWindow) << "Alien?" << !testAttribute(Qt::WA_NativeWindow); #endif -#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ && QT_CONFIG(draganddrop) - // Unregister the dropsite (if already registered) before we - // re-create the widget with a native window. - if (testAttribute(Qt::WA_WState_Created) && !internalWinId() && testAttribute(Qt::WA_NativeWindow) - && d->extra && d->extra->dropTarget) { - d->registerDropSite(false); - } -#endif - d->updateIsOpaque(); setAttribute(Qt::WA_WState_Created); // set created flag @@ -1558,14 +1481,7 @@ QWidget::~QWidget() // and if that also doesn't work, then give up } } - } - -#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ || 0 /* Used to be included in Qt4 for Q_WS_X11 */|| 0 /* Used to be included in Qt4 for Q_WS_MAC */ - else if (!internalWinId() && isVisible()) { - qApp->d_func()->sendSyntheticEnterLeave(this); - } -#endif - else if (isVisible()) { + } else if (isVisible()) { qApp->d_func()->sendSyntheticEnterLeave(this); } @@ -1609,15 +1525,6 @@ QWidget::~QWidget() d->blockSig = blocked; -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // QCocoaView holds a pointer back to this widget. Clear it now - // to make sure it's not followed later on. The lifetime of the - // QCocoaView might exceed the lifetime of this widget in cases - // where Cocoa itself holds references to it. - extern void qt_mac_clearCocoaViewQWidgetPointers(QWidget *); - qt_mac_clearCocoaViewQWidgetPointers(this); -#endif - if (!d->children.isEmpty()) d->deleteChildren(); @@ -1664,9 +1571,6 @@ void QWidgetPrivate::setWinId(WId id) // set widget identifier const WId oldWinId = data.winid; data.winid = id; -#if 0 // Used to be included in Qt4 for Q_WS_X11 - hd = id; // X11: hd == ident -#endif if (mapper && id && !userDesktopWidget) { mapper->insert(data.winid, q); } @@ -1698,9 +1602,7 @@ void QWidgetPrivate::createTLExtra() x->embedded = 0; x->window = 0; x->initialScreenIndex = -1; -#if 0 // Used to be included in Qt4 for Q_WS_MAC - x->wasMaximized = false; -#endif + #ifdef QWIDGET_EXTRA_DEBUG static int count = 0; qDebug() << "tlextra" << ++count; @@ -2097,11 +1999,6 @@ void QWidgetPrivate::subtractOpaqueSiblings(QRegion &sourceRegion, bool *hasDirt if (disableSubtractOpaqueSiblings || q->isWindow()) return; -#if 0 // Used to be included in Qt4 for Q_WS_MAC - if (q->d_func()->isInUnifiedToolbar) - return; -#endif - QRect clipBoundingRect; bool dirtyClipBoundingRect = true; @@ -2234,13 +2131,6 @@ void QWidgetPrivate::updateIsOpaque() #endif // QT_CONFIG(graphicseffect) Q_Q(QWidget); -#if 0 // Used to be included in Qt4 for Q_WS_X11 - if (q->testAttribute(Qt::WA_X11OpenGLOverlay)) { - setOpaque(false); - return; - } -#endif - if (q->testAttribute(Qt::WA_OpaquePaintEvent) || q->testAttribute(Qt::WA_PaintOnScreen)) { setOpaque(true); return; @@ -2293,20 +2183,9 @@ static inline void fillRegion(QPainter *painter, const QRegion &rgn, const QBrus Q_ASSERT(painter); if (brush.style() == Qt::TexturePattern) { -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // Optimize pattern filling on mac by using HITheme directly - // when filling with the standard widget background. - // Defined in qmacstyle_mac.cpp - extern void qt_mac_fill_background(QPainter *painter, const QRegion &rgn, const QBrush &brush); - qt_mac_fill_background(painter, rgn, brush); -#else - { - const QRect rect(rgn.boundingRect()); - painter->setClipRegion(rgn); - painter->drawTiledPixmap(rect, brush.texture(), rect.topLeft()); - } -#endif - + const QRect rect(rgn.boundingRect()); + painter->setClipRegion(rgn); + painter->drawTiledPixmap(rect, brush.texture(), rect.topLeft()); } else if (brush.gradient() && (brush.gradient()->coordinateMode() == QGradient::ObjectBoundingMode || brush.gradient()->coordinateMode() == QGradient::ObjectMode)) { @@ -2380,11 +2259,7 @@ void QWidgetPrivate::paintBackground(QPainter *painter, const QRegion &rgn, Draw visible widgets. */ -#if 0 // Used to be included in Qt4 for Q_WS_MAC - extern QPointer qt_button_down; -#else - extern QWidget *qt_button_down; -#endif +extern QWidget *qt_button_down; void QWidgetPrivate::deactivateWidgetCleanup() { @@ -3053,15 +2928,6 @@ bool QWidget::isFullScreen() const */ void QWidget::showFullScreen() { -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // If the unified toolbar is enabled, we have to disable it before going fullscreen. - QMainWindow *mainWindow = qobject_cast(this); - if (mainWindow && mainWindow->unifiedTitleAndToolBarOnMac()) { - mainWindow->setUnifiedTitleAndToolBarOnMac(false); - QMainWindowLayout *mainLayout = qobject_cast(mainWindow->layout()); - mainLayout->activateUnifiedToolbarAfterFullScreen = true; - } -#endif ensurePolished(); setWindowState((windowState() & ~(Qt::WindowMinimized | Qt::WindowMaximized)) @@ -3089,18 +2955,6 @@ void QWidget::showMaximized() setWindowState((windowState() & ~(Qt::WindowMinimized | Qt::WindowFullScreen)) | Qt::WindowMaximized); -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // If the unified toolbar was enabled before going fullscreen, we have to enable it back. - QMainWindow *mainWindow = qobject_cast(this); - if (mainWindow) - { - QMainWindowLayout *mainLayout = qobject_cast(mainWindow->layout()); - if (mainLayout->activateUnifiedToolbarAfterFullScreen) { - mainWindow->setUnifiedTitleAndToolBarOnMac(true); - mainLayout->activateUnifiedToolbarAfterFullScreen = false; - } - } -#endif setVisible(true); } @@ -3118,18 +2972,6 @@ void QWidget::showNormal() setWindowState(windowState() & ~(Qt::WindowMinimized | Qt::WindowMaximized | Qt::WindowFullScreen)); -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // If the unified toolbar was enabled before going fullscreen, we have to enable it back. - QMainWindow *mainWindow = qobject_cast(this); - if (mainWindow) - { - QMainWindowLayout *mainLayout = qobject_cast(mainWindow->layout()); - if (mainLayout->activateUnifiedToolbarAfterFullScreen) { - mainWindow->setUnifiedTitleAndToolBarOnMac(true); - mainLayout->activateUnifiedToolbarAfterFullScreen = false; - } - } -#endif setVisible(true); } @@ -3345,13 +3187,6 @@ void QWidgetPrivate::setEnabled_helper(bool enable) if (w && !w->testAttribute(attribute)) w->d_func()->setEnabled_helper(enable); } -#if 0 // Used to be included in Qt4 for Q_WS_X11 - if (q->testAttribute(Qt::WA_SetCursor) || q->isWindow()) { - // enforce the windows behavior of clearing the cursor on - // disabled widgets - qt_x11_enforce_cursor(q); - } -#endif #ifndef QT_NO_CURSOR if (q->testAttribute(Qt::WA_SetCursor) || q->isWindow()) { // enforce the windows behavior of clearing the cursor on @@ -3359,9 +3194,6 @@ void QWidgetPrivate::setEnabled_helper(bool enable) qt_qpa_set_cursor(q, false); } #endif -#if 0 // Used to be included in Qt4 for Q_WS_MAC - setEnabled_helper_sys(enable); -#endif #ifndef QT_NO_IM if (q->testAttribute(Qt::WA_InputMethodEnabled) && q->hasFocus()) { QWidget *focusWidget = effectiveFocusWidget(); @@ -4456,13 +4288,7 @@ const QPalette &QWidget::palette() const ) { data->pal.setCurrentColorGroup(QPalette::Active); } else { -#if 0 // Used to be included in Qt4 for Q_WS_MAC - extern bool qt_mac_can_clickThrough(const QWidget *); //qwidget_mac.cpp - if (qt_mac_can_clickThrough(this)) - data->pal.setCurrentColorGroup(QPalette::Active); - else -#endif - data->pal.setCurrentColorGroup(QPalette::Inactive); + data->pal.setCurrentColorGroup(QPalette::Inactive); } return data->pal; } @@ -4725,10 +4551,7 @@ void QWidgetPrivate::updateFont(const QFont &font) #endif data.fnt = QFont(font, q); -#if 0 // Used to be included in Qt4 for Q_WS_X11 - // make sure the font set on this widget is associated with the correct screen - data.fnt.x11SetScreen(xinfo.screen()); -#endif + // Combine new mask with natural mask and propagate to children. #if QT_CONFIG(graphicsview) if (!q->parentWidget() && extra && extra->proxyWidget) { @@ -4902,11 +4725,8 @@ QCursor QWidget::cursor() const void QWidget::setCursor(const QCursor &cursor) { Q_D(QWidget); -// On Mac we must set the cursor even if it is the ArrowCursor. -#if 1 // Used to be excluded in Qt4 for Q_WS_MAC if (cursor.shape() != Qt::ArrowCursor || (d->extra && d->extra->curs)) -#endif { d->createExtra(); d->extra->curs = qt_make_unique(cursor); @@ -5333,11 +5153,9 @@ void QWidgetPrivate::render_helper(QPainter *painter, const QPoint &targetOffset Q_ASSERT(!toBePainted.isEmpty()); Q_Q(QWidget); -#if 1 // Used to be excluded in Qt4 for Q_WS_MAC const QTransform originalTransform = painter->worldTransform(); const bool useDeviceCoordinates = originalTransform.isScaling(); if (!useDeviceCoordinates) { -#endif // Render via a pixmap. const QRect rect = toBePainted.boundingRect(); const QSize size = rect.size(); @@ -5360,7 +5178,6 @@ void QWidgetPrivate::render_helper(QPainter *painter, const QPoint &targetOffset if (restore) painter->setRenderHints(QPainter::SmoothPixmapTransform, false); -#if 1 // Used to be excluded in Qt4 for Q_WS_MAC } else { // Render via a pixmap in device coordinates (to avoid pixmap scaling). QTransform transform = originalTransform; @@ -5391,7 +5208,6 @@ void QWidgetPrivate::render_helper(QPainter *painter, const QPoint &targetOffset painter->drawPixmap(deviceRect.topLeft(), pixmap); painter->setTransform(originalTransform); } -#endif } void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QPoint &offset, DrawWidgetFlags flags, @@ -5471,15 +5287,6 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP if (paintEngine) { setRedirected(pdev, -offset); -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // (Alien support) Special case for Mac when redirecting: If the paint device - // is of the Widget type we need to set WA_WState_InPaintEvent since painting - // outside the paint event is not supported on QWidgets. The attributeis - // restored further down. - if (pdev->devType() == QInternal::Widget) - static_cast(pdev)->setAttribute(Qt::WA_WState_InPaintEvent); - -#endif if (sharedPainter) setSystemClip(pdev->paintEngine(), pdev->devicePixelRatioF(), toBePainted); else @@ -5561,10 +5368,6 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP //restore if (paintEngine) { -#if 0 // Used to be included in Qt4 for Q_WS_MAC - if (pdev->devType() == QInternal::Widget) - static_cast(pdev)->setAttribute(Qt::WA_WState_InPaintEvent, false); -#endif restoreRedirected(); if (!sharedPainter) paintEngine->d_func()->systemRect = QRect(); @@ -5635,7 +5438,6 @@ void QWidgetPrivate::render(QPaintDevice *target, const QPoint &targetOffset, if (paintRegion.isEmpty()) return; -#if 1 // Used to be excluded in Qt4 for Q_WS_MAC QPainter *oldSharedPainter = inRenderWithPainter ? sharedPainter() : 0; // Use the target's shared painter if set (typically set when doing @@ -5648,7 +5450,6 @@ void QWidgetPrivate::render(QPaintDevice *target, const QPoint &targetOffset, setSharedPainter(targetPainter); } } -#endif // Use the target's redirected device if set and adjust offset and paint // region accordingly. This is typically the case when people call render @@ -6440,11 +6241,7 @@ void QWidget::setFocus(Qt::FocusReason reason) if (!f) f = this; - if (QApplication::focusWidget() == f -#if 0 // Used to be included in Qt4 for Q_WS_WIN - && GetFocus() == f->internalWinId() -#endif - ) + if (QApplication::focusWidget() == f) return; #if QT_CONFIG(graphicsview) @@ -6661,17 +6458,10 @@ void QWidget::clearFocus() if (hasFocus()) { // Update proxy state QApplicationPrivate::setFocusWidget(0, Qt::OtherFocusReason); -#if 0 // Used to be included in Qt4 for Q_WS_WIN - if (!(windowType() == Qt::Popup) && GetFocus() == internalWinId()) - SetFocus(0); - else -#endif - { #ifndef QT_NO_ACCESSIBILITY - QAccessibleEvent event(this, QAccessible::Focus); - QAccessible::updateAccessibility(&event); + QAccessibleEvent event(this, QAccessible::Focus); + QAccessible::updateAccessibility(&event); #endif - } } } @@ -7315,18 +7105,6 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) */ QByteArray QWidget::saveGeometry() const { -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // We check if the window was maximized during this invocation. If so, we need to record the - // starting position as 0,0. - Q_D(const QWidget); - QRect newFramePosition = frameGeometry(); - QRect newNormalPosition = normalGeometry(); - if(d->topData()->wasMaximized && !(windowState() & Qt::WindowMaximized)) { - // Change the starting position - newFramePosition.moveTo(0, 0); - newNormalPosition.moveTo(0, 0); - } -#endif QByteArray array; QDataStream stream(&array, QIODevice::WriteOnly); stream.setVersion(QDataStream::Qt_4_0); @@ -7341,13 +7119,8 @@ QByteArray QWidget::saveGeometry() const stream << magicNumber << majorVersion << minorVersion -#if 0 // Used to be included in Qt4 for Q_WS_MAC - << newFramePosition - << newNormalPosition -#else << frameGeometry() << normalGeometry() -#endif << qint32(screenNumber) << quint8(windowState() & Qt::WindowMaximized) << quint8(windowState() & Qt::WindowFullScreen) @@ -7467,11 +7240,6 @@ bool QWidget::restoreGeometry(const QByteArray &geometry) // that would make the window "lost". This happens if: // - The restored geometry is completely oustside the available geometry // - The title bar is outside the available geometry. - // - (Mac only) The window is higher than the available geometry. It must - // be possible to bring the size grip on screen by moving the window. -#if 0 // Used to be included in Qt4 for Q_WS_MAC - restoredNormalGeometry.setHeight(qMin(restoredNormalGeometry.height(), availableGeometry.height() - frameHeight)); -#endif checkRestoredGeometry(availableGeometry, &restoredGeometry, frameHeight); checkRestoredGeometry(availableGeometry, &restoredNormalGeometry, frameHeight); @@ -7991,14 +7759,6 @@ void QWidgetPrivate::show_helper() Q_UNUSED(isEmbedded); #endif - // On Windows, show the popup now so that our own focus handling - // stores the correct old focus widget even if it's stolen in the - // showevent -#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ || 0 /* Used to be included in Qt4 for Q_WS_MAC */ - if (!isEmbedded && q->windowType() == Qt::Popup) - qApp->d_func()->openPopup(q); -#endif - // send the show event before showing the window QShowEvent showEvent; QCoreApplication::sendEvent(q, &showEvent); @@ -8123,12 +7883,6 @@ void QWidgetPrivate::hide_helper() if (!isEmbedded && (q->windowType() == Qt::Popup)) qApp->d_func()->closePopup(q); -#if 0 // Used to be included in Qt4 for Q_WS_WIN - if (q->isWindow() && !(q->windowType() == Qt::Popup) && q->parentWidget() - && !q->parentWidget()->isHidden() && q->isActiveWindow()) - q->parentWidget()->activateWindow(); // Activate parent -#endif - q->setAttribute(Qt::WA_Mapped, false); hide_sys(); @@ -8313,16 +8067,6 @@ void QWidgetPrivate::setVisible(bool visible) QEvent showToParentEvent(QEvent::ShowToParent); QCoreApplication::sendEvent(q, &showToParentEvent); } else { // hide -#if 0 // Used to be included in Qt4 for Q_WS_WIN - // reset WS_DISABLED style in a Blocked window - if(isWindow() && testAttribute(Qt::WA_WState_Created) - && QApplicationPrivate::isBlockedByModal(this)) - { - LONG dwStyle = GetWindowLong(winId(), GWL_STYLE); - dwStyle &= ~WS_DISABLED; - SetWindowLong(winId(), GWL_STYLE, dwStyle); - } -#endif if (QApplicationPrivate::hidden_focus_widget == q) QApplicationPrivate::hidden_focus_widget = 0; @@ -8395,23 +8139,7 @@ void QWidgetPrivate::hideChildren(bool spontaneous) QWidget *widget = qobject_cast(childList.at(i)); if (!widget || widget->isWindow() || widget->testAttribute(Qt::WA_WState_Hidden)) continue; -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // Before doing anything we need to make sure that we don't leave anything in a non-consistent state. - // When hiding a widget we need to make sure that no mouse_down events are active, because - // the mouse_up event will never be received by a hidden widget or one of its descendants. - // The solution is simple, before going through with this we check if there are any mouse_down events in - // progress, if so we check if it is related to this widget or not. If so, we just reset the mouse_down and - // then we continue. - // In X11 and Windows we send a mouse_release event, however we don't do that here because we were already - // ignoring that from before. I.e. Carbon did not send the mouse release event, so we will not send the - // mouse release event. There are two ways to interpret this: - // 1. If we don't send the mouse release event, the widget might get into an inconsistent state, i.e. it - // might be waiting for a release event that will never arrive. - // 2. If we send the mouse release event, then the widget might decide to trigger an action that is not - // supposed to trigger because it is not visible. - if(widget == qt_button_down) - qt_button_down = 0; -#endif + if (spontaneous) widget->setAttribute(Qt::WA_Mapped, false); else @@ -8646,11 +8374,9 @@ QSize QWidgetPrivate::adjustedSize() const s.setWidth(qMax(s.width(), 200)); if (exp & Qt::Vertical) s.setHeight(qMax(s.height(), 100)); -#if 0 // Used to be included in Qt4 for Q_WS_X11 - QRect screen = QDesktopWidgetPrivate::screenGeometry(q->x11Info().screen()); -#else // all others + QRect screen = QDesktopWidgetPrivate::screenGeometry(q->pos()); -#endif + s.setWidth(qMin(s.width(), screen.width()*2/3)); s.setHeight(qMin(s.height(), screen.height()*2/3)); @@ -8775,26 +8501,6 @@ bool QWidget::isAncestorOf(const QWidget *child) const return false; } -#if 0 // Used to be included in Qt4 for Q_WS_WIN -inline void setDisabledStyle(QWidget *w, bool setStyle) -{ - // set/reset WS_DISABLED style. - if(w && w->isWindow() && w->isVisible() && w->isEnabled()) { - LONG dwStyle = GetWindowLong(w->winId(), GWL_STYLE); - LONG newStyle = dwStyle; - if (setStyle) - newStyle |= WS_DISABLED; - else - newStyle &= ~WS_DISABLED; - if (newStyle != dwStyle) { - SetWindowLong(w->winId(), GWL_STYLE, newStyle); - // we might need to repaint in some situations (eg. menu) - w->repaint(); - } - } -} -#endif - /***************************************************************************** QWidget event handling *****************************************************************************/ @@ -9211,9 +8917,6 @@ bool QWidget::event(QEvent *event) } } } -#if 0 // Used to be included in Qt4 for Q_WS_WIN - setDisabledStyle(this, (event->type() == QEvent::WindowBlocked)); -#endif break; #ifndef QT_NO_TOOLTIP case QEvent::ToolTip: @@ -9238,9 +8941,6 @@ bool QWidget::event(QEvent *event) case QEvent::EmbeddingControl: d->topData()->frameStrut.setCoords(0 ,0, 0, 0); data->fstrut_dirty = false; -#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ || 0 /* Used to be included in Qt4 for Q_WS_X11 */ - d->topData()->embedded = 1; -#endif break; #ifndef QT_NO_ACTION case QEvent::ActionAdded: @@ -9263,11 +8963,6 @@ bool QWidget::event(QEvent *event) } break; } -#if 0 // Used to be included in Qt4 for Q_WS_MAC - case QEvent::MacGLWindowChange: - d->needWindowChange = false; - break; -#endif case QEvent::TouchBegin: case QEvent::TouchUpdate: case QEvent::TouchEnd: @@ -9379,11 +9074,6 @@ void QWidget::changeEvent(QEvent * event) case QEvent::MacSizeChange: updateGeometry(); break; -#elif 0 // Used to be included in Qt4 for Q_WS_MAC - case QEvent::ToolTipChange: - case QEvent::MouseTrackingChange: - qt_mac_update_mouseTracking(this); - break; #endif default: @@ -10695,7 +10385,7 @@ void QWidget::setParent(QWidget *parent, Qt::WindowFlags f) // (f & Qt::MSWindowsOwnDC) clause (which is set on QGLWidgets on all // platforms). if (newParent -#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ || defined(QT_OPENGL_ES) +#if defined(QT_OPENGL_ES) || (f & Qt::MSWindowsOwnDC) #endif ) { @@ -10714,15 +10404,6 @@ void QWidget::setParent(QWidget *parent, Qt::WindowFlags f) QCoreApplication::sendEvent(parent, &e); } -//### already hidden above ---> must probably do something smart on the mac -// #if 0 // Used to be included in Qt4 for Q_WS_MAC -// extern bool qt_mac_is_macdrawer(const QWidget *); //qwidget_mac.cpp -// if(!qt_mac_is_macdrawer(q)) //special case -// q->setAttribute(Qt::WA_WState_Hidden); -// #else -// q->setAttribute(Qt::WA_WState_Hidden); -//#endif - if (parent && d->sendChildEvents && d->polished) { QChildEvent e(QEvent::ChildPolished, this); QCoreApplication::sendEvent(parent, &e); @@ -11204,23 +10885,6 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) case Qt::WA_NoChildEventsFromChildren: d->receiveChildEvents = !on; break; -#if 0 // Used to be included in Qt4 for Q_WS_MAC - case Qt::WA_MacOpaqueSizeGrip: - d->macUpdateOpaqueSizeGrip(); - break; - case Qt::WA_MacShowFocusRect: - if (hasFocus()) { - clearFocus(); - setFocus(); - } - break; - case Qt::WA_Hover: - qt_mac_update_mouseTracking(this); - break; - case Qt::WA_MacAlwaysShowToolWindow: - d->macUpdateHideOnSuspend(); - break; -#endif case Qt::WA_MacNormalSize: case Qt::WA_MacSmallSize: case Qt::WA_MacMiniSize: @@ -11298,15 +10962,6 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) } case Qt::WA_PaintOnScreen: d->updateIsOpaque(); -#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ || 0 /* Used to be included in Qt4 for Q_WS_X11 */ || 0 /* Used to be included in Qt4 for Q_WS_MAC */ - // Recreate the widget if it's already created as an alien widget and - // WA_PaintOnScreen is enabled. Paint on screen widgets must have win id. - // So must their children. - if (on) { - setAttribute(Qt::WA_NativeWindow); - d->enforceNativeChildren(); - } -#endif Q_FALLTHROUGH(); case Qt::WA_OpaquePaintEvent: d->updateIsOpaque(); @@ -11318,9 +10973,6 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) d->updateSystemBackground(); break; case Qt::WA_TransparentForMouseEvents: -#if 0 // Used to be included in Qt4 for Q_WS_MAC - d->macUpdateIgnoreMouseEvents(); -#endif break; case Qt::WA_InputMethodEnabled: { #ifndef QT_NO_IM @@ -11337,20 +10989,6 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) d->resolveFont(); d->resolveLocale(); break; -#if 0 // Used to be included in Qt4 for Q_WS_X11 - case Qt::WA_NoX11EventCompression: - if (!d->extra) - d->createExtra(); - d->extra->compress_events = on; - break; - case Qt::WA_X11OpenGLOverlay: - d->updateIsOpaque(); - break; - case Qt::WA_X11DoNotAcceptFocus: - if (testAttribute(Qt::WA_WState_Created)) - d->updateX11AcceptFocus(); - break; -#endif case Qt::WA_DontShowOnScreen: { if (on && isVisible()) { // Make sure we keep the current state and only hide the widget @@ -11393,10 +11031,6 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) break; case Qt::WA_AcceptTouchEvents: -#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ || 0 /* Used to be included in Qt4 for Q_WS_MAC */ - if (on) - d->registerTouchWindow(); -#endif break; default: break; @@ -12012,10 +11646,8 @@ QRect QWidgetPrivate::frameStrut() const } if (data.fstrut_dirty -#if 1 // Used to be excluded in Qt4 for Q_WS_WIN // ### Fix properly for 4.3 && q->isVisible() -#endif && q->testAttribute(Qt::WA_WState_Created)) const_cast(this)->updateFrameStrut(); @@ -12942,10 +12574,8 @@ void QWidget::setMask(const QRegion &newMask) d->extra->mask = newMask; d->extra->hasMask = !newMask.isEmpty(); -#if 1 // Used to be excluded in Qt4 for Q_WS_MAC if (!testAttribute(Qt::WA_WState_Created)) return; -#endif d->setMask_sys(newMask); diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h index 941f92c062d..6fd9c2d2731 100644 --- a/src/widgets/kernel/qwidget_p.h +++ b/src/widgets/kernel/qwidget_p.h @@ -155,41 +155,6 @@ struct QTLWExtra { uint sizeAdjusted : 1; uint inTopLevelResize : 1; uint embedded : 1; - - // *************************** Platform specific values (bit fields first) ********** -#if 0 /* Used to be included in Qt4 for Q_WS_X11 */ // <----------------------------------------------------------- X11 - uint spont_unmapped: 1; // window was spontaneously unmapped - uint dnd : 1; // DND properties installed - uint validWMState : 1; // is WM_STATE valid? - uint waitingForMapNotify : 1; // show() has been called, haven't got the MapNotify yet - WId parentWinId; // parent window Id (valid after reparenting) - WId userTimeWindow; // window id that contains user-time timestamp when WM supports a _NET_WM_USER_TIME_WINDOW atom - QPoint fullScreenOffset; -#ifndef QT_NO_XSYNC - WId syncUpdateCounter; - ulong syncRequestTimestamp; - qint32 newCounterValueHi; - quint32 newCounterValueLo; -#endif -#elif 0 /* Used to be included in Qt4 for Q_WS_WIN */ // <--------------------------------------------------------- WIN - uint hotkeyRegistered: 1; // Hot key from the STARTUPINFO has been registered. - HICON winIconBig; // internal big Windows icon - HICON winIconSmall; // internal small Windows icon -#elif 0 /* Used to be included in Qt4 for Q_WS_MAC */ // <--------------------------------------------------------- MAC - uint resizer : 4; - uint isSetGeometry : 1; - uint isMove : 1; - quint32 wattr; - quint32 wclass; - WindowGroupRef group; - IconRef windowIcon; // the current window icon, if set with setWindowIcon_sys. - quint32 savedWindowAttributesFromMaximized; // Saved attributes from when the calling updateMaximizeButton_sys() - // This value is just to make sure we maximize and restore to the right location, yet we allow apps to be maximized and - // manually resized. - // The name is misleading, since this is set when maximizing the window. It is a hint to saveGeometry(..) to record the - // starting position as 0,0 instead of the normal starting position. - bool wasMaximized; -#endif }; struct QWExtra { @@ -228,21 +193,6 @@ struct QWExtra { uint inRenderWithPainter : 1; uint hasMask : 1; uint hasWindowContainer : 1; - - // *************************** Platform specific values (bit fields first) ********** -#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ // <----------------------------------------------------------- WIN -#if QT_CONFIG(draganddrop) - QOleDropTarget *dropTarget; // drop target - QList > oleDropWidgets; -#endif -#elif 0 /* Used to be included in Qt4 for Q_WS_X11 */ // <--------------------------------------------------------- X11 - uint compress_events : 1; - WId xDndProxy; // XDND forwarding to embedded windows -#elif 0 /* Used to be included in Qt4 for Q_WS_MAC */ // <------------------------------------------------------ MAC - // Cocoa Mask stuff - QImage maskBits; - CGImageRef imageMask; -#endif }; /*! @@ -770,109 +720,8 @@ public: // *************************** Platform specific ************************************ #if defined(Q_OS_WIN) uint noPaintOnScreen : 1; // see qwidget.cpp ::paintEngine() -#endif -#if 0 /* Used to be included in Qt4 for Q_WS_X11 */ // <----------------------------------------------------------- X11 - Qt::HANDLE picture; - static QWidget *mouseGrabber; - static QWidget *keyboardGrabber; - - void setWindowRole(); - void sendStartupMessage(const char *message) const; - void x11UpdateIsOpaque(); - bool isBackgroundInherited() const; - void updateX11AcceptFocus(); - QPoint mapToGlobal(const QPoint &pos) const; - QPoint mapFromGlobal(const QPoint &pos) const; -#elif 0 /* Used to be included in Qt4 for Q_WS_WIN */ // <--------------------------------------------------------- WIN -#ifndef QT_NO_GESTURES - uint nativeGesturePanEnabled : 1; -#endif - bool shouldShowMaximizeButton(); - void winUpdateIsOpaque(); - void reparentChildren(); -#if QT_CONFIG(draganddrop) - QOleDropTarget *registerOleDnd(QWidget *widget); - void unregisterOleDnd(QWidget *widget, QOleDropTarget *target); -#endif - void grabMouseWhileInWindow(); - void registerTouchWindow(); - void winSetupGestures(); -#elif defined(Q_OS_MAC) // <--------------------------------------------------------- MAC +#elif defined(Q_OS_MAC) void macUpdateSizeAttribute(); -#elif 0 /* Used to be included in Qt4 for Q_WS_MAC */ // <--------------------------------------------------------- MAC (old stuff) - // This is new stuff - uint needWindowChange : 1; - - // Each wiget keeps a list of all its child and grandchild OpenGL widgets. - // This list is used to update the gl context whenever a parent and a granparent - // moves, and also to check for intersections with gl widgets within the window - // when a widget moves. - struct GlWidgetInfo - { - GlWidgetInfo(QWidget *widget) : widget(widget), lastUpdateWidget(0) { } - bool operator==(const GlWidgetInfo &other) const { return (widget == other.widget); } - QWidget * widget; - QWidget * lastUpdateWidget; - }; - - // dirtyOnWidget contains the areas in the widget that needs to be repained, - // in the same way as dirtyOnScreen does for the window. Areas are added in - // dirtyWidget_sys and cleared in the paint event. In scroll_sys we then use - // this information repaint invalid areas when widgets are scrolled. - QRegion dirtyOnWidget; - EventHandlerRef window_event; - QList glWidgets; - - //these are here just for code compat (HIViews) - Qt::HANDLE qd_hd; - - void macUpdateHideOnSuspend(); - void macUpdateOpaqueSizeGrip(); - void macUpdateIgnoreMouseEvents(); - void macUpdateMetalAttribute(); - void macUpdateIsOpaque(); - void macSetNeedsDisplay(QRegion region); - void setEnabled_helper_sys(bool enable); - bool isRealWindow() const; - void adjustWithinMaxAndMinSize(int &w, int &h); - void applyMaxAndMinSizeOnWindow(); - void update_sys(const QRect &rect); - void update_sys(const QRegion &rgn); - void setGeometry_sys_helper(int, int, int, int, bool); - void updateMaximizeButton_sys(); - void createWindow_sys(); - void recreateMacWindow(); - void setSubWindowStacking(bool set); - void setWindowLevel(); - void finishCreateWindow_sys_Cocoa(void * /*NSWindow * */ windowRef); - void syncCocoaMask(); - void finishCocoaMaskSetup(); - // Did we add the drawRectOriginal method? - bool drawRectOriginalAdded; - // Is the original drawRect method available? - bool originalDrawMethod; - // Do we need to change the methods? - bool changeMethods; - - // Unified toolbar variables - bool isInUnifiedToolbar; - QUnifiedToolbarSurface *unifiedSurface; - QPoint toolbar_offset; - QWidget *toolbar_ancestor; - bool flushRequested; - bool touchEventsEnabled; - void determineWindowClass(); - void transferChildren(); - bool qt_mac_dnd_event(uint, DragRef); - void toggleDrawers(bool); - //mac event functions - static bool qt_create_root_win(); - static void qt_clean_root_win(); - static bool qt_mac_update_sizer(QWidget *, int up = 0); - static OSStatus qt_window_event(EventHandlerCallRef er, EventRef event, void *); - static OSStatus qt_widget_event(EventHandlerCallRef er, EventRef event, void *); - static bool qt_widget_rgn(QWidget *, short, RgnHandle, bool); - void registerTouchWindow(bool enable = true); #endif void setNetWmWindowTypes(bool skipIfMissing = false); diff --git a/src/widgets/styles/qpixmapstyle.cpp b/src/widgets/styles/qpixmapstyle.cpp index 976bd2630ee..05e84675282 100644 --- a/src/widgets/styles/qpixmapstyle.cpp +++ b/src/widgets/styles/qpixmapstyle.cpp @@ -122,9 +122,6 @@ QPixmapStyle::~QPixmapStyle() void QPixmapStyle::polish(QApplication *application) { QCommonStyle::polish(application); -#if 0 // Used to be included in Qt4 for Q_WS_WIN - QApplication::setEffectEnabled(Qt::UI_AnimateCombo, false); -#endif } /*! @@ -188,11 +185,6 @@ void QPixmapStyle::polish(QWidget *widget) frame->setContentsMargins(pix.margins.left(), desc.margins.top(), pix.margins.right(), desc.margins.bottom()); frame->setAttribute(Qt::WA_TranslucentBackground); -#if 0 // Used to be included in Qt4 for Q_WS_WIN - // FramelessWindowHint is needed on windows to make - // WA_TranslucentBackground work properly - frame->setWindowFlags(widget->windowFlags() | Qt::FramelessWindowHint); -#endif } } #endif // QT_CONFIG(combobox) diff --git a/src/widgets/styles/qstyleoption.cpp b/src/widgets/styles/qstyleoption.cpp index 4faf98a0a3e..5b3efd598fb 100644 --- a/src/widgets/styles/qstyleoption.cpp +++ b/src/widgets/styles/qstyleoption.cpp @@ -198,11 +198,6 @@ void QStyleOption::init(const QWidget *widget) state |= QStyle::State_Active; if (widget->isWindow()) state |= QStyle::State_Window; -#if 0 // Used to be included in Qt4 for Q_WS_MAC - extern bool qt_mac_can_clickThrough(const QWidget *w); //qwidget_mac.cpp - if (!(state & QStyle::State_Active) && !qt_mac_can_clickThrough(widget)) - state &= ~QStyle::State_Enabled; -#endif switch (QStyleHelper::widgetSizePolicy(widget)) { case QStyleHelper::SizeSmall: state |= QStyle::State_Small; diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index ea653459d35..dd225fbec33 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -5153,13 +5153,6 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op sz = csz + QSize(vertical ? 0 : spaceForIcon, vertical ? spaceForIcon : 0); return subRule.boxSize(subRule.adjustSize(sz)); } -#if 0 // Used to be included in Qt4 for Q_WS_MAC - if (baseStyle()->inherits("QMacStyle")) { - //adjust the size after the call to the style because the mac style ignore the size arguments anyway. - //this might cause the (max-){width,height} property to include the native style border while they should not. - return subRule.adjustSize(baseStyle()->sizeFromContents(ct, opt, csz, w)); - } -#endif sz = subRule.adjustSize(csz); break; } diff --git a/src/widgets/util/qflickgesture.cpp b/src/widgets/util/qflickgesture.cpp index 55ec93c7d39..14a30ce7cf7 100644 --- a/src/widgets/util/qflickgesture.cpp +++ b/src/widgets/util/qflickgesture.cpp @@ -462,21 +462,6 @@ QGestureRecognizer::Result QFlickGestureRecognizer::recognize(QGesture *state, } break; -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // the only way to distinguish between real mouse wheels and wheel - // events generated by the native 2 finger swipe gesture is to listen - // for these events (according to Apple's Cocoa Event-Handling Guide) - - case QEvent::NativeGesture: { - QNativeGestureEvent *nge = static_cast(event); - if (nge->gestureType == QNativeGestureEvent::GestureBegin) - d->macIgnoreWheel = true; - else if (nge->gestureType == QNativeGestureEvent::GestureEnd) - d->macIgnoreWheel = false; - break; - } -#endif - // consume all wheel events if the scroller is active case QEvent::Wheel: if (d->macIgnoreWheel || (scroller->state() != QScroller::Inactive)) diff --git a/src/widgets/util/qscroller_mac.mm b/src/widgets/util/qscroller_mac.mm deleted file mode 100644 index 6dbb4830892..00000000000 --- a/src/widgets/util/qscroller_mac.mm +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWidgets module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#if 0 // Used to be included in Qt4 for Q_WS_MAC - -#import - -#include "qscroller_p.h" - -QT_BEGIN_NAMESPACE - -QPointF QScrollerPrivate::realDpi(int screen) const -{ - QMacAutoReleasePool pool; - NSArray *nsscreens = [NSScreen screens]; - - if (screen < 0 || screen >= int([nsscreens count])) - screen = 0; - - NSScreen *nsscreen = [nsscreens objectAtIndex:screen]; - CGDirectDisplayID display = [[[nsscreen deviceDescription] objectForKey:@"NSScreenNumber"] intValue]; - - CGSize mmsize = CGDisplayScreenSize(display); - if (mmsize.width > 0 && mmsize.height > 0) { - return QPointF(CGDisplayPixelsWide(display) / mmsize.width, - CGDisplayPixelsHigh(display) / mmsize.height) * qreal(25.4); - } else { - return QPointF(); - } -} - -QT_END_NAMESPACE - -#endif diff --git a/src/widgets/util/qscrollerproperties.cpp b/src/widgets/util/qscrollerproperties.cpp index c26fba2cd34..df6b899fe4f 100644 --- a/src/widgets/util/qscrollerproperties.cpp +++ b/src/widgets/util/qscrollerproperties.cpp @@ -40,9 +40,6 @@ #include #include #include -#if 0 // Used to be included in Qt4 for Q_WS_WIN -# include -#endif #include "qscrollerproperties.h" #include "private/qscrollerproperties_p.h" @@ -73,10 +70,6 @@ QScrollerPropertiesPrivate *QScrollerPropertiesPrivate::defaults() spp.overshootDragDistanceFactor = qreal(1); spp.overshootScrollDistanceFactor = qreal(0.5); spp.overshootScrollTime = qreal(0.7); -# if 0 // Used to be included in Qt4 for Q_WS_WIN - if (QLibrary::resolve(QLatin1String("UxTheme"), "BeginPanningFeedback")) - spp.overshootScrollTime = qreal(0.35); -# endif spp.hOvershootPolicy = QScrollerProperties::OvershootWhenScrollable; spp.vOvershootPolicy = QScrollerProperties::OvershootWhenScrollable; spp.frameRate = QScrollerProperties::Standard; diff --git a/src/widgets/util/qsystemtrayicon.cpp b/src/widgets/util/qsystemtrayicon.cpp index a38a50d3df0..fd188888707 100644 --- a/src/widgets/util/qsystemtrayicon.cpp +++ b/src/widgets/util/qsystemtrayicon.cpp @@ -626,16 +626,6 @@ void QBalloonTip::balloon(const QPoint& pos, int msecs, bool showArrow) } QPainterPath path; -#if defined(QT_NO_XSHAPE) && 0 /* Used to be included in Qt4 for Q_WS_X11 */ - // XShape is required for setting the mask, so we just - // draw an ugly square when its not available - path.moveTo(0, 0); - path.lineTo(sz.width() - 1, 0); - path.lineTo(sz.width() - 1, sz.height() - 1); - path.lineTo(0, sz.height() - 1); - path.lineTo(0, 0); - move(qMax(pos.x() - sz.width(), scr.left()), pos.y()); -#else path.moveTo(ml + rc, mt); if (arrowAtTop && arrowAtLeft) { if (showArrow) { @@ -685,7 +675,6 @@ void QBalloonTip::balloon(const QPoint& pos, int msecs, bool showArrow) painter1.setBrush(QBrush(Qt::color1)); painter1.drawPath(path); setMask(bitmap); -#endif // Draw the border pixmap = QPixmap(sz); diff --git a/src/widgets/util/util.pri b/src/widgets/util/util.pri index a3bd8897f1e..363291528ef 100644 --- a/src/widgets/util/util.pri +++ b/src/widgets/util/util.pri @@ -54,7 +54,3 @@ qtConfig(xcb) { } else { SOURCES += util/qsystemtrayicon_qpa.cpp } - -mac { - OBJECTIVE_SOURCES += util/qscroller_mac.mm -} diff --git a/src/widgets/widgets/qabstractscrollarea.cpp b/src/widgets/widgets/qabstractscrollarea.cpp index 55b2dcd6621..b295e66574d 100644 --- a/src/widgets/widgets/qabstractscrollarea.cpp +++ b/src/widgets/widgets/qabstractscrollarea.cpp @@ -62,10 +62,6 @@ #include -#if 0 // Used to be included in Qt4 for Q_WS_MAC -#include -#include -#endif #ifdef Q_OS_WIN # include #endif @@ -169,9 +165,6 @@ 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) -#if 0 // Used to be included in Qt4 for Q_WS_WIN - , singleFingerPanEnabled(false) -#endif { } @@ -322,16 +315,6 @@ void QAbstractScrollAreaPrivate::init() #endif } -#if 0 // Used to be included in Qt4 for Q_WS_WIN -void QAbstractScrollAreaPrivate::setSingleFingerPanEnabled(bool on) -{ - singleFingerPanEnabled = on; - QWidgetPrivate *dd = static_cast(QObjectPrivate::get(viewport)); - if (dd) - dd->winSetupGestures(); -} -#endif - void QAbstractScrollAreaPrivate::layoutChildren() { bool needH = false; @@ -362,38 +345,6 @@ void QAbstractScrollAreaPrivate::layoutChildren_helper(bool *needHorizontalScrol const int hscrollOverlap = hbar->style()->pixelMetric(QStyle::PM_ScrollView_ScrollBarOverlap, &opt, hbar); const int vscrollOverlap = vbar->style()->pixelMetric(QStyle::PM_ScrollView_ScrollBarOverlap, &opt, vbar); -#if 0 // Used to be included in Qt4 for Q_WS_MAC - QWidget * const window = q->window(); - - // Use small scroll bars for tool windows, to match the native size grip. - bool hbarIsSmall = hbar->testAttribute(Qt::WA_MacSmallSize); - bool vbarIsSmall = vbar->testAttribute(Qt::WA_MacSmallSize); - const Qt::WindowType windowType = window->windowType(); - if (windowType == Qt::Tool) { - if (!hbarIsSmall) { - hbar->setAttribute(Qt::WA_MacMiniSize, false); - hbar->setAttribute(Qt::WA_MacNormalSize, false); - hbar->setAttribute(Qt::WA_MacSmallSize, true); - } - if (!vbarIsSmall) { - vbar->setAttribute(Qt::WA_MacMiniSize, false); - vbar->setAttribute(Qt::WA_MacNormalSize, false); - vbar->setAttribute(Qt::WA_MacSmallSize, true); - } - } else { - if (hbarIsSmall) { - hbar->setAttribute(Qt::WA_MacMiniSize, false); - hbar->setAttribute(Qt::WA_MacNormalSize, false); - hbar->setAttribute(Qt::WA_MacSmallSize, false); - } - if (vbarIsSmall) { - vbar->setAttribute(Qt::WA_MacMiniSize, false); - vbar->setAttribute(Qt::WA_MacNormalSize, false); - vbar->setAttribute(Qt::WA_MacSmallSize, false); - } - } -#endif - const int hsbExt = hbar->sizeHint().height(); const int vsbExt = vbar->sizeHint().width(); const QPoint extPoint(vsbExt, hsbExt); @@ -403,30 +354,6 @@ void QAbstractScrollAreaPrivate::layoutChildren_helper(bool *needHorizontalScrol const bool hasCornerWidget = (cornerWidget != 0); -// 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. -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // Check if a native sizegrip is present. - bool hasMacReverseSizeGrip = false; - bool hasMacSizeGrip = false; - bool nativeGripPresent = false; - if (q->testAttribute(Qt::WA_WState_Created)) - nativeGripPresent = qt_mac_checkForNativeSizeGrip(q); - - if (nativeGripPresent) { - // Look for a native size grip at the visual window bottom right and at the - // absolute window bottom right. In reverse mode, the native size grip does not - // swich side, so we need to check if it is on the "wrong side". - const QPoint scrollAreaBottomRight = q->mapTo(window, widgetRect.bottomRight() - QPoint(frameWidth, frameWidth)); - const QPoint windowBottomRight = window->rect().bottomRight(); - const QPoint visualWindowBottomRight = QStyle::visualPos(opt.direction, opt.rect, windowBottomRight); - const QPoint offset = windowBottomRight - scrollAreaBottomRight; - const QPoint visualOffset = visualWindowBottomRight - scrollAreaBottomRight; - hasMacSizeGrip = (visualOffset.manhattanLength() < vsbExt); - hasMacReverseSizeGrip = (hasMacSizeGrip == false && (offset.manhattanLength() < hsbExt)); - } -#endif - QPoint cornerOffset((needv && vscrollOverlap == 0) ? vsbExt : 0, (needh && hscrollOverlap == 0) ? hsbExt : 0); QRect controlsRect; QRect viewportRect; @@ -458,12 +385,6 @@ void QAbstractScrollAreaPrivate::layoutChildren_helper(bool *needHorizontalScrol if (hasCornerWidget && ((needv && vscrollOverlap == 0) || (needh && hscrollOverlap == 0))) cornerOffset = extPoint; -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // Also move the scroll bars if they are covered by the native Mac size grip. - if (hasMacSizeGrip) - cornerOffset = extPoint; -#endif - // The corner point is where the scroll bar rects, the corner widget rect and the // viewport rect meets. const QPoint cornerPoint(controlsRect.bottomRight() + QPoint(1, 1) - cornerOffset); @@ -475,13 +396,6 @@ void QAbstractScrollAreaPrivate::layoutChildren_helper(bool *needHorizontalScrol else cornerPaintingRect = QRect(); -#if 0 // Used to be included in Qt4 for Q_WS_MAC - if (hasMacReverseSizeGrip) - reverseCornerPaintingRect = QRect(controlsRect.bottomRight() + QPoint(1, 1) - extPoint, extSize); - else - reverseCornerPaintingRect = QRect(); -#endif - // move the scrollbars away from top/left headers int vHeaderRight = 0; int hHeaderBottom = 0; @@ -501,10 +415,7 @@ void QAbstractScrollAreaPrivate::layoutChildren_helper(bool *needHorizontalScrol #endif // QT_CONFIG(itemviews) if (needh) { QRect horizontalScrollBarRect(QPoint(controlsRect.left() + vHeaderRight, cornerPoint.y()), QPoint(cornerPoint.x() - 1, controlsRect.bottom())); -#if 0 // Used to be included in Qt4 for Q_WS_MAC - if (hasMacReverseSizeGrip) - horizontalScrollBarRect.adjust(vsbExt, 0, 0, 0); -#endif + if (!hasCornerWidget && htransient) horizontalScrollBarRect.adjust(0, 0, cornerOffset.x(), 0); scrollBarContainers[Qt::Horizontal]->setGeometry(QStyle::visualRect(opt.direction, opt.rect, horizontalScrollBarRect)); @@ -617,10 +528,8 @@ void QAbstractScrollArea::setViewport(QWidget *widget) d->viewport->setParent(this); d->viewport->setFocusProxy(this); d->viewport->installEventFilter(d->viewportFilter.data()); -#if 1 // Used to be excluded in Qt4 for Q_WS_MAC #ifndef QT_NO_GESTURES d->viewport->grabGesture(Qt::PanGesture); -#endif #endif d->layoutChildren(); #ifndef QT_NO_OPENGL @@ -1043,13 +952,6 @@ bool QAbstractScrollArea::event(QEvent *e) QPainter p(this); style()->drawPrimitive(QStyle::PE_PanelScrollAreaCorner, &option, &p, this); } -#if 0 // Used to be included in Qt4 for Q_WS_MAC - if (d->reverseCornerPaintingRect.isValid()) { - option.rect = d->reverseCornerPaintingRect; - QPainter p(this); - style()->drawPrimitive(QStyle::PE_PanelScrollAreaCorner, &option, &p, this); - } -#endif } QFrame::paintEvent((QPaintEvent*)e); break; @@ -1122,38 +1024,10 @@ bool QAbstractScrollArea::event(QEvent *e) hBar->setValue(se->contentPos().x()); vBar->setValue(se->contentPos().y()); -#if 0 // Used to be included in Qt4 for Q_WS_WIN - typedef BOOL (*PtrBeginPanningFeedback)(HWND); - typedef BOOL (*PtrUpdatePanningFeedback)(HWND, LONG, LONG, BOOL); - typedef BOOL (*PtrEndPanningFeedback)(HWND, BOOL); + QPoint delta = d->overshoot - se->overshootDistance().toPoint(); + if (!delta.isNull()) + viewport()->move(viewport()->pos() + delta); - static PtrBeginPanningFeedback ptrBeginPanningFeedback = 0; - static PtrUpdatePanningFeedback ptrUpdatePanningFeedback = 0; - static PtrEndPanningFeedback ptrEndPanningFeedback = 0; - - if (!ptrBeginPanningFeedback) - ptrBeginPanningFeedback = (PtrBeginPanningFeedback) QLibrary::resolve(QLatin1String("UxTheme"), "BeginPanningFeedback"); - if (!ptrUpdatePanningFeedback) - ptrUpdatePanningFeedback = (PtrUpdatePanningFeedback) QLibrary::resolve(QLatin1String("UxTheme"), "UpdatePanningFeedback"); - if (!ptrEndPanningFeedback) - ptrEndPanningFeedback = (PtrEndPanningFeedback) QLibrary::resolve(QLatin1String("UxTheme"), "EndPanningFeedback"); - - if (ptrBeginPanningFeedback && ptrUpdatePanningFeedback && ptrEndPanningFeedback) { - WId wid = window()->winId(); - - if (!se->overshootDistance().isNull() && d->overshoot.isNull()) - ptrBeginPanningFeedback(wid); - if (!se->overshootDistance().isNull()) - ptrUpdatePanningFeedback(wid, -se->overshootDistance().x(), -se->overshootDistance().y(), false); - if (se->overshootDistance().isNull() && !d->overshoot.isNull()) - ptrEndPanningFeedback(wid, true); - } else -#endif - { - QPoint delta = d->overshoot - se->overshootDistance().toPoint(); - if (!delta.isNull()) - viewport()->move(viewport()->pos() + delta); - } d->overshoot = se->overshootDistance().toPoint(); return true; @@ -1546,13 +1420,6 @@ void QAbstractScrollAreaPrivate::_q_vslide(int y) void QAbstractScrollAreaPrivate::_q_showOrHideScrollBars() { layoutChildren(); -#if 0 // Used to be included in Qt4 for Q_WS_WIN - // Need to re-subscribe to gestures as the content changes to make sure we - // enable/disable panning when needed. - QWidgetPrivate *dd = static_cast(QObjectPrivate::get(viewport)); - if (dd) - dd->winSetupGestures(); -#endif } QPoint QAbstractScrollAreaPrivate::contentsOffset() const diff --git a/src/widgets/widgets/qabstractscrollarea_p.h b/src/widgets/widgets/qabstractscrollarea_p.h index 732a2ab40d3..6d78b9db6de 100644 --- a/src/widgets/widgets/qabstractscrollarea_p.h +++ b/src/widgets/widgets/qabstractscrollarea_p.h @@ -85,9 +85,7 @@ public: QWidget *viewport; QWidget *cornerWidget; QRect cornerPaintingRect; -#if 0 // Used to be included in Qt4 for Q_WS_MAC - QRect reverseCornerPaintingRect; -#endif + int left, top, right, bottom; // viewport margin int xoffset, yoffset; @@ -112,11 +110,6 @@ public: inline bool viewportEvent(QEvent *event) { return q_func()->viewportEvent(event); } QScopedPointer viewportFilter; - -#if 0 // Used to be included in Qt4 for Q_WS_WIN - bool singleFingerPanEnabled; - void setSingleFingerPanEnabled(bool on = true); -#endif }; class QAbstractScrollAreaFilter : public QObject diff --git a/src/widgets/widgets/qabstractslider.cpp b/src/widgets/widgets/qabstractslider.cpp index 129d540f509..dc325ab8712 100644 --- a/src/widgets/widgets/qabstractslider.cpp +++ b/src/widgets/widgets/qabstractslider.cpp @@ -721,15 +721,10 @@ bool QAbstractSliderPrivate::scrollByDelta(Qt::Orientation orientation, Qt::Keyb offset_accumulated = 0; offset_accumulated += stepsToScrollF; -#if 1 // Used to be excluded in Qt4 for Q_WS_MAC + // Don't scroll more than one page in any case: stepsToScroll = qBound(-pageStep, int(offset_accumulated), pageStep); -#else - // Native UI-elements on Mac can scroll hundreds of lines at a time as - // a result of acceleration. So keep the same behaviour in Qt, and - // don't restrict stepsToScroll to certain maximum (pageStep): - stepsToScroll = int(offset_accumulated); -#endif + offset_accumulated -= int(offset_accumulated); if (stepsToScroll == 0) { // We moved less than a line, but might still have accumulated partial scroll, diff --git a/src/widgets/widgets/qcalendarwidget.cpp b/src/widgets/widgets/qcalendarwidget.cpp index 78706b1854e..81cc0b833af 100644 --- a/src/widgets/widgets/qcalendarwidget.cpp +++ b/src/widgets/widgets/qcalendarwidget.cpp @@ -1585,7 +1585,6 @@ protected: { Q_UNUSED(e) -#if 1 // Used to be excluded in Qt4 for Q_WS_MAC QStyleOptionToolButton opt; initStyleOption(&opt); @@ -1598,7 +1597,7 @@ protected: toolPalette.setColor(QPalette::ButtonText, toolPalette.color(QPalette::HighlightedText)); setPalette(toolPalette); } -#endif + QToolButton::paintEvent(e); } }; diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index 68f19cc3341..e73c63f657b 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -447,13 +447,6 @@ void QComboBoxPrivateContainer::paintEvent(QPaintEvent *e) void QComboBoxPrivateContainer::leaveEvent(QEvent *) { -// On Mac using the Mac style we want to clear the selection -// when the mouse moves outside the popup. -#if 0 // Used to be included in Qt4 for Q_WS_MAC - QStyleOptionComboBox opt = comboStyleOption(); - if (combo->style()->styleHint(QStyle::SH_ComboBox_Popup, &opt, combo)) - view->clearSelection(); -#endif } QComboBoxPrivateContainer::QComboBoxPrivateContainer(QAbstractItemView *itemView, QComboBox *parent) diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp index 3c92d4be0ea..17dc94bba10 100644 --- a/src/widgets/widgets/qdatetimeedit.cpp +++ b/src/widgets/widgets/qdatetimeedit.cpp @@ -1125,16 +1125,6 @@ void QDateTimeEdit::keyPressEvent(QKeyEvent *event) select = false; break; } -#if 0 // Used to be included in Qt4 for Q_WS_MAC - else -#ifdef QT_KEYPAD_NAVIGATION - if (!QApplicationPrivate::keypadNavigationEnabled()) -#endif - { - select = (event->modifiers() & Qt::ShiftModifier); - break; - } -#endif } Q_FALLTHROUGH(); case Qt::Key_Backtab: diff --git a/src/widgets/widgets/qdockarealayout.cpp b/src/widgets/widgets/qdockarealayout.cpp index 55ae42db043..9be99c47232 100644 --- a/src/widgets/widgets/qdockarealayout.cpp +++ b/src/widgets/widgets/qdockarealayout.cpp @@ -1934,11 +1934,6 @@ bool QDockAreaLayoutInfo::restoreState(QDataStream &stream, QList QDockAreaLayoutItem item(new QDockWidgetItem(widget)); if (flags & StateFlagFloating) { bool drawer = false; -#if 0 // Used to be included in Qt4 for Q_WS_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); -#endif if (!testing) { widget->hide(); @@ -1949,13 +1944,6 @@ bool QDockAreaLayoutInfo::restoreState(QDataStream &stream, QList int x, y, w, h; stream >> x >> y >> w >> h; -#if 0 // Used to be included in Qt4 for Q_WS_MAC // drawer support - if (drawer) { - mainWindow->window()->createWinId(); - widget->window()->createWinId(); - qt_mac_set_drawer_preferred_edge(widget, toDockWidgetArea(dockPos)); - } else -#endif if (!testing) widget->setGeometry(QDockAreaLayout::constrainedRect(QRect(x, y, w, h), widget)); @@ -2049,9 +2037,8 @@ void QDockAreaLayoutInfo::updateSeparatorWidgets() const } j++; -#if 1 // Used to be excluded in Qt4 for Q_WS_MAC sepWidget->raise(); -#endif + QRect sepRect = separatorRect(i).adjusted(-2, -2, 2, 2); sepWidget->setGeometry(sepRect); sepWidget->setMask( QRegion(separatorRect(i).translated( - sepRect.topLeft()))); @@ -3090,10 +3077,6 @@ bool QDockAreaLayout::restoreDockWidget(QDockWidget *dockWidget) dockWidget->d_func()->setWindowState(true, true, r); } dockWidget->setVisible(!placeHolder->hidden); -#if 0 // Used to be included in Qt4 for Q_WS_X11 - if (placeHolder->window) // gets rid of the X11BypassWindowManager window flag - dockWidget->d_func()->setWindowState(true); -#endif item->placeHolderItem = 0; delete placeHolder; @@ -3340,9 +3323,8 @@ void QDockAreaLayout::updateSeparatorWidgets() const } j++; -#if 1 // Used to be excluded in Qt4 for Q_WS_MAC sepWidget->raise(); -#endif + QRect sepRect = separatorRect(i).adjusted(-2, -2, 2, 2); sepWidget->setGeometry(sepRect); sepWidget->setMask( QRegion(separatorRect(i).translated( - sepRect.topLeft()))); diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp index 28a7cee2a07..1ba34e0fed7 100644 --- a/src/widgets/widgets/qdockwidget.cpp +++ b/src/widgets/widgets/qdockwidget.cpp @@ -977,11 +977,7 @@ bool QDockWidgetPrivate::mouseMoveEvent(QMouseEvent *event) && (event->pos() - state->pressPos).manhattanLength() > QApplication::startDragDistance()) { startDrag(); -#if 0 // Used to be included in Qt4 for Q_WS_WIN - grabMouseWhileInWindow(); -#else q->grabMouse(); -#endif ret = true; } } @@ -1029,13 +1025,6 @@ void QDockWidgetPrivate::nonClientAreaMouseEvent(QMouseEvent *event) QWidget *tl = q->topLevelWidget(); QRect geo = tl->geometry(); QRect titleRect = tl->frameGeometry(); -#if 0 // Used to be included in Qt4 for Q_WS_MAC - if ((features & QDockWidget::DockWidgetVerticalTitleBar)) { - titleRect.setTop(geo.top()); - titleRect.setBottom(geo.bottom()); - titleRect.setRight(geo.left() - 1); - } else -#endif { titleRect.setLeft(geo.left()); titleRect.setRight(geo.right()); @@ -1588,17 +1577,6 @@ bool QDockWidget::event(QEvent *event) if (d->mouseMoveEvent(static_cast(event))) return true; break; -#if 0 // Used to be included in Qt4 for Q_WS_WIN - case QEvent::Leave: - if (d->state != 0 && d->state->dragging && !d->state->nca) { - // This is a workaround for loosing the mouse on Vista. - QPoint pos = QCursor::pos(); - QMouseEvent fake(QEvent::MouseMove, mapFromGlobal(pos), pos, Qt::NoButton, - QGuiApplication::mouseButtons(), QGuiApplication::keyboardModifiers()); - d->mouseMoveEvent(&fake); - } - break; -#endif case QEvent::MouseButtonRelease: if (d->mouseReleaseEvent(static_cast(event))) return true; diff --git a/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm b/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm index 0b64b2a2bbf..88baf0410b8 100644 --- a/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm +++ b/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm @@ -82,8 +82,32 @@ The following is a snippet showing how to subclass QMacCocoaViewContainer to wrap an NSSearchField. - \snippet macmainwindow.mm 0 + \code + SearchWidget::SearchWidget(QWidget *parent) + : QMacCocoaViewContainer(0, parent) + { + // Many Cocoa objects create temporary autorelease objects, + // so create a pool to catch them. + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + // Create the NSSearchField, set it on the QCocoaViewContainer. + NSSearchField *search = [[NSSearchField alloc] init]; + setCocoaView(search); + + // Use a Qt menu for the search field menu. + QMenu *qtMenu = createMenu(this); + NSMenu *nsMenu = qtMenu->macMenu(0); + [[search cell] setSearchMenuTemplate:nsMenu]; + + // Release our reference, since our super class takes ownership and we + // don't need it anymore. + [search release]; + + // Clean up our pool as we no longer need it. + [pool release]; + } + \endcode */ QT_BEGIN_NAMESPACE diff --git a/src/widgets/widgets/qmdiarea.cpp b/src/widgets/widgets/qmdiarea.cpp index c7b7e5bf97b..6e3de1b1ffc 100644 --- a/src/widgets/widgets/qmdiarea.cpp +++ b/src/widgets/widgets/qmdiarea.cpp @@ -2493,13 +2493,6 @@ bool QMdiArea::event(QEvent *event) { Q_D(QMdiArea); switch (event->type()) { -#if 0 // Used to be included in Qt4 for Q_WS_WIN - // QWidgetPrivate::hide_helper activates another sub-window when closing a - // modal dialog on Windows (see activateWindow() inside the ifdef). - case QEvent::WindowUnblocked: - d->activateCurrentWindow(); - break; -#endif case QEvent::WindowActivate: { d->isActivated = true; if (d->childWindows.isEmpty()) @@ -2557,11 +2550,7 @@ bool QMdiArea::eventFilter(QObject *object, QEvent *event) QKeyEvent *keyEvent = static_cast(event); // Ingore key events without a Ctrl modifier (except for press/release on the modifier itself). -#if 0 // Used to be included in Qt4 for Q_WS_MAC - if (!(keyEvent->modifiers() & Qt::MetaModifier) && keyEvent->key() != Qt::Key_Meta) -#else if (!(keyEvent->modifiers() & Qt::ControlModifier) && keyEvent->key() != Qt::Key_Control) -#endif return QAbstractScrollArea::eventFilter(object, event); // Find closest mdi area (in case we have a nested workspace). @@ -2576,11 +2565,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()) { -#if 0 // Used to be included in Qt4 for Q_WS_MAC - case Qt::Key_Meta: -#else case Qt::Key_Control: -#endif if (keyPress) area->d_func()->startTabToPreviousTimer(); else diff --git a/src/widgets/widgets/qmdisubwindow.cpp b/src/widgets/widgets/qmdisubwindow.cpp index 474cce983cf..d58a1d06dbf 100644 --- a/src/widgets/widgets/qmdisubwindow.cpp +++ b/src/widgets/widgets/qmdisubwindow.cpp @@ -288,13 +288,6 @@ static inline bool isHoverControl(QStyle::SubControl control) return control != QStyle::SC_None && control != QStyle::SC_TitleBarLabel; } -#if 0 // Used to be included in Qt4 for Q_WS_WIN -static inline QRgb colorref2qrgb(COLORREF col) -{ - return qRgb(GetRValue(col),GetGValue(col),GetBValue(col)); -} -#endif - #ifndef QT_NO_TOOLTIP static void showToolTip(QHelpEvent *helpEvent, QWidget *widget, const QStyleOptionComplex &opt, QStyle::ComplexControl complexControl, QStyle::SubControl subControl) @@ -1926,43 +1919,7 @@ QPalette QMdiSubWindowPrivate::desktopPalette() const QPalette newPalette = q->palette(); bool colorsInitialized = false; -#if 0 // Used to be included in Qt4 for Q_WS_WIN // ask system properties on windows -#ifndef SPI_GETGRADIENTCAPTIONS -#define SPI_GETGRADIENTCAPTIONS 0x1008 -#endif -#ifndef COLOR_GRADIENTACTIVECAPTION -#define COLOR_GRADIENTACTIVECAPTION 27 -#endif -#ifndef COLOR_GRADIENTINACTIVECAPTION -#define COLOR_GRADIENTINACTIVECAPTION 28 -#endif - if (QGuiApplication::desktopSettingsAware()) { - newPalette.setColor(QPalette::Active, QPalette::Highlight, - colorref2qrgb(GetSysColor(COLOR_ACTIVECAPTION))); - newPalette.setColor(QPalette::Inactive, QPalette::Highlight, - colorref2qrgb(GetSysColor(COLOR_INACTIVECAPTION))); - newPalette.setColor(QPalette::Active, QPalette::HighlightedText, - colorref2qrgb(GetSysColor(COLOR_CAPTIONTEXT))); - newPalette.setColor(QPalette::Inactive, QPalette::HighlightedText, - colorref2qrgb(GetSysColor(COLOR_INACTIVECAPTIONTEXT))); - colorsInitialized = true; - BOOL hasGradient = false; - SystemParametersInfo(SPI_GETGRADIENTCAPTIONS, 0, &hasGradient, 0); - - if (hasGradient) { - newPalette.setColor(QPalette::Active, QPalette::Base, - colorref2qrgb(GetSysColor(COLOR_GRADIENTACTIVECAPTION))); - newPalette.setColor(QPalette::Inactive, QPalette::Base, - colorref2qrgb(GetSysColor(COLOR_GRADIENTINACTIVECAPTION))); - } else { - newPalette.setColor(QPalette::Active, QPalette::Base, - newPalette.color(QPalette::Active, QPalette::Highlight)); - newPalette.setColor(QPalette::Inactive, QPalette::Base, - newPalette.color(QPalette::Inactive, QPalette::Highlight)); - } - } -#endif 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 88437974304..0a81931b578 100644 --- a/src/widgets/widgets/qplaintextedit.cpp +++ b/src/widgets/widgets/qplaintextedit.cpp @@ -825,9 +825,6 @@ void QPlainTextEditPrivate::init(const QString &txt) viewport->setCursor(Qt::IBeamCursor); #endif originalOffsetY = 0; -#if 0 // Used to be included in Qt4 for Q_WS_WIN - setSingleFingerPanEnabled(true); -#endif } void QPlainTextEditPrivate::_q_textChanged() diff --git a/src/widgets/widgets/qpushbutton.cpp b/src/widgets/widgets/qpushbutton.cpp index b578aa0b182..f48b5706f70 100644 --- a/src/widgets/widgets/qpushbutton.cpp +++ b/src/widgets/widgets/qpushbutton.cpp @@ -684,38 +684,6 @@ bool QPushButton::event(QEvent *e) return QAbstractButton::event(e); } -#if 0 // Used to be included in Qt4 for 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(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 - - QT_END_NAMESPACE #include "moc_qpushbutton.cpp" diff --git a/src/widgets/widgets/qpushbutton_p.h b/src/widgets/widgets/qpushbutton_p.h index a58675fe642..439b6e35d60 100644 --- a/src/widgets/widgets/qpushbutton_p.h +++ b/src/widgets/widgets/qpushbutton_p.h @@ -73,9 +73,6 @@ public: inline void init() { resetLayoutItemMargins(); } static QPushButtonPrivate* get(QPushButton *b) { return b->d_func(); } -#if 0 // Used to be included in Qt4 for Q_WS_MAC - bool hitButton(const QPoint &pos); -#endif #if QT_CONFIG(menu) QPoint adjustedMenuPosition(); #endif diff --git a/src/widgets/widgets/qrubberband.cpp b/src/widgets/widgets/qrubberband.cpp index ade8675db8c..af730f8023d 100644 --- a/src/widgets/widgets/qrubberband.cpp +++ b/src/widgets/widgets/qrubberband.cpp @@ -45,10 +45,6 @@ #include "qstyle.h" #include "qstyleoption.h" -#if 0 // Used to be included in Qt4 for Q_WS_MAC -# include -# include -#endif #include @@ -140,18 +136,9 @@ QRubberBand::QRubberBand(Shape s, QWidget *p) Q_D(QRubberBand); d->shape = s; setAttribute(Qt::WA_TransparentForMouseEvents); -#if 1 // Used to be excluded in Qt4 for Q_WS_WIN setAttribute(Qt::WA_NoSystemBackground); -#endif setAttribute(Qt::WA_WState_ExplicitShowHide); setVisible(false); -#if 0 // Used to be included in Qt4 for Q_WS_MAC - if (isWindow()) { - createWinId(); - extern OSWindowRef qt_mac_window_for(const QWidget *); //qwidget_mac.cpp - macWindowSetHasShadow(qt_mac_window_for(this), false); - } -#endif } /*! diff --git a/src/widgets/widgets/qsizegrip.cpp b/src/widgets/widgets/qsizegrip.cpp index dc5a7158dd1..835af9c7b89 100644 --- a/src/widgets/widgets/qsizegrip.cpp +++ b/src/widgets/widgets/qsizegrip.cpp @@ -50,10 +50,6 @@ #include "qdebug.h" #include -#if 0 // Used to be included in Qt4 for Q_WS_MAC -#include -#endif - #include #include #include @@ -81,9 +77,7 @@ public: Qt::Corner m_corner; bool gotMousePress; QPointer tlw; -#if 0 // Used to be included in Qt4 for Q_WS_MAC - void updateMacSizer(bool hide) const; -#endif + Qt::Corner corner() const; inline bool atBottom() const { @@ -119,9 +113,7 @@ public: updateTopLevelWidget(); if (tlw && showSizeGrip) { Qt::WindowStates sizeGripNotVisibleState = Qt::WindowFullScreen; -#if 1 // Used to be excluded in Qt4 for Q_WS_MAC sizeGripNotVisibleState |= Qt::WindowMaximized; -#endif // Don't show the size grip if the tlw is maximized or in full screen mode. showSizeGrip = !(tlw->windowState() & sizeGripNotVisibleState); } @@ -141,18 +133,6 @@ QSizeGripPrivate::QSizeGripPrivate() { } -#if 0 // Used to be included in Qt4 for 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(q)); - if(topLevelWindow && topLevelWindow->isWindow()) - QWidgetPrivate::qt_mac_update_sizer(topLevelWindow, hide ? -1 : 1); -} -#endif - Qt::Corner QSizeGripPrivate::corner() const { Q_Q(const QSizeGrip); @@ -227,7 +207,7 @@ void QSizeGripPrivate::init() Q_Q(QSizeGrip); m_corner = q->isLeftToRight() ? Qt::BottomRightCorner : Qt::BottomLeftCorner; -#if !defined(QT_NO_CURSOR) && !0 /* Used to be included in Qt4 for Q_WS_MAC */ +#if !defined(QT_NO_CURSOR) q->setCursor(m_corner == Qt::TopLeftCorner || m_corner == Qt::BottomRightCorner ? Qt::SizeFDiagCursor : Qt::SizeBDiagCursor); #endif @@ -440,7 +420,7 @@ void QSizeGrip::moveEvent(QMoveEvent * /*moveEvent*/) return; d->m_corner = d->corner(); -#if !defined(QT_NO_CURSOR) && !0 /* Used to be included in Qt4 for Q_WS_MAC */ +#if !defined(QT_NO_CURSOR) setCursor(d->m_corner == Qt::TopLeftCorner || d->m_corner == Qt::BottomRightCorner ? Qt::SizeFDiagCursor : Qt::SizeBDiagCursor); #endif @@ -451,9 +431,6 @@ void QSizeGrip::moveEvent(QMoveEvent * /*moveEvent*/) */ void QSizeGrip::showEvent(QShowEvent *showEvent) { -#if 0 // Used to be included in Qt4 for Q_WS_MAC - d_func()->updateMacSizer(false); -#endif QWidget::showEvent(showEvent); } @@ -462,9 +439,6 @@ void QSizeGrip::showEvent(QShowEvent *showEvent) */ void QSizeGrip::hideEvent(QHideEvent *hideEvent) { -#if 0 // Used to be included in Qt4 for Q_WS_MAC - d_func()->updateMacSizer(true); -#endif QWidget::hideEvent(hideEvent); } @@ -486,9 +460,7 @@ bool QSizeGrip::eventFilter(QObject *o, QEvent *e) return QWidget::eventFilter(o, e); } Qt::WindowStates sizeGripNotVisibleState = Qt::WindowFullScreen; -#if 1 // Used to be excluded in Qt4 for Q_WS_MAC sizeGripNotVisibleState |= Qt::WindowMaximized; -#endif // 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); diff --git a/src/widgets/widgets/qstatusbar.cpp b/src/widgets/widgets/qstatusbar.cpp index e9044e6cad4..39f0f11dafc 100644 --- a/src/widgets/widgets/qstatusbar.cpp +++ b/src/widgets/widgets/qstatusbar.cpp @@ -90,10 +90,6 @@ public: int savedStrut; -#if 0 // Used to be included in Qt4 for Q_WS_MAC - QPoint dragStart; -#endif - int indexToLastNonPermanentWidget() const { int i = items.size() - 1; @@ -747,44 +743,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. -#if 1 // Used to be excluded in Qt4 for Q_WS_MAC return QWidget::event(e); -#else - // Enable drag-click only if the status bar is the status bar for a - // QMainWindow with a unifed toolbar. - if (parent() == 0 || qobject_cast(parent()) == 0 || - qobject_cast(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 (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 } QT_END_NAMESPACE diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp index 18fda11ddf2..7e1794efef8 100644 --- a/src/widgets/widgets/qtabbar.cpp +++ b/src/widgets/widgets/qtabbar.cpp @@ -68,11 +68,6 @@ #include "private/qapplication_p.h" #include "private/qtabbar_p.h" -#if 0 // Used to be included in Qt4 for Q_WS_MAC -#include -#include -#endif - QT_BEGIN_NAMESPACE namespace { @@ -1976,9 +1971,7 @@ void QTabBar::mousePressEvent(QMouseEvent *event) d->moveTabFinished(d->pressedIndex); d->pressedIndex = d->indexAtPos(event->pos()); -#if 0 // Used to be included in Qt4 for Q_WS_MAC - d->previousPressedIndex = d->pressedIndex; -#endif + if (d->validIndex(d->pressedIndex)) { QStyleOptionTabBarBase optTabBase; optTabBase.init(this); @@ -2058,17 +2051,6 @@ void QTabBar::mouseMoveEvent(QMouseEvent *event) update(); } -#if 0 // Used to be included in Qt4 for 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) { @@ -2162,9 +2144,7 @@ void QTabBar::mouseReleaseEvent(QMouseEvent *event) event->ignore(); return; } -#if 0 // Used to be included in Qt4 for 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) diff --git a/src/widgets/widgets/qtabbar_p.h b/src/widgets/widgets/qtabbar_p.h index 458d486b100..5552c435486 100644 --- a/src/widgets/widgets/qtabbar_p.h +++ b/src/widgets/widgets/qtabbar_p.h @@ -93,9 +93,6 @@ public: selectionBehaviorOnRemove(QTabBar::SelectRightTab), paintWithOffsets(true), movable(false), dragInProgress(false), documentMode(false), autoHide(false), changeCurrentOnDrag(false), switchTabCurrentIndex(-1), switchTabTimerId(0), movingTab(nullptr) -#if 0 // Used to be included in Qt4 for Q_WS_MAC - , previousPressedIndex(-1) -#endif {} int currentIndex; @@ -232,9 +229,6 @@ public: int switchTabTimerId; QMovableTabWidget *movingTab; -#if 0 // Used to be included in Qt4 for Q_WS_MAC - int previousPressedIndex; -#endif // shared by tabwidget and qtabbar static void initStyleBaseOption(QStyleOptionTabBarBase *optTabBase, QTabBar *tabbar, QSize size) { diff --git a/src/widgets/widgets/qtextedit.cpp b/src/widgets/widgets/qtextedit.cpp index bd9e5f8159c..0ccbad7eaac 100644 --- a/src/widgets/widgets/qtextedit.cpp +++ b/src/widgets/widgets/qtextedit.cpp @@ -200,9 +200,6 @@ void QTextEditPrivate::init(const QString &html) #ifndef QT_NO_CURSOR viewport->setCursor(Qt::IBeamCursor); #endif -#if 0 // Used to be included in Qt4 for Q_WS_WIN - setSingleFingerPanEnabled(true); -#endif } void QTextEditPrivate::_q_repaintContents(const QRectF &contentsRect) diff --git a/src/widgets/widgets/qtoolbar.cpp b/src/widgets/widgets/qtoolbar.cpp index d1a0f5ea78e..58e9c4fd875 100644 --- a/src/widgets/widgets/qtoolbar.cpp +++ b/src/widgets/widgets/qtoolbar.cpp @@ -324,13 +324,8 @@ bool QToolBarPrivate::mouseMoveEvent(QMouseEvent *event) event->y() >= 0 && event->y() < q->height()); startDrag(moving); - if (!moving && !wasDragging) { -#if 0 // Used to be included in Qt4 for Q_WS_WIN - grabMouseWhileInWindow(); -#else + if (!moving && !wasDragging) q->grabMouse(); -#endif - } } if (state->dragging) { diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp index 46bc29eed71..9cdae4f28f7 100644 --- a/src/widgets/widgets/qwidgetlinecontrol.cpp +++ b/src/widgets/widgets/qwidgetlinecontrol.cpp @@ -78,11 +78,6 @@ int QWidgetLineControl::redoTextLayout() const QTextLine l = m_textLayout.createLine(); m_textLayout.endLayout(); -#if 0 // Used to be included in Qt4 for Q_WS_MAC - if (m_threadChecks) - m_textLayoutThread = QThread::currentThread(); -#endif - return qRound(l.ascent()); } diff --git a/src/widgets/widgets/qwidgetlinecontrol_p.h b/src/widgets/widgets/qwidgetlinecontrol_p.h index 940a17714ff..8ebed250841 100644 --- a/src/widgets/widgets/qwidgetlinecontrol_p.h +++ b/src/widgets/widgets/qwidgetlinecontrol_p.h @@ -95,10 +95,6 @@ public: m_selstart(0), m_selend(0), m_passwordEchoEditing(false) , m_passwordEchoTimer(0) , m_passwordMaskDelay(-1) -#if 0 // Used to be included in Qt4 for Q_WS_MAC - , m_threadChecks(false) - , m_textLayoutThread(0) - #endif #if defined(QT_BUILD_INTERNAL) , m_passwordMaskDelayOverride(-1) #endif @@ -404,25 +400,9 @@ public: QTextLayout *textLayout() const { -#if 0 // Used to be included in Qt4 for Q_WS_MAC - if (m_threadChecks && QThread::currentThread() != m_textLayoutThread) - redoTextLayout(); -#endif return &m_textLayout; } -#if 0 // Used to be included in Qt4 for Q_WS_MAC - void setThreadChecks(bool threadChecks) - { - m_threadChecks = threadChecks; - } - - bool threadChecks() const - { - return m_threadChecks; - } -#endif - private: void init(const QString &txt); void removeSelectedText(); @@ -534,10 +514,6 @@ private: } int redoTextLayout() const; -#if 0 // Used to be included in Qt4 for Q_WS_MAC - bool m_threadChecks; - mutable QThread *m_textLayoutThread; -#endif public: #if defined(QT_BUILD_INTERNAL) diff --git a/src/widgets/widgets/qwidgetresizehandler.cpp b/src/widgets/widgets/qwidgetresizehandler.cpp index e8d435429fa..9dbba12abab 100644 --- a/src/widgets/widgets/qwidgetresizehandler.cpp +++ b/src/widgets/widgets/qwidgetresizehandler.cpp @@ -124,21 +124,6 @@ bool QWidgetResizeHandler::eventFilter(QObject *o, QEvent *ee) if (!widgetRect.contains(cursorPoint)) return false; if (e->button() == Qt::LeftButton) { -#if 0 // Used to be included in Qt4 for Q_WS_X11 - /* - Implicit grabs do not stop the X server from changing - the cursor in children, which looks *really* bad when - doing resizingk, so we grab the cursor. Note that we do - not do this on Windows since double clicks are lost due - to the grab (see change 198463). - */ - if (e->spontaneous()) -# if !defined(QT_NO_CURSOR) - widget->grabMouse(widget->cursor()); -# else - widget->grabMouse(); -# endif // QT_NO_CURSOR -#endif buttonDown = false; emit activate(); bool me = movingEnabled; diff --git a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp index 4d31d802466..ba5df809f2a 100644 --- a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp @@ -267,10 +267,6 @@ void tst_QPixmap::fromImage() image.fill(0x7f7f7f7f); const QPixmap pixmap = QPixmap::fromImage(image); -#if 0 // Used to be included in Qt4 for Q_WS_X11 - if (pixmap.handle()->classId() == QPlatformPixmap::X11Class && !pixmap.x11PictureHandle()) - QSKIP("Requires XRender support"); -#endif const QImage result = pixmap.toImage(); image = image.convertToFormat(result.format()); QCOMPARE(result, image); @@ -491,11 +487,6 @@ void tst_QPixmap::fill() else pm = QPixmap(400, 400); -#if 0 // Used to be included in Qt4 for Q_WS_X11 - if (!bitmap && pm.handle()->classId() == QPlatformPixmap::X11Class && !pm.x11PictureHandle()) - QSKIP("Requires XRender support"); -#endif - pm.fill(color); if (syscolor && !bitmap && pm.depth() < 24) { QSKIP("Test does not work on displays without true color"); @@ -521,10 +512,6 @@ void tst_QPixmap::fill() void tst_QPixmap::fill_transparent() { QPixmap pixmap(10, 10); -#if 0 // Used to be included in Qt4 for Q_WS_X11 - if (pixmap.handle()->classId() == QPlatformPixmap::X11Class && !pixmap.x11PictureHandle()) - QSKIP("Requires XRender support"); -#endif pixmap.fill(Qt::transparent); QVERIFY(pixmap.hasAlphaChannel()); } diff --git a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp index 90a216e14af..c1c231089a4 100644 --- a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp +++ b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp @@ -111,10 +111,6 @@ private slots: void qcolorprofile_data(); void qcolorprofile(); - -#if 0 // Used to be included in Qt4 for Q_WS_X11 - void setallowX11ColorNames(); -#endif }; // Testing get/set functions @@ -1460,62 +1456,6 @@ void tst_QColor::achromaticHslHue() QCOMPARE(hsl.hslHue(), -1); } -#if 0 // Used to be included in Qt4 for Q_WS_X11 -void tst_QColor::setallowX11ColorNames() -{ - RGBData x11RgbTbl[] = { - // a few standard X11 color names - { "DodgerBlue1", qRgb(30, 144, 255) }, - { "DodgerBlue2", qRgb(28, 134, 238) }, - { "DodgerBlue3", qRgb(24, 116, 205) }, - { "DodgerBlue4", qRgb(16, 78, 139) }, - { "SteelBlue1", qRgb(99, 184, 255) }, - { "SteelBlue2", qRgb(92, 172, 238) }, - { "SteelBlue3", qRgb(79, 148, 205) }, - { "SteelBlue4", qRgb(54, 100, 139) }, - { "DeepSkyBlue1", qRgb(0, 191, 255) }, - { "DeepSkyBlue2", qRgb(0, 178, 238) }, - { "DeepSkyBlue3", qRgb(0, 154, 205) }, - { "DeepSkyBlue4", qRgb(0, 104, 139) }, - { "SkyBlue1", qRgb(135, 206, 255) }, - { "SkyBlue2", qRgb(126, 192, 238) }, - { "SkyBlue3", qRgb(108, 166, 205) }, - { "SkyBlue4", qRgb(74, 112, 139) } - }; - static const int x11RgbTblSize = sizeof(x11RgbTbl) / sizeof(RGBData); - - // X11 color names should not work by default - QVERIFY(!QColor::allowX11ColorNames()); - for (int i = 0; i < x11RgbTblSize; ++i) { - QString colorName = QLatin1String(x11RgbTbl[i].name); - QColor color; - color.setNamedColor(colorName); - QVERIFY(!color.isValid()); - } - - // enable X11 color names - QColor::setAllowX11ColorNames(true); - QVERIFY(QColor::allowX11ColorNames()); - for (int i = 0; i < x11RgbTblSize; ++i) { - QString colorName = QLatin1String(x11RgbTbl[i].name); - QColor color; - color.setNamedColor(colorName); - QColor expected(x11RgbTbl[i].value); - QCOMPARE(color, expected); - } - - // should be able to turn off X11 color names - QColor::setAllowX11ColorNames(false); - QVERIFY(!QColor::allowX11ColorNames()); - for (int i = 0; i < x11RgbTblSize; ++i) { - QString colorName = QLatin1String(x11RgbTbl[i].name); - QColor color; - color.setNamedColor(colorName); - QVERIFY(!color.isValid()); - } -} -#endif - void tst_QColor::premultiply() { // Tests that qPremultiply(qUnpremultiply(x)) returns x. diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp index 0efeb9b356f..4cf23455e1d 100644 --- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp +++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp @@ -461,11 +461,6 @@ void tst_QPainter::drawPixmap_comp() destPm.fill(c1); srcPm.fill(c2); -#if 0 // Used to be included in Qt4 for Q_WS_X11 - if (!destPm.x11PictureHandle()) - QSKIP("Requires XRender support"); -#endif - QPainter p(&destPm); p.drawPixmap(0, 0, srcPm); p.end(); diff --git a/tests/auto/gui/painting/qregion/tst_qregion.cpp b/tests/auto/gui/painting/qregion/tst_qregion.cpp index 24c45838197..d1ea7706b97 100644 --- a/tests/auto/gui/painting/qregion/tst_qregion.cpp +++ b/tests/auto/gui/painting/qregion/tst_qregion.cpp @@ -33,9 +33,6 @@ #include #include #include -#if 0 // Used to be included in Qt4 for Q_WS_X11 -#include -#endif class tst_QRegion : public QObject { @@ -79,9 +76,6 @@ private slots: void isEmpty_data(); void isEmpty(); -#if 0 /* Used to be included in Qt4 for Q_WS_X11 */ && defined(QT_BUILD_INTERNAL) - void clipRectangles(); -#endif void regionFromPath(); void scaleRegions_data(); @@ -910,24 +904,6 @@ void tst_QRegion::isEmpty() #endif } -#if 0 /* Used to be included in Qt4 for Q_WS_X11 */ && defined(QT_BUILD_INTERNAL) -void tst_QRegion::clipRectangles() -{ - QRegion region(30, 30, 30, 30); - int num = 0; - qt_getClipRects(region, num); - QCOMPARE(num, 1); - - region += QRegion(10, 10, 10, 10); - XRectangle *rects2 = static_cast(qt_getClipRects(region, num)); - QCOMPARE(num, 2); - - // Here's the important part (Y-sorted): - QCOMPARE(int(rects2[0].y), 10); - QCOMPARE(int(rects2[1].y), 30); -} -#endif - void tst_QRegion::regionFromPath() { { diff --git a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp index 8a38d0f5171..e12f6d9c188 100644 --- a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp +++ b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp @@ -606,9 +606,6 @@ void tst_QGLThreads::painterOnPixmapInThread() if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ThreadedOpenGL) || !QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ThreadedPixmaps)) QSKIP("No platformsupport for ThreadedOpenGL or ThreadedPixmaps"); -#if 0 // Used to be included in Qt4 for Q_WS_X11 - QSKIP("Drawing text in threads onto X11 drawables currently crashes on some X11 servers."); -#endif PaintThreadManager painterThreads(5); painterThreads.start(); diff --git a/tests/auto/other/lancelot/paintcommands.cpp b/tests/auto/other/lancelot/paintcommands.cpp index dc71253f3ed..032580e0f63 100644 --- a/tests/auto/other/lancelot/paintcommands.cpp +++ b/tests/auto/other/lancelot/paintcommands.cpp @@ -2477,12 +2477,6 @@ void PaintCommands::command_surface_begin(QRegularExpressionMatch re) m_painter->setCompositionMode(QPainter::CompositionMode_Clear); m_painter->fillRect(QRect(0, 0, qRound(w), qRound(h)), Qt::transparent); m_painter->restore(); -#endif -#if 0 // Used to be included in Qt4 for Q_WS_X11 - } else if (m_type == WidgetType) { - m_surface_pixmap = QPixmap(qRound(w), qRound(h)); - m_surface_pixmap.fill(Qt::transparent); - m_painter = new QPainter(&m_surface_pixmap); #endif } else { QImage::Format surface_format; @@ -2534,11 +2528,6 @@ void PaintCommands::command_surface_end(QRegularExpressionMatch) // Flush the pipeline: m_painter->beginNativePainting(); m_painter->endNativePainting(); -#endif -#if 0 // Used to be included in Qt4 for Q_WS_X11 - } else if (m_type == WidgetType) { - m_painter->drawPixmap(m_surface_rect.topLeft(), m_surface_pixmap); - m_surface_pixmap = QPixmap(); #endif } else { m_painter->drawImage(m_surface_rect, m_surface_image); diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp index 39aa65a4789..a437b054792 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp @@ -2768,9 +2768,6 @@ void tst_QGraphicsProxyWidget::windowOpacity() // disabled on platforms without alpha channel support in QPixmap (e.g., // X11 without XRender). int paints = 0; -#if 0 // Used to be included in Qt4 for Q_WS_X11 - paints = !X11->use_xrender; -#endif QTRY_COMPARE(eventSpy.counts[QEvent::UpdateRequest], 0); QTRY_COMPARE(eventSpy.counts[QEvent::Paint], paints); diff --git a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp index 6f7dca86ebc..bcfc4777336 100644 --- a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp +++ b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp @@ -1024,9 +1024,6 @@ void tst_QAbstractItemView::setItemDelegate() centerOnScreen(&v); moveCursorAway(&v); v.show(); -#if 0 // Used to be included in Qt4 for Q_WS_X11 - QCursor::setPos(v.geometry().center()); -#endif QApplication::setActiveWindow(&v); QVERIFY(QTest::qWaitForWindowActive(&v)); diff --git a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp index b8abd78657a..6d38dc262fb 100644 --- a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp +++ b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp @@ -479,9 +479,6 @@ void tst_QMdiArea::subWindowActivated2() // Check that we only emit _one_ signal and the active window // is unchanged after hide/show. mdiArea.hide(); -#if 0 // Used to be included in Qt4 for Q_WS_X11 - qt_x11_wait_for_window_manager(&mdiArea); -#endif QTest::qWait(100); QTRY_COMPARE(spy.count(), 1); QVERIFY(!mdiArea.activeSubWindow()); diff --git a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp index b8891fab953..3ee9c722094 100644 --- a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp +++ b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp @@ -52,9 +52,7 @@ #include QT_BEGIN_NAMESPACE -#if 1 // Used to be excluded in Qt4 for Q_WS_WIN extern bool qt_tab_all_widgets(); -#endif QT_END_NAMESPACE static inline bool tabAllWidgets() diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/view.cpp b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/view.cpp index de4e9e5ad71..6e0ac445a69 100644 --- a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/view.cpp +++ b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/view.cpp @@ -30,12 +30,7 @@ #include -#if 0 // Used to be included in Qt4 for Q_WS_WIN -#define CALLGRIND_START_INSTRUMENTATION {} -#define CALLGRIND_STOP_INSTRUMENTATION {} -#else #include "valgrind/callgrind.h" -#endif #ifndef QT_NO_OPENGL #include diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/moveItems/main.cpp b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/moveItems/main.cpp index e0cc0f8eb49..140278b8f6f 100644 --- a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/moveItems/main.cpp +++ b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/moveItems/main.cpp @@ -27,16 +27,7 @@ ****************************************************************************/ #include -#if 0 // Used to be included in Qt4 for Q_WS_WIN -#define CALLGRIND_START_INSTRUMENTATION {} -#define CALLGRIND_STOP_INSTRUMENTATION {} -#else #include "valgrind/callgrind.h" -#endif - -#if 0 // Used to be included in Qt4 for Q_WS_X11 -extern void qt_x11_wait_for_window_manager(QWidget *); -#endif class View : public QGraphicsView { @@ -89,9 +80,6 @@ int main(int argc, char *argv[]) View view(&scene, item); view.resize(300, 300); view.show(); -#if 0 // Used to be included in Qt4 for Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif return app.exec(); } diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/scrolltest/main.cpp b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/scrolltest/main.cpp index 1fbb229cd8a..566d16ca512 100644 --- a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/scrolltest/main.cpp +++ b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/scrolltest/main.cpp @@ -27,12 +27,7 @@ ****************************************************************************/ #include -#if 0 // Used to be included in Qt4 for Q_WS_WIN -#define CALLGRIND_START_INSTRUMENTATION {} -#define CALLGRIND_STOP_INSTRUMENTATION {} -#else #include "valgrind/callgrind.h" -#endif class ItemMover : public QObject { diff --git a/tests/manual/lance/main.cpp b/tests/manual/lance/main.cpp index 7f5af2d908f..6dc5e2076a6 100644 --- a/tests/manual/lance/main.cpp +++ b/tests/manual/lance/main.cpp @@ -334,20 +334,7 @@ int main(int argc, char **argv) checkers_background = false; } } else { -#if 0 // Used to be included in Qt4 for Q_WS_WIN - QString input = QString::fromLocal8Bit(argv[i]); - if (input.indexOf('*') >= 0) { - QFileInfo info(input); - QDir dir = info.dir(); - QFileInfoList infos = dir.entryInfoList(QStringList(info.fileName())); - for (int ii=0; ii