From b35ea875a12e89661f370df7e91c4791234aaa44 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 5 Jun 2013 13:24:23 +0200 Subject: put ANGLE includes in a QtANGLE subdir otherwise even non-angle builds with pre-generated headers will get them into their include path, which is Not Good (tm). Change-Id: Ie98354297baf3564ef82b3d4a32e5763e625b8f2 Reviewed-by: Friedemann Kleint Reviewed-by: Joerg Bornemann --- src/angle/angle.pro | 2 +- src/angle/src/libEGL/libEGL.pro | 2 +- src/angle/src/libGLESv2/libGLESv2.pro | 4 ++-- src/gui/Qt5GuiConfigExtras.cmake.in | 6 ++++-- src/gui/gui.pro | 6 ++++++ 5 files changed, 14 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/angle/angle.pro b/src/angle/angle.pro index 721caf880a..83510698d3 100644 --- a/src/angle/angle.pro +++ b/src/angle/angle.pro @@ -6,5 +6,5 @@ SUBDIRS += src # 2) If we made a 'QtANGLE' module, the include directory would be flattened which won't work since # we need to support "#include " CONFIG += minimal_syncqt -QMAKE_SYNCQT_OPTIONS = -module KHR -module EGL -module GLES2 -version none +QMAKE_SYNCQT_OPTIONS = -module QtANGLE/KHR -module QtANGLE/EGL -module QtANGLE/GLES2 -version none load(qt_module_headers) diff --git a/src/angle/src/libEGL/libEGL.pro b/src/angle/src/libEGL/libEGL.pro index c0d021ccab..1a338ef0d2 100644 --- a/src/angle/src/libEGL/libEGL.pro +++ b/src/angle/src/libEGL/libEGL.pro @@ -40,5 +40,5 @@ egl_headers.files = \ $$ANGLE_DIR/include/EGL/egl.h \ $$ANGLE_DIR/include/EGL/eglext.h \ $$ANGLE_DIR/include/EGL/eglplatform.h -egl_headers.path = $$[QT_INSTALL_HEADERS]/EGL +egl_headers.path = $$[QT_INSTALL_HEADERS]/QtANGLE/EGL INSTALLS += egl_headers diff --git a/src/angle/src/libGLESv2/libGLESv2.pro b/src/angle/src/libGLESv2/libGLESv2.pro index d12202f33b..ba1f226143 100644 --- a/src/angle/src/libGLESv2/libGLESv2.pro +++ b/src/angle/src/libGLESv2/libGLESv2.pro @@ -235,12 +235,12 @@ for (vs, CLEAR_SHADERS) { load(qt_installs) khr_headers.files = $$ANGLE_DIR/include/KHR/khrplatform.h -khr_headers.path = $$[QT_INSTALL_HEADERS]/KHR +khr_headers.path = $$[QT_INSTALL_HEADERS]/QtANGLE/KHR gles2_headers.files = \ $$ANGLE_DIR/include/GLES2/gl2.h \ $$ANGLE_DIR/include/GLES2/gl2ext.h \ $$ANGLE_DIR/include/GLES2/gl2platform.h -gles2_headers.path = $$[QT_INSTALL_HEADERS]/GLES2 +gles2_headers.path = $$[QT_INSTALL_HEADERS]/QtANGLE/GLES2 INSTALLS += khr_headers gles2_headers diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in index f1bc441009..4a6f6250f5 100644 --- a/src/gui/Qt5GuiConfigExtras.cmake.in +++ b/src/gui/Qt5GuiConfigExtras.cmake.in @@ -2,13 +2,15 @@ !!IF !isEmpty(CMAKE_ANGLE_EGL_DLL_RELEASE) !!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE) -set(Qt5Gui_EGL_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR\") +set(Qt5Gui_EGL_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR/QtANGLE\") !!ELSE -set(Qt5Gui_EGL_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR\") +set(Qt5Gui_EGL_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR/QtANGLE\") !!ENDIF _qt5_Gui_check_file_exists(${Qt5Gui_EGL_INCLUDE_DIRS}) +list(APPEND Qt5Gui_INCLUDE_DIRS ${Qt5Gui_EGL_INCLUDE_DIRS}) +set_property(TARGET Qt5::Gui APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Qt5Gui_EGL_INCLUDE_DIRS}) set(Qt5Gui_OPENGL_INCLUDE_DIRS ${Qt5Gui_EGL_INCLUDE_DIRS}) macro(_populate_qt5gui_gl_target_properties TargetName Configuration LIB_LOCATION IMPLIB_LOCATION) diff --git a/src/gui/gui.pro b/src/gui/gui.pro index e2dd5efcde..3203b41362 100644 --- a/src/gui/gui.pro +++ b/src/gui/gui.pro @@ -12,6 +12,12 @@ MODULE_PLUGIN_TYPES = \ platforms \ imageformats +# This is here only because the platform plugin is no module, obviously. +win32:contains(QT_CONFIG, angle) { + MODULE_AUX_INCLUDES = \ + \$\$QT_MODULE_INCLUDE_BASE/QtANGLE +} + load(qt_module) # Code coverage with TestCocoon -- cgit v1.2.3 From 4fd568fa0633b17b4a8e24736a4766e81afff4f3 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 7 Jun 2013 16:23:25 +0200 Subject: redo include path logic for pre-generated headers make the include dir in the source tree the "main" include path, as that's where the majority of the headers is. then selectively add the shadowed dirs. Change-Id: I03ad13cfcf77175c141b94d41b1221740d851faf Reviewed-by: Joerg Bornemann --- src/tools/bootstrap-dbus/bootstrap-dbus.pro | 3 ++- src/tools/bootstrap/bootstrap.pro | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/tools/bootstrap-dbus/bootstrap-dbus.pro b/src/tools/bootstrap-dbus/bootstrap-dbus.pro index 6af70efda7..62f9f96a9b 100644 --- a/src/tools/bootstrap-dbus/bootstrap-dbus.pro +++ b/src/tools/bootstrap-dbus/bootstrap-dbus.pro @@ -7,8 +7,9 @@ CONFIG += no_module_headers internal_module force_bootstrap DEFINES += \ QT_NO_CAST_FROM_ASCII +MODULE_INCLUDES = \ + \$\$QT_MODULE_INCLUDE_BASE/QtDBus MODULE_PRIVATE_INCLUDES = \ - \$\$QT_MODULE_INCLUDE_BASE/QtDBus \ \$\$QT_MODULE_INCLUDE_BASE/QtDBus/$$QT_VERSION \ \$\$QT_MODULE_INCLUDE_BASE/QtDBus/$$QT_VERSION/QtDBus diff --git a/src/tools/bootstrap/bootstrap.pro b/src/tools/bootstrap/bootstrap.pro index 972f57260e..bf19828634 100644 --- a/src/tools/bootstrap/bootstrap.pro +++ b/src/tools/bootstrap/bootstrap.pro @@ -30,12 +30,13 @@ DEFINES += \ DEFINES -= QT_EVAL -MODULE_PRIVATE_INCLUDES = \ +MODULE_INCLUDES = \ \$\$QT_MODULE_INCLUDE_BASE \ \$\$QT_MODULE_INCLUDE_BASE/QtCore \ + \$\$QT_MODULE_INCLUDE_BASE/QtXml +MODULE_PRIVATE_INCLUDES = \ \$\$QT_MODULE_INCLUDE_BASE/QtCore/$$QT_VERSION \ \$\$QT_MODULE_INCLUDE_BASE/QtCore/$$QT_VERSION/QtCore \ - \$\$QT_MODULE_INCLUDE_BASE/QtXml \ \$\$QT_MODULE_INCLUDE_BASE/QtXml/$$QT_VERSION \ \$\$QT_MODULE_INCLUDE_BASE/QtXml/$$QT_VERSION/QtXml -- cgit v1.2.3 From 45d8bf327eee744570933211f611cf4410ae7e29 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Mon, 10 Jun 2013 14:45:40 +0200 Subject: Doc: Mark QOpenGLFunctions_4_1_Core as a wrapper class The class documentation missing the \wrapper command, making QDoc complain a lot. Change-Id: Iad8fa3d2facadfb3393642dc08ff4dc416bdccc7 Reviewed-by: Martin Smith Reviewed-by: Jerome Pasion --- src/gui/opengl/qopenglfunctions_4_1_core.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/gui/opengl/qopenglfunctions_4_1_core.cpp b/src/gui/opengl/qopenglfunctions_4_1_core.cpp index b36cb0de94..474397bb1f 100644 --- a/src/gui/opengl/qopenglfunctions_4_1_core.cpp +++ b/src/gui/opengl/qopenglfunctions_4_1_core.cpp @@ -57,6 +57,7 @@ QT_BEGIN_NAMESPACE \class QOpenGLFunctions_4_1_Core \inmodule QtGui \since 5.1 + \wrapper \brief The QOpenGLFunctions_4_1_Core class provides all functions for this version and profile of OpenGL. \sa QAbstractOpenGLFunctions -- cgit v1.2.3 From 074c5c94f6018d08abac9bad5151f9300284feb4 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Mon, 10 Jun 2013 13:17:18 +0200 Subject: Doc: Fixed snippet issues in QDoc documentation QDoc uses .qdoc files as snippets in other .qdoc files. These snippet .qdoc files are also parsed, which is not the intent. This change resolves the issue by renaming the files to have a different extension. Task-number: QTBUG-31574 Change-Id: I399c8b714478b9c4b8fbe2db53f601e6a1386cea Reviewed-by: Jerome Pasion --- src/tools/qdoc/doc/examples/cpp.qdoc | 126 --------------------- src/tools/qdoc/doc/examples/cpp.qdoc.sample | 126 +++++++++++++++++++++ src/tools/qdoc/doc/examples/qml.qdoc | 116 ------------------- src/tools/qdoc/doc/examples/qml.qdoc.sample | 116 +++++++++++++++++++ .../qdoc/doc/qdoc-guide/qtwritingstyle-cpp.qdoc | 14 +-- .../qdoc/doc/qdoc-guide/qtwritingstyle-qml.qdoc | 8 +- 6 files changed, 253 insertions(+), 253 deletions(-) delete mode 100644 src/tools/qdoc/doc/examples/cpp.qdoc create mode 100644 src/tools/qdoc/doc/examples/cpp.qdoc.sample delete mode 100644 src/tools/qdoc/doc/examples/qml.qdoc create mode 100644 src/tools/qdoc/doc/examples/qml.qdoc.sample (limited to 'src') diff --git a/src/tools/qdoc/doc/examples/cpp.qdoc b/src/tools/qdoc/doc/examples/cpp.qdoc deleted file mode 100644 index 08286b956a..0000000000 --- a/src/tools/qdoc/doc/examples/cpp.qdoc +++ /dev/null @@ -1,126 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 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. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//![class] -/*! - \class QCache - \brief The QCache class is a template class that provides a cache. - - \ingroup tools - \ingroup shared - - \reentrant - - QCache\ defines a cache that stores objects of type T - associated with keys of type Key. For example, here's the - definition of a cache that stores objects of type Employee - associated with an integer key: - - \snippet code/doc_src_qcache.cpp 0 - - Here's how to insert an object in the cache: - - \snippet code/doc_src_qcache.cpp 1 - - ... detailed description ommitted - - \sa QPixmapCache, QHash, QMap -*/ -//![class] - -//![function] -/*! - \fn QString &QString::remove(int position, int n) - - Removes \a n characters from the string, starting at the given \a - position index, and returns a reference to the string. - - If the specified \a position index is within the string, but \a - position + \a n is beyond the end of the string, the string is - truncated at the specified \a position. - - \snippet qstring/main.cpp 37 - - \sa insert(), replace() -*/ -QString &QString::remove(int pos, int len) -//! [function] - -//! [return] -/*! - Returns \c true if a QScroller object was already created for \a target; \c false otherwise. - - \sa scroller() -*/ -bool QScroller::hasScroller(QObject *target) -//! [return] - -//! [property] -/*! - \property QVariantAnimation::duration - \brief the duration of the animation - - This property describes the duration in milliseconds of the - animation. The default duration is 250 milliseconds. - - \sa QAbstractAnimation::duration() - */ -int QVariantAnimation::duration() const -//! [property] - -//! [signals] -/*! - \fn QAbstractTransition::triggered() - - This signal is emitted when the transition has been triggered (after - onTransition() has been called). -*/ -//! [signals] - -//! [enums] -/*! - \enum QSql::TableType - - This enum type describes types of SQL tables. - - \value Tables All the tables visible to the user. - \value SystemTables Internal tables used by the database. - \value Views All the views visible to the user. - \value AllTables All of the above. -*/ -//! [enums] - -//! [overloaded notifier] -/*! -\property QSpinBox::value -\brief the value of the spin box - -setValue() will emit valueChanged() if the new value is different -from the old one. The \l{QSpinBox::}{value} property has a second notifier -signal which includes the spin box's prefix and suffix. -*/ -//! [overloaded notifier] diff --git a/src/tools/qdoc/doc/examples/cpp.qdoc.sample b/src/tools/qdoc/doc/examples/cpp.qdoc.sample new file mode 100644 index 0000000000..08286b956a --- /dev/null +++ b/src/tools/qdoc/doc/examples/cpp.qdoc.sample @@ -0,0 +1,126 @@ +/**************************************************************************** +** +** Copyright (C) 2013 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. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//![class] +/*! + \class QCache + \brief The QCache class is a template class that provides a cache. + + \ingroup tools + \ingroup shared + + \reentrant + + QCache\ defines a cache that stores objects of type T + associated with keys of type Key. For example, here's the + definition of a cache that stores objects of type Employee + associated with an integer key: + + \snippet code/doc_src_qcache.cpp 0 + + Here's how to insert an object in the cache: + + \snippet code/doc_src_qcache.cpp 1 + + ... detailed description ommitted + + \sa QPixmapCache, QHash, QMap +*/ +//![class] + +//![function] +/*! + \fn QString &QString::remove(int position, int n) + + Removes \a n characters from the string, starting at the given \a + position index, and returns a reference to the string. + + If the specified \a position index is within the string, but \a + position + \a n is beyond the end of the string, the string is + truncated at the specified \a position. + + \snippet qstring/main.cpp 37 + + \sa insert(), replace() +*/ +QString &QString::remove(int pos, int len) +//! [function] + +//! [return] +/*! + Returns \c true if a QScroller object was already created for \a target; \c false otherwise. + + \sa scroller() +*/ +bool QScroller::hasScroller(QObject *target) +//! [return] + +//! [property] +/*! + \property QVariantAnimation::duration + \brief the duration of the animation + + This property describes the duration in milliseconds of the + animation. The default duration is 250 milliseconds. + + \sa QAbstractAnimation::duration() + */ +int QVariantAnimation::duration() const +//! [property] + +//! [signals] +/*! + \fn QAbstractTransition::triggered() + + This signal is emitted when the transition has been triggered (after + onTransition() has been called). +*/ +//! [signals] + +//! [enums] +/*! + \enum QSql::TableType + + This enum type describes types of SQL tables. + + \value Tables All the tables visible to the user. + \value SystemTables Internal tables used by the database. + \value Views All the views visible to the user. + \value AllTables All of the above. +*/ +//! [enums] + +//! [overloaded notifier] +/*! +\property QSpinBox::value +\brief the value of the spin box + +setValue() will emit valueChanged() if the new value is different +from the old one. The \l{QSpinBox::}{value} property has a second notifier +signal which includes the spin box's prefix and suffix. +*/ +//! [overloaded notifier] diff --git a/src/tools/qdoc/doc/examples/qml.qdoc b/src/tools/qdoc/doc/examples/qml.qdoc deleted file mode 100644 index d913c6f164..0000000000 --- a/src/tools/qdoc/doc/examples/qml.qdoc +++ /dev/null @@ -1,116 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 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. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//![qmltype] - \qmltype TextEdit - \instantiates QQuickTextEdit - \inqmlmodule QtQuick 2 - \ingroup qtquick-visual - \ingroup qtquick-input - \inherits Item - \brief Displays multiple lines of editable formatted text - - The TextEdit item displays a block of editable, formatted text. - - It can display both plain and rich text. For example: - - \qml - TextEdit { - width: 240 - text: "Hello World!" - font.family: "Helvetica" - font.pointSize: 20 - color: "blue" - focus: true - } - \endqml - - \image declarative-textedit.gif - - ... omitted detailed description - - \sa Text, TextInput, {examples/quick/text/textselection}{Text Selection example} -//![qmltype] - -//![function] -/* - \qmlmethod QtQuick2::ListModel::remove(int index, int count = 1) - - Deletes the content at \a index from the model. - - \sa clear() -*/ -void QQuickListModel::remove(QQmlV8Function *args) -//! [function] - -//! [return] -/* - Returns \c true if a QScroller object was already created for \a target; \c false otherwise. - - \sa scroller() -*/ -bool QScroller::hasScroller(QObject *target) -//! [return] - -//! [property] -/* - \property QVariantAnimation::duration - \brief the duration of the animation - - This property describes the duration in milliseconds of the - animation. The default duration is 250 milliseconds. - - \sa QAbstractAnimation::duration() - */ -int QVariantAnimation::duration() const -//! [property] - -//! [signals] -/* - This signal is emitted when the user clicks the button. A click is defined - as a press followed by a release. The corresponding handler is - \c onClicked. -*/ -signal clicked() -//! [signals] - -//! [enums] -/*! -\qmlproperty enumeration QtQuick2::Text::font.weight - -Sets the font's weight. - -The weight can be one of: -\list -\li Font.Light -\li Font.Normal - the default -\li Font.DemiBold -\li Font.Bold -\li Font.Black -\endlist -*/ -//! [enums] diff --git a/src/tools/qdoc/doc/examples/qml.qdoc.sample b/src/tools/qdoc/doc/examples/qml.qdoc.sample new file mode 100644 index 0000000000..d913c6f164 --- /dev/null +++ b/src/tools/qdoc/doc/examples/qml.qdoc.sample @@ -0,0 +1,116 @@ +/**************************************************************************** +** +** Copyright (C) 2013 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. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//![qmltype] + \qmltype TextEdit + \instantiates QQuickTextEdit + \inqmlmodule QtQuick 2 + \ingroup qtquick-visual + \ingroup qtquick-input + \inherits Item + \brief Displays multiple lines of editable formatted text + + The TextEdit item displays a block of editable, formatted text. + + It can display both plain and rich text. For example: + + \qml + TextEdit { + width: 240 + text: "Hello World!" + font.family: "Helvetica" + font.pointSize: 20 + color: "blue" + focus: true + } + \endqml + + \image declarative-textedit.gif + + ... omitted detailed description + + \sa Text, TextInput, {examples/quick/text/textselection}{Text Selection example} +//![qmltype] + +//![function] +/* + \qmlmethod QtQuick2::ListModel::remove(int index, int count = 1) + + Deletes the content at \a index from the model. + + \sa clear() +*/ +void QQuickListModel::remove(QQmlV8Function *args) +//! [function] + +//! [return] +/* + Returns \c true if a QScroller object was already created for \a target; \c false otherwise. + + \sa scroller() +*/ +bool QScroller::hasScroller(QObject *target) +//! [return] + +//! [property] +/* + \property QVariantAnimation::duration + \brief the duration of the animation + + This property describes the duration in milliseconds of the + animation. The default duration is 250 milliseconds. + + \sa QAbstractAnimation::duration() + */ +int QVariantAnimation::duration() const +//! [property] + +//! [signals] +/* + This signal is emitted when the user clicks the button. A click is defined + as a press followed by a release. The corresponding handler is + \c onClicked. +*/ +signal clicked() +//! [signals] + +//! [enums] +/*! +\qmlproperty enumeration QtQuick2::Text::font.weight + +Sets the font's weight. + +The weight can be one of: +\list +\li Font.Light +\li Font.Normal - the default +\li Font.DemiBold +\li Font.Bold +\li Font.Black +\endlist +*/ +//! [enums] diff --git a/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-cpp.qdoc b/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-cpp.qdoc index 4ad1f19f67..2095c4e7cb 100644 --- a/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-cpp.qdoc +++ b/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-cpp.qdoc @@ -41,7 +41,7 @@ Note that the documentation must be in the implementation files such as \c .cpp. Class documentation is generated using the \l{class-command}{\\class} command and the name of the class as the first argument. -\snippet examples/cpp.qdoc class +\snippet examples/cpp.qdoc.sample class \l{Context commands} add information about the class, such as its module or which version the class was added. @@ -79,7 +79,7 @@ Typically, function documentation immediately precedes the implementation of the function in the \c .cpp file. For function documentation that is not immediately above the implementation, the \l{fn-command}{\\fn} is needed. -\snippet examples/cpp.qdoc function +\snippet examples/cpp.qdoc.sample function The function documentation starts with a verb, indicating the operation the function performs. This also applies to constructors and destructors. @@ -102,7 +102,7 @@ The \l{a-command}{\\a} command marks the parameter in the documentation. The return type documentation should link to the type documentation or be marked with the \l{c-command}{\\c} command in the case of boolean values. -\snippet examples/cpp.qdoc return +\snippet examples/cpp.qdoc.sample return \section1 Properties @@ -110,7 +110,7 @@ The property documentation resides immediately above the read function's implementation. The \l{topic-commands}{topic command} for properties is \l{property-command}{\\property}. -\snippet examples/cpp.qdoc property +\snippet examples/cpp.qdoc.sample property Property documentation usually starts with "This property...", but these are alternate expressions: @@ -142,7 +142,7 @@ The \l{topic-commands}{topic command} for signals, notifiers, and slots is \l{fn-command}{\\fn}. Signal documentation state when they are triggered or emitted. -\snippet examples/cpp.qdoc signals +\snippet examples/cpp.qdoc.sample signals Signal documentation typically begin with "This signal is triggered when...". Here are alternate styles: @@ -164,7 +164,7 @@ notifiers together. To refer to a specifc version of a notifier or signal, simply refer to the property and mention that there are different versions of the notifier. -\snippet examples/cpp.qdoc overloaded notifier +\snippet examples/cpp.qdoc.sample overloaded notifier \section1 Enums, Namespaces, and other Types @@ -181,7 +181,7 @@ continues with the type description. For enumerations, the \l{value-command}{\\value} command is for listing the values. QDoc creates a table of values for the enum. -\snippet examples/cpp.qdoc enums +\snippet examples/cpp.qdoc.sample enums */ diff --git a/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-qml.qdoc b/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-qml.qdoc index 2d67e62f94..7ca0abed71 100644 --- a/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-qml.qdoc +++ b/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-qml.qdoc @@ -60,7 +60,7 @@ does not exist. The class documentation may be marked as The \l{qmltype-command}{\\qmltype} command is for QML type documentation. -\snippet examples/qml.qdoc qmltype +\snippet examples/qml.qdoc.sample qmltype The \l{instantiates-command}{\\instantiates} accepts the C++ class which implements the QML type as the argument. For types implemented in QML, this @@ -108,7 +108,7 @@ with the \l{qmlsignal-command}{\\qmlsignal} command. Signal documentation must include the condition for emitting the signal, mention the corresponding signal handler, and document whether the signal accepts a parameter. -\snippet examples/qml.qdoc signals +\snippet examples/qml.qdoc.sample signals These are the possible documentation styles for signals: \list @@ -127,7 +127,7 @@ documentation must reside immediately above the function declaration. The function documentation starts with a verb, indicating the operation the function performs. -\snippet examples/qml.qdoc function +\snippet examples/qml.qdoc.sample function Some common verbs for function documentation: \list @@ -153,7 +153,7 @@ QML enumerations are documented as QML properties with the \l{qmlproperty-command}{\\qmlproperty} command. The type of the property is \c enumeration. -\snippet examples/qml.qdoc enums +\snippet examples/qml.qdoc.sample enums The QDoc comment lists the values of the enumeration. If the enumeration is implemented in C++, the documentation may link to the corresponding C++ -- cgit v1.2.3 From b2a0a1437000c6cd78de4bf960993732457a8e92 Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Tue, 28 May 2013 13:09:20 +0200 Subject: Fix issue when QKeyEvent::text() was returning empty string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The code that sets 'text' variable was executed only for KeyPress events. This patch moves 'text' initialization higher up where it will be run for both - KeyPress and KeyRelease events. Task-number: QTBUG-31285 Change-Id: I140de9ef5d29beedad276d348bed964ecdf46f9d Reviewed-by: Tor Arne Vestbø Reviewed-by: Andy Shaw --- src/plugins/platforms/cocoa/qnsview.mm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index 5c5da830ac..10fb293ec0 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -917,13 +917,13 @@ static QTouchDevice *touchDevice = 0; // we will send a key event unless the input method sets m_sendKeyEvent to false m_sendKeyEvent = true; - QString text; + // ignore text for the U+F700-U+F8FF range. This is used by Cocoa when + // delivering function keys (e.g. arrow keys, backspace, F1-F35, etc.) + if (ch.unicode() < 0xf700 || ch.unicode() > 0xf8ff) + text = QCFString::toQString(characters); + if (eventType == QEvent::KeyPress) { - // ignore text for the U+F700-U+F8FF range. This is used by Cocoa when - // delivering function keys (e.g. arrow keys, backspace, F1-F35, etc.) - if (ch.unicode() < 0xf700 || ch.unicode() > 0xf8ff) - text = QCFString::toQString(characters); if (m_composingText.isEmpty()) m_sendKeyEvent = !QWindowSystemInterface::tryHandleShortcutEvent(m_window, timestamp, keyCode, modifiers, text); -- cgit v1.2.3 From a90d93285a0b95013020644f29c5d932aa989d37 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 6 Jun 2013 13:50:23 +0200 Subject: Windows save file dialog: Set default suffix only once. IFileDialog::SetDefaultExtension() needs to be called for the dialog to automatically update the suffix when the user chooses a new file type. Calling it IFileDialogEvents::OnTypeChanged as introduced by 42760e43eaa64e834809ef5fb01a83cfb75f4f04 causes it to use the previous suffix when switching. Call in setNameFilters() using the first available suffix instead. Task-number: QTBUG-31381 Task-number: QTBUG-30748 Change-Id: Idd532e4190c752aa80abce963dd0389be7d22a34 Reviewed-by: Andy Shaw Reviewed-by: Oliver Wolff Reviewed-by: Joerg Bornemann --- .../platforms/windows/qwindowsdialoghelpers.cpp | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp index 33b4eb4771..f7ccb00233 100644 --- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp +++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp @@ -825,7 +825,7 @@ public: inline void updateDirectory() { setDirectory(m_data.directory()); } inline QString directory() const; virtual void exec(HWND owner = 0); - inline void setNameFilters(const QStringList &f); + virtual void setNameFilters(const QStringList &f); inline void selectNameFilter(const QString &filter); inline void updateSelectedNameFilter() { selectNameFilter(m_data.selectedNameFilter()); } inline QString selectedNameFilter() const; @@ -1335,12 +1335,11 @@ class QWindowsNativeSaveFileDialog : public QWindowsNativeFileDialogBase { Q_OBJECT public: - explicit QWindowsNativeSaveFileDialog(const QWindowsFileDialogSharedData &data); + explicit QWindowsNativeSaveFileDialog(const QWindowsFileDialogSharedData &data) + : QWindowsNativeFileDialogBase(data) {} + virtual void setNameFilters(const QStringList &f); virtual QStringList selectedFiles() const; virtual QStringList dialogResult() const; - -private slots: - void slotFilterSelected(const QString &); }; // Return the first suffix from the name filter "Foo files (*.foo;*.bar)" -> "foo". @@ -1358,20 +1357,21 @@ static inline QString suffixFromFilter(const QString &filter) return endPos >= 0 ? filter.mid(suffixPos, endPos - suffixPos) : QString(); } -QWindowsNativeSaveFileDialog::QWindowsNativeSaveFileDialog(const QWindowsFileDialogSharedData &data) - : QWindowsNativeFileDialogBase(data) +void QWindowsNativeSaveFileDialog::setNameFilters(const QStringList &f) { - connect(this, &QWindowsNativeFileDialogBase::filterSelected, - this, &QWindowsNativeSaveFileDialog::slotFilterSelected); -} - -void QWindowsNativeSaveFileDialog::slotFilterSelected(const QString &filter) -{ - // Cause the dialog to append the suffix of the current filter unless a default - // suffix is set (Note: Qt 4.8 sets the selected filter's suffix before - // calling GetSaveFileName()). - if (!hasDefaultSuffix()) - setDefaultSuffixSys(suffixFromFilter(filter)); + QWindowsNativeFileDialogBase::setNameFilters(f); + // QTBUG-31381, QTBUG-30748: IFileDialog will update the suffix of the selected name + // filter only if a default suffix is set (see docs). Set the first available + // suffix unless we have a defaultSuffix. + if (!hasDefaultSuffix()) { + foreach (const QString &filter, f) { + const QString suffix = suffixFromFilter(filter); + if (!suffix.isEmpty()) { + setDefaultSuffixSys(suffix); + break; + } + } + } // m_hasDefaultSuffix } QStringList QWindowsNativeSaveFileDialog::dialogResult() const -- cgit v1.2.3 From e1109df7a92812233935489bc9fbae524536130a Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 7 Jun 2013 13:22:51 +0200 Subject: Remove the use of CMAKE_FIND_ROOT_PATH. This is actually a list in CMake, not a value to be prepended to paths. Specify the QT_SYSROOT instead to root the location of include directories. CMake will soon get a CMAKE_SYSROOT variable which will replace this. Change-Id: I239f69f127f3676a3835aa4f29638f44ef209819 Reviewed-by: Volker Krause Reviewed-by: Stephen Kelly Reviewed-by: Oswald Buddenhagen --- src/corelib/Qt5CTestMacros.cmake | 4 ---- src/gui/Qt5GuiConfigExtras.cmake.in | 12 +++++++----- 2 files changed, 7 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/corelib/Qt5CTestMacros.cmake b/src/corelib/Qt5CTestMacros.cmake index 51537a3904..126a348b47 100644 --- a/src/corelib/Qt5CTestMacros.cmake +++ b/src/corelib/Qt5CTestMacros.cmake @@ -38,10 +38,6 @@ foreach(module ${CMAKE_MODULES_UNDER_TEST}) ) endforeach() -if(CMAKE_CROSSCOMPILING AND CMAKE_FIND_ROOT_PATH) - list(APPEND BUILD_OPTIONS_LIST "-DCMAKE_CXX_LINK_FLAGS=--sysroot=\"${CMAKE_FIND_ROOT_PATH}\"") -endif() - macro(expect_pass _dir) string(REPLACE "(" "_" testname "${_dir}") string(REPLACE ")" "_" testname "${testname}") diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in index 4a6f6250f5..83e77280d5 100644 --- a/src/gui/Qt5GuiConfigExtras.cmake.in +++ b/src/gui/Qt5GuiConfigExtras.cmake.in @@ -57,7 +57,7 @@ find_path(_qt5gui_OPENGL_INCLUDE_DIR $$CMAKE_GL_HEADER_NAME PATHS $$CMAKE_GL_INCDIRS NO_DEFAULT_PATH) if (NOT _qt5gui_OPENGL_INCLUDE_DIR) - message(FATAL_ERROR \"Failed to find \\\"$$CMAKE_GL_HEADER_NAME\\\" in \\\"$$CMAKE_GL_INCDIRS\\\", using the CMAKE_FIND_ROOT_PATH \\\"${CMAKE_FIND_ROOT_PATH}\\\".\") + message(FATAL_ERROR \"Failed to find \\\"$$CMAKE_GL_HEADER_NAME\\\" in \\\"$$CMAKE_GL_INCDIRS\\\".\") endif() _qt5_Gui_check_file_exists(${_qt5gui_OPENGL_INCLUDE_DIR}) @@ -87,7 +87,7 @@ macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs) if (\"${ARGN}\" STREQUAL \"OPTIONAL\") break() else() - message(FATAL_ERROR \"Failed to find \\\"${_lib}\\\" in \\\"${LibDir}\\\", using the CMAKE_FIND_ROOT_PATH \\\"${CMAKE_FIND_ROOT_PATH}\\\".\") + message(FATAL_ERROR \"Failed to find \\\"${_lib}\\\" in \\\"${LibDir}\\\".\") endif() endif() add_library(Qt5::Gui_${_cmake_lib_name} SHARED IMPORTED) @@ -116,9 +116,11 @@ macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs) endif() list(APPEND Qt5Gui_${Name}_LIBRARIES Qt5::Gui_${_cmake_lib_name}) endforeach() - foreach(_dir ${IncDirs}) - _qt5_Gui_check_file_exists(${_dir}) - endforeach() + if (NOT CMAKE_CROSSCOMPILING) + foreach(_dir ${IncDirs}) + _qt5_Gui_check_file_exists(${_dir}) + endforeach() + endif() endmacro() -- cgit v1.2.3 From f2ea45363dae1ad67386d0aeb0697e716cc10aee Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 10 Jun 2013 11:25:24 +0200 Subject: qdoc: QGLFrameBufferObject::bindDefault() was marked \internal The \internal is removed. Task-number: QTBUG-31638 Change-Id: Ib1b65783599fe50e907373e3223a0774f17ac65e Reviewed-by: Jerome Pasion Reviewed-by: Gunnar Sletta --- src/opengl/qglframebufferobject.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index 1c802cabcb..8210b218ec 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -1122,7 +1122,6 @@ QPaintEngine *QGLFramebufferObject::paintEngine() const /*! \fn bool QGLFramebufferObject::bindDefault() - \internal Switches rendering back to the default, windowing system provided framebuffer. -- cgit v1.2.3 From 900cccfd459fcbdbc4aa3d313afe12cfbf68fd87 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 10 Jun 2013 13:50:44 +0200 Subject: Fix drawing of 0-width polylines from outside the devicerect. This was broken by a previous fix which aimed to fix gaps in polylines with tiny line segments. The result was that we skipped updating the origin point when stroke() didn't produce pixels which accidentally included the case of the line being completely outside the deviceRect. I fixed this by returning the value of clipLine in drawLine to the caller so we could still update the origin for this case. Task-number: QTBUG-31579 Change-Id: Iac29436f042da7658bbeaf9370351dc6f2c95065 Reviewed-by: Lars Knoll --- src/gui/painting/qcosmeticstroker.cpp | 42 ++++++++++++++++++++++------------- src/gui/painting/qcosmeticstroker_p.h | 2 +- 2 files changed, 27 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp index 0f3cde3efd..39f64224f0 100644 --- a/src/gui/painting/qcosmeticstroker.cpp +++ b/src/gui/painting/qcosmeticstroker.cpp @@ -133,10 +133,15 @@ struct NoDasher { }; +/* + * The return value is the result of the clipLine() call performed at the start + * of each of the two functions, aka "false" means completely outside the devices + * rect. + */ template -static void drawLine(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); +static bool drawLine(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); template -static void drawLineAA(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); +static bool drawLineAA(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); inline void drawPixel(QCosmeticStroker *stroker, int x, int y, int coverage) { @@ -602,17 +607,20 @@ void QCosmeticStroker::drawPath(const QVectorPath &path) caps |= CapEnd; QCosmeticStroker::Point last = this->lastPixel; - stroke(this, p.x(), p.y(), p2.x(), p2.y(), caps); + bool unclipped = stroke(this, p.x(), p.y(), p2.x(), p2.y(), caps); /* fix for gaps in polylines with fastpen and aliased in a sequence of points with small distances: if current point p2 has been dropped - out, keep last non dropped point p. */ - if (fastPenAliased) { - if (last.x != lastPixel.x || last.y != lastPixel.y || - points == begin + 2 || points == end - 2 ) { - { - p = p2; - } + out, keep last non dropped point p. + + However, if the line was completely outside the devicerect, we + still need to update p to avoid drawing the line after this one from + a bad starting position. + */ + if (fastPenAliased && unclipped) { + if (last.x != lastPixel.x || last.y != lastPixel.y + || points == begin + 2 || points == end - 2) { + p = p2; } } else { p = p2; @@ -720,10 +728,10 @@ static inline void capAdjust(int caps, int &x1, int &x2, int &y, int yinc) the drawing shifts from horizontal to vertical or back. */ template -static void drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) +static bool drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) { if (stroker->clipLine(rx1, ry1, rx2, ry2)) - return; + return false; const int half = stroker->legacyRounding ? 31 : 0; int x1 = toF26Dot6(rx1) + half; @@ -813,7 +821,7 @@ static void drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, } else { // horizontal if (!dx) - return; + return true; QCosmeticStroker::Direction dir = QCosmeticStroker::LeftToRight; @@ -886,14 +894,15 @@ static void drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, } } stroker->lastPixel = last; + return true; } template -static void drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) +static bool drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) { if (stroker->clipLine(rx1, ry1, rx2, ry2)) - return; + return false; int x1 = toF26Dot6(rx1); int y1 = toF26Dot6(ry1); @@ -967,7 +976,7 @@ static void drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx } else { // horizontal if (!dx) - return; + return true; int yinc = F16Dot16FixedDiv(dy, dx); @@ -1029,6 +1038,7 @@ static void drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx drawPixel(stroker, x, (y>>16) + 1, alpha * alphaEnd >> 6); } } + return true; } QT_END_NAMESPACE diff --git a/src/gui/painting/qcosmeticstroker_p.h b/src/gui/painting/qcosmeticstroker_p.h index 05c8a2b0cf..5fc3559da4 100644 --- a/src/gui/painting/qcosmeticstroker_p.h +++ b/src/gui/painting/qcosmeticstroker_p.h @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE class QCosmeticStroker; -typedef void (*StrokeLine)(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); +typedef bool (*StrokeLine)(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); class QCosmeticStroker { -- cgit v1.2.3 From 425af59f534ed8a0f4bc7a77a1f83e4d1e2e2bdc Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Mon, 10 Jun 2013 11:56:14 +0200 Subject: Disable long press on Android Remove the mapping from press-and-hold to right-mouse-button press. This logic was implemented in the android plugin, and there was no way to disable it for applications that needed to handle long presses in a different way. Add an environment variable to enable the mapping for those who really need it, but do not advertise it. (We want to add a proper API for this in 5.2) Task-number: QTBUG-31644 Change-Id: Ia5ae75d6147485b73c78b7c3fa88d11af5d84c06 Reviewed-by: BogDan Vatra --- src/plugins/platforms/android/src/androidjniinput.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/plugins/platforms/android/src/androidjniinput.cpp b/src/plugins/platforms/android/src/androidjniinput.cpp index da6156a330..29ccfe0125 100644 --- a/src/plugins/platforms/android/src/androidjniinput.cpp +++ b/src/plugins/platforms/android/src/androidjniinput.cpp @@ -163,6 +163,10 @@ namespace QtAndroidInput static void longPress(JNIEnv */*env*/, jobject /*thiz*/, jint /*winId*/, jint x, jint y) { + //### TODO: add proper API for Qt 5.2 + static bool rightMouseFromLongPress = qgetenv("QT_NECESSITAS_COMPATIBILITY_LONG_PRESS").toInt(); + if (!rightMouseFromLongPress) + return; m_ignoreMouseEvents = true; QPoint globalPos(x,y); QWindow *tlw = topLevelWindowAt(globalPos); -- cgit v1.2.3 From 85b4f0d2d3ffd326548ca8f0e15ac27f5fd8d77d Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Tue, 11 Jun 2013 11:09:34 +0200 Subject: Avoid floating point exceptions in rasterizeLine. Task-number: QTBUG-16757 Change-Id: I3ef988f1e039c12529d62197d85a62f201e4ae12 Reviewed-by: Lars Knoll --- src/gui/painting/qrasterizer.cpp | 61 +++++++++++++++++++++++++++++----------- 1 file changed, 45 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp index a6be7c6c78..197d49369e 100644 --- a/src/gui/painting/qrasterizer.cpp +++ b/src/gui/painting/qrasterizer.cpp @@ -734,6 +734,35 @@ static inline QPointF snapTo26Dot6Grid(const QPointF &p) qFloorF(p.y() * 64) * (1 / qreal(64))); } +/* + The rasterize line function relies on some div by zero which should + result in +/-inf values. However, when floating point exceptions are + enabled, this will cause crashes, so we return high numbers instead. + As the returned value is used in further arithmetic, returning + FLT_MAX/DBL_MAX will also cause values, so instead return a value + that is well outside the int-range. + */ +static inline qreal qSafeDivide(qreal x, qreal y) +{ + if (y == 0) + return x > 0 ? 1e20 : -1e20; + return x / y; +} + +/* Conversion to int fails if the value is too large to fit into INT_MAX or + too small to fit into INT_MIN, so we need this slightly safer conversion + when floating point exceptions are enabled + */ +static inline int qSafeFloatToQ16Dot16(qreal x) +{ + qreal tmp = x * 65536.; + if (tmp > qreal(INT_MAX)) + return INT_MAX; + else if (tmp < qreal(INT_MIN)) + return -INT_MAX; + return int(tmp); +} + void QRasterizer::rasterizeLine(const QPointF &a, const QPointF &b, qreal width, bool squareCap) { if (a == b || width == 0 || d->clipRect.isEmpty()) @@ -946,23 +975,23 @@ void QRasterizer::rasterizeLine(const QPointF &a, const QPointF &b, qreal width, const QPointF bottomLeftEdge = bottom - left; const QPointF bottomRightEdge = bottom - right; - const qreal topLeftSlope = topLeftEdge.x() / topLeftEdge.y(); - const qreal bottomLeftSlope = bottomLeftEdge.x() / bottomLeftEdge.y(); + const qreal topLeftSlope = qSafeDivide(topLeftEdge.x(), topLeftEdge.y()); + const qreal bottomLeftSlope = qSafeDivide(bottomLeftEdge.x(), bottomLeftEdge.y()); - const qreal topRightSlope = topRightEdge.x() / topRightEdge.y(); - const qreal bottomRightSlope = bottomRightEdge.x() / bottomRightEdge.y(); + const qreal topRightSlope = qSafeDivide(topRightEdge.x(), topRightEdge.y()); + const qreal bottomRightSlope = qSafeDivide(bottomRightEdge.x(), bottomRightEdge.y()); - const Q16Dot16 topLeftSlopeFP = FloatToQ16Dot16(topLeftSlope); - const Q16Dot16 topRightSlopeFP = FloatToQ16Dot16(topRightSlope); + const Q16Dot16 topLeftSlopeFP = qSafeFloatToQ16Dot16(topLeftSlope); + const Q16Dot16 topRightSlopeFP = qSafeFloatToQ16Dot16(topRightSlope); - const Q16Dot16 bottomLeftSlopeFP = FloatToQ16Dot16(bottomLeftSlope); - const Q16Dot16 bottomRightSlopeFP = FloatToQ16Dot16(bottomRightSlope); + const Q16Dot16 bottomLeftSlopeFP = qSafeFloatToQ16Dot16(bottomLeftSlope); + const Q16Dot16 bottomRightSlopeFP = qSafeFloatToQ16Dot16(bottomRightSlope); - const Q16Dot16 invTopLeftSlopeFP = FloatToQ16Dot16(1 / topLeftSlope); - const Q16Dot16 invTopRightSlopeFP = FloatToQ16Dot16(1 / topRightSlope); + const Q16Dot16 invTopLeftSlopeFP = qSafeFloatToQ16Dot16(qSafeDivide(1, topLeftSlope)); + const Q16Dot16 invTopRightSlopeFP = qSafeFloatToQ16Dot16(qSafeDivide(1, topRightSlope)); - const Q16Dot16 invBottomLeftSlopeFP = FloatToQ16Dot16(1 / bottomLeftSlope); - const Q16Dot16 invBottomRightSlopeFP = FloatToQ16Dot16(1 / bottomRightSlope); + const Q16Dot16 invBottomLeftSlopeFP = qSafeFloatToQ16Dot16(qSafeDivide(1, bottomLeftSlope)); + const Q16Dot16 invBottomRightSlopeFP = qSafeFloatToQ16Dot16(qSafeDivide(1, bottomRightSlope)); if (d->antialiased) { const Q16Dot16 iTopFP = IntToQ16Dot16(int(topBound)); @@ -1137,10 +1166,10 @@ void QRasterizer::rasterizeLine(const QPointF &a, const QPointF &b, qreal width, int iBottom = bottom.y() < 0.5f? -1 : int(bottom.y() - 0.5f); int iMiddle = qMin(iLeft, iRight); - Q16Dot16 leftIntersectAf = FloatToQ16Dot16(top.x() + 0.5f + (iTop + 0.5f - top.y()) * topLeftSlope); - Q16Dot16 leftIntersectBf = FloatToQ16Dot16(left.x() + 0.5f + (iLeft + 1.5f - left.y()) * bottomLeftSlope); - Q16Dot16 rightIntersectAf = FloatToQ16Dot16(top.x() - 0.5f + (iTop + 0.5f - top.y()) * topRightSlope); - Q16Dot16 rightIntersectBf = FloatToQ16Dot16(right.x() - 0.5f + (iRight + 1.5f - right.y()) * bottomRightSlope); + Q16Dot16 leftIntersectAf = qSafeFloatToQ16Dot16(top.x() + 0.5f + (iTop + 0.5f - top.y()) * topLeftSlope); + Q16Dot16 leftIntersectBf = qSafeFloatToQ16Dot16(left.x() + 0.5f + (iLeft + 1.5f - left.y()) * bottomLeftSlope); + Q16Dot16 rightIntersectAf = qSafeFloatToQ16Dot16(top.x() - 0.5f + (iTop + 0.5f - top.y()) * topRightSlope); + Q16Dot16 rightIntersectBf = qSafeFloatToQ16Dot16(right.x() - 0.5f + (iRight + 1.5f - right.y()) * bottomRightSlope); int ny; int y = iTop; -- cgit v1.2.3 From 70cb5db4f219dd3e0e5fdffc4309c35b0195a017 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 11 Jun 2013 10:41:33 +0200 Subject: Fix gcc warnings about unused-value Fix multiple gcc warnings about statements in accessibleDebug arguments have no effect. Change-Id: I34bf05d911707f0b50592bf76442a3805c560d56 Reviewed-by: Friedemann Kleint Reviewed-by: Frederik Gladhorn --- src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h b/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h index d4f141c5d8..5b8d08d3c8 100644 --- a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h +++ b/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h @@ -63,7 +63,7 @@ QT_BEGIN_NAMESPACE bool debug_accessibility(); # define accessibleDebug !debug_accessibility() ? (void)0 : qDebug #else -# define accessibleDebug +# define accessibleDebug while (false) qDebug #endif #ifndef QT_NO_DEBUG_OUTPUT -- cgit v1.2.3 From c47b66589341a07abb42ca913247cef51bfe624f Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Tue, 11 Jun 2013 14:07:00 +0200 Subject: Qdoc: replaced example file qt.qdocconf with qtgui.qdocconf Task-number: QTBUG-31574 Change-Id: Idf8509395dd5f16c696473d1eeb91fb86f2b97e7 Reviewed-by: Martin Smith --- src/tools/qdoc/doc/files/qtgui.qdocconf | 50 +++++++++++++++++++++++++++++++++ src/tools/qdoc/doc/qdoc-manual.qdoc | 50 ++++++++++----------------------- 2 files changed, 65 insertions(+), 35 deletions(-) create mode 100644 src/tools/qdoc/doc/files/qtgui.qdocconf (limited to 'src') diff --git a/src/tools/qdoc/doc/files/qtgui.qdocconf b/src/tools/qdoc/doc/files/qtgui.qdocconf new file mode 100644 index 0000000000..5073dd7f0f --- /dev/null +++ b/src/tools/qdoc/doc/files/qtgui.qdocconf @@ -0,0 +1,50 @@ +include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) + +project = QtGui +description = Qt GUI Reference Documentation +url = http://qt-project.org/doc/qt-$QT_VER/qtgui +version = $QT_VERSION + +examplesinstallpath = gui + +qhp.projects = QtGui + +qhp.QtGui.file = qtgui.qhp +qhp.QtGui.namespace = org.qt-project.qtgui.$QT_VERSION_TAG +qhp.QtGui.virtualFolder = qtgui +qhp.QtGui.indexTitle = Qt GUI +qhp.QtGui.indexRoot = + +qhp.QtGui.filterAttributes = qtgui $QT_VERSION qtrefdoc +qhp.QtGui.customFilters.Qt.name = Qtgui $QT_VERSION +qhp.QtGui.customFilters.Qt.filterAttributes = qtgui $QT_VERSION + +qhp.QtGui.subprojects = classes +qhp.QtGui.subprojects.classes.title = C++ Classes +qhp.QtGui.subprojects.classes.indexTitle = Qt GUI C++ Classes +qhp.QtGui.subprojects.classes.selectors = class fake:headerfile +qhp.QtGui.subprojects.classes.sortPages = true + +tagfile = ../../../doc/qtgui/qtgui.tags + +depends += \ + qtcore \ + qtnetwork \ + qtopengl \ + qtsvg \ + qtqml \ + qtquick \ + qtwidgets \ + qtdoc + +headerdirs += .. + +sourcedirs += .. \ + ../../../examples/gui/doc/src + +exampledirs += ../../../examples/gui \ + snippets + +imagedirs += images \ + ../../../examples/gui/doc/images \ + ../../../doc/src/images \ diff --git a/src/tools/qdoc/doc/qdoc-manual.qdoc b/src/tools/qdoc/doc/qdoc-manual.qdoc index b715b200bf..4a4b1db6ff 100644 --- a/src/tools/qdoc/doc/qdoc-manual.qdoc +++ b/src/tools/qdoc/doc/qdoc-manual.qdoc @@ -66,7 +66,7 @@ \li \l {HTML Specific Configuration Variables} \li \l {Supporting Derived Projects} \li \l {Example Manifest Files} - \li \l {qt.qdocconf} + \li \l {qtgui.qdocconf} \li \l {minimum.qdocconf} \li \l {Generating DITA XML Output} \endlist @@ -7179,13 +7179,13 @@ \list \li A minimum configuration file: \l minimum.qdocconf - \li The Qt configuration file: \l qt.qdocconf + \li The Qt configuration file: \l qtgui.qdocconf \endlist */ /*! \page 21-1-minimum-qdocconf.html - \previouspage qt.qdocconf + \previouspage qtgui.qdocconf \contentspage QDoc Manual \nextpage Generating DITA XML Output @@ -7195,14 +7195,14 @@ */ /*! - \page 21-2-qt-qdocconf.html + \page 21-2-qtgui-qdocconf.html \previouspage Supporting Derived Projects \contentspage QDoc Manual \nextpage minimum.qdocconf - \title qt.qdocconf + \title qtgui.qdocconf - \quotefile files/qt.qdocconf + \quotefile files/qtgui.qdocconf */ /*! @@ -7548,10 +7548,9 @@ The general syntax is \tt {extraimages.\e{format} = \e image}. The file extension is optional. - For example, in \l qt.qdocconf we use a couple of images within - the HTML.postheader variable which value is pure HTML. For that - reason, these images are specified using the \c extraimages - variable: + For example, if additional images are used within the HTML.postheader + value, then these images must also be specified using the \c + extraimages variable: \code extraimages.HTML = qt-logo @@ -7819,7 +7818,7 @@ Currently, C++ is the only language that QDoc understands. It is also the default language, and doesn't really need to be - specified. But for example in \l qt.qdocconf: + specified. \code language = Cpp @@ -7889,7 +7888,7 @@ The \c outputdir variable specifies the directory where QDoc will put the generated documentation. - In qt.qdocconf: + For example: \code outputdir = $QTDIR/doc/html @@ -7972,8 +7971,6 @@ The \c sourcedirs variable specifies the directories containing the \c .cpp or \c .qdoc files used in the documentation. - For example in \l qt.qdocconf - \code sourcedirs = $QTDIR/src \ $QTDIR/doc/src \ @@ -8157,7 +8154,7 @@ The \c versionsym variable specifies a C++ preprocessor symbol that defines the version number of the documented software. - For example in \l qt.qdocconf: + For example: \code versionsym = QT_VERSION_STR @@ -8270,7 +8267,7 @@ Cpp.ignoredirectives} variables, non-standard constructs (typically macros) can result in erroneous documentation. - In \l qt.qdocconf: + For example: \code Cpp.ignoredirectives = Q_DECLARE_INTERFACE \ @@ -8324,8 +8321,6 @@ Cpp.ignoredirectives} variables, non-standard constructs (typically macros) can result in erroneous documentation. - In \l qt.qdocconf: - \code Cpp.ignoretokens = QAXFACTORY_EXPORT \ QM_EXPORT_CANVAS \ @@ -8389,18 +8384,12 @@ quotation marks. Note that if the value spans several lines, each line needs to be enclosed by quotation marks. - For example in \l qt.qdocconf: - \code HTML.footer = "


