summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/global/qnamespace.qdoc73
-rw-r--r--src/corelib/io/qdatastream.cpp14
-rw-r--r--src/corelib/kernel/qobject.cpp2
-rw-r--r--src/corelib/tools/qbytearray.cpp5
-rw-r--r--src/corelib/xml/qxmlstream.cpp2
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp10
-rw-r--r--src/gui/kernel/qapplication.cpp17
-rw-r--r--src/gui/kernel/qapplication_p.h2
-rw-r--r--src/gui/kernel/qgesturemanager.cpp9
-rw-r--r--src/gui/kernel/qgesturemanager_p.h4
-rw-r--r--src/gui/kernel/qwidget_qws.cpp2
-rw-r--r--src/gui/kernel/qwidget_s60.cpp2
-rw-r--r--src/gui/kernel/qwidget_x11.cpp2
-rw-r--r--src/gui/styles/qstyleoption.cpp10
-rw-r--r--src/qt_install.pri2
-rw-r--r--src/s60installs/s60installs.pro2
-rw-r--r--src/tools/rcc/rcc.cpp25
17 files changed, 109 insertions, 74 deletions
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/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
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
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index c572fb1..2ab2b05 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -1603,8 +1603,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)
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
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 d474391..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<QWidget *>(receiver), e))
+ if (d->gestureManager->filterEvent(static_cast<QWidget *>(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;
}
}
@@ -5230,6 +5231,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;
@@ -5676,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<int, QWeakPointer<QWidget> > 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
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);
}
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);
}
diff --git a/src/gui/styles/qstyleoption.cpp b/src/gui/styles/qstyleoption.cpp
index bfbdd6f..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 various sub-controls that are active
- (pressed) 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.
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
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
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());
}