From bcbf38b7019c6a3bb71fe57ca7610e6f05478422 Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Thu, 26 Jun 2014 15:25:13 +0200 Subject: Doc: Various \note fixes in Qt namespace documentation. -changed \note and \warning to "Note:" and "Warning:" -\note and \warning split the table. -other minor \note changes Task-number: QTBUG-36972 Change-Id: I88042550cd01101e7225cd3b5f4e0115ea102ea9 Reviewed-by: Liang Qi Reviewed-by: Martin Smith --- src/corelib/global/qnamespace.qdoc | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 8ade3f86d6..4227dd358e 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the documentation of the Qt Toolkit. @@ -294,7 +294,7 @@ This enum provides shorter names for the keyboard modifier keys supported by Qt. - \b{Note:} On Mac OS X, the \c CTRL value corresponds to + \note On Mac OS X, the \c CTRL value corresponds to the Command keys on the Macintosh keyboard, and the \c META value corresponds to the Control keys. @@ -974,7 +974,7 @@ \value WA_NoSystemBackground Indicates that the widget has no background, i.e. when the widget receives paint events, the background is not - automatically repainted. \note Unlike WA_OpaquePaintEvent, newly exposed + automatically repainted. \b Note: Unlike WA_OpaquePaintEvent, newly exposed areas are \b never filled with the background (e.g., after showing a window for the first time the user can see "through" it until the application processes the paint events). This flag is set or cleared by the @@ -986,7 +986,7 @@ before generating paint events. The use of WA_OpaquePaintEvent provides a small optimization by helping to reduce flicker on systems that do not support double buffering and avoiding computational cycles necessary to - erase the background prior to painting. \note Unlike + erase the background prior to painting. \b Note: Unlike WA_NoSystemBackground, WA_OpaquePaintEvent makes an effort to avoid transparent window backgrounds. This flag is set or cleared by the widget's author. @@ -999,7 +999,7 @@ \value WA_PaintOnScreen Indicates that the widget wants to draw directly onto the screen. Widgets with this attribute set do not participate in composition management, i.e. they cannot be semi-transparent or shine - through semi-transparent overlapping widgets. \note This flag is only + through semi-transparent overlapping widgets. \b Note: This flag is only supported on X11 and it disables double buffering. On Qt for Embedded Linux, the flag only works when set on a top-level widget and it relies on support from the active screen driver. This flag is set or cleared by the @@ -1070,7 +1070,7 @@ \value WA_UpdatesDisabled Indicates that updates are blocked (including the system background). This flag is set or cleared by the Qt kernel. - \warning This flag must \e never be set or cleared by the widget's author. + \b Warning: This flag must \e never be set or cleared by the widget's author. \value WA_WindowModified Indicates that the window is marked as modified. On some platforms this flag will do nothing, on others (including Mac OS X @@ -1112,50 +1112,50 @@ \value WA_X11NetWmWindowTypeToolBar Adds _NET_WM_WINDOW_TYPE_TOOLBAR to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute - has no effect on non-X11 platforms. \note Qt automatically sets this + has no effect on non-X11 platforms. \b Note: Qt automatically sets this attribute for QToolBar. \value WA_X11NetWmWindowTypeMenu Adds _NET_WM_WINDOW_TYPE_MENU to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute - has no effect on non-X11 platforms. \note Qt automatically sets this + has no effect on non-X11 platforms. \b Note: Qt automatically sets this attribute for QMenu when torn-off. \value WA_X11NetWmWindowTypeUtility Adds _NET_WM_WINDOW_TYPE_UTILITY to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute - has no effect on non-X11 platforms. \note Qt automatically sets this + has no effect on non-X11 platforms. \b Note: Qt automatically sets this attribute for the Qt::Tool window type. \value WA_X11NetWmWindowTypeSplash Adds _NET_WM_WINDOW_TYPE_SPLASH to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute - has no effect on non-X11 platforms. \note Qt automatically sets this + has no effect on non-X11 platforms. \b Note: Qt automatically sets this attribute for the Qt::SplashScreen window type. \value WA_X11NetWmWindowTypeDialog Adds _NET_WM_WINDOW_TYPE_DIALOG to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This - attribute has no effect on non-X11 platforms. \note Qt automatically sets + attribute has no effect on non-X11 platforms. \b Note: Qt automatically sets this attribute for the Qt::Dialog and Qt::Sheet window types. \value WA_X11NetWmWindowTypeDropDownMenu Adds _NET_WM_WINDOW_TYPE_DROPDOWN_MENU to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This - attribute has no effect on non-X11 platforms. \note Qt + attribute has no effect on non-X11 platforms. \b Note: Qt automatically sets this attribute for QMenus added to a QMenuBar. \value WA_X11NetWmWindowTypePopupMenu Adds _NET_WM_WINDOW_TYPE_POPUP_MENU to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute - has no effect on non-X11 platforms. \note Qt automatically sets this + has no effect on non-X11 platforms. \b Note: Qt automatically sets this attribute for QMenu. \value WA_X11NetWmWindowTypeToolTip Adds _NET_WM_WINDOW_TYPE_TOOLTIP to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute - has no effect on non-X11 platforms. \note Qt automatically sets this + has no effect on non-X11 platforms. \b Note: Qt automatically sets this attribute for the Qt::ToolTip window type. \value WA_X11NetWmWindowTypeNotification Adds @@ -1166,13 +1166,13 @@ \value WA_X11NetWmWindowTypeCombo Adds _NET_WM_WINDOW_TYPE_COMBO to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute - has no effect on non-X11 platforms. \note Qt automatically sets this + has no effect on non-X11 platforms. \b Note: Qt automatically sets this attribute for the QComboBox pop-up. \value WA_X11NetWmWindowTypeDND Adds _NET_WM_WINDOW_TYPE_DND to the window's _NET_WM_WINDOW_TYPE X11 window property. See http://standards.freedesktop.org/wm-spec/ for more details. This attribute - has no effect on non-X11 platforms. \note Qt automatically sets this + has no effect on non-X11 platforms. \b Note: Qt automatically sets this attribute on the feedback widget used during a drag. \value WA_MacFrameworkScaled Enables resolution independence aware mode @@ -1243,7 +1243,7 @@ \value Key_Enter Typically located on the keypad. \value Key_Insert \value Key_Delete - \value Key_Pause The Pause/Break key (\note Not anything to do with pausing media) + \value Key_Pause The Pause/Break key (\b Note: Not related to pausing media) \value Key_Print \value Key_SysReq \value Key_Clear @@ -1514,7 +1514,7 @@ \value Key_MediaPrevious \value Key_MediaNext \value Key_MediaRecord - \value Key_MediaPause A key setting the state of the media player to pause (\note not the pause/break key) + \value Key_MediaPause A key setting the state of the media player to pause (\b Note: not the pause/break key) \value Key_MediaTogglePlayPause A key to toggle the play/pause state in the media player (rather than setting an absolute state) \value Key_HomePage \value Key_Favorites @@ -2856,7 +2856,7 @@ The keypad is used to implement a virtual cursor, unless the device has an analog mouse type of input device (e.g. touchpad) - \note: in 4.6, cursor navigation is only implemented for Symbian OS. + \note In 4.6, cursor navigation is only implemented for Symbian OS. On other platforms, it behaves as NavigationModeNone. \sa QApplication::setNavigationMode() \sa QApplication::navigationMode() -- cgit v1.2.3 From 256f810be3af225bac1ed464a13bcd314a00f303 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 24 Jun 2014 11:28:11 -0700 Subject: Fix annoying warning from ICC 14 on Windows It says that defining a macro that does defined() is not portable. The solution implemented for MSVC 2008 and earlier does work, however, and is portable to all compilers (the parentheses around the macro are unnecessary). Incidentally, this makes d98004cd2f33e8147cff9f3cb203fdef5e6dd00e actually work: Q_CC_MSVC wasn't defined at that point in the file, so that change had never taken effect. warning #3199: "defined" is always false in a macro expansion in Microsoft mode Task-number: QTBUG-39597 Change-Id: Iaa2895e7f63d97c439090043435a2b8d2f185c3a Reviewed-by: Oswald Buddenhagen --- src/corelib/global/qglobal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index f610cfab8c..255eb6c00b 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Copyright (C) 2012 Intel Corporation. +** Copyright (C) 2014 Intel Corporation. ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -59,7 +59,7 @@ #include #include #endif -#if defined(Q_CC_MSVC) && _MSC_VER <= 1500 /* VS2008 */ +#ifdef _MSC_VER # define QT_SUPPORTS(FEATURE) (!defined QT_NO_##FEATURE) #else # define QT_SUPPORTS(FEATURE) (!defined(QT_NO_##FEATURE)) -- cgit v1.2.3 From 9ee27005ee3cfa295c681a5ac04ac1c282b396ca Mon Sep 17 00:00:00 2001 From: David Faure Date: Sun, 8 Jun 2014 14:10:56 +0200 Subject: qDebug: fix data race in qt_message_print The setting of (static) messageHandler to qDefaultMessageHandler if null was happening in multiple threads simultaneously, so it needs synchronization. Used an atomic pointer in case qInstallMessageHandler is called from a thread, but more importantly, initialized the static vars right away. Improve auto test to ensure that qInstallMessageHandler(0) still sets the default message handler. Change-Id: I70335af38c1d28a1cdba1df8a79c6006f227422e Reviewed-by: Thiago Macieira --- src/corelib/global/qlogging.cpp | 42 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 23 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index ff4372a049..ca0fb1bb23 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -1148,8 +1148,13 @@ typedef void (*QtMsgHandler)(QtMsgType, const char *); Q_CORE_EXPORT QtMsgHandler qInstallMsgHandler(QtMsgHandler); #endif -static QtMsgHandler msgHandler = 0; // pointer to debug handler (without context) -static QtMessageHandler messageHandler = 0; // pointer to debug handler (with context) +static void qDefaultMsgHandler(QtMsgType type, const char *buf); +static void qDefaultMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &buf); + +// pointer to QtMsgHandler debug handler (without context) +static QBasicAtomicPointer msgHandler = Q_BASIC_ATOMIC_INITIALIZER(qDefaultMsgHandler); +// pointer to QtMessageHandler debug handler (with context) +static QBasicAtomicPointer messageHandler = Q_BASIC_ATOMIC_INITIALIZER(qDefaultMessageHandler); #if defined(QT_USE_JOURNALD) && !defined(QT_BOOTSTRAPPED) static void systemd_default_message_handler(QtMsgType type, @@ -1315,20 +1320,15 @@ static void qt_message_print(QtMsgType msgType, const QMessageLogContext &contex } #endif - if (!msgHandler) - msgHandler = qDefaultMsgHandler; - if (!messageHandler) - messageHandler = qDefaultMessageHandler; - // prevent recursion in case the message handler generates messages // itself, e.g. by using Qt API if (grabMessageHandler()) { // prefer new message handler over the old one - if (msgHandler == qDefaultMsgHandler - || messageHandler != qDefaultMessageHandler) { - (*messageHandler)(msgType, context, message); + if (msgHandler.load() == qDefaultMsgHandler + || messageHandler.load() != qDefaultMessageHandler) { + (*messageHandler.load())(msgType, context, message); } else { - (*msgHandler)(msgType, message.toLocal8Bit().constData()); + (*msgHandler.load())(msgType, message.toLocal8Bit().constData()); } ungrabMessageHandler(); } else { @@ -1530,22 +1530,18 @@ void qErrnoWarning(int code, const char *msg, ...) QtMessageHandler qInstallMessageHandler(QtMessageHandler h) { - if (!messageHandler) - messageHandler = qDefaultMessageHandler; - QtMessageHandler old = messageHandler; - messageHandler = h; - return old; + if (!h) + h = qDefaultMessageHandler; + //set 'h' and return old message handler + return messageHandler.fetchAndStoreRelaxed(h); } QtMsgHandler qInstallMsgHandler(QtMsgHandler h) { - //if handler is 0, set it to the - //default message handler - if (!msgHandler) - msgHandler = qDefaultMsgHandler; - QtMsgHandler old = msgHandler; - msgHandler = h; - return old; + if (!h) + h = qDefaultMsgHandler; + //set 'h' and return old message handler + return msgHandler.fetchAndStoreRelaxed(h); } void qSetMessagePattern(const QString &pattern) -- cgit v1.2.3