diff options
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/accessible/qaccessiblewidgetfactory.cpp | 9 | ||||
-rw-r--r-- | src/widgets/accessible/widgets.pro | 10 | ||||
-rw-r--r-- | src/widgets/dialogs/qcolordialog.cpp | 15 | ||||
-rw-r--r-- | src/widgets/dialogs/qwizard_win.cpp | 12 | ||||
-rw-r--r-- | src/widgets/itemviews/qlistview.cpp | 7 | ||||
-rw-r--r-- | src/widgets/itemviews/qlistview_p.h | 2 | ||||
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 137 | ||||
-rw-r--r-- | src/widgets/kernel/qapplication_p.h | 5 | ||||
-rw-r--r-- | src/widgets/kernel/qgesturemanager.cpp | 4 | ||||
-rw-r--r-- | src/widgets/styles/qmacstyle_mac.mm | 5 | ||||
-rw-r--r-- | src/widgets/styles/qwindowsxpstyle_p_p.h | 12 | ||||
-rw-r--r-- | src/widgets/util/qcompleter_p.h | 2 | ||||
-rw-r--r-- | src/widgets/util/qsystemtrayicon_win.cpp | 7 | ||||
-rw-r--r-- | src/widgets/widgets.pro | 9 | ||||
-rw-r--r-- | src/widgets/widgets/qcalendarwidget.cpp | 6 | ||||
-rw-r--r-- | src/widgets/widgets/qmenubar.cpp | 3 |
16 files changed, 138 insertions, 107 deletions
diff --git a/src/widgets/accessible/qaccessiblewidgetfactory.cpp b/src/widgets/accessible/qaccessiblewidgetfactory.cpp index d0627f31a7..3bfef49965 100644 --- a/src/widgets/accessible/qaccessiblewidgetfactory.cpp +++ b/src/widgets/accessible/qaccessiblewidgetfactory.cpp @@ -39,6 +39,7 @@ #include "qaccessiblewidgets_p.h" #include "qaccessiblemenu_p.h" +#include "private/qwidget_p.h" #include "simplewidgets_p.h" #include "rangecontrols_p.h" #include "complexwidgets_p.h" @@ -59,7 +60,15 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje QAccessibleInterface *iface = 0; if (!object || !object->isWidgetType()) return iface; + QWidget *widget = static_cast<QWidget*>(object); + // QWidget emits destroyed() from its destructor instead of letting the QObject + // destructor do it, which means the QWidget is unregistered from the accessibillity + // cache. But QWidget destruction also emits enter and leave events, which may end + // up here, so we have to ensure that we don't fill the cache with an entry of + // a widget that is going away. + if (QWidgetPrivate::get(widget)->data.in_destructor) + return iface; if (false) { #ifndef QT_NO_LINEEDIT diff --git a/src/widgets/accessible/widgets.pro b/src/widgets/accessible/widgets.pro index c6af6d3f71..da8607c637 100644 --- a/src/widgets/accessible/widgets.pro +++ b/src/widgets/accessible/widgets.pro @@ -1,10 +1,5 @@ TARGET = qtaccessiblewidgets -PLUGIN_TYPE = accessible -PLUGIN_EXTENDS = widgets -PLUGIN_CLASS_NAME = AccessibleFactory -load(qt_plugin) - QT += core-private gui-private widgets-private QTDIR_build:REQUIRES += "contains(QT_CONFIG, accessibility)" @@ -24,4 +19,7 @@ HEADERS += qaccessiblewidgets.h \ qaccessiblemenu.h \ itemviews.h - +PLUGIN_TYPE = accessible +PLUGIN_EXTENDS = widgets +PLUGIN_CLASS_NAME = AccessibleFactory +load(qt_plugin) diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp index 9f86bea0ca..98f1f4870d 100644 --- a/src/widgets/dialogs/qcolordialog.cpp +++ b/src/widgets/dialogs/qcolordialog.cpp @@ -196,7 +196,6 @@ public: QSize sizeHint() const Q_DECL_OVERRIDE; virtual void setCellBrush(int row, int col, const QBrush &); - QBrush cellBrush(int row, int col); inline int cellWidth() const { return cellw; } @@ -465,20 +464,6 @@ void QWellArray::setCellBrush(int row, int col, const QBrush &b) d->brush[row*numCols()+col] = b; } -/* - Returns the brush set for the cell at \a row, \a column. If no brush is - set, Qt::NoBrush is returned. -*/ - -QBrush QWellArray::cellBrush(int row, int col) -{ - if (d && row >= 0 && row < numRows() && col >= 0 && col < numCols()) - return d->brush[row*numCols()+col]; - return Qt::NoBrush; -} - - - /*!\reimp */ diff --git a/src/widgets/dialogs/qwizard_win.cpp b/src/widgets/dialogs/qwizard_win.cpp index 93381ce7b0..8bc5ba7f56 100644 --- a/src/widgets/dialogs/qwizard_win.cpp +++ b/src/widgets/dialogs/qwizard_win.cpp @@ -53,18 +53,6 @@ #include <QtGui/QWindow> #include <QtWidgets/QDesktopWidget> -// Note, these tests are duplicates in qwindowsxpstyle_p.h. -#ifdef Q_CC_GNU -# include <w32api.h> -# if (__W32API_MAJOR_VERSION >= 3 || (__W32API_MAJOR_VERSION == 2 && __W32API_MINOR_VERSION >= 5)) -# ifdef _WIN32_WINNT -# undef _WIN32_WINNT -# endif -# define _WIN32_WINNT 0x0501 -# include <commctrl.h> -# endif -#endif - #include <uxtheme.h> Q_DECLARE_METATYPE(QMargins) diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp index 1f33649668..c7085a0dc2 100644 --- a/src/widgets/itemviews/qlistview.cpp +++ b/src/widgets/itemviews/qlistview.cpp @@ -1989,6 +1989,11 @@ int QCommonListViewBase::horizontalScrollToValue(const int /*index*/, QListView: /* * ListMode ListView Implementation */ +QListModeViewBase::QListModeViewBase(QListView *q, QListViewPrivate *d) + : QCommonListViewBase(q, d) +{ + dd->defaultDropAction = Qt::CopyAction; +} #ifndef QT_NO_DRAGANDDROP QAbstractItemView::DropIndicatorPosition QListModeViewBase::position(const QPoint &pos, const QRect &rect, const QModelIndex &index) const @@ -2755,7 +2760,7 @@ bool QIconModeViewBase::filterStartDrag(Qt::DropActions supportedActions) drag->setMimeData(dd->model->mimeData(indexes)); drag->setPixmap(pixmap); drag->setHotSpot(dd->pressedPosition - rect.topLeft()); - Qt::DropAction action = drag->exec(supportedActions, Qt::CopyAction); + Qt::DropAction action = drag->exec(supportedActions, dd->defaultDropAction); draggedItems.clear(); if (action == Qt::MoveAction) dd->clearOrRemove(); diff --git a/src/widgets/itemviews/qlistview_p.h b/src/widgets/itemviews/qlistview_p.h index 2e6f69713f..90fb9e1407 100644 --- a/src/widgets/itemviews/qlistview_p.h +++ b/src/widgets/itemviews/qlistview_p.h @@ -196,7 +196,7 @@ public: class QListModeViewBase : public QCommonListViewBase { public: - QListModeViewBase(QListView *q, QListViewPrivate *d) : QCommonListViewBase(q, d) {} + QListModeViewBase(QListView *q, QListViewPrivate *d); QVector<int> flowPositions; QVector<int> segmentPositions; diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 1d5bdc2db7..5d934fe8ec 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -424,7 +424,7 @@ QWidget *QApplicationPrivate::hidden_focus_widget = 0; // will get keyboard inpu QWidget *QApplicationPrivate::active_window = 0; // toplevel with keyboard focus #ifndef QT_NO_WHEELEVENT int QApplicationPrivate::wheel_scroll_lines; // number of lines to scroll -QWidget *QApplicationPrivate::wheel_widget = Q_NULLPTR; +QPointer<QWidget> QApplicationPrivate::wheel_widget; #endif bool qt_in_tab_key_event = false; int qt_antialiasing_threshold = -1; @@ -569,13 +569,18 @@ QApplication::QApplication(int &argc, char **argv) QApplication::QApplication(int &argc, char **argv, int _internal) #endif : QGuiApplication(*new QApplicationPrivate(argc, argv, _internal)) -{ Q_D(QApplication); d->construct(); } +{ + Q_D(QApplication); + d->init(); +} /*! \internal */ -void QApplicationPrivate::construct() +void QApplicationPrivate::init() { + QGuiApplicationPrivate::init(); + initResources(); qt_is_gui_used = (application_type != QApplicationPrivate::Tty); @@ -3319,9 +3324,32 @@ bool QApplication::notify(QObject *receiver, QEvent *e) const bool spontaneous = wheel->spontaneous(); const Qt::ScrollPhase phase = wheel->phase(); - if (phase == Qt::NoScrollPhase || phase == Qt::ScrollBegin - || (phase == Qt::ScrollUpdate && !QApplicationPrivate::wheel_widget)) { - + // Ideally, we should lock on a widget when it starts receiving wheel + // events. This avoids other widgets to start receiving those events + // as the mouse cursor hovers them. However, given the way common + // wheeled mice work, there's no certain way of connecting different + // wheel events as a stream. This results in the NoScrollPhase case, + // where we just send the event from the original receiver and up its + // hierarchy until the event gets accepted. + // + // In the case of more evolved input devices, like Apple's trackpad or + // Magic Mouse, we receive the scroll phase information. This helps us + // connect wheel events as a stream and therefore makes it easier to + // lock on the widget onto which the scrolling was initiated. + // + // We assume that, when supported, the phase cycle follows the pattern: + // + // ScrollBegin (ScrollUpdate* ScrollEnd)+ + // + // This means that we can have scrolling sequences (starting with ScrollBegin) + // or partial sequences (after a ScrollEnd and starting with ScrollUpdate). + // If wheel_widget is null because it was deleted, we also take the same + // code path as an initial sequence. + if (phase == Qt::NoScrollPhase || phase == Qt::ScrollBegin || !QApplicationPrivate::wheel_widget) { + + // A system-generated ScrollBegin event starts a new user scrolling + // sequence, so we reset wheel_widget in case no one accepts the event + // or if we didn't get (or missed) a ScrollEnd previously. if (spontaneous && phase == Qt::ScrollBegin) QApplicationPrivate::wheel_widget = Q_NULLPTR; @@ -3339,7 +3367,10 @@ bool QApplication::notify(QObject *receiver, QEvent *e) res = d->notify_helper(w, &we); eventAccepted = we.isAccepted(); if (res && eventAccepted) { - if (spontaneous && phase != Qt::NoScrollPhase) + // A new scrolling sequence or partial sequence starts and w has accepted + // the event. Therefore, we can set wheel_widget, but only if it's not + // the end of a sequence. + if (spontaneous && (phase == Qt::ScrollBegin || phase == Qt::ScrollUpdate) && QGuiApplicationPrivate::scrollNoPhaseAllowed) QApplicationPrivate::wheel_widget = w; break; } @@ -3350,25 +3381,27 @@ bool QApplication::notify(QObject *receiver, QEvent *e) w = w->parentWidget(); } wheel->setAccepted(eventAccepted); - } else if (QApplicationPrivate::wheel_widget) { - if (!spontaneous) { - // wheel_widget may forward the wheel event to a delegate widget, - // either directly or indirectly (e.g. QAbstractScrollArea will - // forward to its QScrollBars through viewportEvent()). In that - // case, the event will not be spontaneous but synthesized, so - // we can send it straigth to the receiver. - d->notify_helper(w, wheel); - } else { - const QPoint &relpos = QApplicationPrivate::wheel_widget->mapFromGlobal(wheel->globalPos()); - QWheelEvent we(relpos, wheel->globalPos(), wheel->pixelDelta(), wheel->angleDelta(), wheel->delta(), wheel->orientation(), wheel->buttons(), - wheel->modifiers(), wheel->phase(), wheel->source()); - we.spont = true; - we.ignore(); - d->notify_helper(QApplicationPrivate::wheel_widget, &we); - wheel->setAccepted(we.isAccepted()); - if (phase == Qt::ScrollEnd) - QApplicationPrivate::wheel_widget = Q_NULLPTR; - } + } else if (!spontaneous) { + // wheel_widget may forward the wheel event to a delegate widget, + // either directly or indirectly (e.g. QAbstractScrollArea will + // forward to its QScrollBars through viewportEvent()). In that + // case, the event will not be spontaneous but synthesized, so + // we can send it straight to the receiver. + d->notify_helper(w, wheel); + } else { + // The phase is either ScrollUpdate or ScrollEnd, and wheel_widget + // is set. Since it accepted the wheel event previously, we continue + // sending those events until we get a ScrollEnd, which signifies + // the end of the natural scrolling sequence. + const QPoint &relpos = QApplicationPrivate::wheel_widget->mapFromGlobal(wheel->globalPos()); + QWheelEvent we(relpos, wheel->globalPos(), wheel->pixelDelta(), wheel->angleDelta(), wheel->delta(), wheel->orientation(), wheel->buttons(), + wheel->modifiers(), wheel->phase(), wheel->source()); + we.spont = true; + we.ignore(); + d->notify_helper(QApplicationPrivate::wheel_widget, &we); + wheel->setAccepted(we.isAccepted()); + if (phase == Qt::ScrollEnd) + QApplicationPrivate::wheel_widget = Q_NULLPTR; } } break; @@ -3546,6 +3579,10 @@ bool QApplication::notify(QObject *receiver, QEvent *e) QApplicationPrivate::giveFocusAccordingToFocusPolicy(widget, e, localPos); } +#ifndef QT_NO_GESTURES + QPointer<QWidget> gesturePendingWidget; +#endif + while (widget) { // first, try to deliver the touch event acceptTouchEvents = widget->testAttribute(Qt::WA_AcceptTouchEvents); @@ -3563,14 +3600,16 @@ bool QApplication::notify(QObject *receiver, QEvent *e) touchEvent->spont = false; if (res && eventAccepted) { // the first widget to accept the TouchBegin gets an implicit grab. - for (int i = 0; i < touchEvent->touchPoints().count(); ++i) { - const QTouchEvent::TouchPoint &touchPoint = touchEvent->touchPoints().at(i); - d->activeTouchPoints[QGuiApplicationPrivate::ActiveTouchPointsKey(touchEvent->device(), touchPoint.id())].target = widget; - } - break; - } else if (p.isNull() || widget->isWindow() || widget->testAttribute(Qt::WA_NoMousePropagation)) { + d->activateImplicitTouchGrab(widget, touchEvent); break; } +#ifndef QT_NO_GESTURES + if (gesturePendingWidget.isNull() && widget && QGestureManager::gesturePending(widget)) + gesturePendingWidget = widget; +#endif + if (p.isNull() || widget->isWindow() || widget->testAttribute(Qt::WA_NoMousePropagation)) + break; + QPoint offset = widget->pos(); widget = widget->parentWidget(); touchEvent->setTarget(widget); @@ -3584,9 +3623,27 @@ bool QApplication::notify(QObject *receiver, QEvent *e) } } +#ifndef QT_NO_GESTURES + if (!eventAccepted && !gesturePendingWidget.isNull()) { + // the first widget subscribed to a gesture gets an implicit grab + d->activateImplicitTouchGrab(gesturePendingWidget, touchEvent); + } +#endif + touchEvent->setAccepted(eventAccepted); break; } + case QEvent::TouchUpdate: + case QEvent::TouchEnd: + { + QWidget *widget = static_cast<QWidget *>(receiver); + // We may get here if the widget is subscribed to a gesture, + // but has not accepted TouchBegin. Propagate touch events + // only if TouchBegin has been accepted. + if (widget && widget->testAttribute(Qt::WA_WState_AcceptedTouchBeginEvent)) + res = d->notify_helper(widget, e); + break; + } case QEvent::RequestSoftwareInputPanel: inputMethod()->show(); break; @@ -4327,6 +4384,17 @@ QWidget *QApplicationPrivate::findClosestTouchPointTarget(QTouchDevice *device, return static_cast<QWidget *>(closestTarget); } +void QApplicationPrivate::activateImplicitTouchGrab(QWidget *widget, QTouchEvent *touchEvent) +{ + if (touchEvent->type() != QEvent::TouchBegin) + return; + + for (int i = 0, tc = touchEvent->touchPoints().count(); i < tc; ++i) { + const QTouchEvent::TouchPoint &touchPoint = touchEvent->touchPoints().at(i); + activeTouchPoints[QGuiApplicationPrivate::ActiveTouchPointsKey(touchEvent->device(), touchPoint.id())].target = widget; + } +} + bool QApplicationPrivate::translateRawTouchEvent(QWidget *window, QTouchDevice *device, const QList<QTouchEvent::TouchPoint> &touchPoints, @@ -4457,10 +4525,11 @@ bool QApplicationPrivate::translateRawTouchEvent(QWidget *window, || QGestureManager::gesturePending(widget) #endif ) { - if (touchEvent.type() == QEvent::TouchEnd) - widget->setAttribute(Qt::WA_WState_AcceptedTouchBeginEvent, false); if (QApplication::sendSpontaneousEvent(widget, &touchEvent) && touchEvent.isAccepted()) accepted = true; + // widget can be deleted on TouchEnd + if (touchEvent.type() == QEvent::TouchEnd && !widget.isNull()) + widget->setAttribute(Qt::WA_WState_AcceptedTouchBeginEvent, false); } break; } diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h index 0482f83a8a..3358cce744 100644 --- a/src/widgets/kernel/qapplication_p.h +++ b/src/widgets/kernel/qapplication_p.h @@ -156,7 +156,7 @@ public: bool notify_helper(QObject *receiver, QEvent * e); - void construct( + void init( #ifdef Q_DEAD_CODE_FROM_QT4_X11 Display *dpy = 0, Qt::HANDLE visual = 0, Qt::HANDLE cmap = 0 #endif @@ -208,7 +208,7 @@ public: static QWidget *active_window; #ifndef QT_NO_WHEELEVENT static int wheel_scroll_lines; - static QWidget *wheel_widget; + static QPointer<QWidget> wheel_widget; #endif static int enabledAnimations; // Combination of QPlatformTheme::UiEffect @@ -288,6 +288,7 @@ public: QWidget *findClosestTouchPointTarget(QTouchDevice *device, const QTouchEvent::TouchPoint &touchPoint); void appendTouchPoint(const QTouchEvent::TouchPoint &touchPoint); void removeTouchPoint(int touchPointId); + void activateImplicitTouchGrab(QWidget *widget, QTouchEvent *touchBeginEvent); static bool translateRawTouchEvent(QWidget *widget, QTouchDevice *device, const QList<QTouchEvent::TouchPoint> &touchPoints, diff --git a/src/widgets/kernel/qgesturemanager.cpp b/src/widgets/kernel/qgesturemanager.cpp index 9a3e9291bf..8af3516d4b 100644 --- a/src/widgets/kernel/qgesturemanager.cpp +++ b/src/widgets/kernel/qgesturemanager.cpp @@ -555,9 +555,9 @@ bool QGestureManager::filterEvent(QObject *receiver, QEvent *event) if (widgetWindow) return filterEvent(widgetWindow->widget(), event); - if (!m_gestureToRecognizer.contains(static_cast<QGesture *>(receiver))) + QGesture *state = qobject_cast<QGesture *>(receiver); + if (!state || !m_gestureToRecognizer.contains(state)) return false; - QGesture *state = static_cast<QGesture *>(receiver); QMultiMap<QObject *, Qt::GestureType> contexts; contexts.insert(state, state->gestureType()); return filterEventThroughContexts(contexts, event); diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index 3490d09fdf..782077fe70 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -4584,7 +4584,8 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter HIRect menuRect = qt_hirectForQRect(mi->menuRect); HIRect itemRect = qt_hirectForQRect(mi->rect); - if ((opt->state & State_Selected) && (opt->state & State_Enabled) && (opt->state & State_Sunken)){ + const bool selected = (opt->state & State_Selected) && (opt->state & State_Enabled) && (opt->state & State_Sunken); + if (selected) { // Draw a selected menu item background: HIThemeMenuItemDrawInfo mdi; mdi.version = qt_mac_hitheme_version; @@ -4612,7 +4613,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter Qt::AlignCenter | Qt::TextHideMnemonic | Qt::TextDontClip | Qt::TextSingleLine, mi->palette, mi->state & State_Enabled, - mi->text, QPalette::ButtonText); + mi->text, selected ? QPalette::HighlightedText : QPalette::ButtonText); } } break; diff --git a/src/widgets/styles/qwindowsxpstyle_p_p.h b/src/widgets/styles/qwindowsxpstyle_p_p.h index 7daef62ce0..31977304fe 100644 --- a/src/widgets/styles/qwindowsxpstyle_p_p.h +++ b/src/widgets/styles/qwindowsxpstyle_p_p.h @@ -56,18 +56,6 @@ #include <qmap.h> #include <qt_windows.h> -// Note, these tests are duplicated in qwizard_win.cpp. -#ifdef Q_CC_GNU -# include <w32api.h> -# if (__W32API_MAJOR_VERSION >= 3 || (__W32API_MAJOR_VERSION == 2 && __W32API_MINOR_VERSION >= 5)) -# ifdef _WIN32_WINNT -# undef _WIN32_WINNT -# endif -# define _WIN32_WINNT 0x0501 -# include <commctrl.h> -# endif -#endif - #include <uxtheme.h> #if WINVER >= 0x0600 diff --git a/src/widgets/util/qcompleter_p.h b/src/widgets/util/qcompleter_p.h index e2b65ba211..10dde975c0 100644 --- a/src/widgets/util/qcompleter_p.h +++ b/src/widgets/util/qcompleter_p.h @@ -128,7 +128,7 @@ private: }; struct QMatchData { - QMatchData() : exactMatchIndex(-1) { } + QMatchData() : exactMatchIndex(-1), partial(false) { } QMatchData(const QIndexMapper& indices, int em, bool p) : indices(indices), exactMatchIndex(em), partial(p) { } QIndexMapper indices; diff --git a/src/widgets/util/qsystemtrayicon_win.cpp b/src/widgets/util/qsystemtrayicon_win.cpp index adf193bb66..f34714c016 100644 --- a/src/widgets/util/qsystemtrayicon_win.cpp +++ b/src/widgets/util/qsystemtrayicon_win.cpp @@ -40,13 +40,6 @@ #include "qsystemtrayicon_p.h" #ifndef QT_NO_SYSTEMTRAYICON -#if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0600 -# undef _WIN32_WINNT -#endif -#if !defined(_WIN32_WINNT) -# define _WIN32_WINNT 0x0600 -#endif - #if defined(_WIN32_IE) && _WIN32_IE < 0x0600 # undef _WIN32_IE #endif diff --git a/src/widgets/widgets.pro b/src/widgets/widgets.pro index ceb6f96f7c..b609e4c434 100644 --- a/src/widgets/widgets.pro +++ b/src/widgets/widgets.pro @@ -8,13 +8,8 @@ DEFINES += QT_NO_USING_NAMESPACE win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x65000000 irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused -MODULE_PLUGIN_TYPES += \ - styles - QMAKE_DOCS = $$PWD/doc/qtwidgets.qdocconf -load(qt_module) - #platforms mac:include(kernel/mac.pri) win32:include(kernel/win.pri) @@ -45,3 +40,7 @@ QMAKE_DYNAMIC_LIST_FILE = $$PWD/QtWidgets.dynlist testcocoon { load(testcocoon) } + +MODULE_PLUGIN_TYPES += \ + styles +load(qt_module) diff --git a/src/widgets/widgets/qcalendarwidget.cpp b/src/widgets/widgets/qcalendarwidget.cpp index 913f104287..66e4a89fe9 100644 --- a/src/widgets/widgets/qcalendarwidget.cpp +++ b/src/widgets/widgets/qcalendarwidget.cpp @@ -655,7 +655,6 @@ public: int dateEditAcceptDelay() const; void setDateEditAcceptDelay(int delay); - QDate date() const; void setDate(const QDate &date); bool eventFilter(QObject *o, QEvent *e) Q_DECL_OVERRIDE; @@ -691,11 +690,6 @@ void QCalendarTextNavigator::setWidget(QWidget *widget) m_widget = widget; } -QDate QCalendarTextNavigator::date() const -{ - return m_date; -} - void QCalendarTextNavigator::setDate(const QDate &date) { m_date = date; diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp index 261ff0bca3..8fb02aaa72 100644 --- a/src/widgets/widgets/qmenubar.cpp +++ b/src/widgets/widgets/qmenubar.cpp @@ -696,7 +696,8 @@ void QMenuBarPrivate::init() q->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum); q->setAttribute(Qt::WA_CustomWhatsThis); - platformMenuBar = QGuiApplicationPrivate::platformTheme()->createPlatformMenuBar(); + if (!QApplication::instance()->testAttribute(Qt::AA_DontUseNativeMenuBar)) + platformMenuBar = QGuiApplicationPrivate::platformTheme()->createPlatformMenuBar(); if (platformMenuBar) q->hide(); |