From 3986e1cb223cc86b74c2895e74a1eb600e892079 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 21 Jun 2016 09:08:02 +0200 Subject: [PATCH 01/16] Document limitations and good practice for logging category names Task-number: QTBUG-54238 Change-Id: I2b6f54fb26d24e6da19c0e09782483eeb10206e1 Reviewed-by: Leena Miettinen Reviewed-by: Michael Brasser --- src/corelib/io/qloggingcategory.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/corelib/io/qloggingcategory.cpp b/src/corelib/io/qloggingcategory.cpp index b51085ef425..a0c6f4a6f4d 100644 --- a/src/corelib/io/qloggingcategory.cpp +++ b/src/corelib/io/qloggingcategory.cpp @@ -80,6 +80,15 @@ static void setBoolLane(QBasicAtomicInt *atomic, bool enable, int shift) \snippet qloggingcategory/main.cpp 1 + \note Category names are free text. However, to allow easy configuration + of the categories using \l{Logging Rules} the names should follow some rules: + \list + \li Use letters and numbers only. + \li Further structure categories into common areas by using dots. + \li Avoid the category names \c{debug}, \c{info}, \c{warning}, and \c{critical}. + \li Category names starting with \c{qt} are reserved for Qt modules. + \endlist + \section1 Checking Category Configuration QLoggingCategory provides \l isDebugEnabled(), \l isInfoEnabled(), From 8fa40b3b3729394f5061d339f83f214e568dde81 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Tue, 21 Jun 2016 07:33:52 +0000 Subject: [PATCH 02/16] Add -no-opengles3 to configure to avoid QT_OPENGL_ES_3 define. This can be helpful for packaging and when one wants to limit the features to ES 2.0 to ensure the same code is used on both build machine and deployment machine. It also prevents inclusion of GLES3/gl3.h. Windows configure.exe doesn't do auto detection of GLES3 so it does not get the additional option. Change-Id: I8750b41635e41bd0ac41d9d59d93570f7d2196e6 Reviewed-by: Thiago Macieira Reviewed-by: Laszlo Agocs --- configure | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 8f6c3801338..e0228a9bfbf 100755 --- a/configure +++ b/configure @@ -643,6 +643,7 @@ CFG_XRANDR=runtime CFG_XRENDER=auto CFG_MITSHM=auto CFG_OPENGL=auto +CFG_OPENGLES3=yes # still depends on CFG_OPENGL, so auto in practice CFG_OPENVG=auto CFG_OPENVG_LC_INCLUDES=no CFG_OPENVG_SHIVA=auto @@ -1279,6 +1280,13 @@ while [ "$#" -gt 0 ]; do UNKNOWN_OPT=yes fi ;; + opengles3) + if [ "$VAL" = "no" ]; then + CFG_OPENGLES3="no" + else + UNKNOWN_OPT=yes + fi + ;; openvg) if [ "$VAL" = "auto" ] || [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_OPENVG="$VAL" @@ -5333,7 +5341,7 @@ fi # compile-time differentiation and including the version specific (but backwards # compatible) ES headers (for example, GLES3/gl31.h). Other than that, there is # no difference in the configuration, even the library is the same. -if [ "$CFG_OPENGL" = "es2" ]; then +if [ "$CFG_OPENGL" = "es2" ] && [ "$CFG_OPENGLES3" = "yes" ]; then if compileTestWithPkgConfig glesv2 unix/opengles3 "OpenGL ES 3.0" ""; then # Add a define for ES3, in addition to ES and ES2. QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES_3" From 17519feadd7309e125cc64bbac83f73b758c6a60 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 23 Jun 2016 11:50:39 +0200 Subject: [PATCH 03/16] don't override user-provided dependencies for our extra compilers while the names of the compilers are actually an undocumented internal, we don't provide an actually working proper way to sequence extra compiler execution with build-time generated inputs when they are indirectly listed (as via .qrc files). Task-number: QTBUG-54299 Change-Id: I269c26512897b72706dc8b769aa47e8157c2a5c5 Reviewed-by: Joerg Bornemann --- mkspecs/features/dbuscommon.pri | 8 ++++---- mkspecs/features/qgltf.prf | 2 +- mkspecs/features/qlalr.prf | 8 ++++---- mkspecs/features/resources.prf | 2 +- mkspecs/features/uic.prf | 2 +- mkspecs/features/wayland-scanner.prf | 8 ++++---- mkspecs/features/win32/dumpcpp.prf | 6 +++--- mkspecs/features/yacc.prf | 2 +- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/mkspecs/features/dbuscommon.pri b/mkspecs/features/dbuscommon.pri index d836b253dc4..cadcd46d61b 100644 --- a/mkspecs/features/dbuscommon.pri +++ b/mkspecs/features/dbuscommon.pri @@ -57,22 +57,22 @@ for(group, groups) { } $${group}_header.commands = $$QMAKE_QDBUSXML2CPP $$hdr_flags $$qdbusxml2cpp_option ${QMAKE_FILE_OUT}: ${QMAKE_FILE_IN} - $${group}_header.depends = $$QMAKE_QDBUSXML2CPP_EXE + $${group}_header.depends += $$QMAKE_QDBUSXML2CPP_EXE $${group}_header.output = ${QMAKE_FUNC_FILE_IN_qdbusOutputBasename}_$${dbus_type}.h $${group}_header.name = DBUSXML2CPP $${dbus_TYPE} HEADER ${QMAKE_FILE_IN} $${group}_header.variable_out = $${GROUP}_HEADERS $${group}_header.input = $$input_list $${group}_source.commands = $$QMAKE_QDBUSXML2CPP -i ${QMAKE_FILE_OUT_BASE}.h $$src_flags $$qdbusxml2cpp_option :${QMAKE_FILE_OUT} ${QMAKE_FILE_IN} - $${group}_source.depends = $$QMAKE_QDBUSXML2CPP_EXE + $${group}_source.depends += $$QMAKE_QDBUSXML2CPP_EXE $${group}_source.output = ${QMAKE_FUNC_FILE_IN_qdbusOutputBasename}_$${dbus_type}.cpp $${group}_source.name = DBUSXML2CPP $${dbus_TYPE} SOURCE ${QMAKE_FILE_IN} $${group}_source.variable_out = SOURCES $${group}_source.input = $$input_list - $${group}_source.depends = $$eval($${group}_header.output) # this actually belongs to the object file + $${group}_source.depends += $$eval($${group}_header.output) # this actually belongs to the object file $${group}_moc.commands = $$moc_header.commands - $${group}_moc.depends = $$QMAKE_MOC_EXE + $${group}_moc.depends += $$QMAKE_MOC_EXE $${group}_moc.output = $$moc_header.output $${group}_moc.input = $${GROUP}_HEADERS $${group}_moc.variable_out = GENERATED_SOURCES diff --git a/mkspecs/features/qgltf.prf b/mkspecs/features/qgltf.prf index 4a6d16f5201..e3a5c64e320 100644 --- a/mkspecs/features/qgltf.prf +++ b/mkspecs/features/qgltf.prf @@ -5,7 +5,7 @@ isEmpty(QGLTF_DIR): QGLTF_DIR = . qgltf.input = QT3D_MODELS qgltf.output = $$QGLTF_DIR/${QMAKE_FILE_BASE}.qrc qgltf.variable_out += RESOURCES -qgltf.depends = $$QMAKE_QGLTF_EXE +qgltf.depends += $$QMAKE_QGLTF_EXE qgltf.commands = $$QMAKE_QGLTF -d $$QGLTF_DIR $$QGLTF_PARAMS ${QMAKE_FILE_NAME} silent: qgltf.commands = @echo qgltf ${QMAKE_FILE_IN} && $$qgltf.commands -s qgltf.CONFIG += no_link diff --git a/mkspecs/features/qlalr.prf b/mkspecs/features/qlalr.prf index 5f0f3794cb9..941bfe0d9f6 100644 --- a/mkspecs/features/qlalr.prf +++ b/mkspecs/features/qlalr.prf @@ -23,7 +23,7 @@ for (s, QLALRSOURCES) { $${base}.input = $$invar $${base}.output = $$QLALR_DIR/$${parser}.cpp $${base}.variable_out = GENERATED_SOURCES - $${base}.depends = $$QMAKE_QLALR_EXE + $${base}.depends += $$QMAKE_QLALR_EXE $${base}.commands = $$QMAKE_QLALR $$QMAKE_QLALRFLAGS ${QMAKE_FILE_IN} silent: $${base}.commands = @echo qlalr ${QMAKE_FILE_IN} && $${base}.commands $${base}.name = QLALR ${QMAKE_FILE_IN} @@ -31,19 +31,19 @@ for (s, QLALRSOURCES) { $${base}_h.input = $$invar $${base}_h.output = $$QLALR_DIR/$${parser}_p.h $${base}_h.CONFIG = no_link - $${base}_h.depends = $$QLALR_DIR/$${parser}.cpp + $${base}_h.depends += $$QLALR_DIR/$${parser}.cpp $${base}_h.commands = $$escape_expand(\\n) # force creation of rule $${base}_decl.input = $$invar $${base}_decl.output = $$QLALR_DIR/$${decl} $${base}_decl.CONFIG = no_link - $${base}_decl.depends = $$QLALR_DIR/$${parser}.cpp + $${base}_decl.depends += $$QLALR_DIR/$${parser}.cpp $${base}_decl.commands = $$escape_expand(\\n) # force creation of rule $${base}_impl.input = $$invar $${base}_impl.output = $$QLALR_DIR/$${impl} $${base}_impl.variable_out = GENERATED_SOURCES - $${base}_impl.depends = $$QLALR_DIR/$${parser}.cpp + $${base}_impl.depends += $$QLALR_DIR/$${parser}.cpp $${base}_impl.commands = $$escape_expand(\\n) # force creation of rule QMAKE_EXTRA_COMPILERS += $$base $${base}_h $${base}_decl $${base}_impl diff --git a/mkspecs/features/resources.prf b/mkspecs/features/resources.prf index 6d0a3187d87..ec70f49ce13 100644 --- a/mkspecs/features/resources.prf +++ b/mkspecs/features/resources.prf @@ -103,7 +103,7 @@ rcc.clean += $$RCC_CPP $$RCC_TMP } -rcc.depends = $$QMAKE_RCC_EXE +rcc.depends += $$QMAKE_RCC_EXE silent:rcc.commands = @echo rcc ${QMAKE_FILE_IN} && $$rcc.commands else:rcc.commands ~= s/&&/$$escape_expand(\\n\\t)/g QMAKE_EXTRA_COMPILERS += rcc diff --git a/mkspecs/features/uic.prf b/mkspecs/features/uic.prf index e6d8b9cc837..ca8283920a6 100644 --- a/mkspecs/features/uic.prf +++ b/mkspecs/features/uic.prf @@ -3,7 +3,7 @@ qtPrepareTool(QMAKE_UIC, uic, _DEP) isEmpty(UI_DIR):UI_DIR = . isEmpty(QMAKE_MOD_UIC):QMAKE_MOD_UIC = ui_ -uic.depends = $$QMAKE_UIC_EXE +uic.depends += $$QMAKE_UIC_EXE uic.commands = $$QMAKE_UIC ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT} uic.depend_command = $$QMAKE_UIC_DEP -d ${QMAKE_FILE_IN} uic.output = $$UI_DIR/$${QMAKE_MOD_UIC}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)} diff --git a/mkspecs/features/wayland-scanner.prf b/mkspecs/features/wayland-scanner.prf index ce833f1c08f..7319392d859 100644 --- a/mkspecs/features/wayland-scanner.prf +++ b/mkspecs/features/wayland-scanner.prf @@ -78,7 +78,7 @@ qtPrepareTool(QMAKE_QTWAYLANDSCANNER, qtwaylandscanner) qtwayland_client_header.name = qtwayland ${QMAKE_FILE_BASE} qtwayland_client_header.input = WAYLANDCLIENTSOURCES qtwayland_client_header.variable_out = HEADERS -qtwayland_client_header.depends = $$QMAKE_QTWAYLANDSCANNER_EXE $${WAYLAND_CLIENT_HEADER_DEST}wayland-${QMAKE_FILE_BASE}-client-protocol$${first(QMAKE_EXT_H)} +qtwayland_client_header.depends += $$QMAKE_QTWAYLANDSCANNER_EXE $${WAYLAND_CLIENT_HEADER_DEST}wayland-${QMAKE_FILE_BASE}-client-protocol$${first(QMAKE_EXT_H)} qtwayland_client_header.output = $${WAYLAND_CLIENT_HEADER_DEST}qwayland-${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)} qtwayland_client_header.commands = $$QMAKE_QTWAYLANDSCANNER client-header ${QMAKE_FILE_IN} $$WAYLAND_CLIENT_INCLUDE_DIR > ${QMAKE_FILE_OUT} silent:qtwayland_client_header.commands = @echo QtWayland client header ${QMAKE_FILE_IN} && $$qtwayland_client_header.commands @@ -87,7 +87,7 @@ QMAKE_EXTRA_COMPILERS += qtwayland_client_header qtwayland_client_code.name = qtwayland ${QMAKE_FILE_BASE} qtwayland_client_code.input = WAYLANDCLIENTSOURCES qtwayland_client_code.variable_out = SOURCES -qtwayland_client_code.depends = $$QMAKE_QTWAYLANDSCANNER_EXE $${WAYLAND_CLIENT_HEADER_DEST}qwayland-${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)} +qtwayland_client_code.depends += $$QMAKE_QTWAYLANDSCANNER_EXE $${WAYLAND_CLIENT_HEADER_DEST}qwayland-${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)} qtwayland_client_code.output = qwayland-${QMAKE_FILE_BASE}.cpp qtwayland_client_code.commands = $$QMAKE_QTWAYLANDSCANNER client-code ${QMAKE_FILE_IN} $$WAYLAND_CLIENT_INCLUDE_DIR > ${QMAKE_FILE_OUT} silent:qtwayland_client_code.commands = @echo QtWayland client code ${QMAKE_FILE_IN} && $$qtwayland_client_code.commands @@ -96,7 +96,7 @@ QMAKE_EXTRA_COMPILERS += qtwayland_client_code qtwayland_server_header.name = qtwayland ${QMAKE_FILE_BASE} qtwayland_server_header.input = WAYLANDSERVERSOURCES qtwayland_server_header.variable_out = HEADERS -qtwayland_server_header.depends = $$QMAKE_QTWAYLANDSCANNER_EXE $${WAYLAND_SERVER_HEADER_DEST}wayland-${QMAKE_FILE_BASE}-server-protocol$${first(QMAKE_EXT_H)} +qtwayland_server_header.depends += $$QMAKE_QTWAYLANDSCANNER_EXE $${WAYLAND_SERVER_HEADER_DEST}wayland-${QMAKE_FILE_BASE}-server-protocol$${first(QMAKE_EXT_H)} qtwayland_server_header.output = $${WAYLAND_SERVER_HEADER_DEST}qwayland-server-${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)} qtwayland_server_header.commands = $$QMAKE_QTWAYLANDSCANNER server-header ${QMAKE_FILE_IN} $$WAYLAND_SERVER_INCLUDE_DIR > ${QMAKE_FILE_OUT} silent:qtwayland_server_header.commands = @echo QtWayland server header ${QMAKE_FILE_IN} && $$qtwayland_server_header.commands @@ -105,7 +105,7 @@ QMAKE_EXTRA_COMPILERS += qtwayland_server_header qtwayland_server_code.name = qtwayland ${QMAKE_FILE_BASE} qtwayland_server_code.input = WAYLANDSERVERSOURCES qtwayland_server_code.variable_out = SOURCES -qtwayland_server_code.depends = $$QMAKE_QTWAYLANDSCANNER_EXE $${WAYLAND_SERVER_HEADER_DEST}qwayland-server-${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)} +qtwayland_server_code.depends += $$QMAKE_QTWAYLANDSCANNER_EXE $${WAYLAND_SERVER_HEADER_DEST}qwayland-server-${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)} qtwayland_server_code.output = qwayland-server-${QMAKE_FILE_BASE}.cpp qtwayland_server_code.commands = $$QMAKE_QTWAYLANDSCANNER server-code ${QMAKE_FILE_IN} $$WAYLAND_SERVER_INCLUDE_DIR > ${QMAKE_FILE_OUT} silent:qtwayland_server_code.commands = @echo QtWayland server code ${QMAKE_FILE_IN} && $$qtwayland_server_code.commands diff --git a/mkspecs/features/win32/dumpcpp.prf b/mkspecs/features/win32/dumpcpp.prf index eb2e84d753e..c8cb0dd24b6 100644 --- a/mkspecs/features/win32/dumpcpp.prf +++ b/mkspecs/features/win32/dumpcpp.prf @@ -1,6 +1,6 @@ qtPrepareTool(QMAKE_DUMPCPP, dumpcpp) -dumpcpp_decl.depends = $$QMAKE_DUMPCPP_EXE +dumpcpp_decl.depends += $$QMAKE_DUMPCPP_EXE dumpcpp_decl.commands = $$QMAKE_DUMPCPP ${QMAKE_FILE_IN} -o ${QMAKE_FILE_BASE} qaxcontainer_compat: dumpcpp_decl.commands += -compat dumpcpp_decl.output = ${QMAKE_FILE_BASE}.h @@ -17,7 +17,7 @@ dumpcpp_impl.output = ${QMAKE_FILE_BASE}.cpp dumpcpp_impl.input = TYPELIBS dumpcpp_impl.variable_out = SOURCES dumpcpp_impl.name = CPP -dumpcpp_impl.depends = ${QMAKE_FILE_BASE}.h +dumpcpp_impl.depends += ${QMAKE_FILE_BASE}.h QMAKE_EXTRA_COMPILERS += dumpcpp_impl @@ -31,6 +31,6 @@ if(isEmpty(BUILDS)|build_pass):have_target:!contains(TEMPLATE, vc.*) { } objtgt.target = $(OBJECTS) - objtgt.depends = $$TYPELIB_HEADERS + objtgt.depends += $$TYPELIB_HEADERS QMAKE_EXTRA_TARGETS += objtgt } diff --git a/mkspecs/features/yacc.prf b/mkspecs/features/yacc.prf index e78dd8cbb38..915fbf6850f 100644 --- a/mkspecs/features/yacc.prf +++ b/mkspecs/features/yacc.prf @@ -36,7 +36,7 @@ yacc_impl.input = YACCSOURCES yacc_impl.variable_out = GENERATED_SOURCES yacc_impl.commands = $$escape_expand(\\n) # We don't want any commands where, but if command is empty no rules are created - yacc_impl.depends = $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_MOD_YACC}$${first(QMAKE_EXT_H)} # Make sure we depend on the step above + yacc_impl.depends += $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_MOD_YACC}$${first(QMAKE_EXT_H)} # Make sure we depend on the step above yacc_impl.output = $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_MOD_YACC}$${first(QMAKE_EXT_CPP)} # Faked output from this step, output really created in step above QMAKE_EXTRA_COMPILERS += yacc_impl } From b6cf0418677729e91e5ccd866afdb22e11385d74 Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Fri, 13 May 2016 12:20:39 +0300 Subject: [PATCH 04/16] Widgets: use QStringRef to optimize memory allocation Replace substring functions that return QString with corresponding functions that return QStringRef where it's possible. Create QString from QStringRef only where necessary. Change-Id: I728c4338135f83d9cdff4d1ee1aed77f95d453b8 Reviewed-by: Thiago Macieira Reviewed-by: Marc Mutz --- src/widgets/widgets/qabstractspinbox.cpp | 4 ++-- src/widgets/widgets/qtabbar.cpp | 6 +++--- src/widgets/widgets/qtextbrowser.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/widgets/widgets/qabstractspinbox.cpp b/src/widgets/widgets/qabstractspinbox.cpp index b33984e6c64..774f5a708d3 100644 --- a/src/widgets/widgets/qabstractspinbox.cpp +++ b/src/widgets/widgets/qabstractspinbox.cpp @@ -1418,7 +1418,7 @@ QStyle::SubControl QAbstractSpinBoxPrivate::newHoverControl(const QPoint &pos) QString QAbstractSpinBoxPrivate::stripped(const QString &t, int *pos) const { - QString text = t; + QStringRef text(&t); if (specialValueText.size() == 0 || text != specialValueText) { int from = 0; int size = text.size(); @@ -1440,7 +1440,7 @@ QString QAbstractSpinBoxPrivate::stripped(const QString &t, int *pos) const text = text.trimmed(); if (pos) (*pos) -= (s - text.size()); - return text; + return text.toString(); } diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp index 7a192193e49..09b7cb9d245 100644 --- a/src/widgets/widgets/qtabbar.cpp +++ b/src/widgets/widgets/qtabbar.cpp @@ -1413,13 +1413,13 @@ static QString computeElidedText(Qt::TextElideMode mode, const QString &text) QString ret; switch (mode) { case Qt::ElideRight: - ret = text.left(2) + Ellipses; + ret = text.leftRef(2) + Ellipses; break; case Qt::ElideMiddle: - ret = text.left(1) + Ellipses + text.right(1); + ret = text.leftRef(1) + Ellipses + text.rightRef(1); break; case Qt::ElideLeft: - ret = Ellipses + text.right(2); + ret = Ellipses + text.rightRef(2); break; case Qt::ElideNone: ret = text; diff --git a/src/widgets/widgets/qtextbrowser.cpp b/src/widgets/widgets/qtextbrowser.cpp index 45da34c383f..df92fc0e1e4 100644 --- a/src/widgets/widgets/qtextbrowser.cpp +++ b/src/widgets/widgets/qtextbrowser.cpp @@ -302,7 +302,7 @@ void QTextBrowserPrivate::setSource(const QUrl &url) qWarning("QTextBrowser: No document for %s", url.toString().toLatin1().constData()); if (q->isVisible()) { - QString firstTag = txt.left(txt.indexOf(QLatin1Char('>')) + 1); + const QStringRef firstTag = txt.leftRef(txt.indexOf(QLatin1Char('>')) + 1); if (firstTag.startsWith(QLatin1String(" Date: Wed, 1 Jun 2016 15:08:14 +0200 Subject: [PATCH 05/16] Doc: Remove obsolete QtWebKit entries from the example metadata Change-Id: I60caf454ae7e5f6e0c0bd2c2eb1934bc0f7e3fba Reviewed-by: Leena Miettinen --- doc/global/manifest-meta.qdocconf | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/doc/global/manifest-meta.qdocconf b/doc/global/manifest-meta.qdocconf index f535f5e2903..6b4e3410c97 100644 --- a/doc/global/manifest-meta.qdocconf +++ b/doc/global/manifest-meta.qdocconf @@ -14,10 +14,9 @@ # Note: You cannot use operators (+, =, -) in the names. # # Examples: add a 'isHighlighted' attribute for two 'Analog Clock' examples, -# add a 'database' tag for QtSql all examples, a 'webkit' tag for QtWebKit -# examples, and a 'qt5' tag for all examples +# add a 'database' tag for QtSql examples, and a 'qt5' tag for all examples # -# manifestmeta.filters = highlighted sql webkit global +# manifestmeta.filters = highlighted sql global # # manifestmeta.highlighted.names = "QtGui/Analog Clock Window Example" \ # "QtWidgets/Analog Clock Example" @@ -26,13 +25,10 @@ # manifestmeta.sql.names = "QtSql/*" # manifestmeta.sql.tags = database # -# manifestmeta.webkit.names = "QtWebKitExamples/*" -# manifestmeta.webkit.tags = webkit -# # manifestmeta.global.names = * # manifestmeta.global.tags = qt5 -manifestmeta.filters = highlighted webkit1 webkit2 android thumbnail ios +manifestmeta.filters = highlighted android thumbnail ios manifestmeta.highlighted.names = "QtQuick/Qt Quick Demo - Same Game" \ "QtQuick/Qt Quick Demo - Photo Surface" \ @@ -59,26 +55,6 @@ manifestmeta.highlighted.names = "QtQuick/Qt Quick Demo - Same Game" \ manifestmeta.highlighted.attributes = isHighlighted:true -# Add 'webkit1' tag for QtWebKit1 examples -manifestmeta.webkit1.names = "QtWebKitExamples/Tab Browser" \ - "QtWebKitExamples/DOM Traversal Example" \ - "QtWebKitExamples/Fancy Browser Example" \ - "QtWebKitExamples/Form Extractor Example" \ - "QtWebKitExamples/WebKit Frame Capture Example" \ - "QtWebKitExamples/The Webkit Bridge Tutorial*" \ - "QtWebKitExamples/Previewer Example" \ - "QtWebKitExamples/Wheel Scroller Example" \ - "QtWebKitExamples/Simple Selector Example" \ - "QtWebKitExamples/QObject XML Model Example" - -manifestmeta.webkit1.tags = webkit1 - -# Add 'webkit2' tag for QtWebKit2 examples -manifestmeta.webkit2.names = "QtWebKitExamples/Flickr View Example" \ - "QtWebKitExamples/YouTube View Example" - -manifestmeta.webkit2.tags = webkit2 - manifestmeta.android.names = "QtQuick/Qt Quick Demo - Maroon*" \ "QtQuick/Qt Quick Demo - Calqlatr" \ "QtWidgets/Application Chooser Example" \ From ac9899b4cbae6af6f075be91c2863b17605a1085 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 23 Jun 2016 12:15:06 +0200 Subject: [PATCH 06/16] mainwindow example: fix creating custom QDockWidget MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The signal was connected to the wrong slot. Regressed in 2fe56e37ede40dc703a9c3c8eb240b80c9c00757. Change-Id: I33135fc79c3585dfbe0f6ebc04f819e919ed9ed7 Reviewed-by: Sérgio Martins --- examples/widgets/mainwindows/mainwindow/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/widgets/mainwindows/mainwindow/mainwindow.cpp b/examples/widgets/mainwindows/mainwindow/mainwindow.cpp index 91579ae6116..b0fa72276d9 100644 --- a/examples/widgets/mainwindows/mainwindow/mainwindow.cpp +++ b/examples/widgets/mainwindows/mainwindow/mainwindow.cpp @@ -412,7 +412,7 @@ CreateDockWidgetDialog::CreateDockWidgetDialog(QWidget *parent) QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this); connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); - connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::reject); + connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); layout->addWidget(buttonBox, 2, 0, 1, 2); } From 0c44f26fae4d3ee493d8669b2ae1ea525e71c953 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 22 Jun 2016 11:57:15 +0200 Subject: [PATCH 07/16] QDockWidget: fix floating group tab window not having the right title MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before, we were relying on the ZOrderChange event to update the windows title or other flags of a floating tab window when tabs are changed. But this did not catch all the cases. For example, the first tab switch, or when tabs are dragged out. Task-number: QTBUG-53754 Task-number: QTBUG-52107 Change-Id: I1523ce85ceaa95f044bd81f8ccbac0a86978fb33 Reviewed-by: Sérgio Martins --- src/widgets/widgets/qdockarealayout.cpp | 3 +++ src/widgets/widgets/qdockwidget.cpp | 5 ----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/widgets/widgets/qdockarealayout.cpp b/src/widgets/widgets/qdockarealayout.cpp index 2823bd6f2f4..d22e89c6e1e 100644 --- a/src/widgets/widgets/qdockarealayout.cpp +++ b/src/widgets/widgets/qdockarealayout.cpp @@ -2155,6 +2155,9 @@ bool QDockAreaLayoutInfo::updateTabBar() const if (oldCurrentId > 0 && currentTabId() != oldCurrentId) that->setCurrentTabId(oldCurrentId); + if (QDockWidgetGroupWindow *dwgw = qobject_cast(tabBar->parent())) + dwgw->adjustFlags(); + //returns if the tabbar is visible or not return ( (gap ? 1 : 0) + tabBar->count()) > 1; } diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp index 8b2e7a66607..a7e04d3bfc9 100644 --- a/src/widgets/widgets/qdockwidget.cpp +++ b/src/widgets/widgets/qdockwidget.cpp @@ -1386,8 +1386,6 @@ void QDockWidget::changeEvent(QEvent *event) if (QDockAreaLayoutInfo *info = winLayout->layoutState.dockAreaLayout.info(this)) info->updateTabBar(); } - if (QDockWidgetGroupWindow *p = qobject_cast(parent())) - p->adjustFlags(); } #endif // QT_NO_TABBAR break; @@ -1477,9 +1475,6 @@ bool QDockWidget::event(QEvent *event) } if (!isFloating() && layout != 0 && onTop) layout->raise(this); - if (QDockWidgetGroupWindow *p = qobject_cast(parent())) - p->adjustFlags(); - break; } case QEvent::WindowActivate: From 1a96295755391b508ea37b4bfbb681ea15ed7559 Mon Sep 17 00:00:00 2001 From: Ralf Nolden Date: Fri, 24 Jun 2016 22:33:31 +0200 Subject: [PATCH 08/16] Libpng config.tests: use pkg-config when available Add pkg-config to the libpng usages as not all systems have the symlink libpng.so -> libpng.so (affected: NetBSD) that changes with the version of the lib. If no-pkg-config is used, use -lpng as before. Tested with FreeBSD 10.3, NetBSD 7.0.1 using png 1.6.21 Change-Id: I5c87f380c84da3d5c56c94da53adb900791c8caa Reviewed-by: Oswald Buddenhagen --- config.tests/unix/libpng/libpng.pro | 7 ++++++- src/3rdparty/png_dependency.pri | 12 ++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/config.tests/unix/libpng/libpng.pro b/config.tests/unix/libpng/libpng.pro index 4e50fe26e5f..cdca43171cc 100644 --- a/config.tests/unix/libpng/libpng.pro +++ b/config.tests/unix/libpng/libpng.pro @@ -1,3 +1,8 @@ SOURCES = libpng.cpp CONFIG -= qt dylib -LIBS += -lpng +!contains(QT_CONFIG, no-pkg-config) { + CONFIG += link_pkgconfig + PKGCONFIG += libpng +} else { + LIBS += -lpng +} diff --git a/src/3rdparty/png_dependency.pri b/src/3rdparty/png_dependency.pri index 78da861f775..f0a3936c8cc 100644 --- a/src/3rdparty/png_dependency.pri +++ b/src/3rdparty/png_dependency.pri @@ -1,6 +1,14 @@ contains(QT_CONFIG, system-png) { - unix|mingw: LIBS_PRIVATE += -lpng - else: LIBS += libpng.lib + unix|mingw { + !contains(QT_CONFIG, no-pkg-config) { + CONFIG += link_pkgconfig + PKGCONFIG_PRIVATE += libpng + } else { + LIBS_PRIVATE += -lpng + } + } else { + LIBS += libpng.lib + } } else: contains(QT_CONFIG, png) { include($$PWD/libpng.pri) } From b3b2f502e9b499814a1e3b21e1b572e3ff1ba37b Mon Sep 17 00:00:00 2001 From: Ralf Nolden Date: Mon, 27 Jun 2016 10:34:19 +0200 Subject: [PATCH 09/16] NetBSD: use paccept() where accept4() is used Where accept4() is used, NetBSD offers paccept() as a replacement function. Modify check for using accept4() and use paccept() on NetBSD. See http://netbsd.gw.com/cgi-bin/man-cgi?paccept++NetBSD-current and http://reviews.llvm.org/D12485 Change-Id: I9b3ecba5f3afad6c357d3f7b8f89589bf313e273 Reviewed-by: Oswald Buddenhagen Reviewed-by: Thiago Macieira --- config.tests/unix/cloexec/cloexec.cpp | 4 ++++ src/network/socket/qnet_unix_p.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/config.tests/unix/cloexec/cloexec.cpp b/config.tests/unix/cloexec/cloexec.cpp index 3f127d8d3fb..cbde3072370 100644 --- a/config.tests/unix/cloexec/cloexec.cpp +++ b/config.tests/unix/cloexec/cloexec.cpp @@ -44,6 +44,10 @@ int main() (void) pipe2(pipes, O_CLOEXEC | O_NONBLOCK); (void) fcntl(0, F_DUPFD_CLOEXEC, 0); (void) dup3(0, 3, O_CLOEXEC); +#if defined(__NetBSD__) + (void) paccept(0, 0, 0, NULL, SOCK_CLOEXEC | SOCK_NONBLOCK); +#else (void) accept4(0, 0, 0, SOCK_CLOEXEC | SOCK_NONBLOCK); +#endif return 0; } diff --git a/src/network/socket/qnet_unix_p.h b/src/network/socket/qnet_unix_p.h index 9626c53711e..1481f565d44 100644 --- a/src/network/socket/qnet_unix_p.h +++ b/src/network/socket/qnet_unix_p.h @@ -109,7 +109,11 @@ static inline int qt_safe_accept(int s, struct sockaddr *addr, QT_SOCKLEN_T *add int sockflags = SOCK_CLOEXEC; if (flags & O_NONBLOCK) sockflags |= SOCK_NONBLOCK; +# if defined(Q_OS_NETBSD) + fd = ::paccept(s, addr, static_cast(addrlen), NULL, sockflags); +# else fd = ::accept4(s, addr, static_cast(addrlen), sockflags); +# endif return fd; #else fd = ::accept(s, addr, static_cast(addrlen)); From fe9ca6ede8ee9817868ae5aac8c3f8b4480e9aea Mon Sep 17 00:00:00 2001 From: Ralf Nolden Date: Mon, 27 Jun 2016 10:25:42 +0200 Subject: [PATCH 10/16] NetBSD: enable detection of posix_fallocate() posix_fallocate() is declared in unistd.h on NetBSD. Add the include for proper detection on NetBSD 7.0 and up. See http://netbsd.gw.com/cgi-bin/man-cgi?posix_fallocate++NetBSD-current As that is violating the POSIX standards, a PR was opened at NetBSD under http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=51287 for further tracking of the issue. Change-Id: I40ec320677eef37bbc39f58e0bbac34f8cf7b8da Reviewed-by: Thiago Macieira --- config.tests/unix/posix_fallocate/posix_fallocate.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config.tests/unix/posix_fallocate/posix_fallocate.cpp b/config.tests/unix/posix_fallocate/posix_fallocate.cpp index 689feb68704..dfeba4bec1c 100644 --- a/config.tests/unix/posix_fallocate/posix_fallocate.cpp +++ b/config.tests/unix/posix_fallocate/posix_fallocate.cpp @@ -32,6 +32,10 @@ ****************************************************************************/ #include +// NetBSD 7 has posix_fallocate, but in unistd.h instead of fcntl.h +#ifdef __NetBSD__ +# include +#endif int main(int, char **) { From 2a7cee47e5e84c73e32a6953e145771196645f1a Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 22 Jun 2016 10:08:28 +0200 Subject: [PATCH 11/16] Avoid artifacts when hiding or closing a QOpenGLWidget or QQuickWidget child windows and xcb enables SwitchableWidgetComposition meaning that widget backing stores will fall back to the normal flush path when no render-to-texture widgets are visible anymore in the window. This switch however can lead to artifacts with the image of the rtt widget remaining visible until the next full bacinkgstore sync. The safe and simple way around this is to do the switch only in the next flush, keeping the flush where the switch is discovered on the OpenGL-based composition path still. Task-number: QTBUG-54241 Change-Id: I1d3f10999f69c58efa791dd724891add56949dee Reviewed-by: Paul Olav Tvete --- src/widgets/kernel/qwidget.cpp | 1 + src/widgets/kernel/qwidget_p.h | 1 + src/widgets/kernel/qwidgetbackingstore.cpp | 18 ++++++++++++++++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 0376ab88ac9..57148eb811a 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -274,6 +274,7 @@ QWidgetPrivate::QWidgetPrivate(int version) #endif #ifndef QT_NO_OPENGL , renderToTextureReallyDirty(1) + , renderToTextureComposeActive(0) #endif #if defined(Q_OS_WIN) , noPaintOnScreen(0) diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h index 9d4bdc7f89e..9681cb03ec2 100644 --- a/src/widgets/kernel/qwidget_p.h +++ b/src/widgets/kernel/qwidget_p.h @@ -744,6 +744,7 @@ public: #endif #ifndef QT_NO_OPENGL uint renderToTextureReallyDirty : 1; + uint renderToTextureComposeActive : 1; #endif // *************************** Platform specific ************************************ diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp index 5d13fb926b3..7473dd1dfb5 100644 --- a/src/widgets/kernel/qwidgetbackingstore.cpp +++ b/src/widgets/kernel/qwidgetbackingstore.cpp @@ -61,6 +61,8 @@ QT_BEGIN_NAMESPACE extern QRegion qt_dirtyRegion(QWidget *); +Q_GLOBAL_STATIC(QPlatformTextureList, qt_dummy_platformTextureList) + /** * Flushes the contents of the \a backingStore into the screen area of \a widget. * \a tlwOffset is the position of the top level widget relative to the window surface. @@ -103,6 +105,20 @@ void QWidgetBackingStore::qt_flush(QWidget *widget, const QRegion ®ion, QBack offset += widget->mapTo(tlw, QPoint()); #ifndef QT_NO_OPENGL + const bool compositionWasActive = widget->d_func()->renderToTextureComposeActive; + if (!widgetTextures) { + widget->d_func()->renderToTextureComposeActive = false; + // Detect the case of falling back to the normal flush path when no + // render-to-texture widgets are visible anymore. We will force one + // last flush to go through the OpenGL-based composition to prevent + // artifacts. The next flush after this one will use the normal path. + if (compositionWasActive) + widgetTextures = qt_dummy_platformTextureList; + } else { + widget->d_func()->renderToTextureComposeActive = true; + } + + // re-test since we may have been forced to this path via the dummy texture list above if (widgetTextures) { qt_window_private(tlw->windowHandle())->compositing = true; widget->window()->d_func()->sendComposeStatus(widget->window(), false); @@ -978,8 +994,6 @@ static void findAllTextureWidgetsRecursively(QWidget *tlw, QWidget *widget) } } -Q_GLOBAL_STATIC(QPlatformTextureList, qt_dummy_platformTextureList) - static QPlatformTextureList *widgetTexturesFor(QWidget *tlw, QWidget *widget) { foreach (QPlatformTextureList *tl, QWidgetPrivate::get(tlw)->topData()->widgetTextures) { From a8c98dcb89f2b3f8438555d8febe17d3542d0567 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 27 Jun 2016 13:43:45 +0200 Subject: [PATCH 12/16] fix default inc/lib path detection on msys using the Makefile target separator to determine the host system is of course not a terribly good idea. the correct variable to query would be DIR_SEPARATOR, which always reflects the host. however, a direct os query is less obscure in this case. Task-number: QTBUG-54346 Change-Id: I6bc1372a7c9a84a241a97f9f767f046b026411c3 Reviewed-by: Kai Koehne --- mkspecs/features/default_pre.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/default_pre.prf b/mkspecs/features/default_pre.prf index d760586f744..62cd90912ee 100644 --- a/mkspecs/features/default_pre.prf +++ b/mkspecs/features/default_pre.prf @@ -30,7 +30,7 @@ isEmpty(QMAKE_DEFAULT_INCDIRS):!host_build { # Get default include and library paths from compiler # gcc { - equals(QMAKE_DIR_SEP, /) { + !equals(QMAKE_HOST.os, Windows) { cmd_prefix = "LC_ALL=C" cmd_suffix = "/dev/null" } else { From 0d720a000f4f35c5ea6942426efec6847b06f4ce Mon Sep 17 00:00:00 2001 From: James McDonnell Date: Wed, 22 Jun 2016 10:35:22 -0400 Subject: [PATCH 13/16] Improve SQLite3 configuration test Reference an SQLite3 function to verify that the library is being linked. Discovered that the test didn't do this when I switched the Windows configure to use a compile test to determine whether the system has SQLite3. The test passed even though the initial configure changes failed to provide the test with information about the SQLite3 libraries. Change-Id: I3114cfc2dec3a42a60c8e1e432eb8375b440d7e0 Reviewed-by: Oswald Buddenhagen --- config.tests/unix/sqlite/sqlite.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/config.tests/unix/sqlite/sqlite.cpp b/config.tests/unix/sqlite/sqlite.cpp index b639e82ed82..1059e516aff 100644 --- a/config.tests/unix/sqlite/sqlite.cpp +++ b/config.tests/unix/sqlite/sqlite.cpp @@ -35,5 +35,6 @@ int main(int, char **) { + sqlite3_open_v2(0, 0, 0, 0); return 0; } From b9b3bff424677a84cdd73fd34f7514c2f700e612 Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Mon, 27 Jun 2016 12:14:52 +0300 Subject: [PATCH 14/16] QAbstractItemView: use erase and std::remove_if with QList ... instead of using erase() in a loop, with quadratic complexity. Change-Id: Id9c70a0d1d27b5057e5bf64c315bd66cbcd67330 Reviewed-by: Edward Welbourne Reviewed-by: Marc Mutz --- src/widgets/itemviews/qabstractitemview.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp index 26dd49f8cf6..e67f8d83fb1 100644 --- a/src/widgets/itemviews/qabstractitemview.cpp +++ b/src/widgets/itemviews/qabstractitemview.cpp @@ -2604,12 +2604,11 @@ QModelIndexList QAbstractItemView::selectedIndexes() const QModelIndexList indexes; if (d->selectionModel) { indexes = d->selectionModel->selectedIndexes(); - QList::iterator it = indexes.begin(); - while (it != indexes.end()) - if (isIndexHidden(*it)) - it = indexes.erase(it); - else - ++it; + auto isHidden = [this](const QModelIndex &idx) { + return isIndexHidden(idx); + }; + const auto end = indexes.end(); + indexes.erase(std::remove_if(indexes.begin(), end, isHidden), end); } return indexes; } From 25f040820ce3cd97868f7e432e612532bfdca962 Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Fri, 24 Jun 2016 13:59:17 +0300 Subject: [PATCH 15/16] QAbstractItemView: avoid search through QIndexEditorHash Search's implicit cast (QModelIndex to QPersistentModelIndex) is slow. Use cheap pre-test to avoid when we can. Use method from 1d859ef80540ec3dd64f4f7bda3a8e415965650c Change-Id: Ic3d06869de717963bad6357abb99f3e025642078 Reviewed-by: Edward Welbourne --- src/widgets/itemviews/qabstractitemview_p.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/widgets/itemviews/qabstractitemview_p.h b/src/widgets/itemviews/qabstractitemview_p.h index a3af79abcbc..60ae1559b15 100644 --- a/src/widgets/itemviews/qabstractitemview_p.h +++ b/src/widgets/itemviews/qabstractitemview_p.h @@ -277,7 +277,8 @@ public: const QEditorInfo &editorForIndex(const QModelIndex &index) const; inline bool hasEditor(const QModelIndex &index) const { - return indexEditorHash.find(index) != indexEditorHash.constEnd(); + // Search's implicit cast (QModelIndex to QPersistentModelIndex) is slow; use cheap pre-test to avoid when we can. + return !indexEditorHash.isEmpty() && indexEditorHash.contains(index); } QModelIndex indexForEditor(QWidget *editor) const; From e2665600c09358854bb0b29389cc873a2684f77b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= Date: Sat, 11 Jun 2016 18:39:23 +0200 Subject: [PATCH 16/16] xcb: Send expose event while shrinking windows Send synthesized expose event while shrinking the QWindow. This fixes the regression which can break some applications which need the paint events while shrinking the QWindow. Added auto test. Task-number: QTBUG-54040 Change-Id: Iaa992abba67f428237fa12c6cae56592b8fcadb0 Reviewed-by: Gatis Paeglis Reviewed-by: Louai Al-Khanji --- src/plugins/platforms/xcb/qxcbwindow.cpp | 9 +++++++++ src/plugins/platforms/xcb/qxcbwindow.h | 1 + tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | 19 +++++++++++++++++++ 3 files changed, 29 insertions(+) diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index fc04d6afc4e..bf1fd2e177d 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -2102,6 +2102,15 @@ void QXcbWindow::handleConfigureNotifyEvent(const xcb_configure_notify_event_t * // will make the comparison later. QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->screen()); + // Send the synthetic expose event on resize only when the window is shrinked, + // because the "XCB_GRAVITY_NORTH_WEST" flag doesn't send it automatically. + if (!m_oldWindowSize.isEmpty() + && (actualGeometry.width() < m_oldWindowSize.width() + || actualGeometry.height() < m_oldWindowSize.height())) { + QWindowSystemInterface::handleExposeEvent(window(), QRegion(0, 0, actualGeometry.width(), actualGeometry.height())); + } + m_oldWindowSize = actualGeometry.size(); + if (m_usingSyncProtocol && m_syncState == SyncReceived) m_syncState = SyncAndConfigureReceived; diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h index 9ad0153ca25..e7190b17331 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.h +++ b/src/plugins/platforms/xcb/qxcbwindow.h @@ -256,6 +256,7 @@ protected: mutable QMargins m_frameMargins; QRegion m_exposeRegion; + QSize m_oldWindowSize; xcb_visualid_t m_visualId; int m_lastWindowStateEvent; diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index 892dc0899ff..70446e803ab 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -58,6 +58,7 @@ private slots: void setVisible(); void eventOrderOnShow(); void resizeEventAfterResize(); + void exposeEventOnShrink_QTBUG54040(); void mapGlobal(); void positioning_data(); void positioning(); @@ -373,6 +374,24 @@ void tst_QWindow::resizeEventAfterResize() QTRY_COMPARE(window.received(QEvent::Resize), 2); } +void tst_QWindow::exposeEventOnShrink_QTBUG54040() +{ + Window window; + window.setGeometry(QRect(m_availableTopLeft + QPoint(80, 80), m_testWindowSize)); + window.setTitle(QTest::currentTestFunction()); + window.showNormal(); + + QVERIFY(QTest::qWaitForWindowExposed(&window)); + + const int initialExposeCount = window.received(QEvent::Expose); + window.resize(window.width(), window.height() - 5); + QTRY_COMPARE(window.received(QEvent::Expose), initialExposeCount + 1); + window.resize(window.width() - 5, window.height()); + QTRY_COMPARE(window.received(QEvent::Expose), initialExposeCount + 2); + window.resize(window.width() - 5, window.height() - 5); + QTRY_COMPARE(window.received(QEvent::Expose), initialExposeCount + 3); +} + void tst_QWindow::positioning_data() { QTest::addColumn("windowflags");