diff options
-rw-r--r-- | src/controls/ComboBox.qml | 9 | ||||
-rw-r--r-- | src/controls/Private/qquickcontrolsettings.cpp | 1 | ||||
-rw-r--r-- | src/controls/Private/qquicktreemodeladaptor.cpp | 2 | ||||
-rw-r--r-- | src/controls/plugin.cpp | 1 | ||||
-rw-r--r-- | src/controls/qquickmenubar.cpp | 11 | ||||
-rw-r--r-- | src/controls/qquickmenubar_p.h | 1 | ||||
-rw-r--r-- | src/dialogs/qquickplatformfontdialog.cpp | 2 | ||||
-rw-r--r-- | src/extras/TumblerColumn.qml | 2 | ||||
-rw-r--r-- | tests/auto/controls/data/tst_calendar.qml | 6 | ||||
-rw-r--r-- | tests/auto/controls/data/tst_switch.qml | 2 |
10 files changed, 24 insertions, 13 deletions
diff --git a/src/controls/ComboBox.qml b/src/controls/ComboBox.qml index 3463470f..d0940772 100644 --- a/src/controls/ComboBox.qml +++ b/src/controls/ComboBox.qml @@ -289,11 +289,12 @@ Control { \qmlsignal ComboBox::activated(int index) \since QtQuick.Controls 1.1 - \a index is the triggered model index or -1 if a new string is accepted - This signal is similar to currentIndex changed, but will only - be emitted if the combo box index was changed by the user and not - when set programatically. + be emitted if the combo box index was changed by the user, not + when set programmatically. + + \a index is the activated model index, or \c -1 if a new string is + accepted. The corresponding handler is \c onActivated. */ diff --git a/src/controls/Private/qquickcontrolsettings.cpp b/src/controls/Private/qquickcontrolsettings.cpp index 7e6393a8..8483830b 100644 --- a/src/controls/Private/qquickcontrolsettings.cpp +++ b/src/controls/Private/qquickcontrolsettings.cpp @@ -37,6 +37,7 @@ #include "qquickcontrolsettings_p.h" #include <qquickitem.h> #include <qcoreapplication.h> +#include <qdebug.h> #include <qqmlengine.h> #include <qlibrary.h> #include <qdir.h> diff --git a/src/controls/Private/qquicktreemodeladaptor.cpp b/src/controls/Private/qquicktreemodeladaptor.cpp index 0fda5704..666fafc9 100644 --- a/src/controls/Private/qquicktreemodeladaptor.cpp +++ b/src/controls/Private/qquicktreemodeladaptor.cpp @@ -754,7 +754,7 @@ void QQuickTreeModelAdaptor::dump() const int count = m_items.count(); if (count == 0) return; - int countWidth = floorf(log10f(float(count))) + 1; + int countWidth = floor(log10(double(count))) + 1; qInfo() << "Dumping" << this; for (int i = 0; i < count; i++) { const TreeItem &item = m_items.at(i); diff --git a/src/controls/plugin.cpp b/src/controls/plugin.cpp index 802dacb0..e1afeef2 100644 --- a/src/controls/plugin.cpp +++ b/src/controls/plugin.cpp @@ -63,6 +63,7 @@ #endif #ifndef QT_NO_TRANSLATION +#include <QtCore/qcoreapplication.h> #include <QtCore/qlibraryinfo.h> #include <QtCore/qlocale.h> #endif diff --git a/src/controls/qquickmenubar.cpp b/src/controls/qquickmenubar.cpp index 52f2d1eb..efec6510 100644 --- a/src/controls/qquickmenubar.cpp +++ b/src/controls/qquickmenubar.cpp @@ -72,6 +72,8 @@ QQuickMenuBar::QQuickMenuBar(QObject *parent) QQuickMenuBar::~QQuickMenuBar() { + if (isNative()) + setNativeNoNotify(false); } QQmlListProperty<QQuickMenu> QQuickMenuBar::menus() @@ -87,6 +89,13 @@ bool QQuickMenuBar::isNative() const void QQuickMenuBar::setNative(bool native) { bool wasNative = isNative(); + setNativeNoNotify(native); + if (isNative() != wasNative) + emit nativeChanged(); +} + +void QQuickMenuBar::setNativeNoNotify(bool native) +{ if (native) { if (!m_platformMenuBar) { m_platformMenuBar = QGuiApplicationPrivate::platformTheme()->createPlatformMenuBar(); @@ -104,8 +113,6 @@ void QQuickMenuBar::setNative(bool native) delete m_platformMenuBar; m_platformMenuBar = 0; } - if (isNative() != wasNative) - emit nativeChanged(); } void QQuickMenuBar::setContentItem(QQuickItem *item) diff --git a/src/controls/qquickmenubar_p.h b/src/controls/qquickmenubar_p.h index d0bbedce..83166d77 100644 --- a/src/controls/qquickmenubar_p.h +++ b/src/controls/qquickmenubar_p.h @@ -81,6 +81,7 @@ public: QPlatformMenuBar *platformMenuBar() const { return m_platformMenuBar; } private: + void setNativeNoNotify(bool native); static void append_menu(QQmlListProperty<QQuickMenu> *list, QQuickMenu *menu); static int count_menu(QQmlListProperty<QQuickMenu> *list); static QQuickMenu *at_menu(QQmlListProperty<QQuickMenu> *list, int index); diff --git a/src/dialogs/qquickplatformfontdialog.cpp b/src/dialogs/qquickplatformfontdialog.cpp index 4cc53094..8b93fd1d 100644 --- a/src/dialogs/qquickplatformfontdialog.cpp +++ b/src/dialogs/qquickplatformfontdialog.cpp @@ -190,7 +190,7 @@ QPlatformFontDialogHelper *QQuickPlatformFontDialog::helper() containing the dialog's parent Item, modal with respect to the whole application, or non-modal. - By default it is \c Qt.WindowModal. + By default it is \c Qt.NonModal. Modality does not mean that there are any blocking calls to wait for the dialog to be accepted or rejected; it's only that the user will be diff --git a/src/extras/TumblerColumn.qml b/src/extras/TumblerColumn.qml index cef4a592..9c505830 100644 --- a/src/extras/TumblerColumn.qml +++ b/src/extras/TumblerColumn.qml @@ -89,7 +89,7 @@ QtObject { Accessible.role: Accessible.ColumnHeader /*! - \qmlproperty readonly int TumblerColumn::currentIndex + \qmlproperty int TumblerColumn::currentIndex This read-only property holds the index of the current item for this column. If the model count is reduced, the current index will be diff --git a/tests/auto/controls/data/tst_calendar.qml b/tests/auto/controls/data/tst_calendar.qml index 7aa0547f..310451b0 100644 --- a/tests/auto/controls/data/tst_calendar.qml +++ b/tests/auto/controls/data/tst_calendar.qml @@ -574,7 +574,7 @@ Item { } function dragTo(cellX, cellY, expectedCellIndex, expectedDate) { - mouseMove(calendar, toPixelsX(cellX), toPixelsY(cellY), Qt.LeftButton); + mouseMove(calendar, toPixelsX(cellX), toPixelsY(cellY)); compare(calendar.selectedDate, expectedDate); compare(calendar.__panel.pressedCellIndex, expectedCellIndex); compare(hoveredSignalSpy.count, 1); @@ -657,7 +657,7 @@ Item { // unwanted month changes if moving within a bunch of "next month" cells. // We still emit the signals as usual, though. var oldDate = calendar.selectedDate; - mouseMove(calendar, toPixelsX(5), toPixelsY(4), Qt.LeftButton); + mouseMove(calendar, toPixelsX(5), toPixelsY(4)); compare(calendar.selectedDate, oldDate); compare(calendar.__panel.pressedCellIndex, 32); compare(calendar.__panel.hoveredCellIndex, 33); @@ -689,7 +689,7 @@ Item { calendar.selectedDate = calendar.minimumDate; compare(calendar.visibleMonth, calendar.minimumDate.getMonth()); - mouseMove(calendar, toPixelsX(4), toPixelsY(0), Qt.LeftButton); + mouseMove(calendar, toPixelsX(4), toPixelsY(0)); compare(calendar.selectedDate, calendar.minimumDate); compare(calendar.__panel.pressedCellIndex, -1); compare(hoveredSignalSpy.count, 0); diff --git a/tests/auto/controls/data/tst_switch.qml b/tests/auto/controls/data/tst_switch.qml index fd929d48..2ab0582b 100644 --- a/tests/auto/controls/data/tst_switch.qml +++ b/tests/auto/controls/data/tst_switch.qml @@ -127,7 +127,7 @@ Item { // release outside -> no clicked() mousePress(aSwitch, aSwitch.x + 1, aSwitch.y + 1, Qt.LeftButton); - mouseMove(aSwitch, aSwitch.x - 1, aSwitch.y - 1, Qt.LeftButton); + mouseMove(aSwitch, aSwitch.x - 1, aSwitch.y - 1); mouseRelease(aSwitch, aSwitch.x - 1, aSwitch.y - 1, Qt.LeftButton); compare(signalSpy.count, 1); } |