\n" \ ... "
" \endcode - The complete variable entry in \l qt.qdocconf provides the - standard footer of the \l {http://doc.qt.digia.com/4.0/index.html} - {Qt Reference Documentation}. - \target HTML.postheader-variable \section1 HTML.postheader @@ -8414,8 +8403,6 @@ marks. Note that if the value spans several lines, each line needs to be enclosed by quotation marks. - For example in \l qt.qdocconf: - \code HTML.postheader = "" \endcode - The complete variable entry in \l qt.qdocconf provides the - standard header of the \l {http://doc.qt.digia.com/} {Qt Reference Documentation}. \target HTML.style-variable @@ -8440,8 +8425,6 @@ marks. Note that if the value spans several lines, each line needs to be enclosed by quotation marks. - For example in \l qt.qdocconf: - \code HTML.style = "h3.fn,span.fn" \ "{ margin-left: 1cm; text-indent: -1cm; }\n" \ @@ -8473,7 +8456,7 @@ \endcode QDoc expects to find stylesheets in the directory containing the - \l qt.qdocconf file, and it will copy those specified to the output + \l qtgui.qdocconf file, and it will copy those specified to the output directory alongside the HTML pages. */ @@ -8565,7 +8548,7 @@ This feature makes use of the comprehensive indexes generated by QDoc when it creates the Qt reference documentation. - For example, \l qt.qdocconf (the configuration file for Qt) + For example, \l qtgui.qdocconf (the configuration file for Qt) contains the following variable definitions: \code @@ -8585,9 +8568,6 @@ In a mini-project, you can use an index file by defining an \l indexes configuration variable in your \c .qdocconf file. - For example, you can create a \c qtcreator.qdocconf file to help you - check the Qt Creator documentation: - \code project = QtCreator description = Qt Creator Manual -- cgit v1.2.3 From 80d24a737ac4f93eaabaab79e0c60c9da97d6eed Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Mon, 10 Jun 2013 16:56:42 -0400 Subject: Update support status for older Mac OS X platforms. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ifdf487fbae8acbffb32b6db5f8dd93e9eb213d77 Reviewed-by: Gabriel de Dietrich Reviewed-by: Tor Arne Vestbø --- src/corelib/global/qglobal.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 4598f60d5e..6f63a0d9d3 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1050,9 +1050,9 @@ bool qSharedBuild() Q_DECL_NOTHROW \value MV_10_0 Mac OS X 10.0 (unsupported) \value MV_10_1 Mac OS X 10.1 (unsupported) \value MV_10_2 Mac OS X 10.2 (unsupported) - \value MV_10_3 Mac OS X 10.3 - \value MV_10_4 Mac OS X 10.4 - \value MV_10_5 Mac OS X 10.5 + \value MV_10_3 Mac OS X 10.3 (unsupported) + \value MV_10_4 Mac OS X 10.4 (unsupported) + \value MV_10_5 Mac OS X 10.5 (unsupported) \value MV_10_6 Mac OS X 10.6 \value MV_10_7 Mac OS X 10.7 \value MV_10_8 Mac OS X 10.8 -- cgit v1.2.3 From 3b5954e405cfbc3dcf1564d0e9e397825c5c1e5a Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Mon, 3 Jun 2013 18:28:03 +0200 Subject: Cocoa: Remove compilation warning Change-Id: Ib530e7ef4643de07aec91c4af0de8bbedef9882a Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm index c40ae3d81d..3ec6ad7a20 100644 --- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm +++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm @@ -113,6 +113,7 @@ static void cleanupCocoaApplicationDelegate() - (void)updateScreens:(NSNotification *)notification { + Q_UNUSED(notification); if (QCocoaIntegration *ci = dynamic_cast(QGuiApplicationPrivate::platformIntegration())) ci->updateScreens(); } -- cgit v1.2.3 From 7ee15bfbb815df87ae0526f105a13a591b192c76 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Mon, 3 Jun 2013 18:29:56 +0200 Subject: Cocoa: Make sure we update internal window fullscreen state We update the internal/synched state by assigning it its QWindow's state. Since that one is not a flag, it can only be in one state at a time, meaning that we may lose the maximized state (but we've been losing it for some time). Task-number: QTBUG-30139 Change-Id: Idf30713c6ae912cafe3bbdd7be18214cf4de34f7 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/cocoa/qcocoawindow.h | 2 ++ src/plugins/platforms/cocoa/qcocoawindow.mm | 6 ++++++ src/plugins/platforms/cocoa/qnsview.mm | 13 +++++++++---- 3 files changed, 17 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h index 91eaea21b6..b82d096bb5 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.h +++ b/src/plugins/platforms/cocoa/qcocoawindow.h @@ -136,6 +136,8 @@ public: bool windowShouldClose(); bool windowIsPopupType(Qt::WindowType type = Qt::Widget) const; + void setSynchedWindowStateFromWindow(); + NSInteger windowLevel(Qt::WindowFlags flags); NSUInteger windowStyleMask(Qt::WindowFlags flags); void setWindowShadow(Qt::WindowFlags flags); diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index f8d0eafcb3..d9043979d6 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -725,6 +725,12 @@ bool QCocoaWindow::windowShouldClose() return accepted; } +void QCocoaWindow::setSynchedWindowStateFromWindow() +{ + if (QWindow *w = window()) + m_synchedWindowState = w->windowState(); +} + bool QCocoaWindow::windowIsPopupType(Qt::WindowType type) const { if (type == Qt::Widget) diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index 10fb293ec0..529a0ccfe7 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -290,10 +290,15 @@ static QTouchDevice *touchDevice = 0; #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 if (QSysInfo::QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) { - if (notificationName == NSWindowDidEnterFullScreenNotification) { - QWindowSystemInterface::handleWindowStateChanged(m_window, Qt::WindowFullScreen); - } else if (notificationName == NSWindowDidExitFullScreenNotification) { - QWindowSystemInterface::handleWindowStateChanged(m_window, Qt::WindowNoState); + if (notificationName == NSWindowDidEnterFullScreenNotification + || notificationName == NSWindowDidExitFullScreenNotification) { + Qt::WindowState newState = notificationName == NSWindowDidEnterFullScreenNotification ? + Qt::WindowFullScreen : Qt::WindowNoState; + QWindowSystemInterface::handleWindowStateChanged(m_window, newState); + // We want to read the window state back from the window, + // but the event we just sent may be asynchronous. + QWindowSystemInterface::flushWindowSystemEvents(); + m_platformWindow->setSynchedWindowStateFromWindow(); } } #endif -- cgit v1.2.3 From b8c007ede01360594ec5399532f2229e82715cc3 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Mon, 3 Jun 2013 18:33:03 +0200 Subject: Cocoa: Update window state when maximizing from the title bar There's no NSWindow notification we can listen to, but we can override behavior from its delegate. Change-Id: I61cebf4119f83c770fe4e7f45ff0d4e8bf9d0df9 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/cocoa/qnsview.h | 1 + src/plugins/platforms/cocoa/qnsview.mm | 10 ++++++++++ src/plugins/platforms/cocoa/qnswindowdelegate.h | 1 + src/plugins/platforms/cocoa/qnswindowdelegate.mm | 8 ++++++++ 4 files changed, 20 insertions(+) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h index 85f72a4dbb..d28e38886b 100644 --- a/src/plugins/platforms/cocoa/qnsview.h +++ b/src/plugins/platforms/cocoa/qnsview.h @@ -82,6 +82,7 @@ QT_END_NAMESPACE - (void)drawRect:(NSRect)dirtyRect; - (void)updateGeometry; - (void)windowNotification : (NSNotification *) windowNotification; +- (void)notifyWindowWillZoom:(BOOL)willZoom; - (void)viewDidHide; - (void)viewDidUnhide; diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index 529a0ccfe7..ec53fc6a7e 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -306,6 +306,16 @@ static QTouchDevice *touchDevice = 0; } } +- (void)notifyWindowWillZoom:(BOOL)willZoom +{ + Qt::WindowState newState = willZoom ? Qt::WindowMaximized : Qt::WindowNoState; + QWindowSystemInterface::handleWindowStateChanged(m_window, newState); + // We want to read the window state back from the window, + // but the event we just sent may be asynchronous. + QWindowSystemInterface::flushWindowSystemEvents(); + m_platformWindow->setSynchedWindowStateFromWindow(); +} + - (void)viewDidHide { m_platformWindow->obscureWindow(); diff --git a/src/plugins/platforms/cocoa/qnswindowdelegate.h b/src/plugins/platforms/cocoa/qnswindowdelegate.h index 9a616ba8e8..06e11fffbb 100644 --- a/src/plugins/platforms/cocoa/qnswindowdelegate.h +++ b/src/plugins/platforms/cocoa/qnswindowdelegate.h @@ -57,6 +57,7 @@ - (void)windowDidMove:(NSNotification *)notification; - (void)windowWillMove:(NSNotification *)notification; - (BOOL)windowShouldClose:(NSNotification *)notification; +- (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)newFrame; @end diff --git a/src/plugins/platforms/cocoa/qnswindowdelegate.mm b/src/plugins/platforms/cocoa/qnswindowdelegate.mm index 8e17936a78..10536bd5f4 100644 --- a/src/plugins/platforms/cocoa/qnswindowdelegate.mm +++ b/src/plugins/platforms/cocoa/qnswindowdelegate.mm @@ -90,4 +90,12 @@ return YES; } +- (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)newFrame +{ + Q_UNUSED(newFrame); + if (m_cocoaWindow && m_cocoaWindow->m_qtView) + [m_cocoaWindow->m_qtView notifyWindowWillZoom:![window isZoomed]]; + return YES; +} + @end -- cgit v1.2.3 From bfab741cb7ed24d2decfab4cffdcdbf14f6317ca Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 4 Jun 2013 13:54:07 +0200 Subject: Cocoa: Make sure internal minimized state is up to date Refactors some code from previous changes addressing the same issue for maximized and fullscreen states. Change-Id: I8a27274a90e6610b424ea7af3269369a1d724c48 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/cocoa/qnsview.h | 1 + src/plugins/platforms/cocoa/qnsview.mm | 30 ++++++++++++++++-------------- 2 files changed, 17 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h index d28e38886b..92215b9e67 100644 --- a/src/plugins/platforms/cocoa/qnsview.h +++ b/src/plugins/platforms/cocoa/qnsview.h @@ -81,6 +81,7 @@ QT_END_NAMESPACE - (void)invalidateWindowShadowIfNeeded; - (void)drawRect:(NSRect)dirtyRect; - (void)updateGeometry; +- (void)notifyWindowStateChanged:(Qt::WindowState)newState; - (void)windowNotification : (NSNotification *) windowNotification; - (void)notifyWindowWillZoom:(BOOL)willZoom; - (void)viewDidHide; diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index ec53fc6a7e..ab3f495a60 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -251,6 +251,15 @@ static QTouchDevice *touchDevice = 0; } } +- (void)notifyWindowStateChanged:(Qt::WindowState)newState +{ + QWindowSystemInterface::handleWindowStateChanged(m_window, newState); + // We want to read the window state back from the window, + // but the event we just sent may be asynchronous. + QWindowSystemInterface::flushWindowSystemEvents(); + m_platformWindow->setSynchedWindowStateFromWindow(); +} + - (void)windowNotification : (NSNotification *) windowNotification { //qDebug() << "windowNotification" << QCFString::toQString([windowNotification name]); @@ -269,10 +278,11 @@ static QTouchDevice *touchDevice = 0; if (!m_platformWindow->windowIsPopupType()) QWindowSystemInterface::handleWindowActivated(0); } - } else if (notificationName == NSWindowDidMiniaturizeNotification) { - QWindowSystemInterface::handleWindowStateChanged(m_window, Qt::WindowMinimized); - } else if (notificationName == NSWindowDidDeminiaturizeNotification) { - QWindowSystemInterface::handleWindowStateChanged(m_window, Qt::WindowNoState); + } else if (notificationName == NSWindowDidMiniaturizeNotification + || notificationName == NSWindowDidDeminiaturizeNotification) { + Qt::WindowState newState = notificationName == NSWindowDidMiniaturizeNotification ? + Qt::WindowMinimized : Qt::WindowNoState; + [self notifyWindowStateChanged:newState]; } else if ([notificationName isEqualToString: @"NSWindowDidOrderOffScreenNotification"]) { m_platformWindow->obscureWindow(); } else if ([notificationName isEqualToString: @"NSWindowDidOrderOnScreenAndFinishAnimatingNotification"]) { @@ -294,11 +304,7 @@ static QTouchDevice *touchDevice = 0; || notificationName == NSWindowDidExitFullScreenNotification) { Qt::WindowState newState = notificationName == NSWindowDidEnterFullScreenNotification ? Qt::WindowFullScreen : Qt::WindowNoState; - QWindowSystemInterface::handleWindowStateChanged(m_window, newState); - // We want to read the window state back from the window, - // but the event we just sent may be asynchronous. - QWindowSystemInterface::flushWindowSystemEvents(); - m_platformWindow->setSynchedWindowStateFromWindow(); + [self notifyWindowStateChanged:newState]; } } #endif @@ -309,11 +315,7 @@ static QTouchDevice *touchDevice = 0; - (void)notifyWindowWillZoom:(BOOL)willZoom { Qt::WindowState newState = willZoom ? Qt::WindowMaximized : Qt::WindowNoState; - QWindowSystemInterface::handleWindowStateChanged(m_window, newState); - // We want to read the window state back from the window, - // but the event we just sent may be asynchronous. - QWindowSystemInterface::flushWindowSystemEvents(); - m_platformWindow->setSynchedWindowStateFromWindow(); + [self notifyWindowStateChanged:newState]; } - (void)viewDidHide -- cgit v1.2.3 From d8f4abec711d7af4013209fd8b0c9edcedb44ab6 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Wed, 5 Jun 2013 15:47:55 +0200 Subject: Cocoa: Make QWidget::showNormal() work on minimized windows Cocoa sets the NSWindow hidden when it's minimized, and we don't propagate that further to QWindow or QWidget (QWidget's 'visible' documentation is quite ambiguous about that state). The obvious fix is to check for QWindow's visibility. However, this might need to be corrected later if we truly want the visible state to be in sync. Task-number: QTBUG-31117 Change-Id: I457452eff75e6ea746a0ef5351104f8bbb65f98b Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/cocoa/qcocoawindow.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index d9043979d6..19c4faf369 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -486,7 +486,7 @@ void QCocoaWindow::setWindowFlags(Qt::WindowFlags flags) void QCocoaWindow::setWindowState(Qt::WindowState state) { - if ([m_nsWindow isVisible]) + if (window()->isVisible()) syncWindowState(state); // Window state set for hidden windows take effect when show() is called. } -- cgit v1.2.3 From 2d9cd8eef8652873e73d5cde6b6545eea9a17612 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 12 Jun 2013 09:37:46 +0200 Subject: Fix xkbcommon.pri not to override QMAKE_CFLAGS Task-number: QTBUG-31585 Change-Id: I6628a8eececc34aef4cd358ad2c8b246d8845602 Reviewed-by: Jani Heikkinen Reviewed-by: Andy Shaw --- src/3rdparty/xkbcommon.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/3rdparty/xkbcommon.pri b/src/3rdparty/xkbcommon.pri index 99536576f7..d437c6b8b6 100644 --- a/src/3rdparty/xkbcommon.pri +++ b/src/3rdparty/xkbcommon.pri @@ -1,4 +1,4 @@ -QMAKE_CFLAGS = -std=gnu99 -w +QMAKE_CFLAGS += -std=gnu99 -w INCLUDEPATH += $$PWD/xkbcommon $$PWD/xkbcommon/src $$PWD/xkbcommon/src/xkbcomp DEFINES += DFLT_XKB_CONFIG_ROOT='\\"/usr/share/X11/xkb\\"' -- cgit v1.2.3 From 5fc98982372444a745ff888cb5c2f4fbce5c358f Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 13 Jun 2013 12:13:07 +0200 Subject: Fix format in platform plugin loading error reporting. qguiapplication.cpp:792:133: warning: format not a string literal and no format arguments [-Wformat-security]. Introduced by 0d7d53fd46e8ab512bed88d0dab114cfada227ce . Change-Id: I70268a8b597be33226efb9bb4d7d9f672f0d7440 Reviewed-by: Kai Koehne --- src/gui/kernel/qguiapplication.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 3c3cea2910..add1c1f90b 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -789,7 +789,7 @@ static void init_platform(const QString &pluginArgument, const QString &platform fatalMessage += QStringLiteral("Available platforms are: %1\n").arg( keys.join(QStringLiteral(", "))); fatalMessage += QStringLiteral("GUI applications require a platform plugin. Terminating."); - qFatal(qPrintable(fatalMessage)); + qFatal("%s", qPrintable(fatalMessage)); return; } -- cgit v1.2.3 From 46667d604fb2ae11a87c0c075a3d2468d02f7bdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 11 Jun 2013 15:05:13 +0200 Subject: Fix crash when re-creating QThreadData after initially destroying it We destroy the thread data for the main thread when the QCoreApplication is destructed, and then delete the pthread key for the thread data in the global static destructor function 'destroy_current_thread_data_key'. The user may have its own Q_DESTRUCTOR_FUNCTION though, which may or may not run after we've destroyed the key. If it runs after we've destroyed the key, we'll end up trying to re-create the tread-data, as expected, but set_thread_data() will fail to persist it, as pthread_setspecific is called with an invalid key. The result is an infinite recursion: ... 6 in QThreadData::current () at qthread_unix.cpp:216 7 in QObject::QObject (this=0x48e1b30, dd=@0x48e1b40, parent=0x0) at qobject.cpp:703 8 in QThread::QThread (this=0x48e1b30, dd=@0x48e1b40, parent=0x0) at qthread.cpp:396 9 in QAdoptedThread::QAdoptedThread (this=0x48e1b30, data=0x48e1af0) at qthread.cpp:120 10 in QAdoptedThread::QAdoptedThread (this=0x48e1b30, data=0x48e1af0) at qthread.cpp:130 11 in QThreadData::current () at qthread_unix.cpp:219 12 in QObject::QObject (this=0x48e1a20, dd=@0x48e1a30, parent=0x0) at qobject.cpp:703 ... To solve this, we reset current_thread_data_once when destroying the key, so that subsequent calls to pthread_once to potentially create the key will call create_current_thread_data_key once more. This means we'll leak the key for this particular use-case, since we don't end up calling pthread_key_delete a second time, but this leak is small and happens typically only for a short duration during application shutdown. Change-Id: I580484a3239849e891172e24e7f77b75afd2c51b Reviewed-by: Olivier Goffart Reviewed-by: Thiago Macieira --- src/corelib/thread/qthread_unix.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp index f123e1813b..be9b946990 100644 --- a/src/corelib/thread/qthread_unix.cpp +++ b/src/corelib/thread/qthread_unix.cpp @@ -172,6 +172,12 @@ static void destroy_current_thread_data_key() { pthread_once(¤t_thread_data_once, create_current_thread_data_key); pthread_key_delete(current_thread_data_key); + + // Reset current_thread_data_once in case we end up recreating + // the thread-data in the rare case of QObject construction + // after destroying the QThreadData. + pthread_once_t pthread_once_init = PTHREAD_ONCE_INIT; + current_thread_data_once = pthread_once_init; } Q_DESTRUCTOR_FUNCTION(destroy_current_thread_data_key) -- cgit v1.2.3 From 6a9333841d9d5233b0457ec6f0da5bdacda8ea5b Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Mon, 3 Jun 2013 15:09:12 -0300 Subject: BlackBerry: fix delayed root window posting on OpenGL The delayed root window posting introduced by 77a06e7e6c517003 broke the OpenGL support. In that patch, the posting of the root window is trigerred by QQnxRasterRasterBackingStore's call to QQnxWindow::post(), that obviously does not happen when OpenGL is enabled, therefore requiring the OpenGL context to explicitly post() the root window. Change-Id: Ifd302c1dde612a03b79c778ec4586aa70f88260d Reviewed-by: Sean Harmer --- src/plugins/platforms/qnx/qqnxglcontext.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/plugins/platforms/qnx/qqnxglcontext.cpp b/src/plugins/platforms/qnx/qqnxglcontext.cpp index 005b6d272a..ed959467ff 100644 --- a/src/plugins/platforms/qnx/qqnxglcontext.cpp +++ b/src/plugins/platforms/qnx/qqnxglcontext.cpp @@ -315,6 +315,9 @@ void QQnxGLContext::createSurface(QPlatformSurface *surface) } platformWindow->setBufferSize(surfaceSize); + // Post root window, in case it hasn't been posted yet, to make it appear. + platformWindow->screen()->onWindowPost(platformWindow); + // Obtain the native handle for our window screen_window_t handle = platformWindow->nativeHandle(); -- cgit v1.2.3 From 686c94c892006a3e72291ca8971aabf18ea1ec85 Mon Sep 17 00:00:00 2001 From: El Mehdi Fekari Date: Wed, 12 Jun 2013 16:54:07 +0200 Subject: QSystemLocale: Fix the time format on BlackBerry 10 The time format should depend on the device settings (24 hour format) Change-Id: I452d9b7158d39c4a657adfd9e64c99549eeda4ff Reviewed-by: Oswald Buddenhagen Reviewed-by: Rafael Roquetto --- src/corelib/tools/qlocale_blackberry.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/corelib/tools/qlocale_blackberry.cpp b/src/corelib/tools/qlocale_blackberry.cpp index 6d60a97062..e2dfa6c801 100644 --- a/src/corelib/tools/qlocale_blackberry.cpp +++ b/src/corelib/tools/qlocale_blackberry.cpp @@ -289,9 +289,9 @@ QVariant QSystemLocale::query(QueryType type, QVariant in) const case DateToStringShort: return lc_region.toString(in.toDate(), QLocale::ShortFormat); case TimeToStringLong: - return lc_region.toString(in.toTime(), QLocale::LongFormat); + return lc_region.toString(in.toTime(), d->timeFormat(QLocale::LongFormat).toString()); case TimeToStringShort: - return lc_region.toString(in.toTime(), QLocale::ShortFormat); + return lc_region.toString(in.toTime(), d->timeFormat(QLocale::ShortFormat).toString()); case DateTimeToStringShort: return lc_region.toString(in.toDateTime(), d->dateTimeFormat(QLocale::ShortFormat).toString()); case DateTimeToStringLong: -- cgit v1.2.3 From d57d184b6d18deab172ac400b9db973e6aacab21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Mon, 6 May 2013 10:26:38 +0200 Subject: Add basic conversion functions from QVariant(QJsonValue). There is a mismatch how QML and C++ converts QJsonValue. This patch unifies conversions by adding QJsonValue support in QVariant::convert(). Change-Id: I8a1db3d77c517945ef48064b4b66ba03aa4f2fd0 Reviewed-by: Frederik Gladhorn --- src/corelib/kernel/qvariant.cpp | 48 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'src') diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index bae4a837a0..276257ddcf 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -162,6 +162,10 @@ static qlonglong qMetaTypeNumber(const QVariant::Private *d) return qRound64(d->data.f); case QVariant::Double: return qRound64(d->data.d); +#ifndef QT_BOOTSTRAPPED + case QMetaType::QJsonValue: + return v_cast(d)->toDouble(); +#endif } Q_ASSERT(false); return 0; @@ -206,12 +210,14 @@ static qlonglong qConvertToNumber(const QVariant::Private *d, bool *ok) case QMetaType::Long: case QMetaType::Float: case QMetaType::LongLong: + case QMetaType::QJsonValue: return qMetaTypeNumber(d); case QVariant::ULongLong: case QVariant::UInt: case QMetaType::UChar: case QMetaType::UShort: case QMetaType::ULong: + return qlonglong(qMetaTypeUNumber(d)); } @@ -240,6 +246,7 @@ static qulonglong qConvertToUnsignedNumber(const QVariant::Private *d, bool *ok) case QMetaType::Long: case QMetaType::Float: case QMetaType::LongLong: + case QMetaType::QJsonValue: return qulonglong(qMetaTypeNumber(d)); case QVariant::ULongLong: case QVariant::UInt: @@ -340,6 +347,9 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok) case QVariant::Url: *str = v_cast(d)->toString(); break; + case QMetaType::QJsonValue: + *str = v_cast(d)->toString(); + break; #endif case QVariant::Uuid: *str = v_cast(d)->toString(); @@ -580,6 +590,11 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok) case QMetaType::ULong: *b = qMetaTypeUNumber(d) != Q_UINT64_C(0); break; +#ifndef QT_BOOTSTRAPPED + case QMetaType::QJsonValue: + *b = v_cast(d)->toBool(); + break; +#endif default: *b = false; return false; @@ -616,6 +631,11 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok) case QMetaType::ULong: *f = double(qMetaTypeUNumber(d)); break; +#ifndef QT_BOOTSTRAPPED + case QMetaType::QJsonValue: + *f = v_cast(d)->toDouble(); + break; +#endif default: *f = 0.0; return false; @@ -652,6 +672,11 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok) case QMetaType::ULong: *f = float(qMetaTypeUNumber(d)); break; +#ifndef QT_BOOTSTRAPPED + case QMetaType::QJsonValue: + *f = v_cast(d)->toDouble(); + break; +#endif default: *f = 0.0f; return false; @@ -2731,6 +2756,29 @@ bool QVariant::canConvert(int targetTypeId) const if (targetTypeId >= QMetaType::User) return canConvertMetaObject(currentType, targetTypeId, d.data.o); + if (currentType == QMetaType::QJsonValue) { + switch (targetTypeId) { + case QMetaType::QString: + case QMetaType::Bool: + case QMetaType::Int: + case QMetaType::UInt: + case QMetaType::Double: + case QMetaType::Float: + case QMetaType::ULong: + case QMetaType::Long: + case QMetaType::LongLong: + case QMetaType::ULongLong: + case QMetaType::UShort: + case QMetaType::UChar: + case QMetaType::Char: + case QMetaType::SChar: + case QMetaType::Short: + return true; + default: + return false; + } + } + // FIXME It should be LastCoreType intead of Uuid if (currentType > int(QMetaType::QUuid) || targetTypeId > int(QMetaType::QUuid)) { switch (uint(targetTypeId)) { -- cgit v1.2.3 From 2e49b795645908079ec19c28f4ca025084d137ef Mon Sep 17 00:00:00 2001 From: Dominik Holland Date: Thu, 13 Jun 2013 15:23:04 +0200 Subject: Read SingleClickActivation from KDE settings file Change-Id: Ia2ccea89cefb85a7641628d32f925b32ecd6bdc6 Reviewed-by: J-P Nurmi Reviewed-by: Jens Bache-Wiig --- src/platformsupport/themes/genericunix/qgenericunixthemes.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp index cabddcc815..be21e39ecd 100644 --- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp +++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp @@ -164,6 +164,7 @@ public: , kdeVersion(kdeVersion) , toolButtonStyle(Qt::ToolButtonTextBesideIcon) , toolBarIconSize(0) + , singleClick(true) { } QString globalSettingsFile() const @@ -186,6 +187,7 @@ public: QStringList styleNames; int toolButtonStyle; int toolBarIconSize; + bool singleClick; }; void QKdeThemePrivate::refresh() @@ -217,6 +219,8 @@ void QKdeThemePrivate::refresh() styleNames.push_front(style); } + singleClick = kdeSettings.value(QStringLiteral("KDE/SingleClick"), true).toBool(); + const QVariant themeValue = kdeSettings.value(QStringLiteral("Icons/Theme")); if (themeValue.isValid()) iconThemeName = themeValue.toString(); @@ -360,6 +364,8 @@ QVariant QKdeTheme::themeHint(QPlatformTheme::ThemeHint hint) const return QVariant(d->styleNames); case QPlatformTheme::KeyboardScheme: return QVariant(int(KdeKeyboardScheme)); + case QPlatformTheme::ItemViewActivateItemOnSingleClick: + return QVariant(d->singleClick); default: break; } -- cgit v1.2.3 From bd4f92969af2b8b11dcd631d408550a858a63f8a Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 13 Jun 2013 19:42:32 +0200 Subject: QKdeTheme: generate sensible disabled colors for the system palette Task-number: QTBUG-31670 Change-Id: Icbd2f35d9c2f5c1ef05c9dfeae4922be01ff2751 Reviewed-by: Dominik Holland Reviewed-by: Jens Bache-Wiig --- .../themes/genericunix/qgenericunixthemes.cpp | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'src') diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp index be21e39ecd..fdd45a49c5 100644 --- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp +++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp @@ -265,6 +265,14 @@ static inline bool kdeColor(QPalette *pal, QPalette::ColorRole role, void QKdeThemePrivate::readKdeSystemPalette(const QSettings &kdeSettings, QPalette *pal) { + if (!kdeSettings.contains(QStringLiteral("Colors:Button/BackgroundNormal"))) { + // kcolorscheme.cpp: SetDefaultColors + const QColor defaultWindowBackground(214, 210, 208); + const QColor defaultButtonBackground(223, 220, 217); + *pal = QPalette(defaultButtonBackground, defaultWindowBackground); + return; + } + kdeColor(pal, QPalette::Button, kdeSettings, QStringLiteral("Colors:Button/BackgroundNormal")); kdeColor(pal, QPalette::Window, kdeSettings, QStringLiteral("Colors:Window/BackgroundNormal")); kdeColor(pal, QPalette::Text, kdeSettings, QStringLiteral("Colors:View/ForegroundNormal")); @@ -276,6 +284,34 @@ void QKdeThemePrivate::readKdeSystemPalette(const QSettings &kdeSettings, QPalet kdeColor(pal, QPalette::ButtonText, kdeSettings, QStringLiteral("Colors:Button/ForegroundNormal")); kdeColor(pal, QPalette::Link, kdeSettings, QStringLiteral("Colors:View/ForegroundLink")); kdeColor(pal, QPalette::LinkVisited, kdeSettings, QStringLiteral("Colors:View/ForegroundVisited")); + kdeColor(pal, QPalette::ToolTipBase, kdeSettings, QStringLiteral("Colors:Tooltip/BackgroundNormal")); + kdeColor(pal, QPalette::ToolTipText, kdeSettings, QStringLiteral("Colors:Tooltip/ForegroundNormal")); + + // The above code sets _all_ color roles to "normal" colors. In KDE, the disabled + // color roles are calculated by applying various effects described in kdeglobals. + // We use a bit simpler approach here, similar logic than in qt_palette_from_color(). + const QColor button = pal->color(QPalette::Button); + int h, s, v; + button.getHsv(&h, &s, &v); + + const QBrush whiteBrush = QBrush(Qt::white); + const QBrush buttonBrush = QBrush(button); + const QBrush buttonBrushDark = QBrush(button.darker(v > 128 ? 200 : 50)); + const QBrush buttonBrushDark150 = QBrush(button.darker(v > 128 ? 150 : 75)); + const QBrush buttonBrushLight150 = QBrush(button.lighter(v > 128 ? 150 : 75)); + + pal->setBrush(QPalette::Disabled, QPalette::WindowText, buttonBrushDark); + pal->setBrush(QPalette::Disabled, QPalette::ButtonText, buttonBrushDark); + pal->setBrush(QPalette::Disabled, QPalette::Button, buttonBrush); + pal->setBrush(QPalette::Disabled, QPalette::Light, buttonBrushLight150); + pal->setBrush(QPalette::Disabled, QPalette::Dark, buttonBrushDark); + pal->setBrush(QPalette::Disabled, QPalette::Mid, buttonBrushDark150); + pal->setBrush(QPalette::Disabled, QPalette::Text, buttonBrushDark); + pal->setBrush(QPalette::Disabled, QPalette::BrightText, whiteBrush); + pal->setBrush(QPalette::Disabled, QPalette::Base, buttonBrush); + pal->setBrush(QPalette::Disabled, QPalette::Window, buttonBrush); + pal->setBrush(QPalette::Disabled, QPalette::Highlight, buttonBrushDark150); + pal->setBrush(QPalette::Disabled, QPalette::HighlightedText, buttonBrushLight150); } /*! -- cgit v1.2.3 From c492b2bffa70ce12af71ac585c2ec58bcface8f7 Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki Date: Sun, 14 Apr 2013 00:05:34 +0900 Subject: Make qtbase compile with QT_NO_XMLSTREAMREADER D-Bus depends on QXmlStreamReader instead of QDom Change-Id: Ic435970af21ac6e45c4100359ff54bd5793ccce2 Reviewed-by: Thiago Macieira Reviewed-by: Oswald Buddenhagen --- src/corelib/global/qfeatures.h | 10 +++++----- src/corelib/global/qfeatures.txt | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h index 4534e9bf13..2cadea59c1 100644 --- a/src/corelib/global/qfeatures.h +++ b/src/corelib/global/qfeatures.h @@ -391,11 +391,6 @@ #define QT_NO_CONTEXTMENU #endif -// Qt D-Bus module -#if !defined(QT_NO_DBUS) && (defined(QT_NO_PROPERTIES) || defined(QT_NO_DOM)) -#define QT_NO_DBUS -#endif - // QPrinter #if !defined(QT_NO_PRINTER) && (defined(QT_NO_PICTURE) || defined(QT_NO_TEMPORARYFILE)) #define QT_NO_PRINTER @@ -451,6 +446,11 @@ #define QT_NO_BEARERMANAGEMENT #endif +// Qt D-Bus module +#if !defined(QT_NO_DBUS) && (defined(QT_NO_PROPERTIES) || defined(QT_NO_XMLSTREAMREADER)) +#define QT_NO_DBUS +#endif + // QGraphicsView #if !defined(QT_NO_GRAPHICSVIEW) && (defined(QT_NO_SCROLLAREA)) #define QT_NO_GRAPHICSVIEW diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt index 61a3df39f3..814e95c256 100644 --- a/src/corelib/global/qfeatures.txt +++ b/src/corelib/global/qfeatures.txt @@ -1102,7 +1102,7 @@ SeeAlso: ??? Feature: DBUS Description: Provides classes for D-Bus. Section: D-Bus -Requires: PROPERTIES DOM +Requires: PROPERTIES XMLSTREAMREADER Name: Qt D-Bus module SeeAlso: ??? -- cgit v1.2.3 From 570cf51919515c4e49b3dfa3723ea154ae04fd73 Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Thu, 6 Jun 2013 11:55:56 +0200 Subject: Fix for OS X QFileDialog showing bundle as directory Also check if the selectedFile is a bundle to correctly set currentDir. Patch for Qt 4.8 has been submitted Task-number: QTBUG-31562 Change-Id: I72b0e8484b3c3a610932c03cd7fdab4ddee70277 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm index 071edb5b60..a2001b0c05 100644 --- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm @@ -168,7 +168,7 @@ typedef QSharedPointer SharedPointerFileDialogOptions; mSelectedNameFilter = new QStringList([self findStrippedFilterWithVisualFilterName:selectedVisualNameFilter]); QFileInfo sel(selectFile); - if (sel.isDir()){ + if (sel.isDir() && !sel.isBundle()){ mCurrentDir = [QCFString::toNSString(sel.absoluteFilePath()) retain]; mCurrentSelection = new QString; } else { -- cgit v1.2.3 From 3ac5499a9e2fe76e12f7b9adc9865bfdcb2d77aa Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Sat, 8 Jun 2013 00:33:10 +0200 Subject: Cocoa save file dialog behavior fix Currently, in save mode, if selectFile has not been called, the native cocoa file dialog puts the folder name in the line edit. This patch restores the old behavior where the line edit is presented empty to the user. Task-number: QTBUG-31619 Change-Id: I938eb6d968e0e2c343e70bc19f29663e112d0496 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm index a2001b0c05..76cd235514 100644 --- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm @@ -244,15 +244,15 @@ static QString strippedText(QString s) - (void)showModelessPanel { if (mOpenPanel){ - QFileInfo info(!mCurrentSelection->isEmpty() ? *mCurrentSelection : QT_PREPEND_NAMESPACE(QCFString::toQString)(mCurrentDir)); + QFileInfo info(*mCurrentSelection); NSString *filepath = QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.filePath()); bool selectable = (mOptions->acceptMode() == QFileDialogOptions::AcceptSave) || [self panel:nil shouldShowFilename:filepath]; [self updateProperties]; [mOpenPanel setAllowedFileTypes:nil]; - [mOpenPanel setDirectoryURL:selectable ? [NSURL fileURLWithPath:QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.filePath())] - : [NSURL fileURLWithPath:QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.path())]]; + [mSavePanel setNameFieldStringValue:selectable ? QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.fileName()) : @""]; + [mOpenPanel beginWithCompletionHandler:^(NSInteger result){ mReturnCode = result; if (mHelper) @@ -263,13 +263,12 @@ static QString strippedText(QString s) - (BOOL)runApplicationModalPanel { - QFileInfo info(!mCurrentSelection->isEmpty() ? *mCurrentSelection : QT_PREPEND_NAMESPACE(QCFString::toQString)(mCurrentDir)); + QFileInfo info(*mCurrentSelection); NSString *filepath = QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.filePath()); bool selectable = (mOptions->acceptMode() == QFileDialogOptions::AcceptSave) || [self panel:nil shouldShowFilename:filepath]; - [mSavePanel setDirectoryURL:selectable ? [NSURL fileURLWithPath:QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.filePath())] - : [NSURL fileURLWithPath:QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.path())]]; + [mSavePanel setDirectoryURL: [NSURL fileURLWithPath:mCurrentDir]]; [mSavePanel setNameFieldStringValue:selectable ? QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.fileName()) : @""]; // Call processEvents in case the event dispatcher has been interrupted, and needs to do @@ -289,14 +288,14 @@ static QString strippedText(QString s) - (void)showWindowModalSheet:(QWindow *)parent { - QFileInfo info(!mCurrentSelection->isEmpty() ? *mCurrentSelection : QT_PREPEND_NAMESPACE(QCFString::toQString)(mCurrentDir)); + QFileInfo info(*mCurrentSelection); NSString *filepath = QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.filePath()); bool selectable = (mOptions->acceptMode() == QFileDialogOptions::AcceptSave) || [self panel:nil shouldShowFilename:filepath]; [self updateProperties]; - [mSavePanel setDirectoryURL:selectable ? [NSURL fileURLWithPath:QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.filePath())] - : [NSURL fileURLWithPath:QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.path())]]; + [mSavePanel setDirectoryURL: [NSURL fileURLWithPath:mCurrentDir]]; + [mSavePanel setNameFieldStringValue:selectable ? QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.fileName()) : @""]; NSWindow *nsparent = static_cast(qGuiApp->platformNativeInterface()->nativeResourceForWindow("nswindow", parent)); -- cgit v1.2.3 From f730cd7542548d7d5fb7cd25f631e471697960c8 Mon Sep 17 00:00:00 2001 From: Leonard Lee Date: Wed, 12 Jun 2013 11:26:53 +0200 Subject: Recognize separator item in QMenu. The mouse over event on upper level menu separator should automatically close the sub menu listing. Manual test is not needed for this commit since it is easy to test it against common examples. Task-number: QTBUG-31664 Change-Id: I323d7ba206352a5d533584543b9a2ebf842b4dfc Reviewed-by: J-P Nurmi --- src/widgets/widgets/qmenu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index 7c72c5c456..4df89a5ede 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -2854,9 +2854,9 @@ void QMenu::mouseMoveEvent(QMouseEvent *e) d->hasHadMouse = d->hasHadMouse || rect().contains(e->pos()); QAction *action = d->actionAt(e->pos()); - if (!action) { + if (!action || action->isSeparator()) { if (d->hasHadMouse - && (!d->currentAction + && (!d->currentAction || (action && action->isSeparator()) || !(d->currentAction->menu() && d->currentAction->menu()->isVisible()))) d->setCurrentAction(0); return; -- cgit v1.2.3 From d9e722d8560c07adb1852cfd061ffb23197d06fd Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki Date: Mon, 15 Apr 2013 08:27:02 +0900 Subject: Make qtbase compile with QT_NO_TEXTCODEC Change-Id: I1614dc08c0dd1950020e415f37c97160431b2336 Reviewed-by: Oswald Buddenhagen --- src/plugins/platforms/xcb/qxcbkeyboard.cpp | 8 +++++++- src/plugins/platforms/xcb/qxcbmime.cpp | 2 ++ src/tools/qdoc/config.cpp | 2 ++ src/tools/qdoc/ditaxmlgenerator.cpp | 6 ++++++ src/tools/qdoc/generator.cpp | 2 ++ src/tools/qdoc/generator.h | 2 ++ src/tools/qdoc/htmlgenerator.cpp | 10 ++++++++++ src/tools/qdoc/tokenizer.cpp | 12 ++++++++++++ 8 files changed, 43 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp index 155b327315..f7c473de88 100644 --- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp +++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp @@ -883,13 +883,19 @@ int QXcbKeyboard::keysymToQtKey(xcb_keysym_t key) const int QXcbKeyboard::keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers &modifiers, QString text) const { int code = 0; +#ifndef QT_NO_TEXTCODEC QTextCodec *systemCodec = QTextCodec::codecForLocale(); +#endif // Commentary in X11/keysymdef says that X codes match ASCII, so it // is safe to use the locale functions to process X codes in ISO8859-1. // This is mainly for compatibility - applications should not use the // Qt keycodes between 128 and 255 (extended ACSII codes), but should // rather use the QKeyEvent::text(). - if (keysym < 128 || (keysym < 256 && systemCodec->mibEnum() == 4)) { + if (keysym < 128 || (keysym < 256 +#ifndef QT_NO_TEXTCODEC + && systemCodec->mibEnum() == 4 +#endif + )) { // upper-case key, if known code = isprint((int)keysym) ? toupper((int)keysym) : 0; } else if (keysym >= XK_F1 && keysym <= XK_F35) { diff --git a/src/plugins/platforms/xcb/qxcbmime.cpp b/src/plugins/platforms/xcb/qxcbmime.cpp index bc8c559c6e..b205a63267 100644 --- a/src/plugins/platforms/xcb/qxcbmime.cpp +++ b/src/plugins/platforms/xcb/qxcbmime.cpp @@ -170,11 +170,13 @@ QVariant QXcbMime::mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, if (!encoding.isEmpty() && atomName == format + QLatin1String(";charset=") + QString::fromLatin1(encoding)) { +#ifndef QT_NO_TEXTCODEC if (requestedType == QVariant::String) { QTextCodec *codec = QTextCodec::codecForName(encoding); if (codec) return codec->toUnicode(data); } +#endif return data; } diff --git a/src/tools/qdoc/config.cpp b/src/tools/qdoc/config.cpp index 273cb60d7d..a475ccbfb6 100644 --- a/src/tools/qdoc/config.cpp +++ b/src/tools/qdoc/config.cpp @@ -877,7 +877,9 @@ void Config::load(Location location, const QString& fileName) } QTextStream stream(&fin); +#ifndef QT_NO_TEXTCODEC stream.setCodec("UTF-8"); +#endif QString text = stream.readAll(); text += QLatin1String("\n\n"); text += QLatin1Char('\0'); diff --git a/src/tools/qdoc/ditaxmlgenerator.cpp b/src/tools/qdoc/ditaxmlgenerator.cpp index dd87e889bf..af8ac505f8 100644 --- a/src/tools/qdoc/ditaxmlgenerator.cpp +++ b/src/tools/qdoc/ditaxmlgenerator.cpp @@ -532,10 +532,12 @@ void DitaXmlGenerator::initializeGenerator(const Config &config) projectUrl = config.getString(CONFIG_URL); tagFile_ = config.getString(CONFIG_TAGFILE); +#ifndef QT_NO_TEXTCODEC outputEncoding = config.getString(CONFIG_OUTPUTENCODING); if (outputEncoding.isEmpty()) outputEncoding = QLatin1String("ISO-8859-1"); outputCodec = QTextCodec::codecForName(outputEncoding.toLocal8Bit()); +#endif naturalLanguage = config.getString(CONFIG_NATURALLANGUAGE); if (naturalLanguage.isEmpty()) @@ -3586,7 +3588,11 @@ QString DitaXmlGenerator::registerRef(const QString& ref) */ QString DitaXmlGenerator::protectEnc(const QString& string) { +#ifndef QT_NO_TEXTCODEC return protect(string, outputEncoding); +#else + return protect(string); +#endif } QString DitaXmlGenerator::protect(const QString& string, const QString& ) //outputEncoding) diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp index 81be63abe1..187253df50 100644 --- a/src/tools/qdoc/generator.cpp +++ b/src/tools/qdoc/generator.cpp @@ -273,8 +273,10 @@ void Generator::beginSubPage(const InnerNode* node, const QString& fileName) node->location().fatal(tr("Cannot open output file '%1'").arg(outFile->fileName())); QTextStream* out = new QTextStream(outFile); +#ifndef QT_NO_TEXTCODEC if (outputCodec) out->setCodec(outputCodec); +#endif outStreamStack.push(out); const_cast(node)->setOutputFileName(fileName); } diff --git a/src/tools/qdoc/generator.h b/src/tools/qdoc/generator.h index 28a9ae5ce8..2fb3117765 100644 --- a/src/tools/qdoc/generator.h +++ b/src/tools/qdoc/generator.h @@ -178,8 +178,10 @@ protected: QMap editionGroupMap; QMap editionModuleMap; QString naturalLanguage; +#ifndef QT_NO_TEXTCODEC QTextCodec* outputCodec; QString outputEncoding; +#endif QString tagFile_; QStack outStreamStack; diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index 3d6f04decf..845ed35b3c 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -179,10 +179,12 @@ void HtmlGenerator::initializeGenerator(const Config &config) projectUrl = config.getString(CONFIG_URL); tagFile_ = config.getString(CONFIG_TAGFILE); +#ifndef QT_NO_TEXTCODEC outputEncoding = config.getString(CONFIG_OUTPUTENCODING); if (outputEncoding.isEmpty()) outputEncoding = QLatin1String("UTF-8"); outputCodec = QTextCodec::codecForName(outputEncoding.toLocal8Bit()); +#endif naturalLanguage = config.getString(CONFIG_NATURALLANGUAGE); if (naturalLanguage.isEmpty()) @@ -1743,7 +1745,11 @@ void HtmlGenerator::generateHeader(const QString& title, const Node *node, CodeMarker *marker) { +#ifndef QT_NO_TEXTCODEC out() << QString("\n").arg(outputEncoding); +#else + out() << QString("\n"); +#endif out() << "\n"; out() << QString("\n").arg(naturalLanguage); out() << "\n"; @@ -3185,7 +3191,11 @@ QString HtmlGenerator::registerRef(const QString& ref) QString HtmlGenerator::protectEnc(const QString &string) { +#ifndef QT_NO_TEXTCODEC return protect(string, outputEncoding); +#else + return protect(string); +#endif } QString HtmlGenerator::protect(const QString &string, const QString &outputEncoding) diff --git a/src/tools/qdoc/tokenizer.cpp b/src/tools/qdoc/tokenizer.cpp index 3968cdb828..224d451f4c 100644 --- a/src/tools/qdoc/tokenizer.cpp +++ b/src/tools/qdoc/tokenizer.cpp @@ -101,7 +101,9 @@ static QRegExp *definedX = 0; static QRegExp *defines = 0; static QRegExp *falsehoods = 0; +#ifndef QT_NO_TEXTCODEC static QTextCodec *sourceCodec = 0; +#endif /* This function is a perfect hash function for the 37 keywords of C99 @@ -496,7 +498,9 @@ void Tokenizer::initialize(const Config &config) QString sourceEncoding = config.getString(CONFIG_SOURCEENCODING); if (sourceEncoding.isEmpty()) sourceEncoding = QLatin1String("ISO-8859-1"); +#ifndef QT_NO_TEXTCODEC sourceCodec = QTextCodec::codecForName(sourceEncoding.toLocal8Bit()); +#endif comment = new QRegExp("/(?:\\*.*\\*/|/.*\n|/[^\n]*$)"); comment->setMinimal(true); @@ -770,12 +774,20 @@ bool Tokenizer::isTrue(const QString &condition) QString Tokenizer::lexeme() const { +#ifndef QT_NO_TEXTCODEC return sourceCodec->toUnicode(yyLex); +#else + return QString::fromUtf8(yyLex); +#endif } QString Tokenizer::previousLexeme() const { +#ifndef QT_NO_TEXTCODEC return sourceCodec->toUnicode(yyPrevLex); +#else + return QString::fromUtf8(yyPrevLex); +#endif } QT_END_NAMESPACE -- cgit v1.2.3 From d9fb6e6dbb2b322556d581265da2442e3b91a6a3 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 15 Jun 2013 11:49:45 +0200 Subject: Remove use of 'register' from Qt. It is deprecated and clang is starting to warn about it. Patch mostly generated by clang itself, with some careful grep and sed for the platform-specific parts. Change-Id: I8058e6db0f1b41b33a9e8f17a712739159982450 Reviewed-by: Thiago Macieira --- src/corelib/arch/qatomic_alpha.h | 40 +++--- src/corelib/arch/qatomic_armv5.h | 16 +-- src/corelib/arch/qatomic_armv6.h | 112 ++++++++-------- src/corelib/arch/qatomic_ia64.h | 30 ++--- src/corelib/arch/qatomic_mips.h | 40 +++--- src/corelib/arch/qatomic_power.h | 56 ++++---- src/corelib/arch/qatomic_sh4a.h | 36 +++--- src/corelib/codecs/qtextcodec.cpp | 4 +- src/corelib/global/qlogging.cpp | 2 +- src/corelib/io/qfilesystemwatcher_inotify.cpp | 2 +- src/corelib/io/qurl.cpp | 8 +- src/corelib/io/qurlidna.cpp | 8 +- src/corelib/io/qurlrecode.cpp | 4 +- src/corelib/kernel/qcore_unix.cpp | 2 +- src/corelib/kernel/qcore_unix_p.h | 18 +-- src/corelib/kernel/qcoreapplication.cpp | 4 +- src/corelib/kernel/qmetatype.h | 2 +- src/corelib/kernel/qsystemsemaphore_unix.cpp | 2 +- src/corelib/kernel/qtimerinfo_unix.cpp | 20 +-- src/corelib/thread/qgenericatomic.h | 4 +- src/corelib/thread/qmutex.cpp | 2 +- src/corelib/tools/qbytearray.cpp | 20 +-- src/corelib/tools/qbytearraymatcher.cpp | 2 +- src/corelib/tools/qlocale_tools.cpp | 24 ++-- src/corelib/tools/qlocale_tools_p.h | 4 +- src/corelib/tools/qsharedpointer_impl.h | 10 +- src/corelib/tools/qstring.cpp | 10 +- src/corelib/tools/qstringmatcher.cpp | 2 +- src/dbus/qdbusutil.cpp | 8 +- src/gui/image/qbmphandler.cpp | 12 +- src/gui/image/qimage.cpp | 10 +- src/gui/image/qppmhandler.cpp | 2 +- src/gui/image/qxbmhandler.cpp | 4 +- src/gui/painting/qdrawhelper.cpp | 16 +-- src/gui/painting/qdrawhelper_p.h | 4 +- src/gui/painting/qpolygon.cpp | 12 +- src/gui/painting/qregion.cpp | 142 ++++++++++----------- src/network/access/qnetworkcookie_p.h | 2 +- src/network/access/qnetworkreplyhttpimpl.cpp | 6 +- src/network/socket/qnet_unix_p.h | 8 +- src/plugins/imageformats/ico/qicohandler.cpp | 4 +- .../platforms/windows/qwindowskeymapper.cpp | 2 +- src/plugins/platforms/windows/qwindowsmime.cpp | 2 +- src/widgets/kernel/qapplication.cpp | 16 +-- src/widgets/kernel/qwhatsthis.cpp | 2 +- src/widgets/styles/qwindowsxpstyle.cpp | 12 +- src/widgets/widgets/qlcdnumber.cpp | 2 +- 47 files changed, 375 insertions(+), 375 deletions(-) (limited to 'src') diff --git a/src/corelib/arch/qatomic_alpha.h b/src/corelib/arch/qatomic_alpha.h index 71cb112d47..5008a1acda 100644 --- a/src/corelib/arch/qatomic_alpha.h +++ b/src/corelib/arch/qatomic_alpha.h @@ -114,7 +114,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddWaitFree() inline bool QBasicAtomicInt::ref() { - register int old, tmp; + int old, tmp; asm volatile("1:\n" "ldl_l %0,%2\n" /* old=*ptr; */ "addl %0,1,%1\n" /* tmp=old+1; */ @@ -131,7 +131,7 @@ inline bool QBasicAtomicInt::ref() inline bool QBasicAtomicInt::deref() { - register int old, tmp; + int old, tmp; asm volatile("1:\n" "ldl_l %0,%2\n" /* old=*ptr; */ "subl %0,1,%1\n" /* tmp=old-1; */ @@ -148,7 +148,7 @@ inline bool QBasicAtomicInt::deref() inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) { - register int ret; + int ret; asm volatile("1:\n" "ldl_l %0,%1\n" /* ret=*ptr; */ "cmpeq %0,%2,%0\n"/* if (ret==expected) ret=0; else ret=1; */ @@ -167,7 +167,7 @@ inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) { - register int ret; + int ret; asm volatile("1:\n" "ldl_l %0,%1\n" /* ret=*ptr; */ "cmpeq %0,%2,%0\n"/* if (ret==expected) ret=0; else ret=1; */ @@ -187,7 +187,7 @@ inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) { - register int ret; + int ret; asm volatile("mb\n" "1:\n" "ldl_l %0,%1\n" /* ret=*ptr; */ @@ -207,7 +207,7 @@ inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) { - register int old, tmp; + int old, tmp; asm volatile("1:\n" "ldl_l %0,%2\n" /* old=*ptr; */ "mov %3,%1\n" /* tmp=newval; */ @@ -224,7 +224,7 @@ inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) { - register int old, tmp; + int old, tmp; asm volatile("1:\n" "ldl_l %0,%2\n" /* old=*ptr; */ "mov %3,%1\n" /* tmp=newval; */ @@ -242,7 +242,7 @@ inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) { - register int old, tmp; + int old, tmp; asm volatile("mb\n" "1:\n" "ldl_l %0,%2\n" /* old=*ptr; */ @@ -260,7 +260,7 @@ inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) { - register int old, tmp; + int old, tmp; asm volatile("1:\n" "ldl_l %0,%2\n" /* old=*ptr; */ "addl %0,%3,%1\n"/* tmp=old+value; */ @@ -277,7 +277,7 @@ inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) { - register int old, tmp; + int old, tmp; asm volatile("1:\n" "ldl_l %0,%2\n" /* old=*ptr; */ "addl %0,%3,%1\n"/* tmp=old+value; */ @@ -295,7 +295,7 @@ inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) { - register int old, tmp; + int old, tmp; asm volatile("mb\n" "1:\n" "ldl_l %0,%2\n" /* old=*ptr; */ @@ -314,7 +314,7 @@ inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) template Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) { - register void *ret; + void *ret; asm volatile("1:\n" "ldq_l %0,%1\n" /* ret=*ptr; */ "cmpeq %0,%2,%0\n"/* if (ret==expected) tmp=0; else tmp=1; */ @@ -334,7 +334,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValu template Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) { - register void *ret; + void *ret; asm volatile("1:\n" "ldq_l %0,%1\n" /* ret=*ptr; */ "cmpeq %0,%2,%0\n"/* if (ret==expected) tmp=0; else tmp=1; */ @@ -355,7 +355,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValu template Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) { - register void *ret; + void *ret; asm volatile("mb\n" "1:\n" "ldq_l %0,%1\n" /* ret=*ptr; */ @@ -376,7 +376,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValu template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) { - register T *old, *tmp; + T *old, *tmp; asm volatile("1:\n" "ldq_l %0,%2\n" /* old=*ptr; */ "mov %3,%1\n" /* tmp=newval; */ @@ -394,7 +394,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) { - register T *old, *tmp; + T *old, *tmp; asm volatile("1:\n" "ldq_l %0,%2\n" /* old=*ptr; */ "mov %3,%1\n" /* tmp=newval; */ @@ -413,7 +413,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) { - register T *old, *tmp; + T *old, *tmp; asm volatile("mb\n" "1:\n" "ldq_l %0,%2\n" /* old=*ptr; */ @@ -432,7 +432,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) { - register T *old, *tmp; + T *old, *tmp; asm volatile("1:\n" "ldq_l %0,%2\n" /* old=*ptr; */ "addq %0,%3,%1\n"/* tmp=old+value; */ @@ -450,7 +450,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueTo template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) { - register T *old, *tmp; + T *old, *tmp; asm volatile("1:\n" "ldq_l %0,%2\n" /* old=*ptr; */ "addq %0,%3,%1\n"/* tmp=old+value; */ @@ -469,7 +469,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueTo template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) { - register T *old, *tmp; + T *old, *tmp; asm volatile("mb\n" "1:\n" "ldq_l %0,%2\n" /* old=*ptr; */ diff --git a/src/corelib/arch/qatomic_armv5.h b/src/corelib/arch/qatomic_armv5.h index e0a50b3c24..b583ec662c 100644 --- a/src/corelib/arch/qatomic_armv5.h +++ b/src/corelib/arch/qatomic_armv5.h @@ -114,8 +114,8 @@ template struct QAtomicOps : QBasicAtomicOps template<> template inline bool QBasicAtomicOps<4>::ref(T &_q_value) Q_DECL_NOTHROW { - register T originalValue; - register T newValue; + T originalValue; + T newValue; do { originalValue = _q_value; newValue = originalValue + 1; @@ -126,8 +126,8 @@ bool QBasicAtomicOps<4>::ref(T &_q_value) Q_DECL_NOTHROW template<> template inline bool QBasicAtomicOps<4>::deref(T &_q_value) Q_DECL_NOTHROW { - register T originalValue; - register T newValue; + T originalValue; + T newValue; do { originalValue = _q_value; newValue = originalValue - 1; @@ -138,7 +138,7 @@ bool QBasicAtomicOps<4>::deref(T &_q_value) Q_DECL_NOTHROW template<> template inline bool QBasicAtomicOps<4>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW { - register T originalValue; + T originalValue; do { originalValue = _q_value; if (originalValue != expectedValue) @@ -165,7 +165,7 @@ template<> template inline T QBasicAtomicOps<4>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHROW { #if defined(__thumb__) - register T originalValue; + T originalValue; do { originalValue = _q_value; } while (_q_cmpxchg(originalValue, newValue, &_q_value) != 0); @@ -184,8 +184,8 @@ T QBasicAtomicOps<4>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHR template<> template inline T QBasicAtomicOps<4>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType::AdditiveT valueToAdd) Q_DECL_NOTHROW { - register T originalValue; - register T newValue; + T originalValue; + T newValue; do { originalValue = _q_value; newValue = originalValue + valueToAdd; diff --git a/src/corelib/arch/qatomic_armv6.h b/src/corelib/arch/qatomic_armv6.h index 7f5939e391..08b2b02133 100644 --- a/src/corelib/arch/qatomic_armv6.h +++ b/src/corelib/arch/qatomic_armv6.h @@ -117,8 +117,8 @@ template struct QAtomicOps : QBasicAtomicOps template<> template inline bool QBasicAtomicOps<4>::ref(T &_q_value) Q_DECL_NOTHROW { - register T newValue; - register int result; + T newValue; + int result; asm volatile("0:\n" "ldrex %[newValue], [%[_q_value]]\n" "add %[newValue], %[newValue], #1\n" @@ -136,8 +136,8 @@ bool QBasicAtomicOps<4>::ref(T &_q_value) Q_DECL_NOTHROW template<> template inline bool QBasicAtomicOps<4>::deref(T &_q_value) Q_DECL_NOTHROW { - register T newValue; - register int result; + T newValue; + int result; asm volatile("0:\n" "ldrex %[newValue], [%[_q_value]]\n" "sub %[newValue], %[newValue], #1\n" @@ -155,7 +155,7 @@ bool QBasicAtomicOps<4>::deref(T &_q_value) Q_DECL_NOTHROW template<> template inline bool QBasicAtomicOps<4>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW { - register int result; + int result; asm volatile("0:\n" "ldrex %[result], [%[_q_value]]\n" "eors %[result], %[result], %[expectedValue]\n" @@ -175,8 +175,8 @@ bool QBasicAtomicOps<4>::testAndSetRelaxed(T &_q_value, T expectedValue, T newVa template<> template inline T QBasicAtomicOps<4>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHROW { - register T originalValue; - register int result; + T originalValue; + int result; asm volatile("0:\n" "ldrex %[originalValue], [%[_q_value]]\n" "strex %[result], %[newValue], [%[_q_value]]\n" @@ -194,9 +194,9 @@ T QBasicAtomicOps<4>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHR template<> template inline T QBasicAtomicOps<4>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType::AdditiveT valueToAdd) Q_DECL_NOTHROW { - register T originalValue; - register T newValue; - register int result; + T originalValue; + T newValue; + int result; asm volatile("0:\n" "ldrex %[originalValue], [%[_q_value]]\n" "add %[newValue], %[originalValue], %[valueToAdd]\n" @@ -256,8 +256,8 @@ template<> struct QAtomicIntegerTraits { enum { IsInteger = 1 }; }; template<> template inline bool QBasicAtomicOps<1>::ref(T &_q_value) Q_DECL_NOTHROW { - register T newValue; - register int result; + T newValue; + int result; asm volatile("0:\n" "ldrexb %[newValue], [%[_q_value]]\n" "add %[newValue], %[newValue], #1\n" @@ -275,8 +275,8 @@ bool QBasicAtomicOps<1>::ref(T &_q_value) Q_DECL_NOTHROW template<> template inline bool QBasicAtomicOps<1>::deref(T &_q_value) Q_DECL_NOTHROW { - register T newValue; - register int result; + T newValue; + int result; asm volatile("0:\n" "ldrexb %[newValue], [%[_q_value]]\n" "sub %[newValue], %[newValue], #1\n" @@ -294,7 +294,7 @@ bool QBasicAtomicOps<1>::deref(T &_q_value) Q_DECL_NOTHROW template<> template inline bool QBasicAtomicOps<1>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW { - register T result; + T result; asm volatile("0:\n" "ldrexb %[result], [%[_q_value]]\n" "eors %[result], %[result], %[expectedValue]\n" @@ -314,8 +314,8 @@ bool QBasicAtomicOps<1>::testAndSetRelaxed(T &_q_value, T expectedValue, T newVa template<> template inline T QBasicAtomicOps<1>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHROW { - register T originalValue; - register int result; + T originalValue; + int result; asm volatile("0:\n" "ldrexb %[originalValue], [%[_q_value]]\n" "strexb %[result], %[newValue], [%[_q_value]]\n" @@ -333,9 +333,9 @@ T QBasicAtomicOps<1>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHR template<> template inline T QBasicAtomicOps<1>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType::AdditiveT valueToAdd) Q_DECL_NOTHROW { - register T originalValue; - register T newValue; - register int result; + T originalValue; + T newValue; + int result; asm volatile("0:\n" "ldrexb %[originalValue], [%[_q_value]]\n" "add %[newValue], %[originalValue], %[valueToAdd]\n" @@ -355,8 +355,8 @@ T QBasicAtomicOps<1>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveTy template<> template inline bool QBasicAtomicOps<2>::ref(T &_q_value) Q_DECL_NOTHROW { - register T newValue; - register int result; + T newValue; + int result; asm volatile("0:\n" "ldrexh %[newValue], [%[_q_value]]\n" "add %[newValue], %[newValue], #1\n" @@ -374,8 +374,8 @@ bool QBasicAtomicOps<2>::ref(T &_q_value) Q_DECL_NOTHROW template<> template inline bool QBasicAtomicOps<2>::deref(T &_q_value) Q_DECL_NOTHROW { - register T newValue; - register int result; + T newValue; + int result; asm volatile("0:\n" "ldrexh %[newValue], [%[_q_value]]\n" "sub %[newValue], %[newValue], #1\n" @@ -393,7 +393,7 @@ bool QBasicAtomicOps<2>::deref(T &_q_value) Q_DECL_NOTHROW template<> template inline bool QBasicAtomicOps<2>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW { - register T result; + T result; asm volatile("0:\n" "ldrexh %[result], [%[_q_value]]\n" "eors %[result], %[result], %[expectedValue]\n" @@ -413,8 +413,8 @@ bool QBasicAtomicOps<2>::testAndSetRelaxed(T &_q_value, T expectedValue, T newVa template<> template inline T QBasicAtomicOps<2>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHROW { - register T originalValue; - register int result; + T originalValue; + int result; asm volatile("0:\n" "ldrexh %[originalValue], [%[_q_value]]\n" "strexh %[result], %[newValue], [%[_q_value]]\n" @@ -432,9 +432,9 @@ T QBasicAtomicOps<2>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHR template<> template inline T QBasicAtomicOps<2>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType::AdditiveT valueToAdd) Q_DECL_NOTHROW { - register T originalValue; - register T newValue; - register int result; + T originalValue; + T newValue; + int result; asm volatile("0:\n" "ldrexh %[originalValue], [%[_q_value]]\n" "add %[newValue], %[originalValue], %[valueToAdd]\n" @@ -462,8 +462,8 @@ T QBasicAtomicOps<2>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveTy template<> template inline bool QBasicAtomicOps<8>::ref(T &_q_value) Q_DECL_NOTHROW { - register T newValue; - register int result; + T newValue; + int result; asm volatile("0:\n" "ldrexd %[newValue], %H[newValue], [%[_q_value]]\n" "adds %Q[newValue], %Q[newValue], #1\n" @@ -482,8 +482,8 @@ bool QBasicAtomicOps<8>::ref(T &_q_value) Q_DECL_NOTHROW template<> template inline bool QBasicAtomicOps<8>::deref(T &_q_value) Q_DECL_NOTHROW { - register T newValue; - register int result; + T newValue; + int result; asm volatile("0:\n" "ldrexd %[newValue], %H[newValue], [%[_q_value]]\n" "subs %Q[newValue], %Q[newValue], #1\n" @@ -502,7 +502,7 @@ bool QBasicAtomicOps<8>::deref(T &_q_value) Q_DECL_NOTHROW template<> template inline bool QBasicAtomicOps<8>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW { - register T result; + T result; asm volatile("0:\n" "ldrexd %[result], %H[result], [%[_q_value]]\n" "eor %[result], %[result], %[expectedValue]\n" @@ -524,8 +524,8 @@ bool QBasicAtomicOps<8>::testAndSetRelaxed(T &_q_value, T expectedValue, T newVa template<> template inline T QBasicAtomicOps<8>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHROW { - register T originalValue; - register int result; + T originalValue; + int result; asm volatile("0:\n" "ldrexd %[originalValue], %H[originalValue], [%[_q_value]]\n" "strexd %[result], %[newValue], %H[newValue], [%[_q_value]]\n" @@ -543,9 +543,9 @@ T QBasicAtomicOps<8>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHR template<> template inline T QBasicAtomicOps<8>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType::AdditiveT valueToAdd) Q_DECL_NOTHROW { - register T originalValue; - register T newValue; - register int result; + T originalValue; + T newValue; + int result; asm volatile("0:\n" "ldrexd %[originalValue], %H[originalValue], [%[_q_value]]\n" "adds %Q[newValue], %Q[originalValue], %Q[valueToAdd]\n" @@ -588,8 +588,8 @@ T QBasicAtomicOps<8>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveTy inline bool QBasicAtomicInt::ref() Q_DECL_NOTHROW { - register int newValue; - register int result; + int newValue; + int result; retry: __asm { ldrex newValue, [&_q_value] @@ -603,8 +603,8 @@ inline bool QBasicAtomicInt::ref() Q_DECL_NOTHROW inline bool QBasicAtomicInt::deref() Q_DECL_NOTHROW { - register int newValue; - register int result; + int newValue; + int result; retry: __asm { ldrex newValue, [&_q_value] @@ -618,7 +618,7 @@ inline bool QBasicAtomicInt::deref() Q_DECL_NOTHROW inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) Q_DECL_NOTHROW { - register int result; + int result; retry: __asm { ldrex result, [&_q_value] @@ -632,8 +632,8 @@ inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) Q_DECL_NOTHROW { - register int originalValue; - register int result; + int originalValue; + int result; retry: __asm { ldrex originalValue, [&_q_value] @@ -646,9 +646,9 @@ inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) Q_DECL_NOTHROW inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) Q_DECL_NOTHROW { - register int originalValue; - register int newValue; - register int result; + int originalValue; + int newValue; + int result; retry: __asm { ldrex originalValue, [&_q_value] @@ -663,7 +663,7 @@ inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) Q_DECL_NOTHROW template Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) Q_DECL_NOTHROW { - register T *result; + T *result; retry: __asm { ldrex result, [&_q_value] @@ -678,8 +678,8 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValu template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) Q_DECL_NOTHROW { - register T *originalValue; - register int result; + T *originalValue; + int result; retry: __asm { ldrex originalValue, [&_q_value] @@ -693,9 +693,9 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) Q template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) Q_DECL_NOTHROW { - register T *originalValue; - register T *newValue; - register int result; + T *originalValue; + T *newValue; + int result; retry: __asm { ldrex originalValue, [&_q_value] diff --git a/src/corelib/arch/qatomic_ia64.h b/src/corelib/arch/qatomic_ia64.h index ed72036076..98937c7551 100644 --- a/src/corelib/arch/qatomic_ia64.h +++ b/src/corelib/arch/qatomic_ia64.h @@ -192,7 +192,7 @@ template struct QAtomicOps : QBasicAtomicOps typedef T Type; }; -inline bool _q_ia64_fetchadd_immediate(register int value) +inline bool _q_ia64_fetchadd_immediate(int value) { return value == 1 || value == -1 || value == 4 || value == -4 @@ -218,7 +218,7 @@ inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) { - register int expectedValueCopy = expectedValue; + int expectedValueCopy = expectedValue; return (static_cast(_InterlockedCompareExchange(&_q_value, newValue, expectedValueCopy)) @@ -227,7 +227,7 @@ inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) { - register int expectedValueCopy = expectedValue; + int expectedValueCopy = expectedValue; return (static_cast(_InterlockedCompareExchange_acq(reinterpret_cast(&_q_value), newValue, expectedValueCopy)) @@ -236,7 +236,7 @@ inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) { - register int expectedValueCopy = expectedValue; + int expectedValueCopy = expectedValue; return (static_cast(_InterlockedCompareExchange_rel(reinterpret_cast(&_q_value), newValue, expectedValueCopy)) @@ -285,7 +285,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) template Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) { - register T *expectedValueCopy = expectedValue; + T *expectedValueCopy = expectedValue; return (_InterlockedCompareExchangePointer(reinterpret_cast(&_q_value), newValue, expectedValueCopy) @@ -300,7 +300,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValu volatile unsigned long *p; }; x = &_q_value; - register T *expectedValueCopy = expectedValue; + T *expectedValueCopy = expectedValue; return (_InterlockedCompareExchange64_acq(p, quintptr(newValue), quintptr(expectedValueCopy)) == quintptr(expectedValue)); } @@ -313,7 +313,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValu volatile unsigned long *p; }; x = &_q_value; - register T *expectedValueCopy = expectedValue; + T *expectedValueCopy = expectedValue; return (_InterlockedCompareExchange64_rel(p, quintptr(newValue), quintptr(expectedValueCopy)) == quintptr(expectedValue)); } @@ -912,7 +912,7 @@ T QBasicAtomicOps<1>::fetchAndAddAcquire(T &_q_value, typename QAtomicAdditiveTy { valueToAdd *= QAtomicAdditiveType::AddScale; // implement the test-and-set loop - register T old, ret; + T old, ret; do { old = _q_value; _Asm_mov_to_ar((_Asm_app_reg)_AREG_CCV, (quint8)old, FENCE); @@ -926,7 +926,7 @@ template<> template inline T QBasicAtomicOps<1>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType::AdditiveT valueToAdd) Q_DECL_NOTHROW { // implement the test-and-set loop - register T old, ret; + T old, ret; do { old = _q_value; _Asm_mov_to_ar((_Asm_app_reg)_AREG_CCV, (quint8)old, FENCE); @@ -941,7 +941,7 @@ T QBasicAtomicOps<2>::fetchAndAddAcquire(T &_q_value, typename QAtomicAdditiveTy { valueToAdd *= QAtomicAdditiveType::AddScale; // implement the test-and-set loop - register T old, ret; + T old, ret; do { old = _q_value; _Asm_mov_to_ar((_Asm_app_reg)_AREG_CCV, (quint16)old, FENCE); @@ -955,7 +955,7 @@ template<> template inline T QBasicAtomicOps<2>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType::AdditiveT valueToAdd) Q_DECL_NOTHROW { // implement the test-and-set loop - register T old, ret; + T old, ret; do { old = _q_value; _Asm_mov_to_ar((_Asm_app_reg)_AREG_CCV, (quint16)old, FENCE); @@ -970,7 +970,7 @@ T QBasicAtomicOps<4>::fetchAndAddAcquire(T &_q_value, typename QAtomicAdditiveTy { valueToAdd *= QAtomicAdditiveType::AddScale; // implement the test-and-set loop - register T old, ret; + T old, ret; do { old = _q_value; _Asm_mov_to_ar((_Asm_app_reg)_AREG_CCV, (unsigned)old, FENCE); @@ -984,7 +984,7 @@ template<> template inline T QBasicAtomicOps<4>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType::AdditiveT valueToAdd) Q_DECL_NOTHROW { // implement the test-and-set loop - register T old, ret; + T old, ret; do { old = _q_value; _Asm_mov_to_ar((_Asm_app_reg)_AREG_CCV, (unsigned)old, FENCE); @@ -999,7 +999,7 @@ T QBasicAtomicOps<8>::fetchAndAddAcquire(T &_q_value, typename QAtomicAdditiveTy { valueToAdd *= QAtomicAdditiveType::AddScale; // implement the test-and-set loop - register T old, ret; + T old, ret; do { old = _q_value; _Asm_mov_to_ar((_Asm_app_reg)_AREG_CCV, (quint64)old, FENCE); @@ -1013,7 +1013,7 @@ template<> template inline T QBasicAtomicOps<8>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType::AdditiveT valueToAdd) Q_DECL_NOTHROW { // implement the test-and-set loop - register T old, ret; + T old, ret; do { old = _q_value; _Asm_mov_to_ar((_Asm_app_reg)_AREG_CCV, (quint64)old, FENCE); diff --git a/src/corelib/arch/qatomic_mips.h b/src/corelib/arch/qatomic_mips.h index 7716750332..6eb9613e31 100644 --- a/src/corelib/arch/qatomic_mips.h +++ b/src/corelib/arch/qatomic_mips.h @@ -137,8 +137,8 @@ void QBasicAtomicOps::orderedMemoryFence(const T &) Q_DECL_NOTHROW template<> template inline bool QBasicAtomicOps<4>::ref(T &_q_value) Q_DECL_NOTHROW { - register T originalValue; - register T newValue; + T originalValue; + T newValue; asm volatile("0:\n" "ll %[originalValue], %[_q_value]\n" "addiu %[newValue], %[originalValue], %[one]\n" @@ -156,8 +156,8 @@ bool QBasicAtomicOps<4>::ref(T &_q_value) Q_DECL_NOTHROW template<> template inline bool QBasicAtomicOps<4>::deref(T &_q_value) Q_DECL_NOTHROW { - register T originalValue; - register T newValue; + T originalValue; + T newValue; asm volatile("0:\n" "ll %[originalValue], %[_q_value]\n" "addiu %[newValue], %[originalValue], %[minusOne]\n" @@ -175,8 +175,8 @@ bool QBasicAtomicOps<4>::deref(T &_q_value) Q_DECL_NOTHROW template<> template inline bool QBasicAtomicOps<4>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW { - register T result; - register T tempValue; + T result; + T tempValue; asm volatile("0:\n" "ll %[result], %[_q_value]\n" "xor %[result], %[result], %[expectedValue]\n" @@ -199,8 +199,8 @@ bool QBasicAtomicOps<4>::testAndSetRelaxed(T &_q_value, T expectedValue, T newVa template<> template inline T QBasicAtomicOps<4>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHROW { - register T originalValue; - register T tempValue; + T originalValue; + T tempValue; asm volatile("0:\n" "ll %[originalValue], %[_q_value]\n" "move %[tempValue], %[newValue]\n" @@ -218,8 +218,8 @@ T QBasicAtomicOps<4>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHR template<> template inline T QBasicAtomicOps<4>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType::AdditiveT valueToAdd) Q_DECL_NOTHROW { - register T originalValue; - register T newValue; + T originalValue; + T newValue; asm volatile("0:\n" "ll %[originalValue], %[_q_value]\n" "addu %[newValue], %[originalValue], %[valueToAdd]\n" @@ -254,8 +254,8 @@ template<> struct QAtomicIntegerTraits { enum { IsInteger = 1 }; }; template<> template inline bool QBasicAtomicOps<8>::ref(T &_q_value) Q_DECL_NOTHROW { - register T originalValue; - register T newValue; + T originalValue; + T newValue; asm volatile("0:\n" "lld %[originalValue], %[_q_value]\n" "addiu %[newValue], %[originalValue], %[one]\n" @@ -273,8 +273,8 @@ bool QBasicAtomicOps<8>::ref(T &_q_value) Q_DECL_NOTHROW template<> template inline bool QBasicAtomicOps<8>::deref(T &_q_value) Q_DECL_NOTHROW { - register T originalValue; - register T newValue; + T originalValue; + T newValue; asm volatile("0:\n" "lld %[originalValue], %[_q_value]\n" "addiu %[newValue], %[originalValue], %[minusOne]\n" @@ -292,8 +292,8 @@ bool QBasicAtomicOps<8>::deref(T &_q_value) Q_DECL_NOTHROW template<> template inline bool QBasicAtomicOps<8>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW { - register T result; - register T tempValue; + T result; + T tempValue; asm volatile("0:\n" "lld %[result], %[_q_value]\n" "xor %[result], %[result], %[expectedValue]\n" @@ -316,8 +316,8 @@ bool QBasicAtomicOps<8>::testAndSetRelaxed(T &_q_value, T expectedValue, T newVa template<> template inline T QBasicAtomicOps<8>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHROW { - register T originalValue; - register T tempValue; + T originalValue; + T tempValue; asm volatile("0:\n" "lld %[originalValue], %[_q_value]\n" "move %[tempValue], %[newValue]\n" @@ -335,8 +335,8 @@ T QBasicAtomicOps<8>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHR template<> template inline T QBasicAtomicOps<8>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType::AdditiveT valueToAdd) Q_DECL_NOTHROW { - register T originalValue; - register T newValue; + T originalValue; + T newValue; asm volatile("0:\n" "lld %[originalValue], %[_q_value]\n" "addu %[newValue], %[originalValue], %[valueToAdd]\n" diff --git a/src/corelib/arch/qatomic_power.h b/src/corelib/arch/qatomic_power.h index ad1c619d56..3ddd303795 100644 --- a/src/corelib/arch/qatomic_power.h +++ b/src/corelib/arch/qatomic_power.h @@ -124,8 +124,8 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddWaitFree() inline bool QBasicAtomicInt::ref() { - register int originalValue; - register int newValue; + int originalValue; + int newValue; asm volatile("lwarx %[originalValue]," _Q_VALUE "\n" "addi %[newValue], %[originalValue], %[one]\n" "stwcx. %[newValue]," _Q_VALUE "\n" @@ -141,8 +141,8 @@ inline bool QBasicAtomicInt::ref() inline bool QBasicAtomicInt::deref() { - register int originalValue; - register int newValue; + int originalValue; + int newValue; asm volatile("lwarx %[originalValue]," _Q_VALUE "\n" "addi %[newValue], %[originalValue], %[minusOne]\n" "stwcx. %[newValue]," _Q_VALUE "\n" @@ -158,7 +158,7 @@ inline bool QBasicAtomicInt::deref() inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) { - register int result; + int result; asm volatile("lwarx %[result]," _Q_VALUE "\n" "xor. %[result], %[result], %[expectedValue]\n" "bne $+12\n" @@ -175,7 +175,7 @@ inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) { - register int result; + int result; asm volatile("lwarx %[result]," _Q_VALUE "\n" "xor. %[result], %[result], %[expectedValue]\n" "bne $+16\n" @@ -193,7 +193,7 @@ inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) { - register int result; + int result; asm volatile("eieio\n" "lwarx %[result]," _Q_VALUE "\n" "xor. %[result], %[result], %[expectedValue]\n" @@ -211,7 +211,7 @@ inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) { - register int originalValue; + int originalValue; asm volatile("lwarx %[originalValue]," _Q_VALUE "\n" "stwcx. %[newValue]," _Q_VALUE "\n" "bne- $-8\n" @@ -225,7 +225,7 @@ inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) { - register int originalValue; + int originalValue; asm volatile("lwarx %[originalValue]," _Q_VALUE "\n" "stwcx. %[newValue]," _Q_VALUE "\n" "bne- $-8\n" @@ -240,7 +240,7 @@ inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) { - register int originalValue; + int originalValue; asm volatile("eieio\n" "lwarx %[originalValue]," _Q_VALUE "\n" "stwcx. %[newValue]," _Q_VALUE "\n" @@ -255,8 +255,8 @@ inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) { - register int originalValue; - register int newValue; + int originalValue; + int newValue; asm volatile("lwarx %[originalValue]," _Q_VALUE "\n" "add %[newValue], %[originalValue], %[valueToAdd]\n" "stwcx. %[newValue]," _Q_VALUE "\n" @@ -272,8 +272,8 @@ inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) { - register int originalValue; - register int newValue; + int originalValue; + int newValue; asm volatile("lwarx %[originalValue]," _Q_VALUE "\n" "add %[newValue], %[originalValue], %[valueToAdd]\n" "stwcx. %[newValue]," _Q_VALUE "\n" @@ -290,8 +290,8 @@ inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) { - register int originalValue; - register int newValue; + int originalValue; + int newValue; asm volatile("eieio\n" "lwarx %[originalValue]," _Q_VALUE "\n" "add %[newValue], %[originalValue], %[valueToAdd]\n" @@ -317,7 +317,7 @@ inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) template Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) { - register void *result; + void *result; asm volatile(LPARX" %[result]," _Q_VALUE "\n" "xor. %[result], %[result], %[expectedValue]\n" "bne $+12\n" @@ -335,7 +335,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValu template Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) { - register void *result; + void *result; asm volatile(LPARX" %[result]," _Q_VALUE "\n" "xor. %[result], %[result], %[expectedValue]\n" "bne $+16\n" @@ -354,7 +354,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValu template Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) { - register void *result; + void *result; asm volatile("eieio\n" LPARX" %[result]," _Q_VALUE "\n" "xor. %[result], %[result], %[expectedValue]\n" @@ -373,7 +373,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValu template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) { - register T *originalValue; + T *originalValue; asm volatile(LPARX" %[originalValue]," _Q_VALUE "\n" STPCX" %[newValue]," _Q_VALUE "\n" "bne- $-8\n" @@ -388,7 +388,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) { - register T *originalValue; + T *originalValue; asm volatile(LPARX" %[originalValue]," _Q_VALUE "\n" STPCX" %[newValue]," _Q_VALUE "\n" "bne- $-8\n" @@ -404,7 +404,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) { - register T *originalValue; + T *originalValue; asm volatile("eieio\n" LPARX" %[originalValue]," _Q_VALUE "\n" STPCX" %[newValue]," _Q_VALUE "\n" @@ -420,8 +420,8 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) { - register T *originalValue; - register T *newValue; + T *originalValue; + T *newValue; asm volatile(LPARX" %[originalValue]," _Q_VALUE "\n" "add %[newValue], %[originalValue], %[valueToAdd]\n" STPCX" %[newValue]," _Q_VALUE "\n" @@ -438,8 +438,8 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueTo template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) { - register T *originalValue; - register T *newValue; + T *originalValue; + T *newValue; asm volatile(LPARX" %[originalValue]," _Q_VALUE "\n" "add %[newValue], %[originalValue], %[valueToAdd]\n" STPCX" %[newValue]," _Q_VALUE "\n" @@ -457,8 +457,8 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueTo template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) { - register T *originalValue; - register T *newValue; + T *originalValue; + T *newValue; asm volatile("eieio\n" LPARX" %[originalValue]," _Q_VALUE "\n" "add %[newValue], %[originalValue], %[valueToAdd]\n" diff --git a/src/corelib/arch/qatomic_sh4a.h b/src/corelib/arch/qatomic_sh4a.h index 08f75e44f2..6e59279f3e 100644 --- a/src/corelib/arch/qatomic_sh4a.h +++ b/src/corelib/arch/qatomic_sh4a.h @@ -147,7 +147,7 @@ inline bool QBasicAtomicInt::deref() inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) { - register int result; + int result; asm volatile("0:\n" "movli.l @%[_q_value], r0\n" "xor %[expectedValue], r0\n" @@ -169,7 +169,7 @@ inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) { - register int result; + int result; asm volatile("0:\n" "movli.l @%[_q_value], r0\n" "xor %[expectedValue], r0\n" @@ -192,7 +192,7 @@ inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) { - register int result; + int result; asm volatile("synco\n" "0:\n" "movli.l @%[_q_value], r0\n" @@ -220,7 +220,7 @@ inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue) inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) { - register int originalValue; + int originalValue; asm volatile("0:\n" "movli.l @%[_q_value], r0\n" "mov r0, %[originalValue]\n" @@ -237,7 +237,7 @@ inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) { - register int originalValue; + int originalValue; asm volatile("0:\n" "movli.l @%[_q_value], r0\n" "mov r0, %[originalValue]\n" @@ -255,7 +255,7 @@ inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) { - register int originalValue; + int originalValue; asm volatile("synco\n" "0:\n" "movli.l @%[_q_value], r0\n" @@ -278,7 +278,7 @@ inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue) inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) { - register int originalValue; + int originalValue; asm volatile("0:\n" "movli.l @%[_q_value], r0\n" "mov r0, %[originalValue]\n" @@ -295,7 +295,7 @@ inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) { - register int originalValue; + int originalValue; asm volatile("0:\n" "movli.l @%[_q_value], r0\n" "mov r0, %[originalValue]\n" @@ -313,7 +313,7 @@ inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) { - register int originalValue; + int originalValue; asm volatile("synco\n" "0:\n" "movli.l @%[_q_value], r0\n" @@ -337,7 +337,7 @@ inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd) template Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) { - register T *result; + T *result; asm volatile("0:\n" "movli.l @%[_q_value], r0\n" "xor %[expectedValue], r0\n" @@ -360,7 +360,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValu template Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) { - register T *result; + T *result; asm volatile("0:\n" "movli.l @%[_q_value], r0\n" "xor %[expectedValue], r0\n" @@ -384,7 +384,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValu template Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) { - register T *result; + T *result; asm volatile("synco\n" "0:\n" "movli.l @%[_q_value], r0\n" @@ -414,7 +414,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetOrdered(T *expectedValu template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) { - register T *originalValue; + T *originalValue; asm volatile("0:\n" "movli.l @%[_q_value], r0\n" "mov r0, %[originalValue]\n" @@ -432,7 +432,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) { - register T *originalValue; + T *originalValue; asm volatile("0:\n" "movli.l @%[_q_value], r0\n" "mov r0, %[originalValue]\n" @@ -451,7 +451,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) { - register T *originalValue; + T *originalValue; asm volatile("synco\n" "0:\n" "movli.l @%[_q_value], r0\n" @@ -476,7 +476,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreOrdered(T *newValue) template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) { - register T *originalValue; + T *originalValue; asm volatile("0:\n" "movli.l @%[_q_value], r0\n" "mov r0, %[originalValue]\n" @@ -494,7 +494,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueTo template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) { - register T *originalValue; + T *originalValue; asm volatile("0:\n" "movli.l @%[_q_value], r0\n" "mov r0, %[originalValue]\n" @@ -513,7 +513,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueTo template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) { - register T *originalValue; + T *originalValue; asm volatile("synco\n" "0:\n" "movli.l @%[_q_value], r0\n" diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp index 1cedd3a28d..4ed7b00e53 100644 --- a/src/corelib/codecs/qtextcodec.cpp +++ b/src/corelib/codecs/qtextcodec.cpp @@ -99,9 +99,9 @@ Q_GLOBAL_STATIC_WITH_ARGS(QMutex, textCodecsMutex, (QMutex::Recursive)); QMutex *qTextCodecsMutex() { return textCodecsMutex(); } #if !defined(QT_USE_ICU) -static char qtolower(register char c) +static char qtolower(char c) { if (c >= 'A' && c <= 'Z') return c + 0x20; return c; } -static bool qisalnum(register char c) +static bool qisalnum(char c) { return (c >= '0' && c <= '9') || ((c | 0x20) >= 'a' && (c | 0x20) <= 'z'); } bool qTextCodecNameMatch(const char *n, const char *h) diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index c8293beb4e..85ff89ebdd 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -501,7 +501,7 @@ Q_AUTOTEST_EXPORT QByteArray qCleanupFuncinfo(QByteArray info) templatecount = 1; --pos; while (pos && templatecount) { - register char c = info.at(pos); + char c = info.at(pos); if (c == '>') ++templatecount; else if (c == '<') diff --git a/src/corelib/io/qfilesystemwatcher_inotify.cpp b/src/corelib/io/qfilesystemwatcher_inotify.cpp index 18f3404c5d..024af79c33 100644 --- a/src/corelib/io/qfilesystemwatcher_inotify.cpp +++ b/src/corelib/io/qfilesystemwatcher_inotify.cpp @@ -220,7 +220,7 @@ QT_BEGIN_NAMESPACE QInotifyFileSystemWatcherEngine *QInotifyFileSystemWatcherEngine::create(QObject *parent) { - register int fd = -1; + int fd = -1; #ifdef IN_CLOEXEC fd = inotify_init1(IN_CLOEXEC); #endif diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 02e7b967ea..f2e1f9bbc7 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -882,7 +882,7 @@ inline bool QUrlPrivate::setScheme(const QString &value, int len, bool doSetErro // schemes are ASCII only, so we don't need the full Unicode toLower QChar *schemeData = scheme.data(); // force detaching here for (int i = needsLowercasing; i >= 0; --i) { - register ushort c = schemeData[i].unicode(); + ushort c = schemeData[i].unicode(); if (c >= 'A' && c <= 'Z') schemeData[i] = c + 0x20; } @@ -1244,7 +1244,7 @@ inline void QUrlPrivate::parse(const QString &url, QUrl::ParsingMode parsingMode const ushort *const data = reinterpret_cast(begin); for (int i = 0; i < len; ++i) { - register uint uc = data[i]; + uint uc = data[i]; if (uc == '#' && hash == -1) { hash = i; @@ -1472,7 +1472,7 @@ inline QUrlPrivate::ErrorCode QUrlPrivate::validityError(QString *source, int *p // check for a path of "text:text/" for (int i = 0; i < path.length(); ++i) { - register ushort c = path.at(i).unicode(); + ushort c = path.at(i).unicode(); if (c == '/') { // found the slash before the colon return NoError; @@ -1512,7 +1512,7 @@ bool QUrlPrivate::validateComponent(QUrlPrivate::Section section, const QString const ushort *const data = reinterpret_cast(input.constData()); for (uint i = uint(begin); i < uint(end); ++i) { - register uint uc = data[i]; + uint uc = data[i]; if (uc >= 0x80) continue; diff --git a/src/corelib/io/qurlidna.cpp b/src/corelib/io/qurlidna.cpp index 5fa4b5f7a1..70db9e09eb 100644 --- a/src/corelib/io/qurlidna.cpp +++ b/src/corelib/io/qurlidna.cpp @@ -2028,7 +2028,7 @@ Q_AUTOTEST_EXPORT void qt_nameprep(QString *source, int from) const QChar *e = src + source->size(); for ( ; out < e; ++out) { - register ushort uc = out->unicode(); + ushort uc = out->unicode(); if (uc >= 0x80) { break; } else if (uc >= 'A' && uc <= 'Z') { @@ -2121,7 +2121,7 @@ Q_AUTOTEST_EXPORT bool qt_check_std3rules(const QChar *uc, int len) return false; for (int i = 0; i < len; ++i) { - register ushort c = uc[i].unicode(); + ushort c = uc[i].unicode(); if (c == '-' && (i == 0 || i == len - 1)) return false; @@ -2504,7 +2504,7 @@ QString qt_ACE_do(const QString &domain, AceOperation op) const QChar *in = domain.constData() + lastIdx; const QChar *e = in + labelLength; for (; in < e; ++in, ++out) { - register ushort uc = in->unicode(); + ushort uc = in->unicode(); if (uc > 0x7f) simple = false; if (uc >= 'A' && uc <= 'Z') @@ -2533,7 +2533,7 @@ QString qt_ACE_do(const QString &domain, AceOperation op) // That means we need one or two temporaries qt_nameprep(&result, prevLen); labelLength = result.length() - prevLen; - register int toReserve = labelLength + 4 + 6; // "xn--" plus some extra bytes + int toReserve = labelLength + 4 + 6; // "xn--" plus some extra bytes aceForm.resize(0); if (toReserve > aceForm.capacity()) aceForm.reserve(toReserve); diff --git a/src/corelib/io/qurlrecode.cpp b/src/corelib/io/qurlrecode.cpp index 6e01272831..5ff0c40a4f 100644 --- a/src/corelib/io/qurlrecode.cpp +++ b/src/corelib/io/qurlrecode.cpp @@ -464,7 +464,7 @@ static int recode(QString &result, const ushort *begin, const ushort *end, QUrl: ushort *output = 0; for ( ; input != end; ++input) { - register ushort c; + ushort c; EncodingAction action; // try a run where no change is necessary @@ -483,7 +483,7 @@ static int recode(QString &result, const ushort *begin, const ushort *end, QUrl: break; non_trivial: - register uint decoded; + uint decoded; if (c == '%' && retryBadEncoding) { // always write "%25" ensureDetached(result, output, begin, input, end); diff --git a/src/corelib/kernel/qcore_unix.cpp b/src/corelib/kernel/qcore_unix.cpp index 241658acb1..98e697eb57 100644 --- a/src/corelib/kernel/qcore_unix.cpp +++ b/src/corelib/kernel/qcore_unix.cpp @@ -79,7 +79,7 @@ int qt_safe_select(int nfds, fd_set *fdread, fd_set *fdwrite, fd_set *fdexcept, { if (!orig_timeout) { // no timeout -> block forever - register int ret; + int ret; EINTR_LOOP(ret, select(nfds, fdread, fdwrite, fdexcept, 0)); return ret; } diff --git a/src/corelib/kernel/qcore_unix_p.h b/src/corelib/kernel/qcore_unix_p.h index b68146cd6c..8c0589fdc6 100644 --- a/src/corelib/kernel/qcore_unix_p.h +++ b/src/corelib/kernel/qcore_unix_p.h @@ -168,7 +168,7 @@ static inline int qt_safe_open(const char *pathname, int flags, mode_t mode = 07 #ifdef O_CLOEXEC flags |= O_CLOEXEC; #endif - register int fd; + int fd; EINTR_LOOP(fd, QT_OPEN(pathname, flags, mode)); // unknown flags are ignored, so we have no way of verifying if @@ -191,7 +191,7 @@ static inline int qt_safe_pipe(int pipefd[2], int flags = 0) Q_ASSERT((flags & ~O_NONBLOCK) == 0); #endif - register int ret; + int ret; #if QT_UNIX_SUPPORTS_THREADSAFE_CLOEXEC && defined(O_CLOEXEC) // use pipe2 flags |= O_CLOEXEC; @@ -223,7 +223,7 @@ static inline int qt_safe_dup(int oldfd, int atleast = 0, int flags = FD_CLOEXEC { Q_ASSERT(flags == FD_CLOEXEC || flags == 0); - register int ret; + int ret; #ifdef F_DUPFD_CLOEXEC // use this fcntl if (flags & FD_CLOEXEC) { @@ -247,7 +247,7 @@ static inline int qt_safe_dup2(int oldfd, int newfd, int flags = FD_CLOEXEC) { Q_ASSERT(flags == FD_CLOEXEC || flags == 0); - register int ret; + int ret; #if QT_UNIX_SUPPORTS_THREADSAFE_CLOEXEC && defined(O_CLOEXEC) // use dup3 if (flags & FD_CLOEXEC) { @@ -291,7 +291,7 @@ static inline qint64 qt_safe_write_nosignal(int fd, const void *data, qint64 len static inline int qt_safe_close(int fd) { - register int ret; + int ret; EINTR_LOOP(ret, QT_CLOSE(fd)); return ret; } @@ -303,28 +303,28 @@ static inline int qt_safe_close(int fd) static inline int qt_safe_execve(const char *filename, char *const argv[], char *const envp[]) { - register int ret; + int ret; EINTR_LOOP(ret, ::execve(filename, argv, envp)); return ret; } static inline int qt_safe_execv(const char *path, char *const argv[]) { - register int ret; + int ret; EINTR_LOOP(ret, ::execv(path, argv)); return ret; } static inline int qt_safe_execvp(const char *file, char *const argv[]) { - register int ret; + int ret; EINTR_LOOP(ret, ::execvp(file, argv)); return ret; } static inline pid_t qt_safe_waitpid(pid_t pid, int *status, int options) { - register int ret; + int ret; EINTR_LOOP(ret, ::waitpid(pid, status, options)); return ret; } diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 100e014e99..e49d5f961c 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -938,7 +938,7 @@ bool QCoreApplicationPrivate::sendThroughApplicationEventFilters(QObject *receiv if (receiver->d_func()->threadData == this->threadData && extraData) { // application event filters are only called for objects in the GUI thread for (int i = 0; i < extraData->eventFilters.size(); ++i) { - register QObject *obj = extraData->eventFilters.at(i); + QObject *obj = extraData->eventFilters.at(i); if (!obj) continue; if (obj->d_func()->threadData != threadData) { @@ -957,7 +957,7 @@ bool QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject *receiver, Q Q_Q(QCoreApplication); if (receiver != q && receiver->d_func()->extraData) { for (int i = 0; i < receiver->d_func()->extraData->eventFilters.size(); ++i) { - register QObject *obj = receiver->d_func()->extraData->eventFilters.at(i); + QObject *obj = receiver->d_func()->extraData->eventFilters.at(i); if (!obj) continue; if (obj->d_func()->threadData != receiver->d_func()->threadData) { diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index 7413ef4d89..d9b286e691 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -686,7 +686,7 @@ struct QMetaTypeIdQObject template inline int qRegisterMetaTypeStreamOperators() { - register int id = qMetaTypeId(); + int id = qMetaTypeId(); QMetaType::registerStreamOperators(id, QtMetaTypePrivate::QMetaTypeFunctionHelper::Save, QtMetaTypePrivate::QMetaTypeFunctionHelper::Load); return id; diff --git a/src/corelib/kernel/qsystemsemaphore_unix.cpp b/src/corelib/kernel/qsystemsemaphore_unix.cpp index 6e2838a8a5..073bd020ba 100644 --- a/src/corelib/kernel/qsystemsemaphore_unix.cpp +++ b/src/corelib/kernel/qsystemsemaphore_unix.cpp @@ -212,7 +212,7 @@ bool QSystemSemaphorePrivate::modifySemaphore(int count) operation.sem_op = count; operation.sem_flg = SEM_UNDO; - register int res; + int res; EINTR_LOOP(res, semop(semaphore, &operation, 1)); if (-1 == res) { // If the semaphore was removed be nice and create it and then modifySemaphore again diff --git a/src/corelib/kernel/qtimerinfo_unix.cpp b/src/corelib/kernel/qtimerinfo_unix.cpp index 0e33fa697a..f1bbbe5338 100644 --- a/src/corelib/kernel/qtimerinfo_unix.cpp +++ b/src/corelib/kernel/qtimerinfo_unix.cpp @@ -153,7 +153,7 @@ void QTimerInfoList::timerRepair(const timespec &diff) { // repair all timers for (int i = 0; i < size(); ++i) { - register QTimerInfo *t = at(i); + QTimerInfo *t = at(i); t->timeout = t->timeout + diff; } } @@ -182,7 +182,7 @@ void QTimerInfoList::timerInsert(QTimerInfo *ti) { int index = size(); while (index--) { - register const QTimerInfo * const t = at(index); + const QTimerInfo * const t = at(index); if (!(ti->timeout < t->timeout)) break; } @@ -244,8 +244,8 @@ static void calculateCoarseTimerTimeout(QTimerInfo *t, timespec currentTime) // // The objective is to make most timers wake up at the same time, thereby reducing CPU wakeups. - register uint interval = uint(t->interval); - register uint msec = uint(t->timeout.tv_nsec) / 1000 / 1000; + uint interval = uint(t->interval); + uint msec = uint(t->timeout.tv_nsec) / 1000 / 1000; Q_ASSERT(interval >= 20); // Calculate how much we can round and still keep within 5% error @@ -256,14 +256,14 @@ static void calculateCoarseTimerTimeout(QTimerInfo *t, timespec currentTime) if (interval < 50) { // round to even // round towards multiples of 50 ms - register bool roundUp = (msec % 50) >= 25; + bool roundUp = (msec % 50) >= 25; msec >>= 1; msec |= uint(roundUp); msec <<= 1; } else { // round to multiple of 4 // round towards multiples of 100 ms - register bool roundUp = (msec % 100) >= 50; + bool roundUp = (msec % 100) >= 50; msec >>= 2; msec |= uint(roundUp); msec <<= 2; @@ -423,7 +423,7 @@ int QTimerInfoList::timerRemainingTime(int timerId) timespec tm = {0, 0}; for (int i = 0; i < count(); ++i) { - register QTimerInfo *t = at(i); + QTimerInfo *t = at(i); if (t->id == timerId) { if (currentTime < t->timeout) { // time to wait @@ -509,7 +509,7 @@ bool QTimerInfoList::unregisterTimer(int timerId) { // set timer inactive for (int i = 0; i < count(); ++i) { - register QTimerInfo *t = at(i); + QTimerInfo *t = at(i); if (t->id == timerId) { // found it removeAt(i); @@ -530,7 +530,7 @@ bool QTimerInfoList::unregisterTimers(QObject *object) if (isEmpty()) return false; for (int i = 0; i < count(); ++i) { - register QTimerInfo *t = at(i); + QTimerInfo *t = at(i); if (t->obj == object) { // object found removeAt(i); @@ -550,7 +550,7 @@ QList QTimerInfoList::registeredTimers(QObj { QList list; for (int i = 0; i < count(); ++i) { - register const QTimerInfo * const t = at(i); + const QTimerInfo * const t = at(i); if (t->obj == object) { list << QAbstractEventDispatcher::TimerInfo(t->id, (t->timerType == Qt::VeryCoarseTimer diff --git a/src/corelib/thread/qgenericatomic.h b/src/corelib/thread/qgenericatomic.h index a0a851eabb..3a213f6a25 100644 --- a/src/corelib/thread/qgenericatomic.h +++ b/src/corelib/thread/qgenericatomic.h @@ -172,7 +172,7 @@ template struct QGenericAtomicOps { // implement fetchAndStore on top of testAndSet Q_FOREVER { - register T tmp = load(_q_value); + T tmp = load(_q_value); if (BaseClass::testAndSetRelaxed(_q_value, tmp, newValue)) return tmp; } @@ -207,7 +207,7 @@ template struct QGenericAtomicOps { // implement fetchAndAdd on top of testAndSet Q_FOREVER { - register T tmp = BaseClass::load(_q_value); + T tmp = BaseClass::load(_q_value); if (BaseClass::testAndSetRelaxed(_q_value, tmp, T(tmp + valueToAdd))) return tmp; } diff --git a/src/corelib/thread/qmutex.cpp b/src/corelib/thread/qmutex.cpp index 1ed4a77950..378813c889 100644 --- a/src/corelib/thread/qmutex.cpp +++ b/src/corelib/thread/qmutex.cpp @@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE static inline bool isRecursive(QMutexData *d) { - register quintptr u = quintptr(d); + quintptr u = quintptr(d); if (Q_LIKELY(u <= 0x3)) return false; #ifdef QT_LINUX_FUTEX diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index dc3f5f3be9..75900e9775 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -261,8 +261,8 @@ int qstrcmp(const char *str1, const char *str2) int qstricmp(const char *str1, const char *str2) { - register const uchar *s1 = reinterpret_cast(str1); - register const uchar *s2 = reinterpret_cast(str2); + const uchar *s1 = reinterpret_cast(str1); + const uchar *s2 = reinterpret_cast(str2); int res; uchar c; if (!s1 || !s2) @@ -295,8 +295,8 @@ int qstricmp(const char *str1, const char *str2) int qstrnicmp(const char *str1, const char *str2, uint len) { - register const uchar *s1 = reinterpret_cast(str1); - register const uchar *s2 = reinterpret_cast(str2); + const uchar *s1 = reinterpret_cast(str1); + const uchar *s2 = reinterpret_cast(str2); int res; uchar c; if (!s1 || !s2) @@ -321,7 +321,7 @@ int qstrcmp(const QByteArray &str1, const char *str2) const char *str1data = str1.constData(); const char *str1end = str1data + str1.length(); for ( ; str1data < str1end && *str2; ++str1data, ++str2) { - register int diff = int(uchar(*str1data)) - uchar(*str2); + int diff = int(uchar(*str1data)) - uchar(*str2); if (diff) // found a difference return diff; @@ -357,8 +357,8 @@ int qstrcmp(const QByteArray &str1, const QByteArray &str2) #if 0 static void createCRC16Table() // build CRC16 lookup table { - register unsigned int i; - register unsigned int j; + unsigned int i; + unsigned int j; unsigned short crc_tbl[16]; unsigned int v0, v1, v2, v3; for (i = 0; i < 16; i++) { @@ -410,7 +410,7 @@ static const quint16 crc_tbl[16] = { quint16 qChecksum(const char *data, uint len) { - register quint16 crc = 0xffff; + quint16 crc = 0xffff; uchar c; const uchar *p = reinterpret_cast(data); while (len--) { @@ -2671,7 +2671,7 @@ QByteArray QByteArray::mid(int pos, int len) const QByteArray QByteArray::toLower() const { QByteArray s(*this); - register uchar *p = reinterpret_cast(s.data()); + uchar *p = reinterpret_cast(s.data()); if (p) { while (*p) { *p = QChar::toLower((ushort)*p); @@ -2694,7 +2694,7 @@ QByteArray QByteArray::toLower() const QByteArray QByteArray::toUpper() const { QByteArray s(*this); - register uchar *p = reinterpret_cast(s.data()); + uchar *p = reinterpret_cast(s.data()); if (p) { while (*p) { *p = QChar::toUpper((ushort)*p); diff --git a/src/corelib/tools/qbytearraymatcher.cpp b/src/corelib/tools/qbytearraymatcher.cpp index bcd6a56aad..d030192117 100644 --- a/src/corelib/tools/qbytearraymatcher.cpp +++ b/src/corelib/tools/qbytearraymatcher.cpp @@ -61,7 +61,7 @@ static inline int bm_find(const uchar *cc, int l, int index, const uchar *puc, u return index > l ? -1 : index; const uint pl_minus_one = pl - 1; - register const uchar *current = cc + index + pl_minus_one; + const uchar *current = cc + index + pl_minus_one; const uchar *end = cc + l; while (current < end) { uint skip = skiptable[*current]; diff --git a/src/corelib/tools/qlocale_tools.cpp b/src/corelib/tools/qlocale_tools.cpp index 24ca628b5a..6b716b356f 100644 --- a/src/corelib/tools/qlocale_tools.cpp +++ b/src/corelib/tools/qlocale_tools.cpp @@ -300,13 +300,13 @@ bool removeGroupSeparators(QLocalePrivate::CharBuff *num) * Ignores `locale' stuff. Assumes that the upper and lower case * alphabets and digits are each contiguous. */ -qulonglong qstrtoull(const char *nptr, const char **endptr, register int base, bool *ok) +qulonglong qstrtoull(const char *nptr, const char **endptr, int base, bool *ok) { - register const char *s = nptr; - register qulonglong acc; - register unsigned char c; - register qulonglong qbase, cutoff; - register int any, cutlim; + const char *s = nptr; + qulonglong acc; + unsigned char c; + qulonglong qbase, cutoff; + int any, cutlim; if (ok != 0) *ok = true; @@ -381,13 +381,13 @@ qulonglong qstrtoull(const char *nptr, const char **endptr, register int base, b * Ignores `locale' stuff. Assumes that the upper and lower case * alphabets and digits are each contiguous. */ -qlonglong qstrtoll(const char *nptr, const char **endptr, register int base, bool *ok) +qlonglong qstrtoll(const char *nptr, const char **endptr, int base, bool *ok) { - register const char *s; - register qulonglong acc; - register unsigned char c; - register qulonglong qbase, cutoff; - register int neg, any, cutlim; + const char *s; + qulonglong acc; + unsigned char c; + qulonglong qbase, cutoff; + int neg, any, cutlim; /* * Skip white space and pick up leading +/- sign if any. diff --git a/src/corelib/tools/qlocale_tools_p.h b/src/corelib/tools/qlocale_tools_p.h index 3c4e9b5bd5..cb47bfcb5e 100644 --- a/src/corelib/tools/qlocale_tools_p.h +++ b/src/corelib/tools/qlocale_tools_p.h @@ -110,8 +110,8 @@ bool removeGroupSeparators(QLocalePrivate::CharBuff *num); Q_CORE_EXPORT char *qdtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve, char **digits_str); Q_CORE_EXPORT double qstrtod(const char *s00, char const **se, bool *ok); -qlonglong qstrtoll(const char *nptr, const char **endptr, register int base, bool *ok); -qulonglong qstrtoull(const char *nptr, const char **endptr, register int base, bool *ok); +qlonglong qstrtoll(const char *nptr, const char **endptr, int base, bool *ok); +qulonglong qstrtoull(const char *nptr, const char **endptr, int base, bool *ok); QT_END_NAMESPACE diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h index 5e30cf3ecb..1423449a69 100644 --- a/src/corelib/tools/qsharedpointer_impl.h +++ b/src/corelib/tools/qsharedpointer_impl.h @@ -506,7 +506,7 @@ public: if (o) { // increase the strongref, but never up from zero // or less (-1 is used by QWeakPointer on untracked QObject) - register int tmp = o->strongref.load(); + int tmp = o->strongref.load(); while (tmp > 0) { // try to increment from "tmp" to "tmp + 1" if (o->strongref.testAndSetRelaxed(tmp, tmp + 1)) @@ -801,7 +801,7 @@ namespace QtSharedPointer { template Q_INLINE_TEMPLATE QSharedPointer qSharedPointerCast(const QSharedPointer &src) { - register X *ptr = static_cast(src.data()); // if you get an error in this line, the cast is invalid + X *ptr = static_cast(src.data()); // if you get an error in this line, the cast is invalid return QtSharedPointer::copyAndSetPointer(ptr, src); } template @@ -813,7 +813,7 @@ Q_INLINE_TEMPLATE QSharedPointer qSharedPointerCast(const QWeakPointer &sr template Q_INLINE_TEMPLATE QSharedPointer qSharedPointerDynamicCast(const QSharedPointer &src) { - register X *ptr = dynamic_cast(src.data()); // if you get an error in this line, the cast is invalid + X *ptr = dynamic_cast(src.data()); // if you get an error in this line, the cast is invalid if (!ptr) return QSharedPointer(); return QtSharedPointer::copyAndSetPointer(ptr, src); @@ -827,7 +827,7 @@ Q_INLINE_TEMPLATE QSharedPointer qSharedPointerDynamicCast(const QWeakPointer template Q_INLINE_TEMPLATE QSharedPointer qSharedPointerConstCast(const QSharedPointer &src) { - register X *ptr = const_cast(src.data()); // if you get an error in this line, the cast is invalid + X *ptr = const_cast(src.data()); // if you get an error in this line, the cast is invalid return QtSharedPointer::copyAndSetPointer(ptr, src); } template @@ -847,7 +847,7 @@ QWeakPointer qWeakPointerCast(const QSharedPointer &src) template Q_INLINE_TEMPLATE QSharedPointer qSharedPointerObjectCast(const QSharedPointer &src) { - register X *ptr = qobject_cast(src.data()); + X *ptr = qobject_cast(src.data()); return QtSharedPointer::copyAndSetPointer(ptr, src); } template diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 54b1a084b2..de09e5bbe0 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -266,7 +266,7 @@ static bool qMemEquals(const quint16 *a, const quint16 *b, int length) if (a == b || !length) return true; - register union { + union { const quint16 *w; const quint32 *d; quintptr value; @@ -291,7 +291,7 @@ static bool qMemEquals(const quint16 *a, const quint16 *b, int length) // both addresses are 4-bytes aligned // do a fast 32-bit comparison - register const quint32 *e = sa.d + (length >> 1); + const quint32 *e = sa.d + (length >> 1); for ( ; sa.d != e; ++sa.d, ++sb.d) { if (*sa.d != *sb.d) return false; @@ -301,7 +301,7 @@ static bool qMemEquals(const quint16 *a, const quint16 *b, int length) return (length & 1) ? *sa.w == *sb.w : true; } else { // one of the addresses isn't 4-byte aligned but the other is - register const quint16 *e = sa.w + length; + const quint16 *e = sa.w + length; for ( ; sa.w != e; ++sa.w, ++sb.w) { if (*sa.w != *sb.w) return false; @@ -4908,8 +4908,8 @@ int QString::compare_helper(const QChar *data1, int length1, const QChar *data2, { if (cs == Qt::CaseSensitive) return ucstrcmp(data1, length1, data2, length2); - register const ushort *s1 = reinterpret_cast(data1); - register const ushort *s2 = reinterpret_cast(data2); + const ushort *s1 = reinterpret_cast(data1); + const ushort *s2 = reinterpret_cast(data2); return ucstricmp(s1, s1 + length1, s2, s2 + length2); } diff --git a/src/corelib/tools/qstringmatcher.cpp b/src/corelib/tools/qstringmatcher.cpp index d54e9c7ba7..1b8a40ef2f 100644 --- a/src/corelib/tools/qstringmatcher.cpp +++ b/src/corelib/tools/qstringmatcher.cpp @@ -69,7 +69,7 @@ static inline int bm_find(const ushort *uc, uint l, int index, const ushort *puc return index > (int)l ? -1 : index; const uint pl_minus_one = pl - 1; - register const ushort *current = uc + index + pl_minus_one; + const ushort *current = uc + index + pl_minus_one; const ushort *end = uc + l; if (cs == Qt::CaseSensitive) { while (current < end) { diff --git a/src/dbus/qdbusutil.cpp b/src/dbus/qdbusutil.cpp index df5e272a1e..c90490df7f 100644 --- a/src/dbus/qdbusutil.cpp +++ b/src/dbus/qdbusutil.cpp @@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE static inline bool isValidCharacterNoDash(QChar c) { - register ushort u = c.unicode(); + ushort u = c.unicode(); return (u >= 'a' && u <= 'z') || (u >= 'A' && u <= 'Z') || (u >= '0' && u <= '9') @@ -63,7 +63,7 @@ static inline bool isValidCharacterNoDash(QChar c) static inline bool isValidCharacter(QChar c) { - register ushort u = c.unicode(); + ushort u = c.unicode(); return (u >= 'a' && u <= 'z') || (u >= 'A' && u <= 'Z') || (u >= '0' && u <= '9') @@ -72,7 +72,7 @@ static inline bool isValidCharacter(QChar c) static inline bool isValidNumber(QChar c) { - register ushort u = c.unicode(); + ushort u = c.unicode(); return (u >= '0' && u <= '9'); } @@ -259,7 +259,7 @@ static bool isFixedType(int c) // returns NULL if it isn't valid. static const char *validateSingleType(const char *signature) { - register char c = *signature; + char c = *signature; if (c == DBUS_TYPE_INVALID) return 0; diff --git a/src/gui/image/qbmphandler.cpp b/src/gui/image/qbmphandler.cpp index 6abde5e420..cb4e45f1d0 100644 --- a/src/gui/image/qbmphandler.cpp +++ b/src/gui/image/qbmphandler.cpp @@ -53,7 +53,7 @@ static void swapPixel01(QImage *image) // 1-bpp: swap 0 and 1 pixels { int i; if (image->depth() == 1 && image->colorCount() == 2) { - register uint *p = (uint *)image->bits(); + uint *p = (uint *)image->bits(); int nbytes = image->byteCount(); for (i=0; igetChar((char *)&b)) @@ -440,7 +440,7 @@ static bool read_dib_body(QDataStream &s, const BMP_INFOHDR &bi, int offset, int while (--h >= 0) { if (d->read((char*)buf,buflen) != buflen) break; - register uchar *p = data + h*bpl; + uchar *p = data + h*bpl; uchar *b = buf; for (int i=0; i> 4; @@ -457,7 +457,7 @@ static bool read_dib_body(QDataStream &s, const BMP_INFOHDR &bi, int offset, int if (comp == BMP_RLE8) { // run length compression int x=0, y=0; quint8 b; - register uchar *p = data + (h-1)*bpl; + uchar *p = data + (h-1)*bpl; const uchar *endp = p + w; while (y < h) { if (!d->getChar((char *)&b)) @@ -520,7 +520,7 @@ static bool read_dib_body(QDataStream &s, const BMP_INFOHDR &bi, int offset, int } else if (nbits == 16 || nbits == 24 || nbits == 32) { // 16,24,32 bit BMP image - register QRgb *p; + QRgb *p; QRgb *end; uchar *buf24 = new uchar[bpl]; int bpl24 = ((w*nbits+31)/32)*4; @@ -632,7 +632,7 @@ bool qt_write_dib(QDataStream &s, QImage image) uchar *buf = new uchar[bpl_bmp]; uchar *b, *end; - register const uchar *p; + const uchar *p; memset(buf, 0, bpl_bmp); for (y=image.height()-1; y>=0; y--) { // write the image bits diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 0efb9c2646..98f3aeeeb9 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -2270,7 +2270,7 @@ static void dither_to_Mono(QImageData *dst, const QImageData *src, int *b1, *b2; int wbytes = w * (d/8); - register const uchar *p = src->data; + const uchar *p = src->data; const uchar *end = p + wbytes; b2 = line2; if (use_gray) { // 8 bit image @@ -2830,7 +2830,7 @@ static void convert_Mono_to_X32(QImageData *dest, const QImageData *src, Qt::Ima uchar *dest_data = dest->data; if (src->format == QImage::Format_Mono) { for (int y = 0; y < dest->height; y++) { - register uint *p = (uint *)dest_data; + uint *p = (uint *)dest_data; for (int x = 0; x < dest->width; x++) *p++ = colorTable.at((src_data[x>>3] >> (7 - (x & 7))) & 1); @@ -2839,7 +2839,7 @@ static void convert_Mono_to_X32(QImageData *dest, const QImageData *src, Qt::Ima } } else { for (int y = 0; y < dest->height; y++) { - register uint *p = (uint *)dest_data; + uint *p = (uint *)dest_data; for (int x = 0; x < dest->width; x++) *p++ = colorTable.at((src_data[x>>3] >> (x & 7)) & 1); @@ -2873,7 +2873,7 @@ static void convert_Mono_to_Indexed8(QImageData *dest, const QImageData *src, Qt uchar *dest_data = dest->data; if (src->format == QImage::Format_Mono) { for (int y = 0; y < dest->height; y++) { - register uchar *p = dest_data; + uchar *p = dest_data; for (int x = 0; x < dest->width; x++) *p++ = (src_data[x>>3] >> (7 - (x & 7))) & 1; src_data += src->bytes_per_line; @@ -2881,7 +2881,7 @@ static void convert_Mono_to_Indexed8(QImageData *dest, const QImageData *src, Qt } } else { for (int y = 0; y < dest->height; y++) { - register uchar *p = dest_data; + uchar *p = dest_data; for (int x = 0; x < dest->width; x++) *p++ = (src_data[x>>3] >> (x & 7)) & 1; src_data += src->bytes_per_line; diff --git a/src/gui/image/qppmhandler.cpp b/src/gui/image/qppmhandler.cpp index e425eca521..6fc41df77c 100644 --- a/src/gui/image/qppmhandler.cpp +++ b/src/gui/image/qppmhandler.cpp @@ -188,7 +188,7 @@ static bool read_pbm_body(QIODevice *device, char type, int w, int h, int mcc, Q } } } else { // read ascii data - register uchar *p; + uchar *p; int n; for (y=0; yscanLine(y); diff --git a/src/gui/image/qxbmhandler.cpp b/src/gui/image/qxbmhandler.cpp index 498f6ce767..aceb6623ea 100644 --- a/src/gui/image/qxbmhandler.cpp +++ b/src/gui/image/qxbmhandler.cpp @@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE X bitmap image read/write functions *****************************************************************************/ -static inline int hex2byte(register char *p) +static inline int hex2byte(char *p) { return ((isdigit((uchar) *p) ? *p - '0' : toupper((uchar) *p) - 'A' + 10) << 4) | (isdigit((uchar) *(p+1)) ? *(p+1) - '0' : toupper((uchar) *(p+1)) - 'A' + 10); @@ -215,7 +215,7 @@ static bool write_xbm_image(const QImage &sourceImage, QIODevice *device, const } } int bcnt = 0; - register char *p = buf; + char *p = buf; int bpl = (w+7)/8; for (int y = 0; y < h; ++y) { uchar *b = image.scanLine(y); diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 2ebba967ed..de0ab53c1b 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -1121,13 +1121,13 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c fx &= fixed_scale - 1; Q_ASSERT((fx >> 16) == 0); while (b < end) { - register int x1 = (fx >> 16); - register int x2 = x1 + 1; + int x1 = (fx >> 16); + int x2 = x1 + 1; Q_ASSERT(x1 >= 0); Q_ASSERT(x2 < count); - register int distx = (fx & 0x0000ffff) >> 8; - register int idistx = 256 - distx; + int distx = (fx & 0x0000ffff) >> 8; + int idistx = 256 - distx; int rb = ((intermediate_buffer[0][x1] * idistx + intermediate_buffer[0][x2] * distx) >> 8) & 0xff00ff; int ag = (intermediate_buffer[1][x1] * idistx + intermediate_buffer[1][x2] * distx) & 0xff00ff00; *b = rb | ag; @@ -1533,13 +1533,13 @@ static const uint *QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Oper fx &= fixed_scale - 1; Q_ASSERT((fx >> 16) == 0); for (int i = 0; i < length; ++i) { - register int x1 = (fx >> 16); - register int x2 = x1 + 1; + int x1 = (fx >> 16); + int x2 = x1 + 1; Q_ASSERT(x1 >= 0); Q_ASSERT(x2 < count); - register int distx = (fx & 0x0000ffff) >> 8; - register int idistx = 256 - distx; + int distx = (fx & 0x0000ffff) >> 8; + int idistx = 256 - distx; int rb = ((buf1[x1] * idistx + buf1[x2] * distx) >> 8) & 0xff00ff; int ag = (buf2[x1] * idistx + buf2[x2] * distx) & 0xff00ff00; buffer[i] = rb | ag; diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h index 5d9867012f..0b8a41c904 100644 --- a/src/gui/painting/qdrawhelper_p.h +++ b/src/gui/painting/qdrawhelper_p.h @@ -759,7 +759,7 @@ do { \ /* Duff's device */ \ uint *_d = (uint*)(dest) + length; \ const uint *_s = (uint*)(src) + length; \ - register int n = ((length) + 7) / 8; \ + int n = ((length) + 7) / 8; \ switch ((length) & 0x07) \ { \ case 0: do { *--_d = *--_s; \ @@ -779,7 +779,7 @@ do { \ /* Duff's device */ \ ushort *_d = (ushort*)(dest); \ const ushort *_s = (ushort*)(src); \ - register int n = ((length) + 7) / 8; \ + int n = ((length) + 7) / 8; \ switch ((length) & 0x07) \ { \ case 0: do { *_d++ = *_s++; \ diff --git a/src/gui/painting/qpolygon.cpp b/src/gui/painting/qpolygon.cpp index 5398387bcf..34215b53b0 100644 --- a/src/gui/painting/qpolygon.cpp +++ b/src/gui/painting/qpolygon.cpp @@ -218,8 +218,8 @@ void QPolygon::translate(int dx, int dy) if (dx == 0 && dy == 0) return; - register QPoint *p = data(); - register int i = size(); + QPoint *p = data(); + int i = size(); QPoint pt(dx, dy); while (i--) { *p += pt; @@ -447,7 +447,7 @@ QRect QPolygon::boundingRect() const { if (isEmpty()) return QRect(0, 0, 0, 0); - register const QPoint *pd = constData(); + const QPoint *pd = constData(); int minx, maxx, miny, maxy; minx = maxx = pd->x(); miny = maxy = pd->y(); @@ -599,8 +599,8 @@ void QPolygonF::translate(const QPointF &offset) if (offset.isNull()) return; - register QPointF *p = data(); - register int i = size(); + QPointF *p = data(); + int i = size(); while (i--) { *p += offset; ++p; @@ -660,7 +660,7 @@ QRectF QPolygonF::boundingRect() const { if (isEmpty()) return QRectF(0, 0, 0, 0); - register const QPointF *pd = constData(); + const QPointF *pd = constData(); qreal minx, maxx, miny, maxy; minx = maxx = pd->x(); miny = maxy = pd->y(); diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp index ce5abdbbd9..47668c62b6 100644 --- a/src/gui/painting/qregion.cpp +++ b/src/gui/painting/qregion.cpp @@ -1585,14 +1585,14 @@ void QRegionPrivate::selfTest() const static QRegionPrivate qrp; QRegion::QRegionData QRegion::shared_empty = {Q_BASIC_ATOMIC_INITIALIZER(1), &qrp}; -typedef void (*OverlapFunc)(register QRegionPrivate &dest, register const QRect *r1, const QRect *r1End, - register const QRect *r2, const QRect *r2End, register int y1, register int y2); -typedef void (*NonOverlapFunc)(register QRegionPrivate &dest, register const QRect *r, const QRect *rEnd, - register int y1, register int y2); +typedef void (*OverlapFunc)(QRegionPrivate &dest, const QRect *r1, const QRect *r1End, + const QRect *r2, const QRect *r2End, int y1, int y2); +typedef void (*NonOverlapFunc)(QRegionPrivate &dest, const QRect *r, const QRect *rEnd, + int y1, int y2); static bool EqualRegion(const QRegionPrivate *r1, const QRegionPrivate *r2); static void UnionRegion(const QRegionPrivate *reg1, const QRegionPrivate *reg2, QRegionPrivate &dest); -static void miRegionOp(register QRegionPrivate &dest, const QRegionPrivate *reg1, const QRegionPrivate *reg2, +static void miRegionOp(QRegionPrivate &dest, const QRegionPrivate *reg1, const QRegionPrivate *reg2, OverlapFunc overlapFunc, NonOverlapFunc nonOverlap1Func, NonOverlapFunc nonOverlap2Func); @@ -1789,7 +1789,7 @@ SOFTWARE. */ /* $XFree86: xc/lib/X11/Region.c,v 1.1.1.2.2.2 1998/10/04 15:22:50 hohndel Exp $ */ -static void UnionRectWithRegion(register const QRect *rect, const QRegionPrivate *source, +static void UnionRectWithRegion(const QRect *rect, const QRegionPrivate *source, QRegionPrivate &dest) { if (rect->isEmpty()) @@ -1824,9 +1824,9 @@ static void UnionRectWithRegion(register const QRect *rect, const QRegionPrivate */ static void miSetExtents(QRegionPrivate &dest) { - register const QRect *pBox, + const QRect *pBox, *pBoxEnd; - register QRect *pExtents; + QRect *pExtents; dest.innerRect.setCoords(0, 0, -1, -1); dest.innerArea = -1; @@ -1871,11 +1871,11 @@ static void miSetExtents(QRegionPrivate &dest) added by raymond */ -static void OffsetRegion(register QRegionPrivate ®ion, register int x, register int y) +static void OffsetRegion(QRegionPrivate ®ion, int x, int y) { if (region.rects.size()) { - register QRect *pbox = region.rects.data(); - register int nbox = region.numRects; + QRect *pbox = region.rects.data(); + int nbox = region.numRects; while (nbox--) { pbox->translate(x, y); @@ -1902,12 +1902,12 @@ static void OffsetRegion(register QRegionPrivate ®ion, register int x, regist * *----------------------------------------------------------------------- */ -static void miIntersectO(register QRegionPrivate &dest, register const QRect *r1, const QRect *r1End, - register const QRect *r2, const QRect *r2End, int y1, int y2) +static void miIntersectO(QRegionPrivate &dest, const QRect *r1, const QRect *r1End, + const QRect *r2, const QRect *r2End, int y1, int y2) { - register int x1; - register int x2; - register QRect *pNextRect; + int x1; + int x2; + QRect *pNextRect; pNextRect = dest.rects.data() + dest.numRects; @@ -1967,11 +1967,11 @@ static void miIntersectO(register QRegionPrivate &dest, register const QRect *r1 * *----------------------------------------------------------------------- */ -static int miCoalesce(register QRegionPrivate &dest, int prevStart, int curStart) +static int miCoalesce(QRegionPrivate &dest, int prevStart, int curStart) { - register QRect *pPrevBox; /* Current box in previous band */ - register QRect *pCurBox; /* Current box in current band */ - register QRect *pRegEnd; /* End of region */ + QRect *pPrevBox; /* Current box in previous band */ + QRect *pCurBox; /* Current box in current band */ + QRect *pRegEnd; /* End of region */ int curNumRects; /* Number of rectangles in current band */ int prevNumRects; /* Number of rectangles in previous band */ int bandY1; /* Y1 coordinate for current band */ @@ -2096,21 +2096,21 @@ static int miCoalesce(register QRegionPrivate &dest, int prevStart, int curStart * *----------------------------------------------------------------------- */ -static void miRegionOp(register QRegionPrivate &dest, +static void miRegionOp(QRegionPrivate &dest, const QRegionPrivate *reg1, const QRegionPrivate *reg2, OverlapFunc overlapFunc, NonOverlapFunc nonOverlap1Func, NonOverlapFunc nonOverlap2Func) { - register const QRect *r1; // Pointer into first region - register const QRect *r2; // Pointer into 2d region + const QRect *r1; // Pointer into first region + const QRect *r2; // Pointer into 2d region const QRect *r1End; // End of 1st region const QRect *r2End; // End of 2d region - register int ybot; // Bottom of intersection - register int ytop; // Top of intersection + int ybot; // Bottom of intersection + int ytop; // Top of intersection int prevBand; // Index of start of previous band in dest int curBand; // Index of start of current band in dest - register const QRect *r1BandEnd; // End of current band in r1 - register const QRect *r2BandEnd; // End of current band in r2 + const QRect *r1BandEnd; // End of current band in r1 + const QRect *r2BandEnd; // End of current band in r2 int top; // Top of non-overlapping band int bot; // Bottom of non-overlapping band @@ -2312,10 +2312,10 @@ static void miRegionOp(register QRegionPrivate &dest, *----------------------------------------------------------------------- */ -static void miUnionNonO(register QRegionPrivate &dest, register const QRect *r, const QRect *rEnd, - register int y1, register int y2) +static void miUnionNonO(QRegionPrivate &dest, const QRect *r, const QRect *rEnd, + int y1, int y2) { - register QRect *pNextRect; + QRect *pNextRect; pNextRect = dest.rects.data() + dest.numRects; @@ -2348,10 +2348,10 @@ static void miUnionNonO(register QRegionPrivate &dest, register const QRect *r, *----------------------------------------------------------------------- */ -static void miUnionO(register QRegionPrivate &dest, register const QRect *r1, const QRect *r1End, - register const QRect *r2, const QRect *r2End, register int y1, register int y2) +static void miUnionO(QRegionPrivate &dest, const QRect *r1, const QRect *r1End, + const QRect *r2, const QRect *r2End, int y1, int y2) { - register QRect *pNextRect; + QRect *pNextRect; pNextRect = dest.rects.data() + dest.numRects; @@ -2437,10 +2437,10 @@ static void UnionRegion(const QRegionPrivate *reg1, const QRegionPrivate *reg2, *----------------------------------------------------------------------- */ -static void miSubtractNonO1(register QRegionPrivate &dest, register const QRect *r, - const QRect *rEnd, register int y1, register int y2) +static void miSubtractNonO1(QRegionPrivate &dest, const QRect *r, + const QRect *rEnd, int y1, int y2) { - register QRect *pNextRect; + QRect *pNextRect; pNextRect = dest.rects.data() + dest.numRects; @@ -2471,11 +2471,11 @@ static void miSubtractNonO1(register QRegionPrivate &dest, register const QRect *----------------------------------------------------------------------- */ -static void miSubtractO(register QRegionPrivate &dest, register const QRect *r1, const QRect *r1End, - register const QRect *r2, const QRect *r2End, register int y1, register int y2) +static void miSubtractO(QRegionPrivate &dest, const QRect *r1, const QRect *r1End, + const QRect *r2, const QRect *r2End, int y1, int y2) { - register QRect *pNextRect; - register int x1; + QRect *pNextRect; + int x1; x1 = r1->left(); @@ -2573,7 +2573,7 @@ static void miSubtractO(register QRegionPrivate &dest, register const QRect *r1, */ static void SubtractRegion(QRegionPrivate *regM, QRegionPrivate *regS, - register QRegionPrivate &dest) + QRegionPrivate &dest) { Q_ASSERT(!isEmptyHelper(regM)); Q_ASSERT(!isEmptyHelper(regS)); @@ -2668,12 +2668,12 @@ static bool PointInRegion(QRegionPrivate *pRegion, int x, int y) return false; } -static bool RectInRegion(register QRegionPrivate *region, int rx, int ry, uint rwidth, uint rheight) +static bool RectInRegion(QRegionPrivate *region, int rx, int ry, uint rwidth, uint rheight) { - register const QRect *pbox; - register const QRect *pboxEnd; + const QRect *pbox; + const QRect *pboxEnd; QRect rect(rx, ry, rwidth, rheight); - register QRect *prect = ▭ + QRect *prect = ▭ int partIn, partOut; if (!region || region->numRects == 0 || !EXTENTCHECK(®ion->extents, prect)) @@ -3094,8 +3094,8 @@ SOFTWARE. static void InsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, int scanline, ScanLineListBlock **SLLBlock, int *iSLLBlock) { - register EdgeTableEntry *start, *prev; - register ScanLineList *pSLL, *pPrevSLL; + EdgeTableEntry *start, *prev; + ScanLineList *pSLL, *pPrevSLL; ScanLineListBlock *tmpSLLBlock; /* @@ -3172,11 +3172,11 @@ static void InsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, int scanline, * */ -static void CreateETandAET(register int count, register const QPoint *pts, - EdgeTable *ET, EdgeTableEntry *AET, register EdgeTableEntry *pETEs, +static void CreateETandAET(int count, const QPoint *pts, + EdgeTable *ET, EdgeTableEntry *AET, EdgeTableEntry *pETEs, ScanLineListBlock *pSLLBlock) { - register const QPoint *top, + const QPoint *top, *bottom, *PrevPt, *CurrPt; @@ -3259,10 +3259,10 @@ static void CreateETandAET(register int count, register const QPoint *pts, * */ -static void loadAET(register EdgeTableEntry *AET, register EdgeTableEntry *ETEs) +static void loadAET(EdgeTableEntry *AET, EdgeTableEntry *ETEs) { - register EdgeTableEntry *pPrevAET; - register EdgeTableEntry *tmp; + EdgeTableEntry *pPrevAET; + EdgeTableEntry *tmp; pPrevAET = AET; AET = AET->next; @@ -3303,11 +3303,11 @@ static void loadAET(register EdgeTableEntry *AET, register EdgeTableEntry *ETEs) * V-------------------> V---> ... * */ -static void computeWAET(register EdgeTableEntry *AET) +static void computeWAET(EdgeTableEntry *AET) { - register EdgeTableEntry *pWETE; - register int inside = 1; - register int isInside = 0; + EdgeTableEntry *pWETE; + int inside = 1; + int isInside = 0; AET->nextWETE = 0; pWETE = AET; @@ -3337,12 +3337,12 @@ static void computeWAET(register EdgeTableEntry *AET) * */ -static int InsertionSort(register EdgeTableEntry *AET) +static int InsertionSort(EdgeTableEntry *AET) { - register EdgeTableEntry *pETEchase; - register EdgeTableEntry *pETEinsert; - register EdgeTableEntry *pETEchaseBackTMP; - register int changed = 0; + EdgeTableEntry *pETEchase; + EdgeTableEntry *pETEinsert; + EdgeTableEntry *pETEchaseBackTMP; + int changed = 0; AET = AET->next; while (AET) { @@ -3370,9 +3370,9 @@ static int InsertionSort(register EdgeTableEntry *AET) /* * Clean up our act. */ -static void FreeStorage(register ScanLineListBlock *pSLLBlock) +static void FreeStorage(ScanLineListBlock *pSLLBlock) { - register ScanLineListBlock *tmpSLLBlock; + ScanLineListBlock *tmpSLLBlock; while (pSLLBlock) { tmpSLLBlock = pSLLBlock->next; @@ -3436,7 +3436,7 @@ static inline void flushRow(const QRegionSpan *spans, int y, int numSpans, QRegi * stack by the calling procedure. * */ -static void PtsToRegion(register int numFullPtBlocks, register int iCurPtBlock, +static void PtsToRegion(int numFullPtBlocks, int iCurPtBlock, POINTBLOCK *FirstPtBlock, QRegionPrivate *reg) { int lastRow = 0; @@ -3512,12 +3512,12 @@ static QRegionPrivate *PolygonRegion(const QPoint *Pts, int Count, int rule) //int rule; /* winding rule */ { QRegionPrivate *region; - register EdgeTableEntry *pAET; /* Active Edge Table */ - register int y; /* current scanline */ - register int iPts = 0; /* number of pts in buffer */ - register EdgeTableEntry *pWETE; /* Winding Edge Table Entry*/ - register ScanLineList *pSLL; /* current scanLineList */ - register QPoint *pts; /* output buffer */ + EdgeTableEntry *pAET; /* Active Edge Table */ + int y; /* current scanline */ + int iPts = 0; /* number of pts in buffer */ + EdgeTableEntry *pWETE; /* Winding Edge Table Entry*/ + ScanLineList *pSLL; /* current scanLineList */ + QPoint *pts; /* output buffer */ EdgeTableEntry *pPrevAET; /* ptr to previous AET */ EdgeTable ET; /* header node for ET */ EdgeTableEntry AET; /* header node for AET */ diff --git a/src/network/access/qnetworkcookie_p.h b/src/network/access/qnetworkcookie_p.h index 2c099ac922..6bf8a059a4 100644 --- a/src/network/access/qnetworkcookie_p.h +++ b/src/network/access/qnetworkcookie_p.h @@ -73,7 +73,7 @@ public: bool httpOnly; }; -static inline bool isLWS(register char c) +static inline bool isLWS(char c) { return c == ' ' || c == '\t' || c == '\r' || c == '\n'; } diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp index c04421e5c7..c7d3846465 100644 --- a/src/network/access/qnetworkreplyhttpimpl.cpp +++ b/src/network/access/qnetworkreplyhttpimpl.cpp @@ -67,7 +67,7 @@ QT_BEGIN_NAMESPACE class QNetworkProxy; -static inline bool isSeparator(register char c) +static inline bool isSeparator(char c) { static const char separators[] = "()<>@,;:\\\"/[]?={}"; return isLWS(c) || strchr(separators, c) != 0; @@ -123,7 +123,7 @@ static QHash parseHttpOptionHeader(const QByteArray &hea // quoted-pair = "\" CHAR ++pos; while (pos < header.length()) { - register char c = header.at(pos); + char c = header.at(pos); if (c == '"') { // end of quoted text break; @@ -141,7 +141,7 @@ static QHash parseHttpOptionHeader(const QByteArray &hea } else { // case: token while (pos < header.length()) { - register char c = header.at(pos); + char c = header.at(pos); if (isSeparator(c)) break; value += c; diff --git a/src/network/socket/qnet_unix_p.h b/src/network/socket/qnet_unix_p.h index 5e6a1cac54..80e23075d3 100644 --- a/src/network/socket/qnet_unix_p.h +++ b/src/network/socket/qnet_unix_p.h @@ -84,7 +84,7 @@ static inline int qt_safe_socket(int domain, int type, int protocol, int flags = { Q_ASSERT((flags & ~O_NONBLOCK) == 0); - register int fd; + int fd; #if defined(SOCK_CLOEXEC) && defined(SOCK_NONBLOCK) int newtype = type | SOCK_CLOEXEC; if (flags & O_NONBLOCK) @@ -112,7 +112,7 @@ static inline int qt_safe_accept(int s, struct sockaddr *addr, QT_SOCKLEN_T *add { Q_ASSERT((flags & ~O_NONBLOCK) == 0); - register int fd; + int fd; #if QT_UNIX_SUPPORTS_THREADSAFE_CLOEXEC && defined(SOCK_CLOEXEC) && defined(SOCK_NONBLOCK) // use accept4 int sockflags = SOCK_CLOEXEC; @@ -144,7 +144,7 @@ static inline int qt_safe_listen(int s, int backlog) static inline int qt_safe_connect(int sockfd, const struct sockaddr *addr, QT_SOCKLEN_T addrlen) { - register int ret; + int ret; // Solaris e.g. expects a non-const 2nd parameter EINTR_LOOP(ret, QT_SOCKET_CONNECT(sockfd, const_cast(addr), addrlen)); return ret; @@ -192,7 +192,7 @@ static inline int qt_safe_sendto(int sockfd, const void *buf, size_t len, int fl qt_ignore_sigpipe(); #endif - register int ret; + int ret; #ifdef Q_OS_VXWORKS EINTR_LOOP(ret, ::sendto(sockfd, (char *) buf, len, flags, (struct sockaddr *) to, tolen)); #else diff --git a/src/plugins/imageformats/ico/qicohandler.cpp b/src/plugins/imageformats/ico/qicohandler.cpp index a45c3875bc..b1a674365d 100644 --- a/src/plugins/imageformats/ico/qicohandler.cpp +++ b/src/plugins/imageformats/ico/qicohandler.cpp @@ -448,7 +448,7 @@ void ICOReader::read4BitBMP(QImage & image) image = QImage(); break; } - register uchar *p = image.scanLine(h); + uchar *p = image.scanLine(h); uchar *b = buf; for (int i=0; i> 4; @@ -487,7 +487,7 @@ void ICOReader::read16_24_32BMP(QImage & image) { if (iod) { int h = icoAttrib.h; - register QRgb *p; + QRgb *p; QRgb *end; uchar *buf = new uchar[image.bytesPerLine()]; int bpl = ((icoAttrib.w*icoAttrib.nbits+31)/32)*4; diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp index f6163ed8c7..47c136991a 100644 --- a/src/plugins/platforms/windows/qwindowskeymapper.cpp +++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp @@ -664,7 +664,7 @@ void QWindowsKeyMapper::updatePossibleKeyCodes(unsigned char *kbdBuffer, quint32 bool QWindowsKeyMapper::isADeadKey(unsigned int vk_key, unsigned int modifiers) { if ((vk_key < NumKeyboardLayoutItems) && keyLayout[vk_key].exists) { - for (register size_t i = 0; i < NumMods; ++i) { + for (size_t i = 0; i < NumMods; ++i) { if (uint(ModsTbl[i]) == modifiers) return bool(keyLayout[vk_key].deadkeys & 1<constBegin(); it != mySet->constEnd(); ++it) { - register QWidget *w = *it; + QWidget *w = *it; if (!w->parent()) // window w->destroy(true, true); } @@ -1044,7 +1044,7 @@ void QApplication::setStyle(QStyle *style) if (QApplicationPrivate::app_style) { if (QApplicationPrivate::is_app_running && !QApplicationPrivate::is_app_closing) { for (QWidgetList::ConstIterator it = all.constBegin(); it != all.constEnd(); ++it) { - register QWidget *w = *it; + QWidget *w = *it; if (!(w->windowType() == Qt::Desktop) && // except desktop w->testAttribute(Qt::WA_WState_Polished)) { // has been polished QApplicationPrivate::app_style->unpolish(w); @@ -1086,7 +1086,7 @@ void QApplication::setStyle(QStyle *style) // re-polish existing widgets if necessary if (QApplicationPrivate::is_app_running && !QApplicationPrivate::is_app_closing) { for (QWidgetList::ConstIterator it1 = all.constBegin(); it1 != all.constEnd(); ++it1) { - register QWidget *w = *it1; + QWidget *w = *it1; if (w->windowType() != Qt::Desktop && w->testAttribute(Qt::WA_WState_Polished)) { if (w->style() == QApplicationPrivate::app_style) QApplicationPrivate::app_style->polish(w); // repolish @@ -1098,7 +1098,7 @@ void QApplication::setStyle(QStyle *style) } for (QWidgetList::ConstIterator it2 = all.constBegin(); it2 != all.constEnd(); ++it2) { - register QWidget *w = *it2; + QWidget *w = *it2; if (w->windowType() != Qt::Desktop && !w->testAttribute(Qt::WA_SetStyle)) { QEvent e(QEvent::StyleChange); QApplication::sendEvent(w, &e); @@ -1328,7 +1328,7 @@ void QApplicationPrivate::setPalette_helper(const QPalette &palette, const char* QWidgetList wids = QApplication::allWidgets(); for (QWidgetList::ConstIterator it = wids.constBegin(); it != wids.constEnd(); ++it) { - register QWidget *w = *it; + QWidget *w = *it; if (all || (!className && w->isWindow()) || w->inherits(className)) // matching class QApplication::sendEvent(w, &e); } @@ -1510,7 +1510,7 @@ void QApplication::setFont(const QFont &font, const char *className) QWidgetList wids = QApplication::allWidgets(); for (QWidgetList::ConstIterator it = wids.constBegin(); it != wids.constEnd(); ++it) { - register QWidget *w = *it; + QWidget *w = *it; if (all || (!className && w->isWindow()) || w->inherits(className)) // matching class sendEvent(w, &e); } @@ -1580,7 +1580,7 @@ void QApplication::setWindowIcon(const QIcon &icon) QEvent e(QEvent::ApplicationWindowIconChange); QWidgetList all = QApplication::allWidgets(); for (QWidgetList::ConstIterator it = all.constBegin(); it != all.constEnd(); ++it) { - register QWidget *w = *it; + QWidget *w = *it; if (w->isWindow()) sendEvent(w, &e); } @@ -2962,7 +2962,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e) && mouse->type() == QEvent::MouseMove && mouse->buttons() == 0) { // but still send them through all application event filters (normally done by notify_helper) for (int i = 0; d->extraData && i < d->extraData->eventFilters.size(); ++i) { - register QObject *obj = d->extraData->eventFilters.at(i); + QObject *obj = d->extraData->eventFilters.at(i); if (!obj) continue; if (obj->d_func()->threadData != w->d_func()->threadData) { diff --git a/src/widgets/kernel/qwhatsthis.cpp b/src/widgets/kernel/qwhatsthis.cpp index b96bd024cb..661317d21a 100644 --- a/src/widgets/kernel/qwhatsthis.cpp +++ b/src/widgets/kernel/qwhatsthis.cpp @@ -380,7 +380,7 @@ void QWhatsThisPrivate::notifyToplevels(QEvent *e) { QWidgetList toplevels = QApplication::topLevelWidgets(); for (int i = 0; i < toplevels.count(); ++i) { - register QWidget *w = toplevels.at(i); + QWidget *w = toplevels.at(i); QApplication::sendEvent(w, e); } } diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp index 31cf329262..3b3c27f6cb 100644 --- a/src/widgets/styles/qwindowsxpstyle.cpp +++ b/src/widgets/styles/qwindowsxpstyle.cpp @@ -582,7 +582,7 @@ bool QWindowsXPStylePrivate::hasAlphaChannel(const QRect &rect) int firstAlpha = -1; for (int y = startY; y < h/2; ++y) { - register DWORD *buffer = (DWORD*)bufferPixels + (y * bufferW); + DWORD *buffer = (DWORD*)bufferPixels + (y * bufferW); for (int x = startX; x < w; ++x, ++buffer) { int alpha = (*buffer) >> 24; if (firstAlpha == -1) @@ -611,8 +611,8 @@ bool QWindowsXPStylePrivate::fixAlphaChannel(const QRect &rect) bool hasFixedAlphaValue = false; for (int y = startY; y < h; ++y) { - register DWORD *buffer = (DWORD*)bufferPixels + (y * bufferW); - for (register int x = startX; x < w; ++x, ++buffer) { + DWORD *buffer = (DWORD*)bufferPixels + (y * bufferW); + for (int x = startX; x < w; ++x, ++buffer) { uint pixel = *buffer; int alpha = qAlpha(pixel); if (qRed(pixel) > alpha || qGreen(pixel) > alpha || qBlue(pixel) > alpha) { @@ -643,13 +643,13 @@ bool QWindowsXPStylePrivate::swapAlphaChannel(const QRect &rect, bool allPixels) // Flip the alphas, so that 255-alpha pixels are 0, and 0-alpha are 255. for (int y = startY; y < h; ++y) { - register DWORD *buffer = (DWORD*)bufferPixels + (y * bufferW); - for (register int x = startX; x < w; ++x, ++buffer) { + DWORD *buffer = (DWORD*)bufferPixels + (y * bufferW); + for (int x = startX; x < w; ++x, ++buffer) { if (allPixels) { *buffer |= 0xFF000000; continue; } - register unsigned int alphaValue = (*buffer) & 0xFF000000; + unsigned int alphaValue = (*buffer) & 0xFF000000; if (alphaValue == 0xFF000000) { *buffer = 0; valueChange = true; diff --git a/src/widgets/widgets/qlcdnumber.cpp b/src/widgets/widgets/qlcdnumber.cpp index 3ba9ad9ba3..5104171fb1 100644 --- a/src/widgets/widgets/qlcdnumber.cpp +++ b/src/widgets/widgets/qlcdnumber.cpp @@ -429,7 +429,7 @@ void QLCDNumber::setDigitCount(int numDigits) bool doDisplay = d->ndigits == 0; if (numDigits == d->ndigits) // no change return; - register int i; + int i; int dif; if (numDigits > d->ndigits) { // expand dif = numDigits - d->ndigits; -- cgit v1.2.3 From 20d667983b5d0ec434b03a68b42f610338877fe8 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 11 Jun 2013 17:52:45 +0200 Subject: QMacStyle: enable scroll style changes for non-QScrollBars Task-number: QTBUG-31537 Change-Id: Iee2148609df5cb2c121da4088bcd79f26c2eedc4 Reviewed-by: Gabriel de Dietrich --- src/widgets/styles/qmacstyle_mac.mm | 18 +++++++++++++++--- src/widgets/styles/qmacstyle_mac_p_p.h | 2 ++ 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index a8fba4fb68..3daa696155 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -119,9 +119,12 @@ QMacStylePrivate *mPrivate; { Q_UNUSED(notification); QEvent event(QEvent::StyleChange); - foreach (QWidget *widget, QApplication::allWidgets()) { - if (QScrollBar *scrollBar = qobject_cast(widget)) - QCoreApplication::sendEvent(scrollBar, &event); + QMutableSetIterator > it(QMacStylePrivate::scrollBars); + while (it.hasNext()) { + if (!it.next()) + it.remove(); + else + QCoreApplication::sendEvent(it.value(), &event); } } @end @@ -142,6 +145,13 @@ const int QMacStylePrivate::PushButtonContentPadding = 6; const qreal QMacStylePrivate::ScrollBarFadeOutDuration = 200.0; const qreal QMacStylePrivate::ScrollBarFadeOutDelay = 450.0; +QSet > QMacStylePrivate::scrollBars; + +static uint qHash(const QPointer &ptr) +{ + return qHash(ptr.data()); +} + // These colors specify the titlebar gradient colors on // Leopard. Ideally we should get them from the system. static const QColor titlebarGradientActiveBegin(220, 220, 220); @@ -4934,6 +4944,8 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex // no longer possible to move it, second the up/down buttons are removed when // there is not enough space for them. if (cc == CC_ScrollBar) { + if (opt && opt->styleObject && !QMacStylePrivate::scrollBars.contains(opt->styleObject)) + QMacStylePrivate::scrollBars.insert(QPointer(opt->styleObject)); const int scrollBarLength = (slider->orientation == Qt::Horizontal) ? slider->rect.width() : slider->rect.height(); const QMacStyle::WidgetSizePolicy sizePolicy = widgetSizePolicy(widget, opt); diff --git a/src/widgets/styles/qmacstyle_mac_p_p.h b/src/widgets/styles/qmacstyle_mac_p_p.h index c424ff0c3c..bf42087fcb 100644 --- a/src/widgets/styles/qmacstyle_mac_p_p.h +++ b/src/widgets/styles/qmacstyle_mac_p_p.h @@ -93,6 +93,7 @@ #include #include #include +#include #include #include @@ -197,6 +198,7 @@ public: mutable QPointer pressedButton; mutable QPointer defaultButton; mutable QPointer autoDefaultButton; + static QSet > scrollBars; struct ButtonState { int frame; -- cgit v1.2.3 From ae5b0132336b4b944b18f4e4717eb932389ff0ea Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki Date: Sat, 13 Apr 2013 14:57:51 +0900 Subject: Make qtbase compile with QT_NO_TRANSLATION Change-Id: Iaa52ba41218b3ec8f36f0052230e0c2cc31c3ba5 Reviewed-by: Oswald Buddenhagen --- src/tools/qdoc/location.h | 3 +- src/tools/qdoc/openedlist.h | 1 - src/tools/qdoc/qdoc.pro | 1 - src/tools/qdoc/separator.cpp | 2 +- src/tools/qdoc/tr.h | 82 -------------------------------------------- 5 files changed, 2 insertions(+), 87 deletions(-) delete mode 100644 src/tools/qdoc/tr.h (limited to 'src') diff --git a/src/tools/qdoc/location.h b/src/tools/qdoc/location.h index 33472810d3..0c113bcbeb 100644 --- a/src/tools/qdoc/location.h +++ b/src/tools/qdoc/location.h @@ -47,8 +47,7 @@ #define LOCATION_H #include - -#include "tr.h" +#include QT_BEGIN_NAMESPACE diff --git a/src/tools/qdoc/openedlist.h b/src/tools/qdoc/openedlist.h index cf7624b8e3..2aad1f6dcb 100644 --- a/src/tools/qdoc/openedlist.h +++ b/src/tools/qdoc/openedlist.h @@ -49,7 +49,6 @@ #include #include "location.h" -#include "tr.h" QT_BEGIN_NAMESPACE diff --git a/src/tools/qdoc/qdoc.pro b/src/tools/qdoc/qdoc.pro index 3bd11bcd5b..55e32dd4a3 100644 --- a/src/tools/qdoc/qdoc.pro +++ b/src/tools/qdoc/qdoc.pro @@ -38,7 +38,6 @@ HEADERS += atom.h \ separator.h \ text.h \ tokenizer.h \ - tr.h \ tree.h SOURCES += atom.cpp \ codechunk.cpp \ diff --git a/src/tools/qdoc/separator.cpp b/src/tools/qdoc/separator.cpp index 2403fb15c8..af10ba364c 100644 --- a/src/tools/qdoc/separator.cpp +++ b/src/tools/qdoc/separator.cpp @@ -44,7 +44,7 @@ */ #include "separator.h" -#include "tr.h" +#include QT_BEGIN_NAMESPACE diff --git a/src/tools/qdoc/tr.h b/src/tools/qdoc/tr.h deleted file mode 100644 index 36b0c47fef..0000000000 --- a/src/tools/qdoc/tr.h +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - tr.h -*/ - -#ifndef TR_H -#define TR_H - -#include - -#if !defined(QT_BOOTSTRAPPED) && !defined(QT_NO_TRANSLATION) -# define TRANSLATE_QDOC -#endif - -#include -#ifdef TRANSLATE_QDOC -# include -#endif - -QT_BEGIN_NAMESPACE - -#ifndef TRANSLATE_QDOC - -#define Q_DECLARE_TR_FUNCTIONS(context) - -inline QString tr(const char *sourceText, const char *comment = 0) -{ - Q_UNUSED(comment); - return QString( QLatin1String(sourceText) ); -} - -struct QCoreApplication -{ - static inline QString translate(const char * /* context */ , const char *sourceText, const char * /* disambiguation */ = 0) - { return QLatin1String(sourceText); } -}; - -#endif // !TRANSLATE_QDOC - -QT_END_NAMESPACE - -#endif -- cgit v1.2.3 From 41dbfd8888e14440041907ac646c2e63284d50c7 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 16 Jun 2013 19:08:09 -0700 Subject: Doc: there is no Q_OS_X11 (and has never been) Change the example to Q_OS_UNIX. Change-Id: I8aed12237408a0e526839a96867aceae33b993b9 Reviewed-by: Shawn Rutledge Reviewed-by: Jerome Pasion --- src/corelib/global/qglobal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 6f63a0d9d3..e6da7bb32d 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -511,7 +511,7 @@ Q_CORE_EXPORT void *qMemSet(void *dest, int c, size_t n); the application is compiled using Forte Developer, or Sun Studio C++. The header file also declares a range of macros (Q_OS_*) that are defined for the specified platforms. For example, - Q_OS_X11 which is defined for the X Window System. + Q_OS_UNIX which is defined for the Unix-based systems. The purpose of these macros is to enable programmers to add compiler or platform specific code to their application. -- cgit v1.2.3 From e3dadce470bcc020dc11331be1877a10e70786a6 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Sun, 16 Jun 2013 11:32:09 +0300 Subject: Ensure we don't repeat QTBUG-30931 in Qt5 The issue is already fixed in 5.0 but let's be nice and ensure the issue won't be reintroduced later. Task-number: QTBUG-30931 Change-Id: Ia6944acaf6e7217f8d0f1fa75d0e9977db11d892 Reviewed-by: Lars Knoll --- src/corelib/tools/qchar.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/corelib/tools/qchar.cpp b/src/corelib/tools/qchar.cpp index 8545276dac..9ab7155c2d 100644 --- a/src/corelib/tools/qchar.cpp +++ b/src/corelib/tools/qchar.cpp @@ -1739,10 +1739,10 @@ static void composeHelper(QString *str, QChar::UnicodeVersion version, int from) if (from < 0 || s.length() - from < 2) return; - int starter = 0; // starter position uint stcode = 0; // starter code point - int next = -1; - int lastCombining = 0; + int starter = -1; // starter position + int next = -1; // to prevent i == next + int lastCombining = 255; // to prevent combining > lastCombining int pos = from; while (pos < s.length()) { @@ -1766,8 +1766,7 @@ static void composeHelper(QString *str, QChar::UnicodeVersion version, int from) } int combining = p->combiningClass; - if (i == next || combining > lastCombining) { - Q_ASSERT(starter >= from); + if ((i == next || combining > lastCombining) && starter >= from) { // allowed to form ligature with S uint ligature = ligatureHelper(stcode, uc); if (ligature) { -- cgit v1.2.3 From 93c0de7253e79c1510f6c761c1fc7bdfa2d87658 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Tue, 11 Jun 2013 14:50:55 +0200 Subject: Fix QSpinBox clipping issue on Mac when frame=false This was a regression from 5.0. Since we still require a minimum height to be present in order for the spin buttons to draw correctly, we require the same height from a spinbox without a frame as one with a frame. task-number: QTBUG-31538 Change-Id: I999f59a29e826e8e621faebffce9cccd9bedb8ca Reviewed-by: Gabriel de Dietrich Reviewed-by: Jens Bache-Wiig --- src/widgets/styles/qmacstyle_mac.mm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index 3daa696155..f8905b1b1a 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -6033,10 +6033,14 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, bool useAquaGuideline = true; switch (ct) { - case QStyle::CT_SpinBox: - // hack to work around horrible sizeHint() code in QAbstractSpinBox - sz = QCommonStyle::sizeFromContents(ct, opt, csz, widget); - sz.setHeight(sz.height() - 3); + + case CT_SpinBox: + if (const QStyleOptionSpinBox *vopt = qstyleoption_cast(opt)) { + // Add button + frame widths + int buttonWidth = 20; + int fw = proxy()->pixelMetric(PM_SpinBoxFrameWidth, vopt, widget); + sz += QSize(buttonWidth + 2*fw, 2*fw - 3); + } break; case QStyle::CT_TabWidget: // the size between the pane and the "contentsRect" (+4,+4) -- cgit v1.2.3 From 44630a6f4206832db39ae984687727967d6b7540 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 18 Jun 2013 14:40:29 +0200 Subject: Add note to remove unused private field. Change-Id: I33c831de1eb6b687a9c033f83bc266bd33a3540e Reviewed-by: Friedemann Kleint --- src/gui/kernel/qevent.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index 79dcc6d250..82276c5342 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -860,7 +860,14 @@ public: void setContentPos(const QPointF &pos); private: - QObject* m_target; +#ifdef Q_CC_CLANG +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunused-private-field" +#endif // Q_CC_CLANG + QObject* m_target; // Qt 6 remove. +#ifdef Q_CC_CLANG +# pragma clang diagnostic pop +#endif // Q_CC_CLANG QPointF m_startPos; QSizeF m_viewportSize; QRectF m_contentPosRange; -- cgit v1.2.3 From 5d439eb4ca2f3b576c951a1dbe75ce369ed05a39 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Tue, 18 Jun 2013 10:42:11 +0200 Subject: Make PCRE's JIT work on Android devices __clear_cache is missing from Android; use cacheflush instead. Backport in Qt's own PCRE copy of the upstream fix: http://vcs.pcre.org/viewvc?view=revision&revision=1340 Task-number: QTBUG-31754 Change-Id: I4996265f7b19343ba24983d4f8b2f75e2b578504 Reviewed-by: Thiago Macieira --- src/3rdparty/pcre/patches/README | 3 +++ .../pcre/patches/r1340_fix_jit_on_android.patch | 18 ++++++++++++++++++ src/3rdparty/pcre/sljit/sljitConfigInternal.h | 7 +++++++ 3 files changed, 28 insertions(+) create mode 100644 src/3rdparty/pcre/patches/README create mode 100644 src/3rdparty/pcre/patches/r1340_fix_jit_on_android.patch (limited to 'src') diff --git a/src/3rdparty/pcre/patches/README b/src/3rdparty/pcre/patches/README new file mode 100644 index 0000000000..1d2bc389dd --- /dev/null +++ b/src/3rdparty/pcre/patches/README @@ -0,0 +1,3 @@ +These patches are landed in upstream PCRE (they're marked with +their SVN revision number). When upgrading PCRE remember check +if the version you're upgrading to already contains them or not. diff --git a/src/3rdparty/pcre/patches/r1340_fix_jit_on_android.patch b/src/3rdparty/pcre/patches/r1340_fix_jit_on_android.patch new file mode 100644 index 0000000000..41699d4882 --- /dev/null +++ b/src/3rdparty/pcre/patches/r1340_fix_jit_on_android.patch @@ -0,0 +1,18 @@ +Index: sljit/sljitConfigInternal.h +=================================================================== +--- sljit/sljitConfigInternal.h (revision 1339) ++++ sljit/sljitConfigInternal.h (working copy) +@@ -221,6 +221,13 @@ + #define SLJIT_CACHE_FLUSH(from, to) \ + sys_icache_invalidate((char*)(from), (char*)(to) - (char*)(from)) + ++#elif defined __ANDROID__ ++ ++/* Android lacks __clear_cache; instead, cacheflush should be used. */ ++ ++#define SLJIT_CACHE_FLUSH(from, to) \ ++ cacheflush((long)(from), (long)(to), 0) ++ + #elif (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32) || (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64) + + /* The __clear_cache() implementation of GCC is a dummy function on PowerPC. */ diff --git a/src/3rdparty/pcre/sljit/sljitConfigInternal.h b/src/3rdparty/pcre/sljit/sljitConfigInternal.h index 2b6616ef66..bc945fbcab 100644 --- a/src/3rdparty/pcre/sljit/sljitConfigInternal.h +++ b/src/3rdparty/pcre/sljit/sljitConfigInternal.h @@ -217,6 +217,13 @@ #define SLJIT_CACHE_FLUSH(from, to) \ sys_icache_invalidate((char*)(from), (char*)(to) - (char*)(from)) +#elif defined __ANDROID__ + +/* Android lacks __clear_cache; instead, cacheflush should be used. */ + +#define SLJIT_CACHE_FLUSH(from, to) \ + cacheflush((long)(from), (long)(to), 0) + #elif (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32) || (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64) /* The __clear_cache() implementation of GCC is a dummy function on PowerPC. */ -- cgit v1.2.3 From 249c5f0689bf1208a4f1d589de45c20c3ff16de9 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 18 Jun 2013 14:42:43 +0200 Subject: If a QWidget is ignored for auto-quit, ignore its corresponding QWindow. Unit test by Friedemann Kleint Task-number: QTBUG-31569 Change-Id: I526d33d4f88a41f6ac349098476bc45af6c841b0 Reviewed-by: Friedemann Kleint --- src/gui/kernel/qguiapplication.cpp | 8 ++++++++ src/gui/kernel/qguiapplication_p.h | 2 ++ src/widgets/kernel/qapplication.cpp | 4 +++- 3 files changed, 13 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index add1c1f90b..77c9978a9e 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -2478,11 +2478,19 @@ void QGuiApplicationPrivate::emitLastWindowClosed() } bool QGuiApplicationPrivate::shouldQuit() +{ + const QWindowList processedWindows; + return shouldQuitInternal(processedWindows); +} + +bool QGuiApplicationPrivate::shouldQuitInternal(const QWindowList &processedWindows) { /* if there is no visible top-level window left, we allow the quit */ QWindowList list = QGuiApplication::topLevelWindows(); for (int i = 0; i < list.size(); ++i) { QWindow *w = list.at(i); + if (processedWindows.contains(w)) + continue; if (w->isVisible() && !w->transientParent()) return false; } diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h index cd8dfff103..3a4b692b69 100644 --- a/src/gui/kernel/qguiapplication_p.h +++ b/src/gui/kernel/qguiapplication_p.h @@ -91,6 +91,8 @@ public: virtual bool shouldQuit(); + bool shouldQuitInternal(const QWindowList &processedWindows); + static Qt::KeyboardModifiers modifier_buttons; static Qt::MouseButtons mouse_buttons; diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 6921b4b462..080f4358f2 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -2695,12 +2695,14 @@ bool QApplicationPrivate::shouldQuit() the ones without QuitOnClose), we emit the lastWindowClosed signal */ QWidgetList list = QApplication::topLevelWidgets(); + QWindowList processedWindows; for (int i = 0; i < list.size(); ++i) { QWidget *w = list.at(i); + processedWindows.push_back(w->windowHandle()); if (w->isVisible() && !w->parentWidget() && w->testAttribute(Qt::WA_QuitOnClose)) return false; } - return QGuiApplicationPrivate::shouldQuit(); + return QGuiApplicationPrivate::shouldQuitInternal(processedWindows); } static inline void closeAllPopups() -- cgit v1.2.3 From 5f49467c526fe590435fcbadc018b753d6a0f589 Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Tue, 11 Jun 2013 11:29:22 +0100 Subject: QNX: Add option to disable screen power save from an envvar Qt itself has no API for disabling screen power save, although this might make an interesting addition at some point. Instead we make the QNX QPA plugin determine if power save should be disabled from the QQNX_DISABLE_POWER_SAVE environment variable. This would typically be set in the application's bar descriptor file. Change-Id: Ie195ecd0496efd533ad9a32b65883283f471c534 Reviewed-by: Kevin Krammer Reviewed-by: Rafael Roquetto --- src/plugins/platforms/qnx/qqnxrootwindow.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/plugins/platforms/qnx/qqnxrootwindow.cpp b/src/plugins/platforms/qnx/qqnxrootwindow.cpp index 5d58890c51..ff5866d1b7 100644 --- a/src/plugins/platforms/qnx/qqnxrootwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxrootwindow.cpp @@ -162,6 +162,16 @@ QQnxRootWindow::QQnxRootWindow(const QQnxScreen *screen) if (result != 0) qFatal("QQnxRootWindow: failed to set window source position, errno=%d", errno); + // Optionally disable the screen power save + bool ok = false; + const int disablePowerSave = qgetenv("QQNX_DISABLE_POWER_SAVE").toInt(&ok); + if (ok && disablePowerSave) { + const int mode = SCREEN_IDLE_MODE_KEEP_AWAKE; + result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_IDLE_MODE, &mode); + if (result != 0) + qWarning("QQnxRootWindow: failed to disable power saving mode"); + } + createWindowGroup(); // Don't post yet. This will be lazily done from QQnxScreen upon first posting of -- cgit v1.2.3 From 0343b926608a4014ef386b3b21be9a0940d9f8e8 Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Mon, 17 Jun 2013 16:46:39 -0300 Subject: QNX: Fix screen rotation The behavior introduced by qtdeclarative's 475d1ed4f6a2 mandates that an expose event follows a geometry change event. The fix for this uncovered a bug on the raster backing store which caused the rotation to break on QtWidgets. The problem was rooted on the assumption that the QQnxRasterBackingStore::flush() method was only called after paints to the backing store surface, which was discovered to be a false assumption. Flushing the backing store can occur in other circunstances, which are out of scope on the context of the QNX plugin. Task-number: QTBUG-31329 Change-Id: Icfc3e85324f5a8745f6b5f189f27f8b763f770c7 Reviewed-by: Kevin Krammer Reviewed-by: Sean Harmer --- src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp | 7 ++++++- src/plugins/platforms/qnx/qqnxwindow.cpp | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp index 7204e5bce9..6a7a4d0944 100644 --- a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp +++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp @@ -81,6 +81,12 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion ®ion, const { qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << this->window(); + // Sometimes this method is called even though there is nothing to be + // flushed, for instance, after an expose event directly follows a + // geometry change event. + if (!m_hasUnflushedPaintOperations) + return; + QQnxWindow *targetWindow = 0; if (window) targetWindow = static_cast(window->handle()); @@ -117,7 +123,6 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion ®ion, const // We assume that the TLW has been flushed previously and that no changes were made to the // backing store inbetween (### does Qt guarantee this?) - Q_ASSERT(!m_hasUnflushedPaintOperations); targetWindow->adjustBufferSize(); targetWindow->blitFrom(platformWindow, offset, region); diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp index 4c95950a7e..87e59dac61 100644 --- a/src/plugins/platforms/qnx/qqnxwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxwindow.cpp @@ -199,6 +199,7 @@ void QQnxWindow::setGeometry(const QRect &rect) // could result in re-entering QQnxWindow::setGeometry() again. QWindowSystemInterface::setSynchronousWindowsSystemEvents(true); QWindowSystemInterface::handleGeometryChange(window(), rect); + QWindowSystemInterface::handleExposeEvent(window(), rect); QWindowSystemInterface::setSynchronousWindowsSystemEvents(false); // Now move all children. -- cgit v1.2.3 From deadf598f40d4ee194fc8a0a0b7cb48d46d69654 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 17 Jun 2013 13:25:59 +0200 Subject: don't claim that mac style needs windows style we have commonstyle for that for a while now. Change-Id: I1ab3c86af994fc9cc7aaf65d28a2428b5e02be99 Reviewed-by: Joerg Bornemann Reviewed-by: Jens Bache-Wiig --- src/widgets/styles/styles.pri | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src') diff --git a/src/widgets/styles/styles.pri b/src/widgets/styles/styles.pri index b39b17fd86..05568e8408 100644 --- a/src/widgets/styles/styles.pri +++ b/src/widgets/styles/styles.pri @@ -54,12 +54,6 @@ contains( styles, mac ) { styles/qmacstyle_mac_p.h \ styles/qmacstyle_mac_p_p.h OBJECTIVE_SOURCES += styles/qmacstyle_mac.mm - - !contains( styles, windows ) { - message( mac requires windows ) - styles += windows - DEFINES+= QT_STYLE_WINDOWS - } } else { DEFINES += QT_NO_STYLE_MAC } -- cgit v1.2.3 From d4f89b5115a0a9dcaf9d0d9973ea8562c2e41f91 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 17 Jun 2013 13:27:03 +0200 Subject: remove pointless positive QT_FOO_STYLE defines they are not used. only the negative QT_NO_FOO_STYLE defines are used. Change-Id: Ic39081240c78cf66bd50c300b4aad04abca6f38c Reviewed-by: Joerg Bornemann Reviewed-by: Jens Bache-Wiig --- src/widgets/styles/styles.pri | 3 --- 1 file changed, 3 deletions(-) (limited to 'src') diff --git a/src/widgets/styles/styles.pri b/src/widgets/styles/styles.pri index 05568e8408..6a5565a8eb 100644 --- a/src/widgets/styles/styles.pri +++ b/src/widgets/styles/styles.pri @@ -62,7 +62,6 @@ contains( styles, windows ) { HEADERS += styles/qwindowsstyle_p.h HEADERS += styles/qwindowsstyle_p_p.h SOURCES += styles/qwindowsstyle.cpp - DEFINES += QT_STYLE_WINDOWS } else { DEFINES += QT_NO_STYLE_WINDOWS } @@ -74,7 +73,6 @@ contains( styles, windowsvista ) { !contains( styles, windowsxp ) { message( windowsvista requires windowsxp ) styles += windowsxp - DEFINES += QT_STYLE_WINDOWSXP } } else { DEFINES += QT_NO_STYLE_WINDOWSVISTA @@ -87,7 +85,6 @@ contains( styles, windowsxp ) { !contains( styles, windows ) { message( windowsxp requires windows ) styles += windows - DEFINES += QT_STYLE_WINDOWS } } else { DEFINES += QT_NO_STYLE_WINDOWSXP -- cgit v1.2.3 From 60a5a56359670c276aa6810a1b595c42e9e81a73 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 17 Jun 2013 13:27:56 +0200 Subject: fix auto-enabling of windows style it needs to come after the vista and xp style blocks. Change-Id: I66b5c1eff41b19a76802a77b6926552d7343b29c Reviewed-by: Joerg Bornemann Reviewed-by: Jens Bache-Wiig --- src/widgets/styles/styles.pri | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/widgets/styles/styles.pri b/src/widgets/styles/styles.pri index 6a5565a8eb..3707090c4c 100644 --- a/src/widgets/styles/styles.pri +++ b/src/widgets/styles/styles.pri @@ -58,14 +58,6 @@ contains( styles, mac ) { DEFINES += QT_NO_STYLE_MAC } -contains( styles, windows ) { - HEADERS += styles/qwindowsstyle_p.h - HEADERS += styles/qwindowsstyle_p_p.h - SOURCES += styles/qwindowsstyle.cpp -} else { - DEFINES += QT_NO_STYLE_WINDOWS -} - contains( styles, windowsvista ) { HEADERS += styles/qwindowsvistastyle_p.h HEADERS += styles/qwindowsvistastyle_p_p.h @@ -90,6 +82,14 @@ contains( styles, windowsxp ) { DEFINES += QT_NO_STYLE_WINDOWSXP } +contains( styles, windows ) { + HEADERS += styles/qwindowsstyle_p.h + HEADERS += styles/qwindowsstyle_p_p.h + SOURCES += styles/qwindowsstyle.cpp +} else { + DEFINES += QT_NO_STYLE_WINDOWS +} + contains( styles, gtk ) { HEADERS += styles/qgtkglobal_p.h HEADERS += styles/qgtkstyle_p.h -- cgit v1.2.3 From 0a55499c9af9a4b0a98a12a8aba82c3764fa5994 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Tue, 18 Jun 2013 09:11:33 +0200 Subject: Doc: remove the duplicate for in QStyle documentation Task-number: QTBUG-31739 Change-Id: I72ad52da7d7e6899148a91d22266e79dd3184d4c Reviewed-by: Jerome Pasion --- src/widgets/styles/qstyle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp index 603d0e50a5..dccc9ff3ce 100644 --- a/src/widgets/styles/qstyle.cpp +++ b/src/widgets/styles/qstyle.cpp @@ -351,7 +351,7 @@ static int unpackControlTypes(QSizePolicy::ControlTypes controls, QSizePolicy::C \section1 Styles in Item Views The painting of items in views is performed by a delegate. Qt's - default delegate, QStyledItemDelegate, is also used for for calculating bounding + default delegate, QStyledItemDelegate, is also used for calculating bounding rectangles of items, and their sub-elements for the various kind of item \l{Qt::ItemDataRole}{data roles} QStyledItemDelegate supports. See the QStyledItemDelegate class -- cgit v1.2.3 From 46106c4e16dd36deb17011d8587b301971921f5c Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki Date: Mon, 27 May 2013 00:37:18 +0900 Subject: hide placeholder text when QLineEdit has preedit text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ica84e9ce715702b690906ef748970e16d9162c4b Reviewed-by: Gabriel de Dietrich Reviewed-by: Aurélien Gâteau --- src/widgets/widgets/qlineedit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp index 6d648f1126..d44e9ad02f 100644 --- a/src/widgets/widgets/qlineedit.cpp +++ b/src/widgets/widgets/qlineedit.cpp @@ -1802,7 +1802,7 @@ void QLineEdit::paintEvent(QPaintEvent *) int minLB = qMax(0, -fm.minLeftBearing()); int minRB = qMax(0, -fm.minRightBearing()); - if (d->control->text().isEmpty()) { + if (d->control->text().isEmpty() && d->control->preeditAreaText().isEmpty()) { if (!d->placeholderText.isEmpty()) { QColor col = pal.text().color(); col.setAlpha(128); -- cgit v1.2.3 From a4d41f6803beca7e0911610cc4ed8027ab196eb7 Mon Sep 17 00:00:00 2001 From: David Faure Date: Fri, 14 Jun 2013 15:51:48 +0200 Subject: Doc: QTranslator::translate() isn't an overload anymore Change-Id: Ib50044da48be3fb4f43300aa285e15403bd8d65e Reviewed-by: Jerome Pasion Reviewed-by: Oswald Buddenhagen --- src/corelib/kernel/qtranslator.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp index 9243d093df..903ab2e2cd 100644 --- a/src/corelib/kernel/qtranslator.cpp +++ b/src/corelib/kernel/qtranslator.cpp @@ -1084,8 +1084,6 @@ void QTranslatorPrivate::clear() } /*! - \overload translate() - Returns the translation for the key (\a context, \a sourceText, \a disambiguation). If none is found, also tries (\a context, \a sourceText, ""). If that still fails, returns a null string. -- cgit v1.2.3 From 25739bebba0343a8b35775a073c49f0fba080762 Mon Sep 17 00:00:00 2001 From: Debao Zhang Date: Wed, 19 Jun 2013 14:40:17 +0800 Subject: Doc: Fix spelling error Change-Id: I9225ffeddfe17bc4f56ecd9a9c4656403840f828 Reviewed-by: Friedemann Kleint --- src/corelib/global/qtypeinfo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h index 8e34c9792d..58736ac2b8 100644 --- a/src/corelib/global/qtypeinfo.h +++ b/src/corelib/global/qtypeinfo.h @@ -110,7 +110,7 @@ public: To create a proper QTypeInfo specialization for A struct, we have to check all sub-components; B, C and D, then take the lowest common denominator and call - Q_DECLATE_TYPEINFO with the resulting flags. An easier and less fragile approach is to + Q_DECLARE_TYPEINFO with the resulting flags. An easier and less fragile approach is to use QTypeInfoMerger, which does that automatically. So struct A would have the following QTypeInfo definition: -- cgit v1.2.3