From 8796c69480a6e5e331d19edf24d4dabb180bc4d2 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 10 Oct 2016 03:55:35 +0200 Subject: QNetworkSession: make sure that "interface" isn't #defined Depending on #include order isn't a good idea. Change-Id: Ief935e1fcc5d40ecb510fffd147c08dffe6cba2d Reviewed-by: Edward Welbourne --- src/network/bearer/qnetworksession.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/network/bearer/qnetworksession.cpp b/src/network/bearer/qnetworksession.cpp index 6f83fd25ca..1b939bab01 100644 --- a/src/network/bearer/qnetworksession.cpp +++ b/src/network/bearer/qnetworksession.cpp @@ -42,6 +42,11 @@ #include "qnetworkconfigmanager_p.h" +// for QNetworkSession::interface +#ifdef interface +# undef interface +#endif + #ifndef QT_NO_BEARERMANAGEMENT QT_BEGIN_NAMESPACE -- cgit v1.2.1 From d023b300b26a9db3cf4dbbe31c1cc5726fe277d7 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 1 Sep 2016 13:29:46 +0200 Subject: Document that am/pm in QDateTime::toString are locale-specific Change-Id: I28382b25ac94cbfbad4acff1308ddd8baf5ca693 Task-number: QTBUG-55632 Reviewed-by: Edward Welbourne --- src/corelib/tools/qdatetime.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 6b09b4107c..3e29b55666 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -1623,9 +1623,11 @@ QString QTime::toString(Qt::DateFormat format) const \row \li z \li the milliseconds without leading zeroes (0 to 999) \row \li zzz \li the milliseconds with leading zeroes (000 to 999) \row \li AP or A - \li use AM/PM display. \e A/AP will be replaced by either "AM" or "PM". + \li use AM/PM display. \e A/AP will be replaced by either + QLocale::amText() or QLocale::pmText(). \row \li ap or a - \li use am/pm display. \e a/ap will be replaced by either "am" or "pm". + \li use am/pm display. \e a/ap will be replaced by a lower-case version of + QLocale::amText() or QLocale::pmText(). \row \li t \li the timezone (for example "CEST") \endtable @@ -1634,7 +1636,8 @@ QString QTime::toString(Qt::DateFormat format) const expression. Two consecutive single quotes ("''") are replaced by a singlequote in the output. Formats without separators (e.g. "HHmm") are currently not supported. - Example format strings (assuming that the QTime is 14:13:09.042) + Example format strings (assuming that the QTime is 14:13:09.042 and the system + locale is \c{en_US}) \table \header \li Format \li Result -- cgit v1.2.1 From 51767affb380eea5961637f07a2e881b93b6fea5 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 11 Feb 2016 16:28:57 +0100 Subject: Show warning when setting new default QSurfaceFormat If a global shared context is created, and afterwards a new default QSurfaceFormat with a different version or profile is set, it can lead to issues with context sharing. The documentation for QSurfaceFormat::setDefaultFormat mentions this. It would be helpful to actually show a warning in case it happens. Change-Id: I71f7ce95496e1ecbfc6a0c7d7bed146ef8dc351e Reviewed-by: Laszlo Agocs --- src/gui/kernel/qsurfaceformat.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/gui/kernel/qsurfaceformat.cpp b/src/gui/kernel/qsurfaceformat.cpp index d078336d73..18fde5716b 100644 --- a/src/gui/kernel/qsurfaceformat.cpp +++ b/src/gui/kernel/qsurfaceformat.cpp @@ -35,6 +35,7 @@ #include #include +#include #ifdef major #undef major @@ -758,6 +759,11 @@ Q_GLOBAL_STATIC(QSurfaceFormat, qt_default_surface_format) */ void QSurfaceFormat::setDefaultFormat(const QSurfaceFormat &format) { + QOpenGLContext *globalContext = QOpenGLContext::globalShareContext(); + if (globalContext && globalContext->isValid()) { + qWarning("Warning: Setting a new default format with a different version or profile after " + "the global shared context is created may cause issues with context sharing."); + } *qt_default_surface_format() = format; } -- cgit v1.2.1 From cd1d11414021288729cd85a32a7a1160756aeeab Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 30 Sep 2016 18:36:15 +0200 Subject: Unset qgl_current_fbo when the default FBO is bound Previously when a new QOpenGLFramebufferObject was bound, the QOpenGLContextPrivate::qgl_current_fbo member was also updated to point to this new object. But if a user called QOpenGLFramebufferObject::bindDefault(), qgl_current_fbo was not unset, meaning that if the FBO object would be deleted at some point, qgl_current_fbo would be a dangling pointer. This patch makes sure to clear the value of qgl_current_fbo when bindDefault() is called. It is cleared, and not set to point to another object because the default platform OpenGL FBO is not backed by a QOpenGLFramebufferObject. Task-number: QTBUG-56296 Change-Id: I68b53d8b446660accdf5841df3d168ee2f133a90 Reviewed-by: Simon Hausmann Reviewed-by: Laszlo Agocs --- src/gui/opengl/qopenglframebufferobject.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp index 56e04c09d8..b1b580f85b 100644 --- a/src/gui/opengl/qopenglframebufferobject.cpp +++ b/src/gui/opengl/qopenglframebufferobject.cpp @@ -1490,6 +1490,7 @@ bool QOpenGLFramebufferObject::bindDefault() if (ctx) { ctx->functions()->glBindFramebuffer(GL_FRAMEBUFFER, ctx->defaultFramebufferObject()); QOpenGLContextPrivate::get(ctx)->qgl_current_fbo_invalid = true; + QOpenGLContextPrivate::get(ctx)->qgl_current_fbo = Q_NULLPTR; } #ifdef QT_DEBUG else -- cgit v1.2.1 From 23c7816f44cfe02e1e056ab4bb40e618992a0e2b Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Wed, 5 Oct 2016 14:27:16 +0200 Subject: Doc: add notes about validator and completer in QComboBox MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When setting the editable property to false, we delete the internal QLineEdit used by QComboBox. Add comments that this results in the loss of validator and completer. Task-number: QTBUG-56035 Change-Id: Ife04ac2b9bb3f32fae5328f1ec73b1d5d769d52c Reviewed-by: Topi Reiniƶ Reviewed-by: Nico Vertriest --- src/widgets/widgets/qcombobox.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index 450c27d573..0ef76b95f0 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -1678,6 +1678,9 @@ void QComboBox::setIconSize(const QSize &size) By default, this property is \c false. The effect of editing depends on the insert policy. + \note When disabling the \a editable state, the validator and + completer are removed. + \sa InsertPolicy */ bool QComboBox::isEditable() const @@ -1829,6 +1832,8 @@ QLineEdit *QComboBox::lineEdit() const \fn void QComboBox::setValidator(const QValidator *validator) Sets the \a validator to use instead of the current validator. + + \note The validator is removed when the editable property becomes \c false. */ void QComboBox::setValidator(const QValidator *v) @@ -1862,6 +1867,8 @@ const QValidator *QComboBox::validator() const By default, for an editable combo box, a QCompleter that performs case insensitive inline completion is automatically created. + + \note The completer is removed when the \a editable property becomes \c false. */ void QComboBox::setCompleter(QCompleter *c) { -- cgit v1.2.1 From 7740f5e98b2f3ab5d9c1f512d1a89e9e1b64434d Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 13 Oct 2016 13:04:33 +0200 Subject: QMimeXMLProvider: add missing out-of-line destructor Fixes build with the latest GCC 7. Change-Id: I4900a256ed1c6cb177d7f94d54e5b07c06ddad08 Task-number: QTBUG-56514 Reviewed-by: Marc Mutz --- src/corelib/mimetypes/qmimeprovider.cpp | 4 ++++ src/corelib/mimetypes/qmimeprovider_p.h | 1 + 2 files changed, 5 insertions(+) (limited to 'src') diff --git a/src/corelib/mimetypes/qmimeprovider.cpp b/src/corelib/mimetypes/qmimeprovider.cpp index fbd14e2d5d..aa8d8c9b08 100644 --- a/src/corelib/mimetypes/qmimeprovider.cpp +++ b/src/corelib/mimetypes/qmimeprovider.cpp @@ -706,6 +706,10 @@ QMimeXMLProvider::QMimeXMLProvider(QMimeDatabasePrivate *db) initResources(); } +QMimeXMLProvider::~QMimeXMLProvider() +{ +} + bool QMimeXMLProvider::isValid() { return true; diff --git a/src/corelib/mimetypes/qmimeprovider_p.h b/src/corelib/mimetypes/qmimeprovider_p.h index c0517d69a4..8eba71eddd 100644 --- a/src/corelib/mimetypes/qmimeprovider_p.h +++ b/src/corelib/mimetypes/qmimeprovider_p.h @@ -132,6 +132,7 @@ class QMimeXMLProvider : public QMimeProviderBase { public: QMimeXMLProvider(QMimeDatabasePrivate *db); + ~QMimeXMLProvider(); virtual bool isValid() Q_DECL_OVERRIDE; virtual QMimeType mimeTypeForName(const QString &name) Q_DECL_OVERRIDE; -- cgit v1.2.1 From adbafab4ef921b2336511a21cb4300eafa1f4cad Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Thu, 8 Sep 2016 12:33:41 +0200 Subject: Specify timeout is in milliseconds Change-Id: I465b343b6fe64c8d1ce17e34be5f864e8556d374 Reviewed-by: Edward Welbourne --- src/testlib/qtestcase.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 876c573196..80aeff7bd1 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -244,7 +244,7 @@ static void stackTrace() \relates QTest The QTRY_VERIFY_WITH_TIMEOUT() macro is similar to QVERIFY(), but checks the \a condition - repeatedly, until either the condition becomes true or the \a timeout is + repeatedly, until either the condition becomes true or the \a timeout (in milliseconds) is reached. Between each evaluation, events will be processed. If the timeout is reached, a failure is recorded in the test log and the test won't be executed further. @@ -276,7 +276,7 @@ static void stackTrace() The QTRY_VERIFY2_WITH_TIMEOUT macro is similar to QTRY_VERIFY_WITH_TIMEOUT() except that it outputs a verbose \a message when \a condition is still false - after the specified \a timeout. The \a message is a plain C string. + after the specified \a timeout (in milliseconds). The \a message is a plain C string. Example: \code @@ -316,7 +316,7 @@ static void stackTrace() The QTRY_COMPARE_WITH_TIMEOUT() macro is similar to QCOMPARE(), but performs the comparison of the \a actual and \a expected values repeatedly, until either the two values - are equal or the \a timeout is reached. Between each comparison, events + are equal or the \a timeout (in milliseconds) is reached. Between each comparison, events will be processed. If the timeout is reached, a failure is recorded in the test log and the test won't be executed further. -- cgit v1.2.1 From 3189313f226f550892a8bd4993ed52b44abea13a Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Tue, 11 Oct 2016 09:59:03 +0200 Subject: Doc: Fix typo in QtStyledItemDelegate::paint() docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-56399 Change-Id: Iaace0ed05098ab6d880b06a40d8e13aa9288c5ec Reviewed-by: Topi Reiniƶ Reviewed-by: Frederik Gladhorn --- src/widgets/itemviews/qstyleditemdelegate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/widgets/itemviews/qstyleditemdelegate.cpp b/src/widgets/itemviews/qstyleditemdelegate.cpp index 483cfbdc36..7de3ca4b0c 100644 --- a/src/widgets/itemviews/qstyleditemdelegate.cpp +++ b/src/widgets/itemviews/qstyleditemdelegate.cpp @@ -360,7 +360,7 @@ void QStyledItemDelegate::initStyleOption(QStyleOptionViewItem *option, if it is enabled or selected. After painting, you should ensure that the painter is returned to - its the state it was supplied in when this function was called. + the state it was supplied in when this function was called. For example, it may be useful to call QPainter::save() before painting and QPainter::restore() afterwards. -- cgit v1.2.1 From e9110b162cad1c07341fa3ed424484a58f9c642a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 14 Oct 2016 16:44:47 +0200 Subject: iOS: Report correct physical DPI for iPhone 7 Plus Task-number: QTBUG-56509 Change-Id: Ibae94262c2a4c917aeca00cb1a1c28e5ae60f0c4 Reviewed-by: Jake Petroules --- src/plugins/platforms/ios/qiosscreen.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm index 4018a02f8d..7d1c01f36b 100644 --- a/src/plugins/platforms/ios/qiosscreen.mm +++ b/src/plugins/platforms/ios/qiosscreen.mm @@ -201,8 +201,8 @@ QIOSScreen::QIOSScreen(UIScreen *screen) else m_depth = 24; - if (deviceIdentifier.contains(QRegularExpression("^iPhone(7,1|8,2)$"))) { - // iPhone 6 Plus or iPhone 6S Plus + if (deviceIdentifier.contains(QRegularExpression("^iPhone(7,1|8,2|9,2|9,4)$"))) { + // iPhone Plus models m_physicalDpi = 401; } else if (deviceIdentifier.contains(QRegularExpression("^iPad(1,1|2,[1-4]|3,[1-6]|4,[1-3]|5,[3-4]|6,[7-8])$"))) { // All iPads except the iPad Mini series -- cgit v1.2.1 From d71bb504a635b51a85f3ccd919e0d77f869e50a8 Mon Sep 17 00:00:00 2001 From: hjk Date: Sun, 16 Oct 2016 13:26:30 +0200 Subject: Fix QtGui compilation without OpenGL Change-Id: I2a9f8bde7d2ba672e4e664ff731a3272a6def516 Reviewed-by: Laszlo Agocs --- src/gui/kernel/qsurfaceformat.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/gui/kernel/qsurfaceformat.cpp b/src/gui/kernel/qsurfaceformat.cpp index 18fde5716b..109ba8e610 100644 --- a/src/gui/kernel/qsurfaceformat.cpp +++ b/src/gui/kernel/qsurfaceformat.cpp @@ -759,11 +759,13 @@ Q_GLOBAL_STATIC(QSurfaceFormat, qt_default_surface_format) */ void QSurfaceFormat::setDefaultFormat(const QSurfaceFormat &format) { +#ifndef QT_NO_OPENGL QOpenGLContext *globalContext = QOpenGLContext::globalShareContext(); if (globalContext && globalContext->isValid()) { qWarning("Warning: Setting a new default format with a different version or profile after " "the global shared context is created may cause issues with context sharing."); } +#endif *qt_default_surface_format() = format; } -- cgit v1.2.1