From 7a8ee6b2f3c9c7cc6a2833ea332a3e35a4958f6e Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Tue, 5 Jan 2010 13:42:49 +0100 Subject: Prevent a crash when creating an inputContext from the QApplication dtor. When accessing the global input context from the QWidget destructor access it directly instead of calling a helper function. Don't even bother to create an input context if QApplication is being destroyed (just in case if the user is calling the QApplication::inputContext manually from the destructor). Task-number: QTBUG-7105 Reviewed-by: Simon Hausmann (cherry picked from commit f72165460d27860cabd51691f4d935fd74b50f80) --- src/gui/kernel/qapplication.cpp | 2 ++ src/gui/kernel/qwidget_x11.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index d474391..df36466 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -5230,6 +5230,8 @@ QInputContext *QApplication::inputContext() const { Q_D(const QApplication); Q_UNUSED(d);// only static members being used. + if (QApplicationPrivate::is_app_closing) + return d->inputContext; #ifdef Q_WS_X11 if (!X11) return 0; diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp index 3135ece..87c9885 100644 --- a/src/gui/kernel/qwidget_x11.cpp +++ b/src/gui/kernel/qwidget_x11.cpp @@ -1084,7 +1084,7 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows) } else { // release previous focus information participating with // preedit preservation of qic - QInputContext *qic = inputContext(); + QInputContext *qic = QApplicationPrivate::inputContext; if (qic) qic->widgetDestroyed(this); } -- cgit v0.12 From b76d3f7e6d4fe2acc874b91515a4ae33388748cb Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 12 Jan 2010 09:42:00 +0100 Subject: Prevent a crash when creating an inputContext from the QApplication dtor. Complete the fix in f72165460d27860cabd51691f4d935fd74b50f80 by applying the same fix to Symbian and QWS. Task-number: QTBUG-7105 Reviewed-by: Alexis Reviewed-by: Jason McDonald (cherry picked from commit 8b56ffee8bb4ec0c56c2c05ccc1e088f6d9ae8a8) --- src/gui/kernel/qwidget_qws.cpp | 2 +- src/gui/kernel/qwidget_s60.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qwidget_qws.cpp b/src/gui/kernel/qwidget_qws.cpp index e6b473d..f5f9ed6 100644 --- a/src/gui/kernel/qwidget_qws.cpp +++ b/src/gui/kernel/qwidget_qws.cpp @@ -287,7 +287,7 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows) } else { // release previous focus information participating with // preedit preservation of qic -- while we still have a winId - QInputContext *qic = inputContext(); + QInputContext *qic = QApplicationPrivate::inputContext; if (qic) qic->widgetDestroyed(this); } diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index bab3b40..0e92db5 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -1152,7 +1152,7 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows) if (d->ic) { delete d->ic; } else { - QInputContext *ic = inputContext(); + QInputContext *ic = QApplicationPrivate::inputContext; if (ic) { ic->widgetDestroyed(this); } -- cgit v0.12 From fa54cd8d2a3edf2e994c5b287ae3c1f3506b72bc Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 7 Jan 2010 12:23:01 +0100 Subject: doc: Added enum values to table for Qt 4.5 and 4.6. Task-number: QTBUG-7156 (cherry picked from commit 45af493eeeb408f756cc7d76088cbc3e35f5f54b) --- src/corelib/io/qdatastream.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/corelib/io/qdatastream.cpp b/src/corelib/io/qdatastream.cpp index 1383a3b..5eb25d6 100644 --- a/src/corelib/io/qdatastream.cpp +++ b/src/corelib/io/qdatastream.cpp @@ -592,15 +592,17 @@ void QDataStream::setByteOrder(ByteOrder bo) recommend that you do; see \l{Versioning} in the Detailed Description. - In order to accommodate new functionality, the datastream - serialization format of some Qt classes has changed in some - versions of Qt. If you want to read data that was created by an - earlier version of Qt, or write data that can be read by a - program that was compiled with an earlier version of Qt, use this - function to modify the serialization format used by QDataStream. + To accommodate new functionality, the datastream serialization + format of some Qt classes has changed in some versions of Qt. If + you want to read data that was created by an earlier version of + Qt, or write data that can be read by a program that was compiled + with an earlier version of Qt, use this function to modify the + serialization format used by QDataStream. \table \header \i Qt Version \i QDataStream Version + \row \i Qt 4.6 \i 12 + \row \i Qt 4.5 \i 11 \row \i Qt 4.4 \i 10 \row \i Qt 4.3 \i 9 \row \i Qt 4.2 \i 8 -- cgit v0.12 From 03e14562078b1849b2fa03aeef71c3debd2e95ee Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 7 Jan 2010 13:51:56 +0100 Subject: doc: Corrected parameter value in snippet. Task-number: QTBUG-7158 (cherry picked from commit 52ecb299691defc3be6d202c7fab71bf865c710a) --- doc/src/snippets/code/doc_src_properties.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/snippets/code/doc_src_properties.qdoc b/doc/src/snippets/code/doc_src_properties.qdoc index 9845abb..2567b2a 100644 --- a/doc/src/snippets/code/doc_src_properties.qdoc +++ b/doc/src/snippets/code/doc_src_properties.qdoc @@ -112,7 +112,7 @@ MyClass *myinstance = new MyClass; QObject *object = myinstance; myinstance->setPriority(MyClass::VeryHigh); -object->setProperty("priority", "VeryHigh"); +object->setProperty("priority", (int)MyClass::VeryHigh); //! [6] -- cgit v0.12 From ecd7ceff04a9f26932a5cd3bbcd5e0eb426ff713 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 11 Jan 2010 13:43:31 +0100 Subject: doc: Corrected explanation of when append() does nothing. Task-number: QTBUG-7246 (cherry picked from commit 8e2c575f6383a69e9c1d4f069e3c8e3b219197b5) --- src/corelib/tools/qbytearray.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index 517927a..6f29057 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -1591,8 +1591,9 @@ QByteArray& QByteArray::append(const char *str) array and returns a reference to this byte array. If \a len is negative, the length of the string will be determined - automatically using qstrlen(). If \a len is zero or the length of the - string is zero, nothing will be appended to the byte array. + automatically using qstrlen(). If \a len is zero or \a str is + null, nothing is appended to the byte array. Ensure that \a len is + \e not longer than \a str. */ QByteArray &QByteArray::append(const char *str, int len) -- cgit v0.12 From 3f077666ea4547580fa4568499e8ecf6174b392e Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 12 Jan 2010 12:29:35 +0200 Subject: Added absolute path to sqlite3.sis in s60installs.pro Relative path was only working when package was created from s60installs directory. Binary installer creation requires package creation to work also from Qt root, so added absolute path to sqlite3.sis. Task-number: QTBUG-7275 Reviewed-by: Janne Anttila (cherry picked from commit 008bae01b016926209dddacc6e31c79b9d99d4f7) --- src/s60installs/s60installs.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro index eb35419..bbc758b 100644 --- a/src/s60installs/s60installs.pro +++ b/src/s60installs/s60installs.pro @@ -36,7 +36,7 @@ symbian: { sqlitedeployment = \ "; Deploy sqlite onto phone that does not have it already" \ - "@\"sqlite3.sis\", (0x2002af5f)" + "@\"$$PWD/sqlite3.sis\", (0x2002af5f)" qtlibraries.pkg_postrules += sqlitedeployment qtlibraries.path = c:/sys/bin -- cgit v0.12 From d1ece2b76abf64b7dff250551c5aeb3bbf5803e3 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 6 Jan 2010 12:32:25 +0100 Subject: Remove special Phonon processing from syncqt. Restore original Qt 4.4 behaviour. The capital P headers are not correct because of frameworks on Mac. More info, see thread: http://lists.kde.org/?l=kde-multimedia&m=126045273702498&w=2 Task-number: QTBUG-4685 Reviewed-by: Trust Me (cherry picked from commit 72adb8f5710fea385e94f9726546397cfbb1e4ad) --- bin/syncqt | 23 +++++++++++------------ mkspecs/features/qt.prf | 3 --- src/qt_install.pri | 2 +- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/bin/syncqt b/bin/syncqt index 629e124..620256e 100755 --- a/bin/syncqt +++ b/bin/syncqt @@ -800,9 +800,11 @@ foreach (@modules_to_sync) { foreach(@classes) { my $header_base = basename($header); my $class = $_; - if ($class =~ m/::/) { - $class =~ s,::,/,g; - } + # Strip namespaces: + $class =~ s/^.*:://; +# if ($class =~ m/::/) { +# class =~ s,::,/,g; +# } $class_lib_map_contents .= "QT_CLASS_LIB($_, $lib, $header_base)\n"; $header_copies++ if(syncHeader("$out_basedir/include/$lib/$class", "$out_basedir/include/$lib/$header", 0)); } @@ -824,9 +826,11 @@ foreach (@modules_to_sync) { my $pri_install_iheader = fixPaths($iheader, $current_dir); foreach(@classes) { my $class = $_; - if ($class =~ m/::/) { - $class =~ s,::,/,g; - } + # Strip namespaces: + $class =~ s/^.*:://; +# if ($class =~ m/::/) { +# $class =~ s,::,/,g; +# } my $class_header = fixPaths("$out_basedir/include/$lib/$class", $current_dir) . " "; $pri_install_classes .= $class_header @@ -851,12 +855,7 @@ foreach (@modules_to_sync) { unless($showonly) { my @master_includes; - if ($lib eq "phonon") { - push @master_includes, "$out_basedir/include/phonon_compat/phonon/phonon"; - push @master_includes, "$out_basedir/include/phonon/Phonon/Phonon"; - } else { - push @master_includes, "$out_basedir/include/$lib/$lib"; - } + push @master_includes, "$out_basedir/include/$lib/$lib"; foreach my $master_include (@master_includes) { #generate the "master" include file $pri_install_files .= fixPaths($master_include, "$modules{$lib}") . " "; #get the master file installed too diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf index af93f11..831f5b6 100644 --- a/mkspecs/features/qt.prf +++ b/mkspecs/features/qt.prf @@ -160,9 +160,6 @@ for(QTLIB, $$list($$lower($$unique(QT)))) { else:isEqual(QTLIB, dbus):qlib = QtDBus else:isEqual(QTLIB, phonon) { qlib = phonon - INCLUDEPATH += $$QMAKE_INCDIR_QT/phonon_compat/phonon - INCLUDEPATH += $$QMAKE_INCDIR_QT/phonon_compat - INCLUDEPATH += $$QMAKE_INCDIR_QT/phonon/Phonon # The Helix backend requires this. Since we can't let a plugin set it, # we bump the values for all Symbian Phonon plugins. diff --git a/src/qt_install.pri b/src/qt_install.pri index 5b29942..f906e92 100644 --- a/src/qt_install.pri +++ b/src/qt_install.pri @@ -16,7 +16,7 @@ qt_install_headers { } equals(TARGET, phonon) { - class_headers.path = $$[QT_INSTALL_HEADERS]/$$TARGET/Phonon + class_headers.path = $$[QT_INSTALL_HEADERS]/$$TARGET } else { flat_headers.files = $$INSTALL_HEADERS flat_headers.path = $$[QT_INSTALL_HEADERS]/Qt -- cgit v0.12 From 76d6c14a5c39b72cb4569bc71f4acb929a0eed79 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 6 Jan 2010 14:18:39 +0100 Subject: Use the lowercase/shortname.h headers for Phonon includes Task-number: QTBUG-4685 Reviewed-by: TrustMe (cherry picked from commit bd01114b3fcf2cc702fdd9e303a15bcc900cfe95) --- demos/qmediaplayer/mediaplayer.h | 18 +++++++++--------- examples/phonon/capabilities/window.h | 16 ++++++++-------- examples/phonon/qmusicplayer/mainwindow.h | 10 +++++----- .../src/plugins/phononwidgets/videoplayertaskmenu.h | 4 ++-- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/demos/qmediaplayer/mediaplayer.h b/demos/qmediaplayer/mediaplayer.h index 32cabf4..c663399 100644 --- a/demos/qmediaplayer/mediaplayer.h +++ b/demos/qmediaplayer/mediaplayer.h @@ -50,15 +50,15 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include QT_BEGIN_NAMESPACE class QPushButton; diff --git a/examples/phonon/capabilities/window.h b/examples/phonon/capabilities/window.h index 04f1e59..3890f13 100644 --- a/examples/phonon/capabilities/window.h +++ b/examples/phonon/capabilities/window.h @@ -44,14 +44,14 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include QT_BEGIN_NAMESPACE diff --git a/examples/phonon/qmusicplayer/mainwindow.h b/examples/phonon/qmusicplayer/mainwindow.h index 6fbdca3..813747a 100644 --- a/examples/phonon/qmusicplayer/mainwindow.h +++ b/examples/phonon/qmusicplayer/mainwindow.h @@ -43,11 +43,11 @@ #define MAINWINDOW_H #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include QT_BEGIN_NAMESPACE diff --git a/tools/designer/src/plugins/phononwidgets/videoplayertaskmenu.h b/tools/designer/src/plugins/phononwidgets/videoplayertaskmenu.h index 5713cde..daf906e 100644 --- a/tools/designer/src/plugins/phononwidgets/videoplayertaskmenu.h +++ b/tools/designer/src/plugins/phononwidgets/videoplayertaskmenu.h @@ -47,8 +47,8 @@ #include #include -#include -#include +#include +#include QT_BEGIN_NAMESPACE -- cgit v0.12 From 101619014a7ac9c989c57202c67b939d4d765093 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 12 Jan 2010 13:09:31 +0100 Subject: doc: Updated the descriptions of the connection types. Replaced the ambiguous "delivered" with the explanation that the blocking queued connection type blocks the emitter's thread until the slot finishes executing in the receiver's thread. Task-number: QTBUG-6392 (cherry picked from commit 4da15757269feb872432c43a3516a1349d6dcf39) --- doc/src/frameworks-technologies/threads.qdoc | 45 +++++++++++------ src/corelib/global/qnamespace.qdoc | 73 ++++++++++++++++------------ src/corelib/kernel/qobject.cpp | 2 +- 3 files changed, 73 insertions(+), 47 deletions(-) diff --git a/doc/src/frameworks-technologies/threads.qdoc b/doc/src/frameworks-technologies/threads.qdoc index fa173c5..fbfe94b 100644 --- a/doc/src/frameworks-technologies/threads.qdoc +++ b/doc/src/frameworks-technologies/threads.qdoc @@ -472,24 +472,37 @@ \section1 Signals and Slots Across Threads - Qt supports three types of signal-slot connections: + Qt supports these signal-slot connection types: \list - \o With \l{Qt::DirectConnection}{direct connections}, the - slot gets called immediately when the signal is emitted. The - slot is executed in the thread that emitted the signal (which - is not necessarily the thread where the receiver object - lives). - - \o With \l{Qt::QueuedConnection}{queued connections}, the - slot is invoked when control returns to the event loop of the - thread to which the object belongs. The slot is executed in - the thread where the receiver object lives. - - \o With \l{Qt::AutoConnection}{auto connections} (the default), - the behavior is the same as with direct connections if - the signal is emitted in the thread where the receiver lives; - otherwise, the behavior is that of a queued connection. + + \o \l{Qt::AutoConnection}{Auto Connection} (default) The behavior + is the same as the Direct Connection, if the emitter and + receiver are in the same thread. The behavior is the same as + the Queued Connection, if the emitter and receiver are in + different threads. + + \o \l{Qt::DirectConnection}{Direct Connection} The slot is invoked + immediately, when the signal is emitted. The slot is executed + in the emitter's thread, which is not necessarily the + receiver's thread. + + \o \l{Qt::QueuedConnection}{Queued Connection} The slot is invoked + when control returns to the event loop of the receiver's + thread. The slot is executed in the receiver's thread. + + \o \l{Qt::BlockingQueuedConnection}{Blocking Queued Connection} + The slot is invoked as for the Queued Connection, except the + current thread blocks until the slot returns. \note Using this + type to connect objects in the same thread will cause deadlock. + + \o \l{Qt::UniqueConnection}{Unique Connection} The behavior is the + same as the Auto Connection, but the connection is made only if + it does not duplicate an existing connection. i.e., if the same + signal is already connected to the same slot for the same pair + of objects, then the connection is not made and connect() + returns false. + \endlist The connection type can be specified by passing an additional diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index e40e51b..e663268 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -515,45 +515,58 @@ /*! \enum Qt::ConnectionType - This enum describes the types of connection that can be used between signals and - slots. In particular, it determines whether a particular signal is delivered to a - slot immediately or queued for delivery at a later time. + This enum describes the types of connection that can be used + between signals and slots. In particular, it determines whether a + particular signal is delivered to a slot immediately or queued for + delivery at a later time. + + \value AutoConnection + (default) Same as DirectConnection, if the emitter and + receiver are in the same thread. Same as QueuedConnection, + if the emitter and receiver are in different threads. + + \value DirectConnection + The slot is invoked immediately, when the signal is + emitted. + + \value QueuedConnection + The slot is invoked when control returns to the event loop + of the receiver's thread. The slot is executed in the + receiver's thread. - \value DirectConnection When emitted, the signal is immediately delivered to the slot. - \value QueuedConnection When emitted, the signal is queued until the event loop is - able to deliver it to the slot. \value BlockingQueuedConnection - Same as QueuedConnection, except that the current thread blocks - until the slot has been delivered. This connection type should - only be used for receivers in a different thread. Note that misuse - of this type can lead to deadlocks in your application. - \value AutoConnection If the signal is emitted from the thread - in which the receiving object lives, the - slot is invoked directly, as with - Qt::DirectConnection; otherwise the - signal is queued, as with - Qt::QueuedConnection. - \value UniqueConnection Same as AutoConnection, but there will be a check that the signal is - not already connected to the same slot before connecting, otherwise, - the connection will fail. - This value was introduced in Qt 4.6. + Same as QueuedConnection, except the current thread blocks + until the slot returns. This connection type should only be + used where the emitter and receiver are in different + threads. \note Violating this rule can cause your + application to deadlock. + + \value UniqueConnection + Same as AutoConnection, but the connection is made only if + it does not duplicate an existing connection. i.e., if the + same signal is already connected to the same slot for the + same pair of objects, then the connection will fail. This + connection type was introduced in Qt 4.6. + \value AutoCompatConnection - The default connection type for signals and slots when Qt 3 support - is enabled. Equivalent to AutoConnection for connections but will cause warnings - to be output under certain circumstances. See - \l{Porting to Qt 4#Compatibility Signals and Slots}{Compatibility Signals and Slots} - for further information. + The default type when Qt 3 support is enabled. Same as + AutoConnection but will also cause warnings to be output in + certain situations. See \l{Porting to Qt 4#Compatibility + Signals and Slots}{Compatibility Signals and Slots} for + further information. - With queued connections, the parameters must be of types that are known to - Qt's meta-object system, because Qt needs to copy the arguments to store them - in an event behind the scenes. If you try to use a queued connection and - get the error message + With queued connections, the parameters must be of types that are + known to Qt's meta-object system, because Qt needs to copy the + arguments to store them in an event behind the scenes. If you try + to use a queued connection and get the error message: \snippet doc/src/snippets/code/doc_src_qnamespace.qdoc 0 - call qRegisterMetaType() to register the data type before you + Call qRegisterMetaType() to register the data type before you establish the connection. + When using signals and slots with multiple threads, see \l{Signals and Slots Across Threads}. + \sa {Thread Support in Qt}, QObject::connect(), qRegisterMetaType() */ diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 2a71e88..fc6ac33 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -2456,7 +2456,7 @@ int QObject::receivers(const char *signal) const If you pass the Qt::UniqueConnection \a type, the connection will only be made if it is not a duplicate. If there is already a duplicate (exact same signal to the exact same slot on the same objects), - the connection will fail and connect will return false + the connection will fail and connect will return false. The optional \a type parameter describes the type of connection to establish. In particular, it determines whether a particular -- cgit v0.12 From 0bf13d5b011843bf2a15d8eff884f81e489e1dcc Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 6 Jan 2010 14:33:01 +0100 Subject: doc: Clarified that .lnk files are System files on Windows. Task-number: QTBUG-6615 (cherry picked from commit 73b7ff354f9eaf5819847dac0c147351c80d8a9b) --- src/gui/styles/qstyleoption.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/styles/qstyleoption.cpp b/src/gui/styles/qstyleoption.cpp index bfbdd6f..a8a6334 100644 --- a/src/gui/styles/qstyleoption.cpp +++ b/src/gui/styles/qstyleoption.cpp @@ -2836,8 +2836,8 @@ QStyleOptionComplex::QStyleOptionComplex(int version, int type) /*! \variable QStyleOptionComplex::activeSubControls - \brief a bitwise OR of the various sub-controls that are active - (pressed) for the complex control + \brief a bitwise OR of the \l{QStyle::SubControl} {sub-controls} + that are active for the complex control The default value is QStyle::SC_None. -- cgit v0.12 From a6236b2028ae5197da3e9701b5052611bda1a2fe Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 6 Jan 2010 14:57:15 +0100 Subject: doc: Clarified activeSubControls and subControls. Task-number: QTBUG-6405 (cherry picked from commit e2734782e72fccbc3bf528f201bac50703718b54) --- src/gui/styles/qstyleoption.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gui/styles/qstyleoption.cpp b/src/gui/styles/qstyleoption.cpp index a8a6334..5084ffd 100644 --- a/src/gui/styles/qstyleoption.cpp +++ b/src/gui/styles/qstyleoption.cpp @@ -2826,8 +2826,9 @@ QStyleOptionComplex::QStyleOptionComplex(int version, int type) /*! \variable QStyleOptionComplex::subControls - \brief a bitwise OR of the various sub-controls that need to be - drawn for the complex control + + This variable holds a bitwise OR of the \l{QStyle::SubControl} + {sub-controls} to be drawn for the complex control. The default value is QStyle::SC_All. @@ -2836,8 +2837,9 @@ QStyleOptionComplex::QStyleOptionComplex(int version, int type) /*! \variable QStyleOptionComplex::activeSubControls - \brief a bitwise OR of the \l{QStyle::SubControl} {sub-controls} - that are active for the complex control + + This variable holds a bitwise OR of the \l{QStyle::SubControl} + {sub-controls} that are active for the complex control. The default value is QStyle::SC_None. -- cgit v0.12 From d718754c22d1b5a6aa218f48d4b4aae57f5654df Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 7 Jan 2010 14:25:13 +0100 Subject: doc: Removed incorrect \inmodule command. Task-number: QTBUG-6606 (cherry picked from commit 86bb9a9f8b2a455d4f3f8f58bb1a0f751d68df35) --- src/corelib/xml/qxmlstream.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp index c2e2eda..3edfeae 100644 --- a/src/corelib/xml/qxmlstream.cpp +++ b/src/corelib/xml/qxmlstream.cpp @@ -2884,8 +2884,6 @@ QStringRef QXmlStreamReader::documentEncoding() const \brief The QXmlStreamWriter class provides an XML writer with a simple streaming API. - - \inmodule QtXml \ingroup xml-tools QXmlStreamWriter is the counterpart to QXmlStreamReader for writing -- cgit v0.12 From 57e5efffc994509c0c92b2f6a466889127c14b98 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 8 Jan 2010 12:47:14 +0100 Subject: doc: Explained parameter value defaults where appropriate. Task-number: QTBUG-6607 (cherry picked from commit 3aa77d64608f944592939c5d673f1b7dabec730f) --- doc/src/development/rcc.qdoc | 50 ++++++++++++++++++++++++-------------------- src/tools/rcc/rcc.cpp | 25 +++++++++++++++++----- 2 files changed, 47 insertions(+), 28 deletions(-) diff --git a/doc/src/development/rcc.qdoc b/doc/src/development/rcc.qdoc index b479915..162e65b 100644 --- a/doc/src/development/rcc.qdoc +++ b/doc/src/development/rcc.qdoc @@ -57,37 +57,41 @@ \table \header \o Option \o Argument \o Description - \row \o \c{-o} \o \o Writes output to file rather than - stdout. + \row \o \c{-o} \o \c{file} \o Writes output to \c{file} rather than + stdout. - \row \o \c{-name} \o \c name \o Creates an external initialization - function with name. + \row \o \c{-name} \o \c{name} \o Creates an external initialization + function with \c{name}. - \row \o \c{-threshold} \o \c level \o Specifies a threshold (in bytes) - to use when compressing files. If - the file is smaller than the - threshold, it will not be - compressed, independent of what - the compression level is. + \row \o \c{-threshold} \o \c{level} \o Specifies a threshold \c{level} (in + bytes) to use when deciding whether + to compress a file. If the file is + smaller than the threshold \c{level}, + it is not compressed. The default + threshold level is 70 bytes. - \row \o \c{-compress} \o \c level \o Compresses input files with the - given level. Level is an integer - from 1 to 9 - 1 being the fastest, - producing the least compression; - 9 being the slowest, producing - the most compression. + \row \o \c{-compress} \o \c{level} \o Compress input files to the given + compression \{level}, which is an + integer in the range 1 to 9. Level 1 + does the least compression but is + fastest. Level 9 does the most + compression but is slowest. To turn + off compression, use \c{-no-compress}. + The default value for \c{level} is -1, + which means use zlib's default + compression level. - \row \o \c{-root} \o \c path \o Prefixes the resource access path - with root path. + \row \o \c{-root} \o \c{path} \o Prefix the resource access path with \c{path}. + The default is no prefix. - \row \o \c{-no-compress} \o \o Disables all compression. + \row \o \c{-no-compress} \o \o Disables all compression. - \row \o \c{-binary} \o \o Outputs a binary file for use as - a dynamic resource. + \row \o \c{-binary} \o \o Outputs a binary file for use as a dynamic resource. - \row \o \c{-version} \o \o Displays version information. + \row \o \c{-version} \o \o Displays version information. + + \row \o \c{-help} \o \o Displays usage information. - \row \o \c{-help} \o \o Displays usage information. \endtable See also \l{The Qt Resource System} for more information about embedding diff --git a/src/tools/rcc/rcc.cpp b/src/tools/rcc/rcc.cpp index 2dd0582..954c4ad 100644 --- a/src/tools/rcc/rcc.cpp +++ b/src/tools/rcc/rcc.cpp @@ -452,8 +452,16 @@ bool RCCResourceLibrary::interpretResourceFile(QIODevice *inputDevice, else return false; } else if (file.isFile()) { - const bool arc = addFile(alias, RCCFileInfo(alias.section(slash, -1), file, language, country, - RCCFileInfo::NoFlags, compressLevel, compressThreshold)); + const bool arc = + addFile(alias, + RCCFileInfo(alias.section(slash, -1), + file, + language, + country, + RCCFileInfo::NoFlags, + compressLevel, + compressThreshold) + ); if (!arc) m_failedResources.push_back(absFileName); } else { @@ -473,9 +481,16 @@ bool RCCResourceLibrary::interpretResourceFile(QIODevice *inputDevice, it.next(); QFileInfo child(it.fileInfo()); if (child.fileName() != QLatin1String(".") && child.fileName() != QLatin1String("..")) { - const bool arc = addFile(alias + child.fileName(), - RCCFileInfo(child.fileName(), child, language, country, - RCCFileInfo::NoFlags, compressLevel, compressThreshold)); + const bool arc = + addFile(alias + child.fileName(), + RCCFileInfo(child.fileName(), + child, + language, + country, + RCCFileInfo::NoFlags, + compressLevel, + compressThreshold) + ); if (!arc) m_failedResources.push_back(child.fileName()); } -- cgit v0.12 From 6649a1f1340a6e3bf6fcc61e641add504797d77a Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 8 Jan 2010 12:58:18 +0100 Subject: doc: Fixed typos. Task-number: QTBUG-6607 (cherry picked from commit 8894467656973bd311bcc5822a38bdd0e171da51) --- doc/src/development/rcc.qdoc | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/doc/src/development/rcc.qdoc b/doc/src/development/rcc.qdoc index 162e65b..4c2e0c6 100644 --- a/doc/src/development/rcc.qdoc +++ b/doc/src/development/rcc.qdoc @@ -57,10 +57,9 @@ \table \header \o Option \o Argument \o Description - \row \o \c{-o} \o \c{file} \o Writes output to \c{file} rather than - stdout. + \row \o \c{-o} \o \c{file} \o Write output to \c{file} rather than to stdout. - \row \o \c{-name} \o \c{name} \o Creates an external initialization + \row \o \c{-name} \o \c{name} \o Create an external initialization function with \c{name}. \row \o \c{-threshold} \o \c{level} \o Specifies a threshold \c{level} (in @@ -71,7 +70,7 @@ threshold level is 70 bytes. \row \o \c{-compress} \o \c{level} \o Compress input files to the given - compression \{level}, which is an + compression \c{level}, which is an integer in the range 1 to 9. Level 1 does the least compression but is fastest. Level 9 does the most @@ -84,13 +83,13 @@ \row \o \c{-root} \o \c{path} \o Prefix the resource access path with \c{path}. The default is no prefix. - \row \o \c{-no-compress} \o \o Disables all compression. + \row \o \c{-no-compress} \o \o Disable compression. - \row \o \c{-binary} \o \o Outputs a binary file for use as a dynamic resource. + \row \o \c{-binary} \o \o Output a binary file for use as a dynamic resource. - \row \o \c{-version} \o \o Displays version information. + \row \o \c{-version} \o \o Display version information. - \row \o \c{-help} \o \o Displays usage information. + \row \o \c{-help} \o \o Display usage information. \endtable -- cgit v0.12 From 09b7479c73d3da868c04752c621af30f505559dc Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Wed, 6 Jan 2010 18:16:27 +0100 Subject: Fixes a crash when destroying and creating QApplication. Moved the gestureManager pointer to a QApplicationPrivate to make sure if QApplication object is destroyed, QGestureManager pointer is set to zero. Task-number: QTBUG-7029 Reviewed-by: Thiago (cherry picked from commit 828b1299e1ecb2da23799a2e49370e00dcf9c126) --- src/gui/graphicsview/qgraphicsscene.cpp | 10 ++++++---- src/gui/kernel/qapplication.cpp | 15 ++++++++++++--- src/gui/kernel/qapplication_p.h | 2 ++ src/gui/kernel/qgesturemanager.cpp | 9 --------- src/gui/kernel/qgesturemanager_p.h | 4 +--- 5 files changed, 21 insertions(+), 19 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 16ce26a..83ef110 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -1136,8 +1136,9 @@ bool QGraphicsScenePrivate::filterEvent(QGraphicsItem *item, QEvent *event) bool QGraphicsScenePrivate::sendEvent(QGraphicsItem *item, QEvent *event) { if (QGraphicsObject *object = item->toGraphicsObject()) { - if (qt_gestureManager) { - if (qt_gestureManager->filterEvent(object, event)) + QGestureManager *gestureManager = QApplicationPrivate::instance()->gestureManager; + if (gestureManager) { + if (gestureManager->filterEvent(object, event)) return true; } } @@ -6157,9 +6158,10 @@ void QGraphicsScenePrivate::cancelGesturesForChildren(QGesture *original, QWidge } } - Q_ASSERT(qt_gestureManager); // it would be very odd if we got called without a manager. + QGestureManager *gestureManager = QApplicationPrivate::instance()->gestureManager; + Q_ASSERT(gestureManager); // it would be very odd if we got called without a manager. for (setIter = canceledGestures.begin(); setIter != canceledGestures.end(); ++setIter) { - qt_gestureManager->recycle(*setIter); + gestureManager->recycle(*setIter); gestureTargets.remove(*setIter); } } diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index df36466..fb923be 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -177,6 +177,7 @@ QApplicationPrivate::QApplicationPrivate(int &argc, char **argv, QApplication::T directPainters = 0; #endif + gestureManager = 0; gestureWidget = 0; if (!self) @@ -3632,7 +3633,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e) } // walk through parents and check for gestures - if (qt_gestureManager) { + if (d->gestureManager) { switch (e->type()) { case QEvent::Paint: case QEvent::MetaCall: @@ -3664,13 +3665,13 @@ bool QApplication::notify(QObject *receiver, QEvent *e) break; default: if (receiver->isWidgetType()) { - if (qt_gestureManager->filterEvent(static_cast(receiver), e)) + if (d->gestureManager->filterEvent(static_cast(receiver), e)) return true; } else { // a special case for events that go to QGesture objects. // We pass the object to the gesture manager and it'll figure // out if it's QGesture or not. - if (qt_gestureManager->filterEvent(receiver, e)) + if (d->gestureManager->filterEvent(receiver, e)) return true; } } @@ -5678,6 +5679,14 @@ Q_GUI_EXPORT void qt_translateRawTouchEvent(QWidget *window, QApplicationPrivate::translateRawTouchEvent(window, deviceType, touchPoints); } +QGestureManager* QGestureManager::instance() +{ + QApplicationPrivate *qAppPriv = QApplicationPrivate::instance(); + if (!qAppPriv->gestureManager) + qAppPriv->gestureManager = new QGestureManager(qApp); + return qAppPriv->gestureManager; +} + QT_END_NAMESPACE #include "moc_qapplication.cpp" diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h index b004f95..e865399 100644 --- a/src/gui/kernel/qapplication_p.h +++ b/src/gui/kernel/qapplication_p.h @@ -84,6 +84,7 @@ class QInputContext; class QObject; class QWidget; class QSocketNotifier; +class QGestureManager; extern bool qt_is_gui_used; #ifndef QT_NO_CLIPBOARD @@ -509,6 +510,7 @@ public: void sendSyntheticEnterLeave(QWidget *widget); #endif + QGestureManager *gestureManager; QWidget *gestureWidget; QMap > widgetForTouchPointId; diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp index 4757656..a4604bf 100644 --- a/src/gui/kernel/qgesturemanager.cpp +++ b/src/gui/kernel/qgesturemanager.cpp @@ -67,15 +67,6 @@ QT_BEGIN_NAMESPACE -QGestureManager *qt_gestureManager = 0; - -QGestureManager* QGestureManager::instance() -{ - if (!qt_gestureManager) - qt_gestureManager = new QGestureManager(qApp); - return qt_gestureManager; -} - QGestureManager::QGestureManager(QObject *parent) : QObject(parent), state(NotGesture), m_lastCustomGestureId(0) { diff --git a/src/gui/kernel/qgesturemanager_p.h b/src/gui/kernel/qgesturemanager_p.h index 0e1f153..9c4658c 100644 --- a/src/gui/kernel/qgesturemanager_p.h +++ b/src/gui/kernel/qgesturemanager_p.h @@ -78,7 +78,7 @@ public: bool filterEvent(QGraphicsObject *receiver, QEvent *event); #endif //QT_NO_GRAPHICSVIEW - static QGestureManager* instance(); + static QGestureManager* instance(); // declared in qapplication.cpp void cleanupCachedGestures(QObject *target, Qt::GestureType type); @@ -142,8 +142,6 @@ private: void cancelGesturesForChildren(QGesture *originatingGesture); }; -extern QGestureManager *qt_gestureManager; - QT_END_NAMESPACE #endif // QGESTUREMANAGER_P_H -- cgit v0.12