From 3986e1cb223cc86b74c2895e74a1eb600e892079 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 21 Jun 2016 09:08:02 +0200 Subject: [PATCH 01/10] 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 b51085ef42..a0c6f4a6f4 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/10] 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 8f6c380133..e0228a9bfb 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 dc283936b0b5ea4f17a0a173adbd73b90ab2fee6 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Wed, 1 Jun 2016 15:08:14 +0200 Subject: [PATCH 03/10] 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 f535f5e290..6b4e3410c9 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 04/10] 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 91579ae611..b0fa72276d 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 05/10] 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 2823bd6f2f..d22e89c6e1 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 8b2e7a6660..a7e04d3bfc 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 06/10] 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 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/src/3rdparty/png_dependency.pri b/src/3rdparty/png_dependency.pri index 78da861f77..f0a3936c8c 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 07/10] 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 3f127d8d3f..cbde307237 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 9626c53711..1481f565d4 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 08/10] 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 689feb6870..dfeba4bec1 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 09/10] 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 0376ab88ac..57148eb811 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 9d4bdc7f89..9681cb03ec 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 5d13fb926b..7473dd1dfb 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 0d720a000f4f35c5ea6942426efec6847b06f4ce Mon Sep 17 00:00:00 2001 From: James McDonnell Date: Wed, 22 Jun 2016 10:35:22 -0400 Subject: [PATCH 10/10] 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 b639e82ed8..1059e516af 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; }