diff --git a/configure b/configure index 1165bb8cc6..5eb81a80b6 100755 --- a/configure +++ b/configure @@ -5393,9 +5393,11 @@ fi if [ "$CFG_SHARED" = "yes" ]; then QMAKE_OUTDIR="${QMAKE_OUTDIR}-shared" QT_CONFIG="$QT_CONFIG shared" + QTCONFIG_CONFIG="$QTCONFIG_CONFIG shared" elif [ "$CFG_SHARED" = "no" ]; then QMAKE_OUTDIR="${QMAKE_OUTDIR}-static" QT_CONFIG="$QT_CONFIG static" + QTCONFIG_CONFIG="$QTCONFIG_CONFIG static" fi #FIXME: qpa is implicit this should all be removed diff --git a/mkspecs/common/qcc-base-qnx.conf b/mkspecs/common/qcc-base-qnx.conf index 68a4182e0f..b1bae7122d 100644 --- a/mkspecs/common/qcc-base-qnx.conf +++ b/mkspecs/common/qcc-base-qnx.conf @@ -14,6 +14,7 @@ QMAKE_LFLAGS_PLUGIN += $$QMAKE_LFLAGS_SHLIB QMAKE_LFLAGS_SONAME += -Wl,-soname, QMAKE_LFLAGS_THREAD += QMAKE_LFLAGS_RPATH = -Wl,-rpath, +QMAKE_LFLAGS_RPATHLINK = -Wl,-rpath-link, # -Bsymbolic-functions (ld) support QMAKE_LFLAGS_BSYMBOLIC_FUNC = -Wl,-Bsymbolic-functions diff --git a/mkspecs/features/debug.prf b/mkspecs/features/debug.prf deleted file mode 100644 index b11bfbf6b6..0000000000 --- a/mkspecs/features/debug.prf +++ /dev/null @@ -1,7 +0,0 @@ -CONFIG -= release -QMAKE_CFLAGS += $$QMAKE_CFLAGS_DEBUG -QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_DEBUG -QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_OBJECTIVE_CFLAGS_DEBUG -QMAKE_LFLAGS += $$QMAKE_LFLAGS_DEBUG -QMAKE_LIBFLAGS += $$QMAKE_LIBFLAGS_DEBUG -!debug_and_release:fix_output_dirs:fixExclusiveOutputDirs(debug, release) diff --git a/mkspecs/features/debug_and_release.prf b/mkspecs/features/debug_and_release.prf deleted file mode 100644 index 8b8932184f..0000000000 --- a/mkspecs/features/debug_and_release.prf +++ /dev/null @@ -1 +0,0 @@ -!macx-xcode:addExclusiveBuilds(debug, Debug, release, Release) diff --git a/mkspecs/features/default_post.prf b/mkspecs/features/default_post.prf index 3afab5240e..cdd200e80b 100644 --- a/mkspecs/features/default_post.prf +++ b/mkspecs/features/default_post.prf @@ -4,14 +4,11 @@ contains(TEMPLATE, ".*(lib|app)"):CONFIG += have_target !have_target:!force_qt: CONFIG -= qt -!shared:!dll:!static:!staticlib { - contains(QT_CONFIG, static): CONFIG += static - else: CONFIG += shared -} +load(resolve_config) QT_BREAKPAD_ROOT_PATH = $$(QT_BREAKPAD_ROOT_PATH) !isEmpty(QT_BREAKPAD_ROOT_PATH): \ # quick test first whether requested ... - !staticlib:!static:CONFIG(release, debug|release):have_target: \ # is it applicable? + !static:release:have_target: \ # is it applicable? !contains(TARGET, .*phony_target.*): \ # monster hack, you don't really see this here, right? ;) system($$QT_BREAKPAD_ROOT_PATH/qtbreakpadsymbols --breakpad-exists) { # do we really have it? CONFIG += breakpad force_debug_info @@ -24,9 +21,27 @@ force_debug_info { QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO } -CONFIG(debug, debug|release):load(debug) -else:load(release) -debug_and_release:load(debug_and_release) +debug { + QMAKE_CFLAGS += $$QMAKE_CFLAGS_DEBUG + QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_DEBUG + QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_OBJECTIVE_CFLAGS_DEBUG + QMAKE_LFLAGS += $$QMAKE_LFLAGS_DEBUG + QMAKE_LIBFLAGS += $$QMAKE_LIBFLAGS_DEBUG +} else { + QMAKE_CFLAGS += $$QMAKE_CFLAGS_RELEASE + QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_RELEASE + QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_OBJECTIVE_CFLAGS_RELEASE + QMAKE_LFLAGS += $$QMAKE_LFLAGS_RELEASE + QMAKE_LIBFLAGS += $$QMAKE_LIBFLAGS_RELEASE +} + +dll:win32: QMAKE_LFLAGS += $$QMAKE_LFLAGS_DLL +static:mac: QMAKE_LFLAGS += $$QMAKE_LFLAGS_STATIC_LIB +staticlib:unix { + QMAKE_CFLAGS += $$QMAKE_CFLAGS_STATIC_LIB + QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_STATIC_LIB +} + incredibuild_xge { CONFIG -= incredibuild_xge CONFIG = incredibuild_xge $$CONFIG diff --git a/mkspecs/features/dll.prf b/mkspecs/features/dll.prf deleted file mode 100644 index 943ab93def..0000000000 --- a/mkspecs/features/dll.prf +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG += shared - diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf index 5a1e39b1c7..8de038c5f8 100644 --- a/mkspecs/features/qt.prf +++ b/mkspecs/features/qt.prf @@ -125,7 +125,7 @@ for(QT_CURRENT_VERIFY, $$list($$QT_PLUGIN_VERIFY)) { } isEqual(QT_CURRENT_VERIFY, DEPLOYMENT_PLUGIN):shared:wince*: { QT_ITEM = - CONFIG(debug, debug|release): QT_ITEM = $${QTPLUG}d4.dll + debug: QT_ITEM = $${QTPLUG}d4.dll else: QT_ITEM = $${QTPLUG}4.dll eval(qt_additional_plugin_$${QTPLUG}.files = $$[QT_INSTALL_PLUGINS/get]/$${QT_PLUGINPATH}/$${QT_ITEM}) diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index b6e3454f0e..bac7ca1751 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -10,7 +10,7 @@ defineReplace(qtPlatformTargetSuffix) { defineReplace(qtLibraryTarget) { LIBRARY_NAME = $$1 - mac:!static:contains(QT_CONFIG, qt_framework) { + mac:CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework) { QMAKE_FRAMEWORK_BUNDLE_NAME = $$LIBRARY_NAME export(QMAKE_FRAMEWORK_BUNDLE_NAME) } else { diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf index e6263af7a5..728d1f5f85 100644 --- a/mkspecs/features/qt_module.prf +++ b/mkspecs/features/qt_module.prf @@ -25,12 +25,6 @@ isEmpty(VERSION):VERSION = $$QT_VERSION # Compile as shared/DLL or static according to the option given to configure # unless overridden. Host builds are always static host_build|staticlib: CONFIG += static -!static:!shared { - contains(QT_CONFIG, static): \ - CONFIG += static - else: \ - CONFIG += shared -} ucmodule = $$upper($$MODULE) @@ -87,7 +81,7 @@ contains(QT_CONFIG, separate_debug_info_nocopy):CONFIG += separate_debug_info_no contains(QT_CONFIG, c++11):CONFIG += c++11 #mac frameworks -mac:!static:contains(QT_CONFIG, qt_framework) { +mac:CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework) { #QMAKE_FRAMEWORK_VERSION = 4.0 CONFIG += lib_bundle qt_no_framework_direct_includes qt_framework CONFIG(release, debug|release) { diff --git a/mkspecs/features/qt_plugin.prf b/mkspecs/features/qt_plugin.prf index 2ec523d78c..54a995daae 100644 --- a/mkspecs/features/qt_plugin.prf +++ b/mkspecs/features/qt_plugin.prf @@ -28,10 +28,7 @@ contains(QT_CONFIG, separate_debug_info):CONFIG += separate_debug_info contains(QT_CONFIG, separate_debug_info_nocopy):CONFIG += separate_debug_info_nocopy contains(QT_CONFIG, c++11):CONFIG += c++11 -contains(QT_CONFIG, static):CONFIG += static -else:CONFIG += shared - -static { +CONFIG(static, static|shared) { isEmpty(MODULE): MODULE = $$basename(TARGET) MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_plugin_$${MODULE}.pri diff --git a/mkspecs/features/release.prf b/mkspecs/features/release.prf deleted file mode 100644 index 2d63c240d0..0000000000 --- a/mkspecs/features/release.prf +++ /dev/null @@ -1,7 +0,0 @@ -CONFIG -= debug -QMAKE_CFLAGS += $$QMAKE_CFLAGS_RELEASE -QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_RELEASE -QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_OBJECTIVE_CFLAGS_RELEASE -QMAKE_LFLAGS += $$QMAKE_LFLAGS_RELEASE -QMAKE_LIBFLAGS += $$QMAKE_LIBFLAGS_RELEASE -!debug_and_release:fix_output_dirs:fixExclusiveOutputDirs(release, debug) \ No newline at end of file diff --git a/mkspecs/features/resolve_config.prf b/mkspecs/features/resolve_config.prf new file mode 100644 index 0000000000..41e82b2382 --- /dev/null +++ b/mkspecs/features/resolve_config.prf @@ -0,0 +1,46 @@ +# +# W A R N I N G +# ------------- +# +# This file is not part of the Qt API. It exists purely as an +# implementation detail. It may change from version to version +# without notice, or even be removed. +# +# We mean it. +# + +staticlib: \ + CONFIG += static +else: dll: \ + CONFIG += shared + +CONFIG(static, static|shared) { + CONFIG -= shared dll + contains(TEMPLATE, ".*lib"): CONFIG += staticlib +} else { + CONFIG -= static staticlib + contains(TEMPLATE, ".*lib"): CONFIG += dll +} + +static_and_shared { + !macx-xcode: addExclusiveBuilds(static, Static, shared, Shared) +} else: fix_output_dirs { + static: \ + fixExclusiveOutputDirs(static, shared) + else: \ + fixExclusiveOutputDirs(shared, static) +} + +CONFIG(debug, debug|release): \ + CONFIG -= release +else: \ + CONFIG -= debug + +debug_and_release { + !macx-xcode: addExclusiveBuilds(debug, Debug, release, Release) +} else: fix_output_dirs { + debug: \ + fixExclusiveOutputDirs(debug, release) + else: \ + fixExclusiveOutputDirs(release, debug) +} diff --git a/mkspecs/features/resolve_target.prf b/mkspecs/features/resolve_target.prf index c60faf22c0..8cd12b2a00 100644 --- a/mkspecs/features/resolve_target.prf +++ b/mkspecs/features/resolve_target.prf @@ -9,6 +9,8 @@ # We mean it. # +load(resolve_config) + QMAKE_RESOLVED_TARGET = $$absolute_path($$DESTDIR, $$OUT_PWD)/ win32 { diff --git a/mkspecs/features/shared.prf b/mkspecs/features/shared.prf deleted file mode 100644 index 86efd8e6d8..0000000000 --- a/mkspecs/features/shared.prf +++ /dev/null @@ -1,7 +0,0 @@ -CONFIG -= static -contains(TEMPLATE, ".*lib"): { - CONFIG += dll - CONFIG -= staticlib - win32:QMAKE_LFLAGS += $$QMAKE_LFLAGS_DLL -} -!static_and_shared:fix_output_dirs:fixExclusiveOutputDirs(shared, static) diff --git a/mkspecs/features/static.prf b/mkspecs/features/static.prf deleted file mode 100644 index 288852d5df..0000000000 --- a/mkspecs/features/static.prf +++ /dev/null @@ -1,14 +0,0 @@ -CONFIG -= shared dll -contains(TEMPLATE, ".*lib"):{ - CONFIG += staticlib - unix { - QMAKE_CFLAGS += $$QMAKE_CFLAGS_STATIC_LIB - QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_STATIC_LIB - } -} - -mac { - QMAKE_LFLAGS += $$QMAKE_LFLAGS_STATIC_LIB -} - -!static_and_shared:fix_output_dirs:fixExclusiveOutputDirs(static, shared) diff --git a/mkspecs/features/static_and_shared.prf b/mkspecs/features/static_and_shared.prf deleted file mode 100644 index 47c68e50a0..0000000000 --- a/mkspecs/features/static_and_shared.prf +++ /dev/null @@ -1,3 +0,0 @@ -have_target:!macx-xcode { - addExclusiveBuilds(static, Static, shared, Shared) -} diff --git a/mkspecs/features/staticlib.prf b/mkspecs/features/staticlib.prf deleted file mode 100644 index 4884964a6f..0000000000 --- a/mkspecs/features/staticlib.prf +++ /dev/null @@ -1 +0,0 @@ -CONFIG += static diff --git a/mkspecs/features/unix/bsymbolic_functions.prf b/mkspecs/features/unix/bsymbolic_functions.prf index 5a60463e36..5fca5ac170 100644 --- a/mkspecs/features/unix/bsymbolic_functions.prf +++ b/mkspecs/features/unix/bsymbolic_functions.prf @@ -1,5 +1,5 @@ -!staticlib:!static:contains(TEMPLATE, lib) { +dll { QMAKE_LFLAGS_SHLIB += $$QMAKE_LFLAGS_BSYMBOLIC_FUNC !isEmpty(QMAKE_DYNAMIC_LIST_FILE):QMAKE_LFLAGS_SHLIB += $$QMAKE_LFLAGS_DYNAMIC_LIST$$QMAKE_DYNAMIC_LIST_FILE diff --git a/mkspecs/features/unix/gdb_dwarf_index.prf b/mkspecs/features/unix/gdb_dwarf_index.prf index 9a7a8e01bc..0a5ee507ff 100644 --- a/mkspecs/features/unix/gdb_dwarf_index.prf +++ b/mkspecs/features/unix/gdb_dwarf_index.prf @@ -1,4 +1,4 @@ -!CONFIG(separate_debug_info):CONFIG(debug, debug|release):have_target:!staticlib:!static:!isEmpty(QMAKE_OBJCOPY) { +!separate_debug_info:have_target:debug:!static:!isEmpty(QMAKE_OBJCOPY) { contains(TEMPLATE, "lib") { QMAKE_GDB_INDEX = { test -z \"$(DESTDIR)\" || cd \"$(DESTDIR)\"; } && diff --git a/mkspecs/features/unix/separate_debug_info.prf b/mkspecs/features/unix/separate_debug_info.prf index 3ddeffbf44..c5ff6dcba3 100644 --- a/mkspecs/features/unix/separate_debug_info.prf +++ b/mkspecs/features/unix/separate_debug_info.prf @@ -1,5 +1,5 @@ -!separate_debug_info_nocopy:have_target:!staticlib:!static:!isEmpty(QMAKE_OBJCOPY) { +!separate_debug_info_nocopy:have_target:!static:!isEmpty(QMAKE_OBJCOPY) { qnx { debug_info_suffix = sym debug_info_keep = --keep-file-symbols diff --git a/src/corelib/doc/src/threads-basics.qdoc b/src/corelib/doc/src/threads-basics.qdoc index dad41368c6..dd5267f0ba 100644 --- a/src/corelib/doc/src/threads-basics.qdoc +++ b/src/corelib/doc/src/threads-basics.qdoc @@ -269,7 +269,8 @@ This is the result of running the code: - \badcode + \code + //bad code hello from GUI thread 3079423696 hello from worker thread 3076111216 \endcode diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 9cd19ccae9..67d26301a4 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -642,12 +642,30 @@ Q_CORE_EXPORT void *qMemSet(void *dest, int c, size_t n); \sa Q_UINT64_C(), qint64, qulonglong */ +/*! + \typedef qintptr + \relates + + Integral type for representing pointers in a signed integer (useful for + hashing, etc.). + + Typedef for either qint32 or qint64. This type is guaranteed to + be the same size as a pointer on all platforms supported by Qt. On + a system with 32-bit pointers, qintptr is a typedef for qint32; + on a system with 64-bit pointers, qintptr is a typedef for + qint64. + + Note that qintptr is signed. Use quintptr for unsigned values. + + \sa qptrdiff, qint32, qint64 +*/ + /*! \typedef quintptr \relates - Integral type for representing a pointers (useful for hashing, - etc.). + Integral type for representing pointers in an unsigned integer (useful for + hashing, etc.). Typedef for either quint32 or quint64. This type is guaranteed to be the same size as a pointer on all platforms supported by Qt. On diff --git a/src/dbus/qdbusargument.cpp b/src/dbus/qdbusargument.cpp index 191eb5eea6..dab2daf90f 100644 --- a/src/dbus/qdbusargument.cpp +++ b/src/dbus/qdbusargument.cpp @@ -212,7 +212,8 @@ bool QDBusArgumentPrivate::checkReadAndDetach(QDBusArgumentPrivate *&d) The following example illustrates this wrong usage in context of a class that may contain invalid data: - \badcode + \code + //bad code // Wrongly marshall the MyTime data into a D-Bus argument QDBusArgument &operator<<(QDBusArgument &argument, const MyTime &mytime) { diff --git a/src/gui/painting/qpagedpaintdevice.h b/src/gui/painting/qpagedpaintdevice.h index aa8506492f..d44a401184 100644 --- a/src/gui/painting/qpagedpaintdevice.h +++ b/src/gui/painting/qpagedpaintdevice.h @@ -46,6 +46,9 @@ QT_BEGIN_NAMESPACE +#if defined(B0) +#undef B0 // Terminal hang-up. We assume that you do not want that. +#endif class QPagedPaintDevicePrivate; diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index b59a0850e8..c483e93a5f 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -229,7 +229,7 @@ QTransform QPainterPrivate::hidpiScaleTransform() const { #ifdef Q_OS_MAC // Limited feature introduction for Qt 5.0.0, remove ifdef in a later release. - if (device->physicalDpiX() == 0 || device->logicalDpiX() == 0) + if (device->devType() == QInternal::Printer || device->physicalDpiX() == 0 || device->logicalDpiX() == 0) return QTransform(); const qreal deviceScale = (device->physicalDpiX() / device->logicalDpiX()); if (deviceScale > 1.0) @@ -1839,7 +1839,7 @@ bool QPainter::begin(QPaintDevice *pd) #ifdef Q_OS_MAC // Limited feature introduction for Qt 5.0.0, remove ifdef in a later release. - const bool isHighDpi = (d->device->physicalDpiX() == 0 || d->device->logicalDpiX() == 0) ? + const bool isHighDpi = (pd->devType() == QInternal::Printer || d->device->physicalDpiX() == 0 || d->device->logicalDpiX() == 0) ? false : (d->device->physicalDpiX() / d->device->logicalDpiX() > 1); #else const bool isHighDpi = false; diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 833c07dfe0..c19238d768 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -313,15 +313,15 @@ or the proxy server stopped responding in the authentication phase. \value ProxyNotFoundError The proxy address set with setProxy() (or the application proxy) was not found. - \value ProxyProtocolError The connection negotiation with the proxy server + \value ProxyProtocolError The connection negotiation with the proxy server failed, because the response from the proxy server could not be understood. \value OperationError An operation was attempted while the socket was in a state that did not permit it. - \value SslInternalError The SSL library being used reported a internal error, this is + \value SslInternalError The SSL library being used reported an internal error. This is probably the result of a bad installation or misconfiguration of the library. - \value SslInvalidUserDataError Invalid data(certificate, key, cypher, etc.) was + \value SslInvalidUserDataError Invalid data (certificate, key, cypher, etc.) was provided and its use resulted in an error in the SSL library. - \value TemporaryError A temporary error occurred(e.g., operation would block and socket + \value TemporaryError A temporary error occurred (e.g., operation would block and socket is non-blocking). \value UnknownSocketError An unidentified error occurred. diff --git a/src/plugins/platforms/cocoa/qcocoacursor.h b/src/plugins/platforms/cocoa/qcocoacursor.h index f8829c53e6..dfa1fcff81 100644 --- a/src/plugins/platforms/cocoa/qcocoacursor.h +++ b/src/plugins/platforms/cocoa/qcocoacursor.h @@ -53,6 +53,7 @@ class QCocoaCursor : public QPlatformCursor { public: QCocoaCursor(); + ~QCocoaCursor(); virtual void changeCursor(QCursor * widgetCursor, QWindow * widget); virtual QPoint pos() const; diff --git a/src/plugins/platforms/cocoa/qcocoacursor.mm b/src/plugins/platforms/cocoa/qcocoacursor.mm index 85ac083d3c..12808b7041 100644 --- a/src/plugins/platforms/cocoa/qcocoacursor.mm +++ b/src/plugins/platforms/cocoa/qcocoacursor.mm @@ -48,6 +48,10 @@ QT_BEGIN_NAMESPACE QCocoaCursor::QCocoaCursor() +{ +} + +QCocoaCursor::~QCocoaCursor() { // release cursors QHash::const_iterator i = m_cursors.constBegin(); @@ -97,10 +101,15 @@ void QCocoaCursor::changeCursor(QCursor *cursor, QWindow *window) break; case Qt::DragLinkCursor: [[NSCursor dragLinkCursor] set]; + break; default : { // No suitable OS cursor exist, use cursors provided // by Qt for the rest. Check for a cached cursor: NSCursor *cocoaCursor = m_cursors.value(newShape); + if (cocoaCursor && cursor->shape() == Qt::BitmapCursor) { + [cocoaCursor release]; + cocoaCursor = 0; + } if (cocoaCursor == 0) { cocoaCursor = createCursorData(cursor); if (cocoaCursor == 0) { diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp index 2cee666e23..ab9c94772b 100644 --- a/src/plugins/platforms/qnx/qqnxwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxwindow.cpp @@ -335,7 +335,11 @@ void QQnxWindow::setBufferSize(const QSize &size) // Set window buffer size errno = 0; - int val[2] = { size.width(), size.height() }; + + // libscreen fails when creating empty buffers + const QSize nonEmptySize = size.isEmpty() ? QSize(1, 1) : size; + + int val[2] = { nonEmptySize.width(), nonEmptySize.height() }; int result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_BUFFER_SIZE, val); if (result != 0) { qFatal("QQnxWindow: failed to set window buffer size, errno=%d", errno); @@ -362,6 +366,7 @@ void QQnxWindow::setBufferSize(const QSize &size) errno = 0; result = screen_create_window_buffers(m_window, MAX_BUFFER_COUNT); if (result != 0) { + qWarning() << "QQnxWindow: Buffer size was" << size; qFatal("QQnxWindow: failed to create window buffers, errno=%d", errno); } @@ -380,7 +385,7 @@ void QQnxWindow::setBufferSize(const QSize &size) } // Cache new buffer size - m_bufferSize = size; + m_bufferSize = nonEmptySize; // Buffers were destroyed; reacquire them m_currentBufferIndex = -1; diff --git a/src/tools/qdoc/doc/qdoc-manual.qdoc b/src/tools/qdoc/doc/qdoc-manual.qdoc index 5254c46eb5..4d70faa968 100644 --- a/src/tools/qdoc/doc/qdoc-manual.qdoc +++ b/src/tools/qdoc/doc/qdoc-manual.qdoc @@ -243,7 +243,6 @@ \li \l {11-qdoc-commands-specialcontent.html#abstract-command} {\\abstract} \li \l {12-0-qdoc-commands-miscellaneous.html#annotatedlist-command} {\\annotatedlist} \li \l {04-qdoc-commands-textmarkup.html#b-command} {\\b} \span {class="newStuff"} {(new 5/3/2012)} - \li \l {06-qdoc-commands-includecodeinline.html#badcode-command} {\\badcode} \li \l {04-qdoc-commands-textmarkup.html#b-command} {\\bold} {(deprecated, use \\b)} \li \l {11-qdoc-commands-specialcontent.html#brief-command} {\\brief} \li \l {04-qdoc-commands-textmarkup.html#c-command} {\\c} @@ -1175,8 +1174,7 @@ snippets. It renders the code verbatim in a separate paragraph in the code font. - When processing any of the \\code, \l {badcode-command} - {\\badcode}, \l {newcode-command} {\\newcode} or \l + When processing any of the \\code, \l {newcode-command} {\\newcode} or \l {oldcode-command} {\\oldcode} commands, QDoc removes all indentation that is common for the verbatim code blocks within a \c{/}\c{*!} ... \c{*}\c{/} comment before it adds the standard @@ -1225,67 +1223,9 @@ See also \l {c-command} {\\c}, \l {07-0-qdoc-commands-includingexternalcode.html#quotefromfile-command} - {\\quotefromfile}, \l {badcode-command} {\\badcode}, \l - {newcode-command} {\\newcode} and \l {oldcode-command} + {\\quotefromfile}, \l{newcode-command} {\\newcode} and \l {oldcode-command} {\\oldcode}. - \target badcode-command - \section1 \\badcode - - The \\badcode and \\endcode commands delimit a snippet of code - that doesn't compile or is wrong for some other reason. - - The \\badcode command is similar to the \l {code-command} {\\code} - command, but it renders the code snippet using a grey font instead - of black. - - Like the \l {code-command} {\\code} command, this command begins - its code snippet on a new line rendered in the code font and with - the standard indentation. - - \code - / *! - The statement below is rendered using the - regular \\code command: - - \code - statusbar()->message(tr("Host %1 found").arg(hostName)); - \ endcode - - While the following statement is rendered using - the \\badcode command: - - \badcode - statusbar()->message(tr("Host" + hostName + " found")); - \ endcode - * / - \endcode - - QDoc renders this as: - - \quotation - The statement below is rendered using the - regular \\code command: - - \code - statusbar()->message(tr("Host %1 found").arg(hostName)); - \endcode - - While the following statement is rendered using - the \\badcode command: - - \badcode - statusbar()->message(tr("Host" + hostName + " found")); - \endcode - \endquotation - - Other QDoc commands are disabled within \\badcode... \\endcode, - and the special character '\\' is accepted and rendered like the - rest of the code. - - See also \l {code-command} {\\code}, \l {newcode-command} - {\\newcode} and \l {oldcode-command} {\\oldcode}. - \target newcode-command \section1 \\newcode @@ -1293,14 +1233,12 @@ show how to port a snippet of code to a new version of an API. The \\newcode command, and its companion the \\oldcode command, is - a convenience combination of the \l {code-command} {\\code} and \l - {badcode-command} {\\badcode} commands: The combination provides a - text relating the two code snippets to each other. The command - requires a preceding \\oldcode statement. + a convenience combination of the \l {code-command} {\\code} commands: + The combination provides a text relating the two code snippets to each + other. The command requires a preceding \\oldcode statement. - Like the \l {code-command} {\\code} and \l {badcode-command} - {\\badcode} commands, the \\newcode command renders its code on a - new line in the documentation using a typewriter font and the + Like the \l{code-command}{\\code} command, the \\newcode command renders its + code on a new line in the documentation using a typewriter font and the standard indentation. \code @@ -1339,7 +1277,7 @@ \\newcode statement; otherwise QDoc fails to parse the command and emits a warning. - See also \l {newcode-command} {\\newcode} and \l {badcode-command} {\\badcode}. + See also \l {newcode-command} {\\newcode}. \target qml-command \section1 \\qml @@ -8688,7 +8626,6 @@ \li \l {12-0-qdoc-commands-miscellaneous.html#annotatedlist-command} {\\annotatedlist} \li \l {04-qdoc-commands-textmarkup.html#b-command} {\\b} \span {class="newStuff"} {(new 5/3/2012)} \li \l { 22-qdoc-configuration-generalvariables.html#basedir-variable} {basedir} \span {class="newStuff"} {(experimental)} - \li \l {06-qdoc-commands-includecodeinline.html#badcode-command} {\\badcode} \li \l {04-qdoc-commands-textmarkup.html#b-command} {\\bold} \span {class="newStuff"} {(deprecated, use \\b)} \li \l {11-qdoc-commands-specialcontent.html#brief-command} {\\brief} \li \l {04-qdoc-commands-textmarkup.html#c-command} {\\c} diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp index 7ba8f60f71..c22258b3d2 100644 --- a/src/widgets/dialogs/qcolordialog.cpp +++ b/src/widgets/dialogs/qcolordialog.cpp @@ -1735,8 +1735,9 @@ QColor QColorDialog::selectedColor() const */ void QColorDialog::setOption(ColorDialogOption option, bool on) { - Q_D(QColorDialog); - d->options->setOption(static_cast(option), on); + const QColorDialog::ColorDialogOptions previousOptions = options(); + if (!(previousOptions & option) != !on) + setOptions(previousOptions ^ option); } /*! diff --git a/src/widgets/dialogs/qfontdialog.cpp b/src/widgets/dialogs/qfontdialog.cpp index 79aab3280f..4036dc80ab 100644 --- a/src/widgets/dialogs/qfontdialog.cpp +++ b/src/widgets/dialogs/qfontdialog.cpp @@ -853,8 +853,9 @@ QFont QFontDialog::selectedFont() const */ void QFontDialog::setOption(FontDialogOption option, bool on) { - Q_D(QFontDialog); - d->options->setOption(static_cast(option), on); + const QFontDialog::FontDialogOptions previousOptions = options(); + if (!(previousOptions & option) != !on) + setOptions(previousOptions ^ option); } /*! diff --git a/src/widgets/kernel/qstackedlayout.cpp b/src/widgets/kernel/qstackedlayout.cpp index cb2711c636..f38f0a6f08 100644 --- a/src/widgets/kernel/qstackedlayout.cpp +++ b/src/widgets/kernel/qstackedlayout.cpp @@ -300,7 +300,9 @@ void QStackedLayout::setCurrentIndex(int index) parent->setUpdatesEnabled(false); } - QWidget *fw = parent ? parent->window()->focusWidget() : 0; + QPointer fw = parent ? parent->window()->focusWidget() : 0; + const bool focusWasOnOldPage = fw && (prev && prev->isAncestorOf(fw)); + if (prev) { prev->clearFocus(); if (d->stackingMode == StackOne) @@ -315,24 +317,25 @@ void QStackedLayout::setCurrentIndex(int index) // was somewhere on the outgoing widget. if (parent) { - if (fw && (prev && prev->isAncestorOf(fw))) { // focus was on old page + if (focusWasOnOldPage) { // look for the best focus widget we can find if (QWidget *nfw = next->focusWidget()) nfw->setFocus(); else { // second best: first child widget in the focus chain - QWidget *i = fw; - while ((i = i->nextInFocusChain()) != fw) { - if (((i->focusPolicy() & Qt::TabFocus) == Qt::TabFocus) - && !i->focusProxy() && i->isVisibleTo(next) && i->isEnabled() - && next->isAncestorOf(i)) { - i->setFocus(); - break; + if (QWidget *i = fw) { + while ((i = i->nextInFocusChain()) != fw) { + if (((i->focusPolicy() & Qt::TabFocus) == Qt::TabFocus) + && !i->focusProxy() && i->isVisibleTo(next) && i->isEnabled() + && next->isAncestorOf(i)) { + i->setFocus(); + break; + } } + // third best: incoming widget + if (i == fw ) + next->setFocus(); } - // third best: incoming widget - if (i == fw ) - next->setFocus(); } } } diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp index c5694d9d8c..a2e363f991 100644 --- a/src/widgets/widgets/qdockwidget.cpp +++ b/src/widgets/widgets/qdockwidget.cpp @@ -1000,6 +1000,14 @@ void QDockWidgetPrivate::plug(const QRect &rect) setWindowState(false, false, rect); } +static void setFrameStrutEventsEnabled(const QWidget *w, bool enabled) +{ + if (const QWindow *window = w->windowHandle()) + if (QPlatformWindow *platformWindow = window->handle()) + if (platformWindow->frameStrutEventsEnabled() != enabled) + platformWindow->setFrameStrutEventsEnabled(enabled); +} + void QDockWidgetPrivate::setWindowState(bool floating, bool unplug, const QRect &rect) { Q_Q(QDockWidget); @@ -1053,9 +1061,7 @@ void QDockWidgetPrivate::setWindowState(bool floating, bool unplug, const QRect } if (floating && nativeDeco) - if (const QWindow *window = q->windowHandle()) - if (QPlatformWindow *platformWindow = window->handle()) - platformWindow->setFrameStrutEventsEnabled(true); + setFrameStrutEventsEnabled(q, true); resizer->setActive(QWidgetResizeHandler::Resize, !unplug && floating && !nativeDeco); } @@ -1391,6 +1397,8 @@ bool QDockWidget::event(QEvent *event) emit visibilityChanged(false); break; case QEvent::Show: + if (static_cast(QDockWidget::layout())->nativeWindowDeco(isFloating())) + setFrameStrutEventsEnabled(this, true); d->toggleViewAction->setChecked(true); emit visibilityChanged(geometry().right() >= 0 && geometry().bottom() >= 0); break; diff --git a/src/widgets/widgets/qmdisubwindow.cpp b/src/widgets/widgets/qmdisubwindow.cpp index a3219e69d7..7ea2369ba5 100644 --- a/src/widgets/widgets/qmdisubwindow.cpp +++ b/src/widgets/widgets/qmdisubwindow.cpp @@ -160,7 +160,7 @@ #include #include #include -#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC) #include #endif #include @@ -296,7 +296,7 @@ static void showToolTip(QHelpEvent *helpEvent, QWidget *widget, const QStyleOpti Q_ASSERT(helpEvent->type() == QEvent::ToolTip); Q_ASSERT(widget); -#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC) // Native Mac windows don't show tool tip. if (qobject_cast(widget->style())) return; @@ -1071,7 +1071,7 @@ void QMdiSubWindowPrivate::updateCursor() { #ifndef QT_NO_CURSOR Q_Q(QMdiSubWindow); -#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC) if (qobject_cast(q->style())) return; #endif @@ -1491,7 +1491,7 @@ void QMdiSubWindowPrivate::processClickedSubControl() q->showNormal(); break; case QStyle::SC_TitleBarMinButton: -#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC) if (qobject_cast(q->style())) { if (q->isMinimized()) q->showNormal(); @@ -1508,7 +1508,7 @@ void QMdiSubWindowPrivate::processClickedSubControl() q->showNormal(); break; case QStyle::SC_TitleBarMaxButton: -#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC) if (qobject_cast(q->style())) { if (q->isMaximized()) q->showNormal(); @@ -1555,7 +1555,7 @@ QRegion QMdiSubWindowPrivate::getRegion(Operation operation) const } QRegion region; -#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC) if (qobject_cast(q->style())) return region; #endif @@ -1709,7 +1709,7 @@ int QMdiSubWindowPrivate::titleBarHeight(const QStyleOptionTitleBar &options) co } int height = q->style()->pixelMetric(QStyle::PM_TitleBarHeight, &options, q); -#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC) // ### Fix mac style, the +4 pixels hack is not necessary anymore if (qobject_cast(q->style())) height -= 4; @@ -1764,7 +1764,7 @@ bool QMdiSubWindowPrivate::drawTitleBarWhenMaximized() const if (isChildOfTabbedQMdiArea(q)) return false; -#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC) || defined(Q_OS_WINCE_WM) +#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC) || defined(Q_OS_WINCE_WM) return true; #else if (q->style()->styleHint(QStyle::SH_Workspace_FillSpaceOnMaximize, 0, q)) @@ -2172,7 +2172,7 @@ void QMdiSubWindowPrivate::setSizeGrip(QSizeGrip *newSizeGrip) return; newSizeGrip->setFixedSize(newSizeGrip->sizeHint()); bool putSizeGripInLayout = layout ? true : false; -#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC) if (qobject_cast(q->style())) putSizeGripInLayout = false; #endif @@ -2228,7 +2228,8 @@ void QMdiSubWindowPrivate::updateInternalWindowTitle() Note that only \l{QMdiSubWindow}s can be set as children of QMdiArea; you cannot, for instance, write: - \badcode + \code + //bad code QMdiArea mdiArea; QTextEdit editor(&mdiArea); // invalid child widget \endcode @@ -2255,7 +2256,7 @@ QMdiSubWindow::QMdiSubWindow(QWidget *parent, Qt::WindowFlags flags) d->titleBarPalette = d->desktopPalette(); d->font = QApplication::font("QMdiSubWindowTitleBar"); // We don't want the menu icon by default on mac. -#ifndef Q_WS_MAC +#ifndef Q_OS_MAC if (windowIcon().isNull()) d->menuIcon = style()->standardIcon(QStyle::SP_TitleBarMenuButton, 0, this); else @@ -2823,7 +2824,7 @@ bool QMdiSubWindow::event(QEvent *event) d->isMaximizeMode = false; d->isWidgetHiddenByUs = false; if (!parent()) { -#if !defined(QT_NO_SIZEGRIP) && defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC) +#if !defined(QT_NO_SIZEGRIP) && defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC) if (qobject_cast(style())) delete d->sizeGrip; #endif @@ -2918,7 +2919,7 @@ void QMdiSubWindow::showEvent(QShowEvent *showEvent) return; } -#if !defined(QT_NO_SIZEGRIP) && defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC) +#if !defined(QT_NO_SIZEGRIP) && defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC) if (qobject_cast(style()) && !d->sizeGrip && !(windowFlags() & Qt::FramelessWindowHint)) { d->setSizeGrip(new QSizeGrip(0)); @@ -3312,7 +3313,7 @@ void QMdiSubWindow::mouseMoveEvent(QMouseEvent *mouseEvent) hoverRegion += style()->subControlRect(QStyle::CC_TitleBar, &options, d->hoveredSubControl, this); } -#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC) if (qobject_cast(style()) && !hoverRegion.isEmpty()) hoverRegion += QRegion(0, 0, width(), d->titleBarHeight(options)); #endif @@ -3522,7 +3523,7 @@ QSize QMdiSubWindow::minimumSizeHint() const int sizeGripHeight = 0; if (d->sizeGrip && d->sizeGrip->isVisibleTo(const_cast(this))) sizeGripHeight = d->sizeGrip->height(); -#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC) else if (parent() && qobject_cast(style()) && !d->sizeGrip) sizeGripHeight = style()->pixelMetric(QStyle::PM_SizeGripSize, 0, this); #endif diff --git a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp index 6198aa8668..2163426cac 100644 --- a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp +++ b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp @@ -600,9 +600,6 @@ void tst_QMdiSubWindow::showShaded() else #endif mouseReceiver = window; -#ifdef Q_OS_MAC - QEXPECT_FAIL("", "QTBUG-25297", Abort); -#endif QVERIFY(mouseReceiver); sendMouseMove(mouseReceiver, mousePosition, Qt::NoButton); sendMousePress(mouseReceiver, mousePosition); @@ -711,9 +708,6 @@ void tst_QMdiSubWindow::setOpaqueResizeAndMove() mouseReceiver = qFindChild(window); else mouseReceiver = window; -#ifdef Q_OS_MAC - QEXPECT_FAIL("", "QTBUG-25297", Abort); -#endif QVERIFY(mouseReceiver); // ----------------------------- resize ----------------------------- @@ -1451,9 +1445,6 @@ void tst_QMdiSubWindow::defaultSizeGrip() // QSizeGrip on windows with decoration. QMdiSubWindow *windowWithDecoration = mdiArea.addSubWindow(new QWidget); windowWithDecoration->show(); -#ifdef Q_OS_MAC - QEXPECT_FAIL("", "QTBUG-25297", Abort); -#endif QVERIFY(qFindChild(windowWithDecoration)); // ...but not on windows without decoration (Qt::FramelessWindowHint). @@ -1713,9 +1704,6 @@ void tst_QMdiSubWindow::fixedMinMaxSize() // to minimize the window. subWindow->showMinimized(); QVERIFY(subWindow->isMinimized()); -#ifdef Q_OS_MAC - QEXPECT_FAIL("", "QTBUG-25297", Abort); -#endif QCOMPARE(subWindow->size(), minimizedSize); QCOMPARE(subWindow->minimumSize(), minimizedSize); diff --git a/tests/auto/widgets/widgets/qstackedwidget/tst_qstackedwidget.cpp b/tests/auto/widgets/widgets/qstackedwidget/tst_qstackedwidget.cpp index 3b5c73ca57..c17db4c7f3 100644 --- a/tests/auto/widgets/widgets/qstackedwidget/tst_qstackedwidget.cpp +++ b/tests/auto/widgets/widgets/qstackedwidget/tst_qstackedwidget.cpp @@ -47,6 +47,7 @@ #include #include #include +#include class tst_QStackedWidget : public QObject { @@ -58,7 +59,8 @@ public: private slots: void getSetCheck(); - void testMinimumSize(); + void testMinimumSize(); + void dynamicPages(); }; tst_QStackedWidget::tst_QStackedWidget() @@ -72,15 +74,15 @@ tst_QStackedWidget::~tst_QStackedWidget() // Testing that stackedwidget respect the minimum size of it's contents (task 95319) void tst_QStackedWidget::testMinimumSize() { - QWidget w; + QWidget w; QStackedWidget sw(&w); QPushButton button("Text", &sw); - sw.addWidget(&button); + sw.addWidget(&button); QHBoxLayout hboxLayout; hboxLayout.addWidget(&sw); w.setLayout(&hboxLayout); w.show(); - QVERIFY(w.minimumSize() != QSize(0, 0)); + QVERIFY(w.minimumSize() != QSize(0, 0)); } // Testing get/set functions @@ -111,11 +113,97 @@ void tst_QStackedWidget::getSetCheck() // has no problem handling out-of-bounds indices. // ("convenience function" => "just another way of achieving the // same goal") - obj1.setCurrentWidget((QWidget *)0); + obj1.setCurrentWidget((QWidget *)0); QCOMPARE(obj1.currentWidget(), var2); #endif delete var2; } +// QTBUG-18242, a widget that deletes its children in hideEvent(). +// This caused a crash in QStackedLayout::setCurrentIndex() since +// the focus widget was destroyed while hiding the previous page. +class TestPage : public QWidget +{ +public: + TestPage (bool staticWidgets = false) : QWidget(0), m_staticWidgets(staticWidgets) + { + new QVBoxLayout (this); + } + + ~TestPage() { + destroyWidgets(); + } + + void setN(int n) + { + m_n = n; + if (m_staticWidgets) + createWidgets(); + } + + virtual void showEvent (QShowEvent *) + { + if (!m_staticWidgets) + createWidgets(); + } + + virtual void hideEvent (QHideEvent *) + { + if (!m_staticWidgets) + destroyWidgets(); + } + +private: + void createWidgets() { + for (int i = 0; i < m_n; ++i) { + QLineEdit *le = new QLineEdit(this); + le->setObjectName(QString::fromLatin1("lineEdit%1").arg(i)); + layout ()->addWidget(le); + m_les << le; + } + } + + void destroyWidgets() + { + qDeleteAll(m_les); + m_les.clear (); + } + + int m_n; + const bool m_staticWidgets; + QList m_les; +}; + +void tst_QStackedWidget::dynamicPages() +{ + QStackedWidget *sw = new QStackedWidget; + + TestPage *w1 = new TestPage(true); + w1->setN(3); + + TestPage *w2 = new TestPage; + w2->setN(3); + + sw->addWidget(w1); + sw->addWidget(w2); + + QLineEdit *le11 = w1->findChild(QLatin1String("lineEdit1")); + le11->setFocus(); // set focus to second widget in the page + sw->resize(200, 200); + sw->show(); + qApp->setActiveWindow(sw); + QTest::qWaitForWindowActive(sw); + QTRY_COMPARE(QApplication::focusWidget(), le11); + + sw->setCurrentIndex(1); + QLineEdit *le22 = w2->findChild(QLatin1String("lineEdit2")); + le22->setFocus(); + QTRY_COMPARE(QApplication::focusWidget(), le22); + // Going back should move focus back to le11 + sw->setCurrentIndex(0); + QTRY_COMPARE(QApplication::focusWidget(), le11); + +} + QTEST_MAIN(tst_QStackedWidget) #include "tst_qstackedwidget.moc" diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 3d9c0c8ab4..29c1e4a661 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -3029,6 +3029,7 @@ void Configure::generateQConfigPri() configStream << "CONFIG+= "; configStream << dictionary[ "BUILD" ]; + configStream << (dictionary[ "SHARED" ] == "no" ? " static" : " shared"); if (dictionary[ "LTCG" ] == "yes") configStream << " ltcg";