diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-10-26 21:28:31 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2015-10-26 21:29:32 +0000 |
commit | e0d0e4a9a28dfede54c4c0ec4c42be05bc955d95 (patch) | |
tree | 2cc96e7943a2ad6d0a93bafc60504bbf6e3c8c3b /src | |
parent | 00f35b4ae7f94e0fe1c8c77efec401ab5f3c4855 (diff) | |
parent | 6bc1ce9c164d0230508eafbe6c18144c8b1a6a74 (diff) | |
download | qtbase-e0d0e4a9a28dfede54c4c0ec4c42be05bc955d95.tar.gz |
Merge "Merge remote-tracking branch 'origin/5.5' into 5.6" into refs/staging/5.6
Diffstat (limited to 'src')
-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 |
8 files changed, 54 insertions, 20 deletions
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 b11396aeaf..5181cc7e11 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 c01dbbc712..1b7bc91c83 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); } } |