diff options
-rw-r--r-- | qmake/generators/win32/msvc_objectmodel.cpp | 2 | ||||
-rw-r--r-- | src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java | 25 | ||||
-rw-r--r-- | src/android/jar/src/org/qtproject/qt5/android/QtLayout.java | 30 | ||||
-rw-r--r-- | src/corelib/kernel/qcfsocketnotifier.cpp | 1 | ||||
-rw-r--r-- | src/network/doc/snippets/code/src_network_ssl_qsslcertificate.cpp | 3 | ||||
-rw-r--r-- | src/network/ssl/qsslcertificate.cpp | 4 | ||||
-rw-r--r-- | src/network/ssl/qsslsocket.cpp | 4 | ||||
-rw-r--r-- | src/plugins/platforms/android/qandroidplatformscreen.h | 1 | ||||
-rw-r--r-- | src/widgets/widgets/qlineedit_p.cpp | 6 | ||||
-rw-r--r-- | tests/auto/other/networkselftest/BLACKLIST | 4 | ||||
-rw-r--r-- | tests/auto/other/networkselftest/networkselftest.pro | 1 | ||||
-rw-r--r-- | tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp | 58 |
12 files changed, 101 insertions, 38 deletions
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index 11e93e54c2..339dae953a 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -922,6 +922,8 @@ bool VCCLCompilerTool::parseOption(const char* option) TreatWChar_tAsBuiltInType = ((*c) == '-' ? _False : _True); else if (config->CompilerVersion >= NET2013 && strncmp(option + 4, "strictStrings", 13) == 0) AdditionalOptions += option; + else if (config->CompilerVersion >= NET2015 && strncmp(option + 4, "throwingNew", 11) == 0) + AdditionalOptions += option; else found = false; } else { diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java index a6067b1a10..445896622a 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java @@ -250,12 +250,18 @@ public class QtActivityDelegate if (m_imm == null) return; - if (m_softInputMode == 0 && height > m_layout.getHeight() * 2 / 3) - m_activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_UNCHANGED | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); - else if (m_softInputMode == 0) - m_activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_UNCHANGED | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); - else + if (m_softInputMode != 0) { m_activity.getWindow().setSoftInputMode(m_softInputMode); + // softInputIsHidden is true if SOFT_INPUT_STATE_HIDDEN or SOFT_INPUT_STATE_ALWAYS_HIDDEN is set. + final boolean softInputIsHidden = (m_softInputMode & WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN) != 0; + if (softInputIsHidden) + return; + } else { + if (height > m_layout.getHeight() * 2 / 3) + m_activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_UNCHANGED | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); + else + m_activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_UNCHANGED | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); + } int initialCapsMode = 0; @@ -344,8 +350,7 @@ public class QtActivityDelegate m_editText.setImeOptions(imeOptions); m_editText.setInputType(inputType); - m_layout.removeView(m_editText); - m_layout.addView(m_editText, new QtLayout.LayoutParams(width, height, x, y)); + m_layout.setLayoutParams(m_editText, new QtLayout.LayoutParams(width, height, x, y), false); m_editText.requestFocus(); m_editText.postDelayed(new Runnable() { @Override @@ -1124,12 +1129,10 @@ public class QtActivityDelegate if (Build.VERSION.SDK_INT < 11 || w <= 0 || h <= 0) { m_activity.openContextMenu(m_layout); } else if (Build.VERSION.SDK_INT < 14) { - m_layout.removeView(m_editText); - m_layout.addView(m_editText, new QtLayout.LayoutParams(w, h, x, y)); + m_layout.setLayoutParams(m_editText, new QtLayout.LayoutParams(w, h, x, y), false); QtPopupMenu.getInstance().showMenu(m_editText); } else { - m_layout.removeView(m_editText); - m_layout.addView(m_editText, new QtLayout.LayoutParams(w, h, x, y)); + m_layout.setLayoutParams(m_editText, new QtLayout.LayoutParams(w, h, x, y), false); QtPopupMenu14.getInstance().showMenu(m_editText); } } diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtLayout.java b/src/android/jar/src/org/qtproject/qt5/android/QtLayout.java index 4d7ca47dde..408636dcf3 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtLayout.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtLayout.java @@ -216,4 +216,34 @@ public class QtLayout extends ViewGroup invalidate(); attachViewToParent(view, index, view.getLayoutParams()); } + + /** + * set the layout params on a child view. + * + * Note: This function adds the child view if it's not in the + * layout already. + */ + public void setLayoutParams(final View childView, + final ViewGroup.LayoutParams params, + final boolean forceRedraw) + { + // Invalid view + if (childView == null) + return; + + // Invalid params + if (!checkLayoutParams(params)) + return; + + // View is already in the layout and can therefore be updated + final boolean canUpdate = (this == childView.getParent()); + + if (canUpdate) { + childView.setLayoutParams(params); + if (forceRedraw) + invalidate(); + } else { + addView(childView, params); + } + } } diff --git a/src/corelib/kernel/qcfsocketnotifier.cpp b/src/corelib/kernel/qcfsocketnotifier.cpp index 24e1e0ac9a..7f4c26d978 100644 --- a/src/corelib/kernel/qcfsocketnotifier.cpp +++ b/src/corelib/kernel/qcfsocketnotifier.cpp @@ -304,3 +304,4 @@ void QCFSocketNotifier::enableSocketNotifiers(CFRunLoopObserverRef ref, CFRunLoo } QT_END_NAMESPACE + diff --git a/src/network/doc/snippets/code/src_network_ssl_qsslcertificate.cpp b/src/network/doc/snippets/code/src_network_ssl_qsslcertificate.cpp index 8abae00b4e..d157af737c 100644 --- a/src/network/doc/snippets/code/src_network_ssl_qsslcertificate.cpp +++ b/src/network/doc/snippets/code/src_network_ssl_qsslcertificate.cpp @@ -39,7 +39,8 @@ ****************************************************************************/ //! [0] -foreach (const QSslCertificate &cert, QSslCertificate::fromPath("C:/ssl/certificate.*.pem", QSsl::Pem, +foreach (const QSslCertificate &cert, QSslCertificate::fromPath("C:/ssl/certificate.*.pem", + QSsl::Pem, QRegExp::Wildcard)) { qDebug() << cert.issuerInfo(QSslCertificate::Organization); } diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp index 6f91ccdb4d..22d66770e5 100644 --- a/src/network/ssl/qsslcertificate.cpp +++ b/src/network/ssl/qsslcertificate.cpp @@ -446,8 +446,8 @@ QByteArray QSslCertificate::digest(QCryptographicHash::Algorithm algorithm) cons /*! Searches all files in the \a path for certificates encoded in the - specified \a format and returns them in a list. \e must be a file or a - pattern matching one or more files, as specified by \a syntax. + specified \a format and returns them in a list. \a path must be a file + or a pattern matching one or more files, as specified by \a syntax. Example: diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp index 0472a9a198..788e59df24 100644 --- a/src/network/ssl/qsslsocket.cpp +++ b/src/network/ssl/qsslsocket.cpp @@ -1311,8 +1311,8 @@ QList<QSslCipher> QSslSocket::supportedCiphers() /*! Searches all files in the \a path for certificates encoded in the specified \a format and adds them to this socket's CA certificate - database. \a path can be explicit, or it can contain wildcards in - the format specified by \a syntax. Returns \c true if one or more + database. \a path must be a file or a pattern matching one or more + files, as specified by \a syntax. Returns \c true if one or more certificates are added to the socket's CA certificate database; otherwise returns \c false. diff --git a/src/plugins/platforms/android/qandroidplatformscreen.h b/src/plugins/platforms/android/qandroidplatformscreen.h index 403d6036f0..f4f9cedb70 100644 --- a/src/plugins/platforms/android/qandroidplatformscreen.h +++ b/src/plugins/platforms/android/qandroidplatformscreen.h @@ -49,7 +49,6 @@ QT_BEGIN_NAMESPACE class QAndroidPlatformWindow; -class QAndroidPlatformBackingStore; class QAndroidPlatformScreen: public QObject, public QPlatformScreen, public AndroidSurfaceClient { diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp index e6dd4b8f3b..599ebce0ab 100644 --- a/src/widgets/widgets/qlineedit_p.cpp +++ b/src/widgets/widgets/qlineedit_p.cpp @@ -335,7 +335,7 @@ void QLineEditIconButton::actionEvent(QActionEvent *e) switch (e->type()) { case QEvent::ActionChanged: { const QAction *action = e->action(); - if (isVisible() != action->isVisible()) { + if (isVisibleTo(parentWidget()) != action->isVisible()) { setVisible(action->isVisible()); if (QLineEdit *le = qobject_cast<QLineEdit *>(parentWidget())) static_cast<QLineEditPrivate *>(qt_widget_private(le))->positionSideWidgets(); @@ -439,13 +439,13 @@ void QLineEditPrivate::positionSideWidgets() QRect widgetGeometry(QPoint(QLineEditIconButton::IconMargin, (contentRect.height() - iconSize.height()) / 2), iconSize); foreach (const SideWidgetEntry &e, leftSideWidgetList()) { e.widget->setGeometry(widgetGeometry); - if (e.widget->isVisible()) + if (e.action->isVisible()) widgetGeometry.moveLeft(widgetGeometry.left() + delta); } widgetGeometry.moveLeft(contentRect.width() - iconSize.width() - QLineEditIconButton::IconMargin); foreach (const SideWidgetEntry &e, rightSideWidgetList()) { e.widget->setGeometry(widgetGeometry); - if (e.widget->isVisible()) + if (e.action->isVisible()) widgetGeometry.moveLeft(widgetGeometry.left() - delta); } } diff --git a/tests/auto/other/networkselftest/BLACKLIST b/tests/auto/other/networkselftest/BLACKLIST new file mode 100644 index 0000000000..4a958b43a5 --- /dev/null +++ b/tests/auto/other/networkselftest/BLACKLIST @@ -0,0 +1,4 @@ +# QTBUG-27571 +[ftpProxyServer] +windows 32bit +windows 64bit diff --git a/tests/auto/other/networkselftest/networkselftest.pro b/tests/auto/other/networkselftest/networkselftest.pro index 22208e02fb..60b45e6b5e 100644 --- a/tests/auto/other/networkselftest/networkselftest.pro +++ b/tests/auto/other/networkselftest/networkselftest.pro @@ -4,5 +4,4 @@ TARGET = tst_networkselftest SOURCES += tst_networkselftest.cpp QT = core core-private network testlib -win32:CONFIG += insignificant_test # QTBUG-27571 DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp index a41d80d7dd..666960d98e 100644 --- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp @@ -4319,10 +4319,10 @@ void tst_QLineEdit::clearButtonVisibleAfterSettingText_QTBUG_45518() #endif // QT_BUILD_INTERNAL } -static inline QIcon sideWidgetTestIcon() +static inline QIcon sideWidgetTestIcon(Qt::GlobalColor color = Qt::yellow) { QImage image(QSize(20, 20), QImage::Format_ARGB32); - image.fill(Qt::yellow); + image.fill(color); return QIcon(QPixmap::fromImage(image)); } @@ -4360,6 +4360,15 @@ void tst_QLineEdit::sideWidgets() lineEdit->addAction(iconAction); } +template <class T> T *findAssociatedWidget(const QAction *a) +{ + foreach (QWidget *w, a->associatedWidgets()) { + if (T *result = qobject_cast<T *>(w)) + return result; + } + return Q_NULLPTR; +} + void tst_QLineEdit::sideWidgetsActionEvents() { // QTBUG-39660, verify whether action events are handled by the widget. @@ -4368,28 +4377,43 @@ void tst_QLineEdit::sideWidgetsActionEvents() QLineEdit *lineEdit = new QLineEdit(&testWidget); l->addWidget(lineEdit); l->addSpacerItem(new QSpacerItem(0, 50, QSizePolicy::Ignored, QSizePolicy::Fixed)); - QAction *iconAction = lineEdit->addAction(sideWidgetTestIcon(), QLineEdit::LeadingPosition); + QAction *iconAction1 = lineEdit->addAction(sideWidgetTestIcon(Qt::red), QLineEdit::LeadingPosition); + QAction *iconAction2 = lineEdit->addAction(sideWidgetTestIcon(Qt::blue), QLineEdit::LeadingPosition); + QAction *iconAction3 = lineEdit->addAction(sideWidgetTestIcon(Qt::yellow), QLineEdit::LeadingPosition); + iconAction3->setVisible(false); + testWidget.move(300, 300); testWidget.show(); QVERIFY(QTest::qWaitForWindowExposed(&testWidget)); - QWidget *toolButton = Q_NULLPTR; - foreach (QWidget *w, iconAction->associatedWidgets()) { - if (qobject_cast<QToolButton *>(w)) { - toolButton = w; - break; - } - } - QVERIFY(toolButton); + QWidget *toolButton1 = findAssociatedWidget<QToolButton>(iconAction1); + QWidget *toolButton2 = findAssociatedWidget<QToolButton>(iconAction2); + QWidget *toolButton3 = findAssociatedWidget<QToolButton>(iconAction3); + + QVERIFY(toolButton1); + QVERIFY(toolButton2); + QVERIFY(toolButton3); + + QVERIFY(!toolButton3->isVisible()); // QTBUG-48899 , action hidden before show(). + + QVERIFY(toolButton1->isVisible()); + QVERIFY(toolButton1->isEnabled()); + + QVERIFY(toolButton2->isVisible()); + QVERIFY(toolButton2->isEnabled()); + + const int toolButton1X = toolButton1->x(); + const int toolButton2X = toolButton2->x(); + QVERIFY(toolButton1X < toolButton2X); // QTBUG-48806, positioned beside each other. - QVERIFY(toolButton->isVisible()); - QVERIFY(toolButton->isEnabled()); + iconAction1->setEnabled(false); + QVERIFY(!toolButton1->isEnabled()); - iconAction->setEnabled(false); - QVERIFY(!toolButton->isEnabled()); + iconAction1->setVisible(false); + QVERIFY(!toolButton1->isVisible()); - iconAction->setVisible(false); - QVERIFY(!toolButton->isVisible()); + // QTBUG-39660, button 2 takes position of invisible button 1. + QCOMPARE(toolButton2->x(), toolButton1X); } Q_DECLARE_METATYPE(Qt::AlignmentFlag) |