From 3986e1cb223cc86b74c2895e74a1eb600e892079 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 21 Jun 2016 09:08:02 +0200 Subject: 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(+) (limited to 'src') 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(), -- cgit v1.2.3 From 0c44f26fae4d3ee493d8669b2ae1ea525e71c953 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 22 Jun 2016 11:57:15 +0200 Subject: 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(-) (limited to 'src') 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: -- cgit v1.2.3 From 1a96295755391b508ea37b4bfbb681ea15ed7559 Mon Sep 17 00:00:00 2001 From: Ralf Nolden Date: Fri, 24 Jun 2016 22:33:31 +0200 Subject: 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 --- src/3rdparty/png_dependency.pri | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') 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) } -- cgit v1.2.3 From b3b2f502e9b499814a1e3b21e1b572e3ff1ba37b Mon Sep 17 00:00:00 2001 From: Ralf Nolden Date: Mon, 27 Jun 2016 10:34:19 +0200 Subject: 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 --- src/network/socket/qnet_unix_p.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') 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)); -- cgit v1.2.3 From 2a7cee47e5e84c73e32a6953e145771196645f1a Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 22 Jun 2016 10:08:28 +0200 Subject: 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(-) (limited to 'src') 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) { -- cgit v1.2.3