diff options
author | Liang Qi <liang.qi@qt.io> | 2016-07-01 12:33:16 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-07-01 13:21:29 +0200 |
commit | 200fdd96f0aae9d2060cf3b8cb491eda10d6d68f (patch) | |
tree | 80b3a1450c3fa8cbd44e07d82f6f5d3985a5902e | |
parent | cb260c6c7f1ebd4b3fa5f86c3d98ec8ff0486095 (diff) | |
parent | e2665600c09358854bb0b29389cc873a2684f77b (diff) |
Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
configure
configure.json
Change-Id: Iba032d9a29c273da2585632bc6e22bbafb961808
32 files changed, 126 insertions, 51 deletions
diff --git a/config.tests/unix/cloexec/cloexec.cpp b/config.tests/unix/cloexec/cloexec.cpp index 2cd62c925d..cc6948a280 100644 --- a/config.tests/unix/cloexec/cloexec.cpp +++ b/config.tests/unix/cloexec/cloexec.cpp @@ -50,6 +50,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/config.tests/unix/libpng/libpng.pro b/config.tests/unix/libpng/libpng.pro index 4e50fe26e5..cdca43171c 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/config.tests/unix/posix_fallocate/posix_fallocate.cpp b/config.tests/unix/posix_fallocate/posix_fallocate.cpp index dd39eec7b9..ce1286813a 100644 --- a/config.tests/unix/posix_fallocate/posix_fallocate.cpp +++ b/config.tests/unix/posix_fallocate/posix_fallocate.cpp @@ -38,6 +38,10 @@ ****************************************************************************/ #include <fcntl.h> +// NetBSD 7 has posix_fallocate, but in unistd.h instead of fcntl.h +#ifdef __NetBSD__ +# include <unistd.h> +#endif int main(int, char **) { diff --git a/config.tests/unix/sqlite/sqlite.cpp b/config.tests/unix/sqlite/sqlite.cpp index 6ea2386a48..dd17f74101 100644 --- a/config.tests/unix/sqlite/sqlite.cpp +++ b/config.tests/unix/sqlite/sqlite.cpp @@ -41,5 +41,6 @@ int main(int, char **) { + sqlite3_open_v2(0, 0, 0, 0); return 0; } diff --git a/configure.json b/configure.json index 164571b297..87fd5d7190 100644 --- a/configure.json +++ b/configure.json @@ -104,6 +104,7 @@ "mysql_config": "string", "nomake": { "type": "addString", "values": [ "examples", "tests", "tools" ] }, "opengl": { "type": "optionalString", "values": [ "no", "yes", "desktop", "es2" ] }, + "opengles3": "boolean", "opensource": { "type": "void", "name": "commercial", "value": "no" }, "openssl": "boolean", "openssl-linked": { "type": "void", "name": "openssl", "value": "linked" }, diff --git a/doc/global/manifest-meta.qdocconf b/doc/global/manifest-meta.qdocconf index 1e7313711b..bb242eb98f 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" \ diff --git a/examples/widgets/mainwindows/mainwindow/mainwindow.cpp b/examples/widgets/mainwindows/mainwindow/mainwindow.cpp index a0aedb6f24..a21a64bdd4 100644 --- a/examples/widgets/mainwindows/mainwindow/mainwindow.cpp +++ b/examples/widgets/mainwindows/mainwindow/mainwindow.cpp @@ -429,7 +429,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); } diff --git a/mkspecs/features/dbuscommon.pri b/mkspecs/features/dbuscommon.pri index d836b253dc..cadcd46d61 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/default_pre.prf b/mkspecs/features/default_pre.prf index 293f7ba0bd..01aa182be0 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 >/dev/null" } else { diff --git a/mkspecs/features/qgltf.prf b/mkspecs/features/qgltf.prf index 4a6d16f520..e3a5c64e32 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 5f0f3794cb..941bfe0d9f 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 6d0a3187d8..ec70f49ce1 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 e6d8b9cc83..ca8283920a 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 ce833f1c08..7319392d85 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 eb2e84d753..c8cb0dd24b 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 e78dd8cbb3..915fbf6850 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 } diff --git a/src/3rdparty/png_dependency.pri b/src/3rdparty/png_dependency.pri index eb32432b49..2ec2e8929d 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) { INCLUDEPATH += $$PWD/libpng LIBS_PRIVATE += -L$$QT_BUILD_TREE/lib -lqtpng$$qtPlatformTargetSuffix() diff --git a/src/corelib/io/qloggingcategory.cpp b/src/corelib/io/qloggingcategory.cpp index 519cec507a..afdf0d0312 100644 --- a/src/corelib/io/qloggingcategory.cpp +++ b/src/corelib/io/qloggingcategory.cpp @@ -86,6 +86,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(), diff --git a/src/network/socket/qnet_unix_p.h b/src/network/socket/qnet_unix_p.h index 9d17c6dd33..8d2a4ae852 100644 --- a/src/network/socket/qnet_unix_p.h +++ b/src/network/socket/qnet_unix_p.h @@ -115,7 +115,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<QT_SOCKLEN_T *>(addrlen), NULL, sockflags); +# else fd = ::accept4(s, addr, static_cast<QT_SOCKLEN_T *>(addrlen), sockflags); +# endif return fd; #else fd = ::accept(s, addr, static_cast<QT_SOCKLEN_T *>(addrlen)); diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 063778a1de..c5cc2cd790 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 9ad0153ca2..e7190b1733 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/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp index 42e0cc7585..4768c58d1d 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<QModelIndex>::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; } diff --git a/src/widgets/itemviews/qabstractitemview_p.h b/src/widgets/itemviews/qabstractitemview_p.h index a3af79abcb..60ae1559b1 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; diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 6fa74b7cc6..a71089793c 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -281,6 +281,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 838236536a..71691a4afa 100644 --- a/src/widgets/kernel/qwidget_p.h +++ b/src/widgets/kernel/qwidget_p.h @@ -750,6 +750,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 ecaba584f2..32aabcec9f 100644 --- a/src/widgets/kernel/qwidgetbackingstore.cpp +++ b/src/widgets/kernel/qwidgetbackingstore.cpp @@ -67,6 +67,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. @@ -109,6 +111,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); @@ -970,8 +986,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) { diff --git a/src/widgets/widgets/qabstractspinbox.cpp b/src/widgets/widgets/qabstractspinbox.cpp index b33984e6c6..774f5a708d 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/qdockarealayout.cpp b/src/widgets/widgets/qdockarealayout.cpp index 3b185a5e67..55e774024a 100644 --- a/src/widgets/widgets/qdockarealayout.cpp +++ b/src/widgets/widgets/qdockarealayout.cpp @@ -2168,6 +2168,9 @@ bool QDockAreaLayoutInfo::updateTabBar() const if (oldCurrentId > 0 && currentTabId() != oldCurrentId) that->setCurrentTabId(oldCurrentId); + if (QDockWidgetGroupWindow *dwgw = qobject_cast<QDockWidgetGroupWindow *>(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 e8c5502ae6..d2fa9a7c06 100644 --- a/src/widgets/widgets/qdockwidget.cpp +++ b/src/widgets/widgets/qdockwidget.cpp @@ -1390,8 +1390,6 @@ void QDockWidget::changeEvent(QEvent *event) if (QDockAreaLayoutInfo *info = winLayout->layoutState.dockAreaLayout.info(this)) info->updateTabBar(); } - if (QDockWidgetGroupWindow *p = qobject_cast<QDockWidgetGroupWindow *>(parent())) - p->adjustFlags(); } #endif // QT_NO_TABBAR break; @@ -1481,9 +1479,6 @@ bool QDockWidget::event(QEvent *event) } if (!isFloating() && layout != 0 && onTop) layout->raise(this); - if (QDockWidgetGroupWindow *p = qobject_cast<QDockWidgetGroupWindow *>(parent())) - p->adjustFlags(); - break; } case QEvent::WindowActivate: diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp index 8c808f98cb..fe04299b92 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 45da34c383..df92fc0e1e 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("<qt")) && firstTag.contains(QLatin1String("type")) && firstTag.contains(QLatin1String("detail"))) { #ifndef QT_NO_CURSOR QApplication::restoreOverrideCursor(); diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index 4d4565f02e..a41c574454 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(); @@ -370,6 +371,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<int>("windowflags"); |