From 84dc7d5f5560d69a0d7973f591ce253605a458ac Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 10 Oct 2016 21:53:09 +0200 Subject: QComboBox: fix build with GCC 7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GCC 7 warns about implicit fall-throughs now. Fix by adding the missing comments. Interestingly, Coverity only found one of them, even though all three still exist in dev, too. Change-Id: I9f2c5e2700d5ec5234fee3a532feffe01b7c4ce3 Coverity-Id: 11156 Reviewed-by: Edward Welbourne Reviewed-by: Sérgio Martins --- src/widgets/widgets/qcombobox.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/widgets') diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index 0ef76b95f0..22ba26b6a3 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -3125,6 +3125,7 @@ void QComboBox::keyPressEvent(QKeyEvent *e) case Qt::Key_Up: if (e->modifiers() & Qt::ControlModifier) break; // pass to line edit for auto completion + // fall through case Qt::Key_PageUp: #ifdef QT_KEYPAD_NAVIGATION if (QApplication::keypadNavigationEnabled()) @@ -3210,6 +3211,7 @@ void QComboBox::keyPressEvent(QKeyEvent *e) switch (move) { case MoveFirst: newIndex = -1; + // fall through case MoveDown: newIndex++; while ((newIndex < count()) && !(d->model->flags(d->model->index(newIndex,d->modelColumn,d->root)) & Qt::ItemIsEnabled)) @@ -3217,6 +3219,7 @@ void QComboBox::keyPressEvent(QKeyEvent *e) break; case MoveLast: newIndex = count(); + // fall through case MoveUp: newIndex--; while ((newIndex >= 0) && !(d->model->flags(d->model->index(newIndex,d->modelColumn,d->root)) & Qt::ItemIsEnabled)) -- cgit v1.2.3 From 843247e1c509ec3ce55a2e2051b83fcfa6634135 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 14 Oct 2016 13:05:00 +0200 Subject: Call raise on the window that contains the widget and not the widget When the mouse is clicked on the widget in a window while a popup is visible then it should raise just the window and not the widget inside it. If the widget is in a stacked layout then calling raise() on it can cause it to appear on top so avoid this by calling raise() directly on the window. Task-number: QTBUG-52670 Change-Id: Idd287c6cc7038c57e14e92f4a3e1c50985925684 Reviewed-by: Friedemann Kleint --- src/widgets/kernel/qwidgetwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets') diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp index 95f63025fb..40c488857e 100644 --- a/src/widgets/kernel/qwidgetwindow.cpp +++ b/src/widgets/kernel/qwidgetwindow.cpp @@ -529,7 +529,7 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event) // activate window of the widget under mouse pointer if (!w->isActiveWindow()) { w->activateWindow(); - w->raise(); + w->window()->raise(); } QWindow *win = w->windowHandle(); -- cgit v1.2.3 From e2d8c7bf2203cbc0c7ff923caf3132881aafa0b0 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 1 Sep 2016 11:53:15 +0200 Subject: Don't change the size of widgets just because it is in a floating dock When a QDockWidget was floating on macOS then it would force the size of various widgets, such as buttons, comboboxes, to be the smallest needed rather than the size they had when it was docked. Task-number: QTBUG-7460 Task-number: QTBUG-52354 Change-Id: Id348180934f113f3a9a9ce5622a9af03eed04108 Reviewed-by: Jake Petroules --- src/widgets/styles/qmacstyle_mac.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/widgets') diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index 46918a2d5f..84445bfce4 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -1034,6 +1034,8 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg #if defined(QMAC_QAQUASTYLE_SIZE_CONSTRAIN) || defined(DEBUG_SIZE_CONSTRAINT) static QAquaWidgetSize qt_aqua_guess_size(const QWidget *widg, QSize large, QSize small, QSize mini) { + Q_UNUSED(widg); + if (large == QSize(-1, -1)) { if (small != QSize(-1, -1)) return QAquaSizeSmall; @@ -1049,7 +1051,7 @@ static QAquaWidgetSize qt_aqua_guess_size(const QWidget *widg, QSize large, QSiz } #ifndef QT_NO_MAINWINDOW - if (qobject_cast(widg->window()) || qEnvironmentVariableIsSet("QWIDGET_ALL_SMALL")) { + if (qEnvironmentVariableIsSet("QWIDGET_ALL_SMALL")) { //if (small.width() != -1 || small.height() != -1) return QAquaSizeSmall; } else if (qEnvironmentVariableIsSet("QWIDGET_ALL_MINI")) { -- cgit v1.2.3 From 78ee77f49122ac525590715a0a034965e3e59adf Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 4 Oct 2016 15:04:04 +0200 Subject: iOS: link photo lib plugin based on Info.plist contents MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the application's Info.plist contains the key 'NSPhotoLibraryUsageDescription', we know that we can safely link in qiosnsphotolibrarysupport without violating AppStore requirements. This is a simple feature that doesn't introduce additional qmake API for doing app deployment with optional iOS QPA plugins. [ChangeLog][iOS] Starting from iOS 10, Apple requires all apps that need access to photos to have the key 'NSPhotoLibraryUsageDescription' in the Info.plist. Therefore, to get the same support in Qt (when, e.g., using a file dialog), the Info.plist assigned to QMAKE_INFO_PLIST will need this key as well. Change-Id: I7a93afe24b589cad96d5a1d9e2a155ad1671178a Reviewed-by: Tor Arne Vestbø Reviewed-by: Jake Petroules --- src/widgets/dialogs/qfiledialog.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/widgets') diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index 61f5f7b0d2..f8e4299397 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -896,6 +896,9 @@ void QFileDialogPrivate::_q_goToUrl(const QUrl &url) {QStandardPaths::standardLocations(QStandardPaths::PicturesLocation).last()}, a native image picker dialog will be used for accessing the user's photo album. The filename returned can be loaded using QFile and related APIs. + For this to be enabled, the Info.plist assigned to QMAKE_INFO_PLIST in the + project file must contain the key \c NSPhotoLibraryUsageDescription. See + Info.plist documentation from Apple for more information regarding this key. This feature was added in Qt 5.5. */ void QFileDialog::setDirectory(const QString &directory) -- cgit v1.2.3 From e8b55a6d2a6e44337b75dd0d116b1b020a437631 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Wed, 19 Oct 2016 20:22:10 +0200 Subject: Document qGuiApp and tweap qApp Change-Id: I2cd865da0e081251a2702c11cb83dde35444693a Reviewed-by: Edward Welbourne --- src/widgets/kernel/qapplication.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index b64d6e2159..93ee820c98 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -4229,13 +4229,10 @@ void QApplication::beep() \relates QApplication A global pointer referring to the unique application object. It is - equivalent to the pointer returned by the QCoreApplication::instance() - function except that, in GUI applications, it is a pointer to a - QApplication instance. + equivalent to QCoreApplication::instance(), but cast as a QApplication pointer, + so only valid when the unique application object is a QApplication. - Only one application object can be created. - - \sa QCoreApplication::instance() + \sa QCoreApplication::instance(), qGuiApp */ /*! -- cgit v1.2.3