From d138a239d27b3f2d3b654b4768f8000bb2a555a1 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Fri, 23 Jun 2017 10:47:23 -0700 Subject: Fix current tab text color on Mac when a proxy style is installed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We move the code forcing white text on the current tab to QMacStyle. This removes the small encapsulation violation even though we need to check for the tab text color in the style and modify the palette. Amends 2fbc1432025dd478cf9e940e3c2a1952b218c6dc. Change-Id: If31dc11ae389ee5315e84ab03cf1c08540d81640 Reviewed-by: Błażej Szczygieł Reviewed-by: Jake Petroules --- src/widgets/widgets/qtabbar.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp index 060d1f9a03..4cd9522bfb 100644 --- a/src/widgets/widgets/qtabbar.cpp +++ b/src/widgets/widgets/qtabbar.cpp @@ -176,10 +176,6 @@ void QTabBarPrivate::initBasicStyleOption(QStyleOptionTab *option, int tabIndex) if (tab.textColor.isValid()) option->palette.setColor(q->foregroundRole(), tab.textColor); - else if (q->style()->inherits("QMacStyle") - && isCurrent && !documentMode && q->isActiveWindow()) { - option->palette.setColor(QPalette::WindowText, Qt::white); - } option->icon = tab.icon; option->iconSize = q->iconSize(); // Will get the default value then. -- cgit v1.2.3 From 5ede5706a8b8052280981aa1d9c42999a24b74b5 Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Tue, 30 May 2017 22:22:22 +0200 Subject: Convert features.wheelevent to QT_CONFIG Change-Id: I46083a9115c199d1ebe024ed5f64b160a27462f1 Reviewed-by: Oswald Buddenhagen --- src/widgets/widgets/qabstractbutton.cpp | 2 +- src/widgets/widgets/qabstractscrollarea.cpp | 4 ++-- src/widgets/widgets/qabstractscrollarea.h | 2 +- src/widgets/widgets/qabstractslider.cpp | 4 ++-- src/widgets/widgets/qabstractslider.h | 2 +- src/widgets/widgets/qabstractspinbox.cpp | 2 +- src/widgets/widgets/qabstractspinbox.h | 2 +- src/widgets/widgets/qcalendarwidget.cpp | 4 ++-- src/widgets/widgets/qcombobox.cpp | 2 +- src/widgets/widgets/qcombobox.h | 2 +- src/widgets/widgets/qdatetimeedit.cpp | 2 +- src/widgets/widgets/qdatetimeedit.h | 2 +- src/widgets/widgets/qmenu.cpp | 2 +- src/widgets/widgets/qmenu.h | 2 +- src/widgets/widgets/qplaintextedit.cpp | 2 +- src/widgets/widgets/qplaintextedit.h | 2 +- src/widgets/widgets/qscrollbar.cpp | 2 +- src/widgets/widgets/qscrollbar.h | 2 +- src/widgets/widgets/qtabbar.cpp | 4 ++-- src/widgets/widgets/qtabbar.h | 2 +- src/widgets/widgets/qtextedit.cpp | 2 +- src/widgets/widgets/qtextedit.h | 2 +- 22 files changed, 26 insertions(+), 26 deletions(-) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qabstractbutton.cpp b/src/widgets/widgets/qabstractbutton.cpp index 77fb203b82..e65613d5cd 100644 --- a/src/widgets/widgets/qabstractbutton.cpp +++ b/src/widgets/widgets/qabstractbutton.cpp @@ -935,7 +935,7 @@ bool QAbstractButton::event(QEvent *e) case QEvent::HoverEnter: case QEvent::HoverLeave: case QEvent::ContextMenu: -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) case QEvent::Wheel: #endif return true; diff --git a/src/widgets/widgets/qabstractscrollarea.cpp b/src/widgets/widgets/qabstractscrollarea.cpp index abdd946c49..673983d575 100644 --- a/src/widgets/widgets/qabstractscrollarea.cpp +++ b/src/widgets/widgets/qabstractscrollarea.cpp @@ -1188,7 +1188,7 @@ bool QAbstractScrollArea::viewportEvent(QEvent *e) case QEvent::TouchEnd: case QEvent::MouseMove: case QEvent::ContextMenu: -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) case QEvent::Wheel: #endif #ifndef QT_NO_DRAGANDDROP @@ -1305,7 +1305,7 @@ void QAbstractScrollArea::mouseMoveEvent(QMouseEvent *e) \sa QWidget::wheelEvent() */ -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void QAbstractScrollArea::wheelEvent(QWheelEvent *e) { Q_D(QAbstractScrollArea); diff --git a/src/widgets/widgets/qabstractscrollarea.h b/src/widgets/widgets/qabstractscrollarea.h index 476914b781..193fabce56 100644 --- a/src/widgets/widgets/qabstractscrollarea.h +++ b/src/widgets/widgets/qabstractscrollarea.h @@ -116,7 +116,7 @@ protected: void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE; void mouseDoubleClickEvent(QMouseEvent *) Q_DECL_OVERRIDE; void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE; -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void wheelEvent(QWheelEvent *) Q_DECL_OVERRIDE; #endif #ifndef QT_NO_CONTEXTMENU diff --git a/src/widgets/widgets/qabstractslider.cpp b/src/widgets/widgets/qabstractslider.cpp index 0ea9250695..99ee1eccb7 100644 --- a/src/widgets/widgets/qabstractslider.cpp +++ b/src/widgets/widgets/qabstractslider.cpp @@ -710,7 +710,7 @@ bool QAbstractSliderPrivate::scrollByDelta(Qt::Orientation orientation, Qt::Keyb // offset), we might end up with a fraction (e.g. scroll 1.3 lines). We can // only scroll whole lines, so we keep the reminder until next event. qreal stepsToScrollF = -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) QApplication::wheelScrollLines() * #endif offset * effectiveSingleStep(); @@ -759,7 +759,7 @@ bool QAbstractSliderPrivate::scrollByDelta(Qt::Orientation orientation, Qt::Keyb /*! \reimp */ -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void QAbstractSlider::wheelEvent(QWheelEvent * e) { Q_D(QAbstractSlider); diff --git a/src/widgets/widgets/qabstractslider.h b/src/widgets/widgets/qabstractslider.h index 8979685724..d26d6a879c 100644 --- a/src/widgets/widgets/qabstractslider.h +++ b/src/widgets/widgets/qabstractslider.h @@ -146,7 +146,7 @@ protected: void keyPressEvent(QKeyEvent *ev) Q_DECL_OVERRIDE; void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE; -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE; #endif void changeEvent(QEvent *e) Q_DECL_OVERRIDE; diff --git a/src/widgets/widgets/qabstractspinbox.cpp b/src/widgets/widgets/qabstractspinbox.cpp index 501d9560d9..4a3abe0c32 100644 --- a/src/widgets/widgets/qabstractspinbox.cpp +++ b/src/widgets/widgets/qabstractspinbox.cpp @@ -1119,7 +1119,7 @@ void QAbstractSpinBox::keyReleaseEvent(QKeyEvent *event) \reimp */ -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void QAbstractSpinBox::wheelEvent(QWheelEvent *event) { Q_D(QAbstractSpinBox); diff --git a/src/widgets/widgets/qabstractspinbox.h b/src/widgets/widgets/qabstractspinbox.h index b60178b94c..d81cbfdc34 100644 --- a/src/widgets/widgets/qabstractspinbox.h +++ b/src/widgets/widgets/qabstractspinbox.h @@ -137,7 +137,7 @@ protected: void resizeEvent(QResizeEvent *event) override; void keyPressEvent(QKeyEvent *event) override; void keyReleaseEvent(QKeyEvent *event) override; -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void wheelEvent(QWheelEvent *event) override; #endif void focusInEvent(QFocusEvent *event) override; diff --git a/src/widgets/widgets/qcalendarwidget.cpp b/src/widgets/widgets/qcalendarwidget.cpp index f81377a85c..c5db3a7c9a 100644 --- a/src/widgets/widgets/qcalendarwidget.cpp +++ b/src/widgets/widgets/qcalendarwidget.cpp @@ -957,7 +957,7 @@ protected: void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE; #endif void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE; @@ -1412,7 +1412,7 @@ void QCalendarView::keyPressEvent(QKeyEvent *event) QTableView::keyPressEvent(event); } -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void QCalendarView::wheelEvent(QWheelEvent *event) { const int numDegrees = event->delta() / 8; diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index 45dfffe8bd..5520e9d28f 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -3285,7 +3285,7 @@ void QComboBox::keyReleaseEvent(QKeyEvent *e) /*! \reimp */ -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void QComboBox::wheelEvent(QWheelEvent *e) { #ifdef Q_OS_DARWIN diff --git a/src/widgets/widgets/qcombobox.h b/src/widgets/widgets/qcombobox.h index 2da1ceb047..8f99594a76 100644 --- a/src/widgets/widgets/qcombobox.h +++ b/src/widgets/widgets/qcombobox.h @@ -234,7 +234,7 @@ protected: void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE; void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE; void keyReleaseEvent(QKeyEvent *e) Q_DECL_OVERRIDE; -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE; #endif #ifndef QT_NO_CONTEXTMENU diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp index 2e0a8a3cd7..e136363b17 100644 --- a/src/widgets/widgets/qdatetimeedit.cpp +++ b/src/widgets/widgets/qdatetimeedit.cpp @@ -1194,7 +1194,7 @@ void QDateTimeEdit::keyPressEvent(QKeyEvent *event) \reimp */ -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void QDateTimeEdit::wheelEvent(QWheelEvent *event) { QAbstractSpinBox::wheelEvent(event); diff --git a/src/widgets/widgets/qdatetimeedit.h b/src/widgets/widgets/qdatetimeedit.h index b54b0e7cf0..30e4a58bb3 100644 --- a/src/widgets/widgets/qdatetimeedit.h +++ b/src/widgets/widgets/qdatetimeedit.h @@ -177,7 +177,7 @@ public Q_SLOTS: protected: void keyPressEvent(QKeyEvent *event) override; -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void wheelEvent(QWheelEvent *event) override; #endif void focusInEvent(QFocusEvent *event) override; diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index 5732131578..95bb976566 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -2797,7 +2797,7 @@ void QMenu::paintEvent(QPaintEvent *e) style()->drawControl(QStyle::CE_MenuEmptyArea, &menuOpt, &p, this); } -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) /*! \reimp */ diff --git a/src/widgets/widgets/qmenu.h b/src/widgets/widgets/qmenu.h index e9a5db1112..9d1a17a5b3 100644 --- a/src/widgets/widgets/qmenu.h +++ b/src/widgets/widgets/qmenu.h @@ -237,7 +237,7 @@ protected: void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE; void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE; void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE; -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void wheelEvent(QWheelEvent *) Q_DECL_OVERRIDE; #endif void enterEvent(QEvent *) Q_DECL_OVERRIDE; diff --git a/src/widgets/widgets/qplaintextedit.cpp b/src/widgets/widgets/qplaintextedit.cpp index 746dc20122..173be7aa88 100644 --- a/src/widgets/widgets/qplaintextedit.cpp +++ b/src/widgets/widgets/qplaintextedit.cpp @@ -2296,7 +2296,7 @@ void QPlainTextEdit::changeEvent(QEvent *e) /*! \reimp */ -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void QPlainTextEdit::wheelEvent(QWheelEvent *e) { Q_D(QPlainTextEdit); diff --git a/src/widgets/widgets/qplaintextedit.h b/src/widgets/widgets/qplaintextedit.h index 432ec85a57..d773c4791c 100644 --- a/src/widgets/widgets/qplaintextedit.h +++ b/src/widgets/widgets/qplaintextedit.h @@ -250,7 +250,7 @@ protected: virtual void focusOutEvent(QFocusEvent *e) Q_DECL_OVERRIDE; virtual void showEvent(QShowEvent *) Q_DECL_OVERRIDE; virtual void changeEvent(QEvent *e) Q_DECL_OVERRIDE; -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) virtual void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE; #endif diff --git a/src/widgets/widgets/qscrollbar.cpp b/src/widgets/widgets/qscrollbar.cpp index 66f1a4c689..a98f3fe085 100644 --- a/src/widgets/widgets/qscrollbar.cpp +++ b/src/widgets/widgets/qscrollbar.cpp @@ -493,7 +493,7 @@ bool QScrollBar::event(QEvent *event) /*! \reimp */ -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void QScrollBar::wheelEvent(QWheelEvent *event) { event->ignore(); diff --git a/src/widgets/widgets/qscrollbar.h b/src/widgets/widgets/qscrollbar.h index b99ad219eb..963ae4263b 100644 --- a/src/widgets/widgets/qscrollbar.h +++ b/src/widgets/widgets/qscrollbar.h @@ -64,7 +64,7 @@ public: bool event(QEvent *event) Q_DECL_OVERRIDE; protected: -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void wheelEvent(QWheelEvent *) Q_DECL_OVERRIDE; #endif void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE; diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp index 4cd9522bfb..b9020253a5 100644 --- a/src/widgets/widgets/qtabbar.cpp +++ b/src/widgets/widgets/qtabbar.cpp @@ -2181,7 +2181,7 @@ void QTabBar::keyPressEvent(QKeyEvent *event) /*!\reimp */ -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void QTabBar::wheelEvent(QWheelEvent *event) { #ifndef Q_OS_MAC @@ -2193,7 +2193,7 @@ void QTabBar::wheelEvent(QWheelEvent *event) Q_UNUSED(event) #endif } -#endif //QT_NO_WHEELEVENT +#endif // QT_CONFIG(wheelevent) void QTabBarPrivate::setCurrentNextEnabledIndex(int offset) { diff --git a/src/widgets/widgets/qtabbar.h b/src/widgets/widgets/qtabbar.h index 71ca58c993..c7d9f95d93 100644 --- a/src/widgets/widgets/qtabbar.h +++ b/src/widgets/widgets/qtabbar.h @@ -203,7 +203,7 @@ protected: void mousePressEvent (QMouseEvent *) Q_DECL_OVERRIDE; void mouseMoveEvent (QMouseEvent *) Q_DECL_OVERRIDE; void mouseReleaseEvent (QMouseEvent *) Q_DECL_OVERRIDE; -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE; #endif void keyPressEvent(QKeyEvent *) Q_DECL_OVERRIDE; diff --git a/src/widgets/widgets/qtextedit.cpp b/src/widgets/widgets/qtextedit.cpp index 1abc9bef8e..6973cec429 100644 --- a/src/widgets/widgets/qtextedit.cpp +++ b/src/widgets/widgets/qtextedit.cpp @@ -1831,7 +1831,7 @@ void QTextEdit::changeEvent(QEvent *e) /*! \reimp */ -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void QTextEdit::wheelEvent(QWheelEvent *e) { Q_D(QTextEdit); diff --git a/src/widgets/widgets/qtextedit.h b/src/widgets/widgets/qtextedit.h index b0e19193a9..745b644511 100644 --- a/src/widgets/widgets/qtextedit.h +++ b/src/widgets/widgets/qtextedit.h @@ -288,7 +288,7 @@ protected: virtual void focusOutEvent(QFocusEvent *e) Q_DECL_OVERRIDE; virtual void showEvent(QShowEvent *) Q_DECL_OVERRIDE; virtual void changeEvent(QEvent *e) Q_DECL_OVERRIDE; -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) virtual void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE; #endif -- cgit v1.2.3 From 6e9d24212db60743f13497f942713961d6601844 Mon Sep 17 00:00:00 2001 From: Oleg Yadrov Date: Fri, 16 Jun 2017 17:06:53 -0400 Subject: QTabBar: fix expanded tabs appearance Fix regression introduced by 175f33ed8. 'expanding' property set to true was ignored when QStyle::styleHint() returned Qt::AlignRight for SH_TabBar_Alignment. When we calculate tabs geometry, we put an empty tab at the front and back and set its expansive attribute depending on tab alignment AND 'expanding' property. Task-number: QTBUG-61480 Change-Id: I6a1827ae8a3f2c6bee5124c18c7f2b1c0a7862f3 Reviewed-by: Gabriel de Dietrich --- src/widgets/widgets/qtabbar.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp index b9020253a5..85bc9a4a09 100644 --- a/src/widgets/widgets/qtabbar.cpp +++ b/src/widgets/widgets/qtabbar.cpp @@ -447,9 +447,10 @@ void QTabBarPrivate::layoutTabs() QVector tabChain(tabList.count() + 2); // We put an empty item at the front and back and set its expansive attribute - // depending on tabAlignment. + // depending on tabAlignment and expanding. tabChain[tabChainIndex].init(); - tabChain[tabChainIndex].expansive = (tabAlignment != Qt::AlignLeft) + tabChain[tabChainIndex].expansive = (!expanding) + && (tabAlignment != Qt::AlignLeft) && (tabAlignment != Qt::AlignJustify); tabChain[tabChainIndex].empty = true; ++tabChainIndex; @@ -514,13 +515,12 @@ void QTabBarPrivate::layoutTabs() maxExtent = maxWidth; } - if (!expanding) { - // Mirror our front item. - tabChain[tabChainIndex].init(); - tabChain[tabChainIndex].expansive = (tabAlignment != Qt::AlignRight) - && (tabAlignment != Qt::AlignJustify); - tabChain[tabChainIndex].empty = true; - } + // Mirror our front item. + tabChain[tabChainIndex].init(); + tabChain[tabChainIndex].expansive = (!expanding) + && (tabAlignment != Qt::AlignRight) + && (tabAlignment != Qt::AlignJustify); + tabChain[tabChainIndex].empty = true; Q_ASSERT(tabChainIndex == tabChain.count() - 1); // add an assert just to make sure. // Do the calculation -- cgit v1.2.3 From 150ee7f4f1fb6280aa7fd8c15b6d72d806c0f68c Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Sat, 10 Jun 2017 07:09:50 +0200 Subject: Convert features.whatsthis to QT_[REQUIRE_]CONFIG Move feature definition to gui/configure.json Change-Id: I00b35c0e259d0a695d84a9bf6803eba74d41465a Reviewed-by: Oswald Buddenhagen --- src/widgets/widgets/qlineedit.cpp | 1 - src/widgets/widgets/qmdisubwindow.cpp | 4 +++- src/widgets/widgets/qmenu.cpp | 16 ++++++++-------- src/widgets/widgets/qmenubar.cpp | 6 ++++-- src/widgets/widgets/qtabbar.cpp | 10 ++++++---- src/widgets/widgets/qtabbar.h | 2 +- src/widgets/widgets/qtabbar_p.h | 2 +- src/widgets/widgets/qtabwidget.cpp | 4 ++-- src/widgets/widgets/qtabwidget.h | 2 +- src/widgets/widgets/qtextbrowser.cpp | 4 +++- src/widgets/widgets/qtoolbutton.cpp | 2 +- 11 files changed, 30 insertions(+), 23 deletions(-) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp index 7e24704de3..863c1e9bbe 100644 --- a/src/widgets/widgets/qlineedit.cpp +++ b/src/widgets/widgets/qlineedit.cpp @@ -60,7 +60,6 @@ #include "qvalidator.h" #include "qvariant.h" #include "qvector.h" -#include "qwhatsthis.h" #include "qdebug.h" #include "qtextedit.h" #include diff --git a/src/widgets/widgets/qmdisubwindow.cpp b/src/widgets/widgets/qmdisubwindow.cpp index a8cdca1719..b4f2c97e04 100644 --- a/src/widgets/widgets/qmdisubwindow.cpp +++ b/src/widgets/widgets/qmdisubwindow.cpp @@ -153,7 +153,9 @@ #include #include #include +#if QT_CONFIG(whatsthis) #include +#endif #include #include #include @@ -1490,7 +1492,7 @@ void QMdiSubWindowPrivate::processClickedSubControl() Q_Q(QMdiSubWindow); switch (activeSubControl) { case QStyle::SC_TitleBarContextHelpButton: -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) QWhatsThis::enterWhatsThisMode(); #endif break; diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index 95bb976566..0b874cb09a 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -59,7 +59,7 @@ #ifndef QT_NO_EFFECTS # include #endif -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) # include #endif @@ -187,7 +187,7 @@ private: void QMenuPrivate::init() { Q_Q(QMenu); -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) q->setAttribute(Qt::WA_CustomWhatsThis); #endif q->setAttribute(Qt::WA_X11NetWmWindowTypePopupMenu); @@ -1327,12 +1327,12 @@ void QMenuPrivate::activateCausedStack(const QVector > &caused void QMenuPrivate::activateAction(QAction *action, QAction::ActionEvent action_e, bool self) { Q_Q(QMenu); -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) bool inWhatsThisMode = QWhatsThis::inWhatsThisMode(); #endif if (!action || !q->isEnabled() || (action_e == QAction::Trigger -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) && !inWhatsThisMode #endif && (action->isSeparator() ||!action->isEnabled()))) @@ -1343,7 +1343,7 @@ void QMenuPrivate::activateAction(QAction *action, QAction::ActionEvent action_e */ const QVector > causedStack = calcCausedStack(); if (action_e == QAction::Trigger) { -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) if (!inWhatsThisMode) actionAboutToTrigger = action; #endif @@ -1362,7 +1362,7 @@ void QMenuPrivate::activateAction(QAction *action, QAction::ActionEvent action_e } } -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) if (inWhatsThisMode) { QString s = action->whatsThis(); if (s.isEmpty()) @@ -2971,7 +2971,7 @@ QMenu::event(QEvent *e) } break; #endif // QT_NO_TOOLTIP -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) case QEvent::QueryWhatsThis: e->setAccepted(d->whatsThis.size()); if (QAction *action = d->actionAt(static_cast(e)->pos())) { @@ -3233,7 +3233,7 @@ void QMenu::keyPressEvent(QKeyEvent *e) key_consumed = true; break; } -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) case Qt::Key_F1: if (!d->currentAction || d->currentAction->whatsThis().isNull()) break; diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp index c16b2a5ac1..8ec2a3ed94 100644 --- a/src/widgets/widgets/qmenubar.cpp +++ b/src/widgets/widgets/qmenubar.cpp @@ -52,7 +52,9 @@ #include #include #include +#if QT_CONFIG(whatsthis) #include +#endif #include #include "private/qguiapplication_p.h" #include "qpa/qplatformintegration.h" @@ -1013,7 +1015,7 @@ void QMenuBar::mousePressEvent(QMouseEvent *e) QAction *action = d->actionAt(e->pos()); if (!action || !d->isVisible(action) || !action->isEnabled()) { d->setCurrentAction(0); -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) if (QWhatsThis::inWhatsThisMode()) QWhatsThis::showText(e->globalPos(), d->whatsThis, this); #endif @@ -1432,7 +1434,7 @@ bool QMenuBar::event(QEvent *e) } break; #endif -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) case QEvent::QueryWhatsThis: e->setAccepted(d->whatsThis.size()); if (QAction *action = d->actionAt(static_cast(e)->pos())) { diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp index 85bc9a4a09..9e803f4388 100644 --- a/src/widgets/widgets/qtabbar.cpp +++ b/src/widgets/widgets/qtabbar.cpp @@ -49,7 +49,9 @@ #include "qstylepainter.h" #include "qtabwidget.h" #include "qtooltip.h" +#if QT_CONFIG(whatsthis) #include "qwhatsthis.h" +#endif #include "private/qtextengine_p.h" #ifndef QT_NO_ACCESSIBILITY #include "qaccessible.h" @@ -1220,7 +1222,7 @@ QString QTabBar::tabToolTip(int index) const } #endif // QT_NO_TOOLTIP -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) /*! \since 4.1 @@ -1248,7 +1250,7 @@ QString QTabBar::tabWhatsThis(int index) const return QString(); } -#endif // QT_NO_WHATSTHIS +#endif // QT_CONFIG(whatsthis) /*! Sets the data of the tab at position \a index to \a data. @@ -1628,7 +1630,7 @@ bool QTabBar::event(QEvent *event) } } #endif // QT_NO_TOOLTIP -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) } else if (event->type() == QEvent::QueryWhatsThis) { const QTabBarPrivate::Tab *tab = d->at(d->indexAtPos(static_cast(event)->pos())); if (!tab || tab->whatsThis.isEmpty()) @@ -1642,7 +1644,7 @@ bool QTabBar::event(QEvent *event) return true; } } -#endif // QT_NO_WHATSTHIS +#endif // QT_CONFIG(whatsthis) #ifndef QT_NO_SHORTCUT } else if (event->type() == QEvent::Shortcut) { QShortcutEvent *se = static_cast(event); diff --git a/src/widgets/widgets/qtabbar.h b/src/widgets/widgets/qtabbar.h index c7d9f95d93..2a27a98661 100644 --- a/src/widgets/widgets/qtabbar.h +++ b/src/widgets/widgets/qtabbar.h @@ -123,7 +123,7 @@ public: QString tabToolTip(int index) const; #endif -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) void setTabWhatsThis(int index, const QString &text); QString tabWhatsThis(int index) const; #endif diff --git a/src/widgets/widgets/qtabbar_p.h b/src/widgets/widgets/qtabbar_p.h index 7c653a95e9..354c2fc05a 100644 --- a/src/widgets/widgets/qtabbar_p.h +++ b/src/widgets/widgets/qtabbar_p.h @@ -118,7 +118,7 @@ public: #ifndef QT_NO_TOOLTIP QString toolTip; #endif -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) QString whatsThis; #endif QIcon icon; diff --git a/src/widgets/widgets/qtabwidget.cpp b/src/widgets/widgets/qtabwidget.cpp index 7c75f859ed..c84c78275d 100644 --- a/src/widgets/widgets/qtabwidget.cpp +++ b/src/widgets/widgets/qtabwidget.cpp @@ -1163,7 +1163,7 @@ QString QTabWidget::tabToolTip(int index) const } #endif // QT_NO_TOOLTIP -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) /*! \since 4.1 @@ -1187,7 +1187,7 @@ QString QTabWidget::tabWhatsThis(int index) const Q_D(const QTabWidget); return d->tabs->tabWhatsThis(index); } -#endif // QT_NO_WHATSTHIS +#endif // QT_CONFIG(whatsthis) /*! This virtual handler is called after a new tab was added or diff --git a/src/widgets/widgets/qtabwidget.h b/src/widgets/widgets/qtabwidget.h index 59fcea223f..7d8864241a 100644 --- a/src/widgets/widgets/qtabwidget.h +++ b/src/widgets/widgets/qtabwidget.h @@ -94,7 +94,7 @@ public: QString tabToolTip(int index) const; #endif -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) void setTabWhatsThis(int index, const QString &text); QString tabWhatsThis(int index) const; #endif diff --git a/src/widgets/widgets/qtextbrowser.cpp b/src/widgets/widgets/qtextbrowser.cpp index df92fc0e1e..902a6afb8a 100644 --- a/src/widgets/widgets/qtextbrowser.cpp +++ b/src/widgets/widgets/qtextbrowser.cpp @@ -52,7 +52,9 @@ #include #include #include +#if QT_CONFIG(whatsthis) #include +#endif #include #include @@ -307,7 +309,7 @@ void QTextBrowserPrivate::setSource(const QUrl &url) #ifndef QT_NO_CURSOR QApplication::restoreOverrideCursor(); #endif -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) QWhatsThis::showText(QCursor::pos(), txt, q); #endif return; diff --git a/src/widgets/widgets/qtoolbutton.cpp b/src/widgets/widgets/qtoolbutton.cpp index 80a061e6d5..1d06f57d7b 100644 --- a/src/widgets/widgets/qtoolbutton.cpp +++ b/src/widgets/widgets/qtoolbutton.cpp @@ -922,7 +922,7 @@ void QToolButton::setDefaultAction(QAction *action) #ifndef QT_NO_STATUSTIP setStatusTip(action->statusTip()); #endif -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) setWhatsThis(action->whatsThis()); #endif #ifndef QT_NO_MENU -- cgit v1.2.3 From bf6f91e527e0fec49a8cd82eb4b9a55ff3db6d98 Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Mon, 12 Jun 2017 08:44:53 +0200 Subject: Convert features.statustip to QT_CONFIG Change-Id: Ic719ab93ed1802fcc713885ad0421cb44c7a998b Reviewed-by: Oswald Buddenhagen --- src/widgets/widgets/qmainwindow.cpp | 4 ++-- src/widgets/widgets/qmenu.cpp | 2 +- src/widgets/widgets/qmenubar.cpp | 4 ++-- src/widgets/widgets/qtoolbutton.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp index c9349ac72d..2cc7ce35da 100644 --- a/src/widgets/widgets/qmainwindow.cpp +++ b/src/widgets/widgets/qmainwindow.cpp @@ -1498,7 +1498,7 @@ bool QMainWindow::event(QEvent *event) } #endif -#ifndef QT_NO_STATUSTIP +#if QT_CONFIG(statustip) case QEvent::StatusTip: #ifndef QT_NO_STATUSBAR if (QStatusBar *sb = d->layout->statusBar()) @@ -1507,7 +1507,7 @@ bool QMainWindow::event(QEvent *event) #endif static_cast(event)->ignore(); return true; -#endif // QT_NO_STATUSTIP +#endif // QT_CONFIG(statustip) case QEvent::StyleChange: #ifndef QT_NO_DOCKWIDGET diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index 0b874cb09a..167a10efc3 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -657,7 +657,7 @@ void QMenuPrivate::setCurrentAction(QAction *action, int popup, SelectionReason } } } -#ifndef QT_NO_STATUSTIP +#if QT_CONFIG(statustip) } else if (previousAction) { previousAction->d_func()->showStatusText(topCausedWidget(), QString()); #endif diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp index 8ec2a3ed94..552409a4ed 100644 --- a/src/widgets/widgets/qmenubar.cpp +++ b/src/widgets/widgets/qmenubar.cpp @@ -378,7 +378,7 @@ void QMenuBarPrivate::setCurrentAction(QAction *action, bool popup, bool activat q->update(actionRect(currentAction)); popupState = popup; -#ifndef QT_NO_STATUSTIP +#if QT_CONFIG(statustip) QAction *previousAction = currentAction; #endif currentAction = action; @@ -387,7 +387,7 @@ void QMenuBarPrivate::setCurrentAction(QAction *action, bool popup, bool activat if(popup) popupAction(action, activateFirst); q->update(actionRect(action)); -#ifndef QT_NO_STATUSTIP +#if QT_CONFIG(statustip) } else if (previousAction) { QString empty; QStatusTipEvent tip(empty); diff --git a/src/widgets/widgets/qtoolbutton.cpp b/src/widgets/widgets/qtoolbutton.cpp index 1d06f57d7b..13595575e6 100644 --- a/src/widgets/widgets/qtoolbutton.cpp +++ b/src/widgets/widgets/qtoolbutton.cpp @@ -919,7 +919,7 @@ void QToolButton::setDefaultAction(QAction *action) #ifndef QT_NO_TOOLTIP setToolTip(action->toolTip()); #endif -#ifndef QT_NO_STATUSTIP +#if QT_CONFIG(statustip) setStatusTip(action->statusTip()); #endif #if QT_CONFIG(whatsthis) -- cgit v1.2.3 From 3aed1fccda2e3bcc0d8328543ef511b411b230d6 Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Tue, 30 May 2017 21:25:32 +0200 Subject: Convert features.fontcombobox to QT_[REQUIRE_]CONFIG Change-Id: I98f85cdb3b1c1ceae010362a5d5747d62ba62a22 Reviewed-by: Oswald Buddenhagen --- src/widgets/widgets/qfontcombobox.cpp | 4 ---- src/widgets/widgets/qfontcombobox.h | 4 +--- src/widgets/widgets/widgets.pri | 7 +++++-- 3 files changed, 6 insertions(+), 9 deletions(-) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qfontcombobox.cpp b/src/widgets/widgets/qfontcombobox.cpp index 9bd33409ae..f206d01999 100644 --- a/src/widgets/widgets/qfontcombobox.cpp +++ b/src/widgets/widgets/qfontcombobox.cpp @@ -39,8 +39,6 @@ #include "qfontcombobox.h" -#ifndef QT_NO_FONTCOMBOBOX - #include #include #include @@ -563,5 +561,3 @@ QT_END_NAMESPACE #include "qfontcombobox.moc" #include "moc_qfontcombobox.cpp" - -#endif // QT_NO_FONTCOMBOBOX diff --git a/src/widgets/widgets/qfontcombobox.h b/src/widgets/widgets/qfontcombobox.h index 983d5224dd..1e4555ce2d 100644 --- a/src/widgets/widgets/qfontcombobox.h +++ b/src/widgets/widgets/qfontcombobox.h @@ -44,11 +44,10 @@ #include #include -#ifndef QT_NO_FONTCOMBOBOX +QT_REQUIRE_CONFIG(fontcombobox); QT_BEGIN_NAMESPACE - class QFontComboBoxPrivate; class Q_WIDGETS_EXPORT QFontComboBox : public QComboBox @@ -101,5 +100,4 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QFontComboBox::FontFilters) QT_END_NAMESPACE -#endif // QT_NO_FONTCOMBOBOX #endif diff --git a/src/widgets/widgets/widgets.pri b/src/widgets/widgets/widgets.pri index 1779c8d183..726235ef4e 100644 --- a/src/widgets/widgets/widgets.pri +++ b/src/widgets/widgets/widgets.pri @@ -14,7 +14,6 @@ HEADERS += \ widgets/qdockwidget.h \ widgets/qdockwidget_p.h \ widgets/qdockarealayout_p.h \ - widgets/qfontcombobox.h \ widgets/qframe.h \ widgets/qframe_p.h \ widgets/qgroupbox.h \ @@ -78,7 +77,6 @@ SOURCES += \ widgets/qdockwidget.cpp \ widgets/qdockarealayout.cpp \ widgets/qeffects.cpp \ - widgets/qfontcombobox.cpp \ widgets/qframe.cpp \ widgets/qgroupbox.cpp \ widgets/qkeysequenceedit.cpp \ @@ -152,6 +150,11 @@ qtConfig(commandlinkbutton) { widgets/qcommandlinkbutton.cpp } +qtConfig(fontcombobox) { + HEADERS += widgets/qfontcombobox.h + SOURCES += widgets/qfontcombobox.cpp +} + qtConfig(label) { HEADERS += \ widgets/qlabel.h \ -- cgit v1.2.3