summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2009-09-29 06:49:11 (GMT)
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2009-09-29 06:49:11 (GMT)
commitff6c8f9439630c2ea3bf78d5568a44521e915898 (patch)
treeff3fc149ebc6547dda412500aadeacbe568e2ceb
parent6034fc5b4a15bab2ab65e4cc3963fe00bdcb415b (diff)
parentfd5269a9a80bf8b119086b3f326c72a332aba4e9 (diff)
downloadQt-ff6c8f9439630c2ea3bf78d5568a44521e915898.zip
Qt-ff6c8f9439630c2ea3bf78d5568a44521e915898.tar.gz
Qt-ff6c8f9439630c2ea3bf78d5568a44521e915898.tar.bz2
Merge branch '4.6' of git@scm.dev.troll.no:qt/qt into 4.6
-rw-r--r--demos/boxes/main.cpp7
-rw-r--r--demos/sub-attaq/states.cpp5
-rw-r--r--dist/changes-4.5.355
-rw-r--r--doc/src/development/designer-manual.qdoc4
-rw-r--r--doc/src/development/qmake-manual.qdoc2
-rw-r--r--doc/src/examples/rogue.qdoc2
-rw-r--r--doc/src/frameworks-technologies/statemachine.qdoc6
-rw-r--r--doc/src/qt4-intro.qdoc2
-rw-r--r--doc/src/snippets/statemachine/eventtest.cpp2
-rw-r--r--examples/animation/easing/animation.h6
-rw-r--r--examples/animation/stickman/lifecycle.cpp2
-rw-r--r--examples/statemachine/factorial/main.cpp6
-rw-r--r--examples/statemachine/rogue/movementtransition.h6
-rw-r--r--examples/webkit/formextractor/formextractor.cpp14
-rw-r--r--mkspecs/features/qt_functions.prf3
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.h5
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp21
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/jit/ExecutableAllocator.h5
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp4
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h3
-rw-r--r--src/3rdparty/javascriptcore/VERSION4
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/jit/ExecutableAllocator.h5
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h3
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebinspector_p.h4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp10
-rw-r--r--src/corelib/animation/qabstractanimation.cpp19
-rw-r--r--src/corelib/animation/qabstractanimation.h2
-rw-r--r--src/corelib/animation/qparallelanimationgroup.cpp14
-rw-r--r--src/corelib/animation/qparallelanimationgroup.h2
-rw-r--r--src/corelib/animation/qpauseanimation.cpp2
-rw-r--r--src/corelib/animation/qpauseanimation.h2
-rw-r--r--src/corelib/animation/qsequentialanimationgroup.cpp4
-rw-r--r--src/corelib/animation/qsequentialanimationgroup.h2
-rw-r--r--src/corelib/animation/qvariantanimation.cpp2
-rw-r--r--src/corelib/animation/qvariantanimation.h2
-rw-r--r--src/corelib/global/qglobal.cpp2
-rw-r--r--src/corelib/kernel/qcoreevent.cpp5
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp3
-rw-r--r--src/corelib/statemachine/qeventtransition.cpp12
-rw-r--r--src/corelib/statemachine/qsignalevent.h83
-rw-r--r--src/corelib/statemachine/qsignaltransition.cpp15
-rw-r--r--src/corelib/statemachine/qstatemachine.cpp49
-rw-r--r--src/corelib/statemachine/qstatemachine.h36
-rw-r--r--src/corelib/statemachine/qwrappedevent.h80
-rw-r--r--src/corelib/statemachine/statemachine.pri4
-rw-r--r--src/corelib/tools/qlocale.cpp7
-rw-r--r--src/corelib/tools/qsharedpointer_impl.h2
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout.cpp88
-rw-r--r--src/gui/graphicsview/qgraphicslayout.cpp2
-rw-r--r--src/gui/graphicsview/qsimplex_p.cpp4
-rw-r--r--src/gui/image/qimagereader.cpp18
-rw-r--r--src/gui/image/qpixmap_s60.cpp15
-rw-r--r--src/gui/inputmethod/qinputcontext.cpp4
-rw-r--r--src/gui/kernel/qapplication_s60.cpp4
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm6
-rw-r--r--src/gui/kernel/qeventdispatcher_x11.cpp2
-rw-r--r--src/gui/kernel/qguieventdispatcher_glib.cpp2
-rw-r--r--src/gui/kernel/qsoftkeymanager.cpp15
-rw-r--r--src/gui/kernel/qwidget.cpp3
-rw-r--r--src/gui/painting/qcolor.cpp23
-rw-r--r--src/gui/painting/qdrawhelper_mmx.cpp2
-rw-r--r--src/gui/painting/qdrawhelper_mmx3dnow.cpp3
-rw-r--r--src/gui/painting/qpaintbuffer.cpp18
-rw-r--r--src/gui/painting/qpaintbuffer_p.h4
-rw-r--r--src/gui/painting/qpainter.cpp4
-rw-r--r--src/gui/painting/qprinter.cpp6
-rw-r--r--src/gui/statemachine/qkeyeventtransition.cpp4
-rw-r--r--src/gui/statemachine/qmouseeventtransition.cpp4
-rw-r--r--src/gui/text/qtextobject.cpp2
-rw-r--r--src/gui/widgets/qcalendarwidget.cpp20
-rw-r--r--src/gui/widgets/qdialogbuttonbox.cpp1
-rw-r--r--src/gui/widgets/qspinbox.cpp214
-rw-r--r--src/gui/widgets/qtabbar.cpp2
-rw-r--r--src/multimedia/audio/qaudioinput.cpp2
-rw-r--r--src/multimedia/audio/qaudiooutput.cpp2
-rw-r--r--src/network/kernel/qhostaddress.cpp3
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp2
-rw-r--r--src/opengl/qgl.cpp2
-rw-r--r--src/opengl/qgl_win.cpp6
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp5
-rw-r--r--src/script/api/qscriptengine.cpp17
-rw-r--r--src/script/api/qscriptengine_p.h3
-rw-r--r--src/script/bridge/qscriptactivationobject.cpp2
-rw-r--r--src/script/bridge/qscriptfunction.cpp4
-rw-r--r--src/script/bridge/qscriptobject.cpp4
-rw-r--r--src/src.pro1
-rw-r--r--src/testlib/qtestcase.cpp11
-rw-r--r--tests/auto/q3popupmenu/tst_q3popupmenu.cpp4
-rw-r--r--tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp2
-rw-r--r--tests/auto/qcombobox/tst_qcombobox.cpp6
-rw-r--r--tests/auto/qdom/tst_qdom.cpp15
-rw-r--r--tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp42
-rw-r--r--tests/auto/qeasingcurve/tst_qeasingcurve.cpp12
-rw-r--r--tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp8
-rw-r--r--tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp4
-rw-r--r--tests/auto/qgraphicsview/tst_qgraphicsview.cpp47
-rw-r--r--tests/auto/qlabel/tst_qlabel.cpp15
-rw-r--r--tests/auto/qmdiarea/tst_qmdiarea.cpp30
-rw-r--r--tests/auto/qmdisubwindow/tst_qmdisubwindow.cpp6
-rw-r--r--tests/auto/qmessagebox/tst_qmessagebox.cpp11
-rw-r--r--tests/auto/qprocess/qprocess.pro1
-rw-r--r--tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp6
-rw-r--r--tests/auto/qscriptcontext/tst_qscriptcontext.cpp91
-rw-r--r--tests/auto/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp6
-rw-r--r--tests/auto/qsharedmemory/qsystemlock/qsystemlock.pro4
-rw-r--r--tests/auto/qsharedmemory/qsystemlock/tst_qsystemlock.cpp9
-rw-r--r--tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp54
-rw-r--r--tests/auto/qspinbox/tst_qspinbox.cpp8
-rw-r--r--tests/auto/qsqldatabase/tst_qsqldatabase.cpp4
-rw-r--r--tests/auto/qstatemachine/tst_qstatemachine.cpp81
-rw-r--r--tests/auto/qtableview/tst_qtableview.cpp1
-rw-r--r--tests/auto/qtextdocument/tst_qtextdocument.cpp10
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp40
-rw-r--r--tests/auto/qwindowsurface/tst_qwindowsurface.cpp2
-rw-r--r--tests/benchmarks/qanimation/rectanimation.cpp4
-rw-r--r--tests/benchmarks/qanimation/rectanimation.h2
-rw-r--r--tools/qdoc3/cppcodeparser.cpp3
-rw-r--r--tools/qdoc3/test/assistant.qdocconf2
-rw-r--r--tools/qdoc3/test/designer.qdocconf2
-rw-r--r--tools/qdoc3/test/linguist.qdocconf2
-rw-r--r--tools/qdoc3/test/qmake.qdocconf2
-rw-r--r--tools/qdoc3/test/qt-api-only-with-xcode.qdocconf8
-rw-r--r--tools/qdoc3/test/qt-api-only.qdocconf8
123 files changed, 883 insertions, 738 deletions
diff --git a/demos/boxes/main.cpp b/demos/boxes/main.cpp
index 557afc9..957f183 100644
--- a/demos/boxes/main.cpp
+++ b/demos/boxes/main.cpp
@@ -68,7 +68,7 @@ protected:
inline bool matchString(const char *extensionString, const char *subString)
{
int subStringLength = strlen(subString);
- return (strncmp(extensionString, subString, subStringLength) == 0)
+ return (strncmp(extensionString, subString, subStringLength) == 0)
&& ((extensionString[subStringLength] == ' ') || (extensionString[subStringLength] == '\0'));
}
@@ -137,11 +137,12 @@ int main(int argc, char **argv)
"This demo can be GPU and CPU intensive and may\n"
"work poorly or not at all on your system.");
+ widget->makeCurrent(); // The current context must be set before calling Scene's constructor
+ Scene scene(1024, 768, maxTextureSize);
GraphicsView view;
view.setViewport(widget);
view.setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
- widget->makeCurrent(); // The current context must be set before calling Scene's constructor
- view.setScene(new Scene(1024, 768, maxTextureSize));
+ view.setScene(&scene);
view.show();
return app.exec();
diff --git a/demos/sub-attaq/states.cpp b/demos/sub-attaq/states.cpp
index 4a9d845..10c173e 100644
--- a/demos/sub-attaq/states.cpp
+++ b/demos/sub-attaq/states.cpp
@@ -54,7 +54,6 @@
#include <QtGui/QGraphicsView>
#include <QtCore/QStateMachine>
#include <QtGui/QKeyEventTransition>
-#include <QtCore/QSignalEvent>
#include <QtCore/QFinalState>
PlayState::PlayState(GraphicsScene *scene, QState *parent)
@@ -295,7 +294,7 @@ bool UpdateScoreTransition::eventTest(QEvent *event)
if (!QSignalTransition::eventTest(event))
return false;
else {
- QSignalEvent *se = static_cast<QSignalEvent*>(event);
+ QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent*>(event);
game->score += se->arguments().at(0).toInt();
scene->progressItem->setScore(game->score);
return true;
@@ -315,7 +314,7 @@ bool WinTransition::eventTest(QEvent *event)
if (!QSignalTransition::eventTest(event))
return false;
else {
- QSignalEvent *se = static_cast<QSignalEvent*>(event);
+ QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent*>(event);
game->score += se->arguments().at(0).toInt();
scene->progressItem->setScore(game->score);
return true;
diff --git a/dist/changes-4.5.3 b/dist/changes-4.5.3
index df282b0..d797b4c 100644
--- a/dist/changes-4.5.3
+++ b/dist/changes-4.5.3
@@ -33,11 +33,49 @@ Third party components
* Library *
****************************************************************************
+- QDirIterator
+ * [258230] Fixed inconsistencies in value returned from
+ QDirIterator::next().
+
+- QColorDialog
+ * [256164] Fixed the setting of alpha values in QColorDialog.
+
+- QDoubleSpinBox
+ * [255019] Fixed a crash when using large value for decimals.
+
+- QInputDialog
+ * [255502] Fixed bug in getDouble()
+
+- QNetworkAccessManager
+ * [256240] Proper handling of HTTP redirect in AlwaysCache mode.
+ * [257662] Fix timing issues that could trigger double sending of an
+ HTTP request.
+ * [256630] Fix usage of QProgressDialog together with QNetworkReply.
+
+- QSslCertificate
+ * [256066] Fix loading of a PEM when the length was a multiple of 64.
+
+- QTemporaryFile
+ * [260165] Fixed a bug where temporary files would be left behind when
+ copying a file to a non-existing directory.
****************************************************************************
* Database Drivers *
****************************************************************************
-
+- [QT-353] (ODBC) Fixed issue of forward only datasets failing when not
+ explicitly set so.
+- [222678] Fixed QSqlTableModel: trying to delete the wrong row.
+- (Interbase) Fixed crash when calling numRows on unknown query type.
+- Fixed several database autotests.
+- Fixed determination of end of odbc string on deficient driver.
+- Fixed formatting of date strings in psql driver.
+- Fixed mysql queries automatically getting prepared. Now have to explicitly
+ prepare them if you want that functionality.
+- Fixed failure when QSqlTableModel has null fields to update.
+- Fixed missing isnan/isinf on some platforms (needed for postgres driver)
+- Fixed ::record for dialect 3 named tables in interbase/firebird.
+- Fixed invalid length for numeric fields in oracle.
+- (ODBC) Fixed non-unicode strings should be strings, not bytearrays.
****************************************************************************
* Platform Specific Changes *
@@ -46,6 +84,10 @@ Third party components
Qt for Linux/X11
----------------
+- Fixed a bug where an empty KDEDIRS variable would bring /share into the icon
+ search path.
+- [KDE 191759] Plasma spinning in endless loop.
+
Qt for Windows
--------------
@@ -53,7 +95,16 @@ Qt for Windows
Qt for Mac OS X
---------------
+[252088] Drag and drop events will now consider the WA_TransparentForMouseEvents
+ in Cocoa port.
+[255428] Fixed an an issue when Calling QWidget::raise() on hidden windows making
+ them visible in Cocoa port.
+[256269] Window resize events triggered from QWidget::adjustSize() will now
+ be sent as non-spontaneous event in the Cocoa port.
+[258822] Fixed a crash when inserting the same menu twice in a menubar in Cocoa port.
+- Fixed the wizard background images for Snow Leopard.
+
Qt for Embedded Linux
---------------------
@@ -61,7 +112,7 @@ Qt for Embedded Linux
Qt for Windows CE
-----------------
-
+[260702] Fixed restoring of minimized Windows.
****************************************************************************
* Compiler Specific Changes *
diff --git a/doc/src/development/designer-manual.qdoc b/doc/src/development/designer-manual.qdoc
index 0c5bf83..4f4db85 100644
--- a/doc/src/development/designer-manual.qdoc
+++ b/doc/src/development/designer-manual.qdoc
@@ -61,8 +61,8 @@
\l{Getting To Know Qt Designer} document. For a quick tutorial on how to
use \QD, refer to \l{A Quick Start to Qt Designer}.
- Qt Designer 4.5 boasts a long list of improvements. For a detailed list of
- what is new, refer \l{What's New in Qt Designer 4.5}.
+ Qt Designer 4.6 boasts a long list of improvements. For a detailed list of
+ what is new, refer \l{What's New in Qt Designer 4.6}.
\image designer-multiple-screenshot.png
diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc
index 861c772..f2cae5b 100644
--- a/doc/src/development/qmake-manual.qdoc
+++ b/doc/src/development/qmake-manual.qdoc
@@ -4056,6 +4056,8 @@
You can test for any other platform-compiler combination as long as a
specification exists for it in the \c mkspecs directory.
+ The scope \c unix is true for the Symbian platform.
+
\section1 Variables
Many of the variables used in project files are special variables that
diff --git a/doc/src/examples/rogue.qdoc b/doc/src/examples/rogue.qdoc
index 3eb9249..4f9dc3f 100644
--- a/doc/src/examples/rogue.qdoc
+++ b/doc/src/examples/rogue.qdoc
@@ -194,7 +194,7 @@
\snippet examples/statemachine/rogue/movementtransition.h 1
- The KeyPress events come wrapped in \l{QWrappedEvent}s. \c event
+ The KeyPress events come wrapped in \l{QStateMachine::WrappedEvent}s. \c event
must be confirmed to be a wrapped event because Qt uses other
events internally. After that, it is simply a matter of checking
which key has been pressed.
diff --git a/doc/src/frameworks-technologies/statemachine.qdoc b/doc/src/frameworks-technologies/statemachine.qdoc
index 904b551..2b137dd 100644
--- a/doc/src/frameworks-technologies/statemachine.qdoc
+++ b/doc/src/frameworks-technologies/statemachine.qdoc
@@ -308,9 +308,9 @@
A QStateMachine runs its own event loop. For signal transitions
(QSignalTransition objects), QStateMachine automatically posts a
- QSignalEvent to itself when it intercepts the corresponding signal;
- similarly, for QObject event transitions (QEventTransition objects) a
- QWrappedEvent is posted.
+ QStateMachine::SignalEvent to itself when it intercepts the corresponding
+ signal; similarly, for QObject event transitions (QEventTransition objects)
+ a QStateMachine::WrappedEvent is posted.
You can post your own events to the state machine using
QStateMachine::postEvent().
diff --git a/doc/src/qt4-intro.qdoc b/doc/src/qt4-intro.qdoc
index 0177d35..03d9b29 100644
--- a/doc/src/qt4-intro.qdoc
+++ b/doc/src/qt4-intro.qdoc
@@ -784,7 +784,7 @@
these settings when you edit forms.
More information about these improvements can be found in the
- \l{What's New in Qt Designer 4.5} overview.
+ \l{What's New in Qt Designer 4.6} overview.
\section1 Qt Linguist Improvements
diff --git a/doc/src/snippets/statemachine/eventtest.cpp b/doc/src/snippets/statemachine/eventtest.cpp
index b6397ba..817dbfc 100644
--- a/doc/src/snippets/statemachine/eventtest.cpp
+++ b/doc/src/snippets/statemachine/eventtest.cpp
@@ -52,7 +52,7 @@ protected:
bool eventTest(QEvent *event)
{
if (event->type() == QEvent::Wrapped) {
- QEvent *wrappedEvent = static_cast<QWrappedEvent *>(event)->event();
+ QEvent *wrappedEvent = static_cast<QStateMachine::WrappedEvent *>(event)->event();
if (wrappedEvent->type() == QEvent::KeyPress) {
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(wrappedEvent);
// Do your event test
diff --git a/examples/animation/easing/animation.h b/examples/animation/easing/animation.h
index 78fdc14..bd58be0 100644
--- a/examples/animation/easing/animation.h
+++ b/examples/animation/easing/animation.h
@@ -68,7 +68,7 @@ public:
m_path = QPainterPath();
}
- void updateCurrentTime()
+ void updateCurrentTime(int currentTime)
{
if (m_pathType == CirclePath) {
if (m_path.isEmpty()) {
@@ -78,7 +78,7 @@ public:
m_path.addEllipse(QRectF(from, to));
}
int dura = duration();
- const qreal progress = ((dura == 0) ? 1 : ((((currentTime() - 1) % dura) + 1) / qreal(dura)));
+ const qreal progress = ((dura == 0) ? 1 : ((((currentTime - 1) % dura) + 1) / qreal(dura)));
qreal easedProgress = easingCurve().valueForProgress(progress);
if (easedProgress > 1.0) {
@@ -90,7 +90,7 @@ public:
updateCurrentValue(pt);
emit valueChanged(pt);
} else {
- QPropertyAnimation::updateCurrentTime();
+ QPropertyAnimation::updateCurrentTime(currentTime);
}
}
diff --git a/examples/animation/stickman/lifecycle.cpp b/examples/animation/stickman/lifecycle.cpp
index f5dca74..250fb85 100644
--- a/examples/animation/stickman/lifecycle.cpp
+++ b/examples/animation/stickman/lifecycle.cpp
@@ -64,7 +64,7 @@ public:
virtual bool eventTest(QEvent *e)
{
if (QSignalTransition::eventTest(e)) {
- QVariant key = static_cast<QSignalEvent*>(e)->arguments().at(0);
+ QVariant key = static_cast<QStateMachine::SignalEvent*>(e)->arguments().at(0);
return (key.toInt() == int(m_key));
}
diff --git a/examples/statemachine/factorial/main.cpp b/examples/statemachine/factorial/main.cpp
index 54f4ec0..018b84f 100644
--- a/examples/statemachine/factorial/main.cpp
+++ b/examples/statemachine/factorial/main.cpp
@@ -98,13 +98,13 @@ public:
{
if (!QSignalTransition::eventTest(e))
return false;
- QSignalEvent *se = static_cast<QSignalEvent*>(e);
+ QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent*>(e);
return se->arguments().at(0).toInt() > 1;
}
virtual void onTransition(QEvent *e)
{
- QSignalEvent *se = static_cast<QSignalEvent*>(e);
+ QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent*>(e);
int x = se->arguments().at(0).toInt();
int fac = m_fact->property("fac").toInt();
m_fact->setProperty("fac", x * fac);
@@ -128,7 +128,7 @@ public:
{
if (!QSignalTransition::eventTest(e))
return false;
- QSignalEvent *se = static_cast<QSignalEvent*>(e);
+ QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent*>(e);
return se->arguments().at(0).toInt() <= 1;
}
diff --git a/examples/statemachine/rogue/movementtransition.h b/examples/statemachine/rogue/movementtransition.h
index dbaf8d9..b919360 100644
--- a/examples/statemachine/rogue/movementtransition.h
+++ b/examples/statemachine/rogue/movementtransition.h
@@ -62,8 +62,8 @@ public:
protected:
bool eventTest(QEvent *event) {
if (event->type() == QEvent::Wrapped &&
- static_cast<QWrappedEvent *>(event)->event()->type() == QEvent::KeyPress) {
- QEvent *wrappedEvent = static_cast<QWrappedEvent *>(event)->event();
+ static_cast<QStateMachine::WrappedEvent *>(event)->event()->type() == QEvent::KeyPress) {
+ QEvent *wrappedEvent = static_cast<QStateMachine::WrappedEvent *>(event)->event();
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(wrappedEvent);
int key = keyEvent->key();
@@ -78,7 +78,7 @@ protected:
//![2]
void onTransition(QEvent *event) {
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(
- static_cast<QWrappedEvent *>(event)->event());
+ static_cast<QStateMachine::WrappedEvent *>(event)->event());
int key = keyEvent->key();
switch (key) {
diff --git a/examples/webkit/formextractor/formextractor.cpp b/examples/webkit/formextractor/formextractor.cpp
index 10bd9af..3ce888c 100644
--- a/examples/webkit/formextractor/formextractor.cpp
+++ b/examples/webkit/formextractor/formextractor.cpp
@@ -67,15 +67,15 @@ void FormExtractor::submit()
QWebElement femaleGender = frame->findFirstElement("#genderFemale");
QWebElement updates = frame->findFirstElement("#updates");
- ui.firstNameEdit->setText(firstName.scriptableProperty("value").toString());
- ui.lastNameEdit->setText(lastName.scriptableProperty("value").toString());
+ ui.firstNameEdit->setText(firstName.evaluateScript("this.value").toString());
+ ui.lastNameEdit->setText(lastName.evaluateScript("this.value").toString());
- if (maleGender.scriptableProperty("checked").toBool())
- ui.genderEdit->setText(maleGender.scriptableProperty("value").toString());
- else if (femaleGender.scriptableProperty("checked").toBool())
- ui.genderEdit->setText(femaleGender.scriptableProperty("value").toString());
+ if (maleGender.evaluateScript("this.checked").toBool())
+ ui.genderEdit->setText(maleGender.evaluateScript("this.value").toString());
+ else if (femaleGender.evaluateScript("this.checked").toBool())
+ ui.genderEdit->setText(femaleGender.evaluateScript("this.value").toString());
- if (updates.scriptableProperty("checked").toBool())
+ if (updates.evaluateScript("this.checked").toBool())
ui.updatesEdit->setText("Yes");
else
ui.updatesEdit->setText("No");
diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
index 645aa3a..243a829 100644
--- a/mkspecs/features/qt_functions.prf
+++ b/mkspecs/features/qt_functions.prf
@@ -47,8 +47,7 @@ defineTest(qtAddLibrary) {
}
symbian*:isEqual(LIB_NAME, QtGui) {
# Needed for #include <QtGui> because qs60mainapplication.h includes aknapp.h
- INCLUDEPATH -= $$MW_LAYER_SYSTEMINCLUDE
- INCLUDEPATH = $$MW_LAYER_SYSTEMINCLUDE $$INCLUDEPATH
+ INCLUDEPATH *= $$MW_LAYER_SYSTEMINCLUDE
}
isEmpty(LINKAGE) {
CONFIG(debug, debug|release) {
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.h b/src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.h
index 8072162..811818d 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.h
@@ -43,11 +43,12 @@ namespace JSC {
#if PLATFORM(QT)
#ifdef QT_BUILD_SCRIPT_LIB
- virtual void scriptUnload(qint64 id)
+ virtual void scriptUnload(QT_PREPEND_NAMESPACE(qint64) id)
{
UNUSED_PARAM(id);
};
- virtual void scriptLoad(qint64 id, const UString &program,
+ virtual void scriptLoad(QT_PREPEND_NAMESPACE(qint64) id,
+ const UString &program,
const UString &fileName, int baseLineNumber)
{
UNUSED_PARAM(id);
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp
index 7d3a84d..bfb0307 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp
@@ -435,7 +435,7 @@ void Interpreter::dumpRegisters(CallFrame* callFrame)
printf("[ReturnPC] | %10p | %p \n", it, (*it).vPC()); ++it;
printf("[ReturnValueRegister] | %10p | %d \n", it, (*it).i()); ++it;
printf("[ArgumentCount] | %10p | %d \n", it, (*it).i()); ++it;
- printf("[Callee] | %10p | %p \n", it, (*it).function()); ++it;
+ printf("[Callee] | %10p | %p \n", it, (*it).object()); ++it;
printf("[OptionalCalleeArguments] | %10p | %p \n", it, (*it).arguments()); ++it;
printf("-----------------------------------------------------------------------------\n");
@@ -3071,8 +3071,11 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
if (callType == CallTypeHost) {
ScopeChainNode* scopeChain = callFrame->scopeChain();
CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + registerOffset);
+#ifdef QT_BUILD_SCRIPT_LIB //we need the returnValue to be 0 as it is used as flags
+ newCallFrame->init(0, vPC + 5, scopeChain, callFrame, 0, argCount, asObject(v));
+#else
newCallFrame->init(0, vPC + 5, scopeChain, callFrame, dst, argCount, asObject(v));
-
+#endif
Register* thisRegister = newCallFrame->registers() - RegisterFile::CallFrameHeaderSize - argCount;
ArgList args(thisRegister + 1, argCount - 1);
@@ -3113,7 +3116,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
exceptionValue = createStackOverflowError(callFrame);
goto vm_throw;
}
- ASSERT(!callFrame->callee()->isHostFunction());
+ ASSERT(!asFunction(callFrame->callee())->isHostFunction());
int32_t expectedParams = static_cast<JSFunction*>(callFrame->callee())->jsExecutable()->parameterCount();
int32_t inplaceArgs = min(argCount, expectedParams);
int32_t i = 0;
@@ -3225,7 +3228,12 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
if (callType == CallTypeHost) {
ScopeChainNode* scopeChain = callFrame->scopeChain();
CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + registerOffset);
+#ifdef QT_BUILD_SCRIPT_LIB //we need the returnValue to be 0 as it is used as flags
+ newCallFrame->init(0, vPC + 5, scopeChain, callFrame, 0, argCount, asObject(v));
+#else
newCallFrame->init(0, vPC + 5, scopeChain, callFrame, dst, argCount, asObject(v));
+#endif
+
Register* thisRegister = newCallFrame->registers() - RegisterFile::CallFrameHeaderSize - argCount;
ArgList args(thisRegister + 1, argCount - 1);
@@ -3469,7 +3477,8 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
structure = callDataScopeChain->globalObject()->emptyObjectStructure();
#ifdef QT_BUILD_SCRIPT_LIB
// ### world-class hack
- QScriptObject* newObject = new (globalData) QScriptObject(structure);
+ QT_PREPEND_NAMESPACE(QScriptObject)* newObject
+ = new (globalData) QT_PREPEND_NAMESPACE(QScriptObject)(structure);
#else
JSObject* newObject = new (globalData) JSObject(structure);
#endif
@@ -3500,7 +3509,11 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
ScopeChainNode* scopeChain = callFrame->scopeChain();
CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + registerOffset);
+#ifdef QT_BUILD_SCRIPT_LIB //we need the returnValue to be 0 as it is used as flags
+ newCallFrame->init(0, vPC + 7, scopeChain, callFrame, 0, argCount, asObject(v));
+#else
newCallFrame->init(0, vPC + 7, scopeChain, callFrame, dst, argCount, asObject(v));
+#endif
JSValue returnValue;
{
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/jit/ExecutableAllocator.h b/src/3rdparty/javascriptcore/JavaScriptCore/jit/ExecutableAllocator.h
index 12e2a32..3274fcc 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/jit/ExecutableAllocator.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/jit/ExecutableAllocator.h
@@ -191,11 +191,6 @@ public:
{
User::IMB_Range(code, static_cast<char*>(code) + size);
}
-#elif PLATFORM(ARM) && COMPILER(GCC) && (GCC_VERSION >= 30406) && !defined(DISABLE_BUILTIN_CLEAR_CACHE)
- static void cacheFlush(void* code, size_t size)
- {
- __clear_cache(reinterpret_cast<char*>(code), reinterpret_cast<char*>(code) + size);
- }
#elif PLATFORM(ARM_TRADITIONAL) && PLATFORM(LINUX)
static void cacheFlush(void* code, size_t size)
{
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp
index a110dcd..0b147df 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp
@@ -1777,7 +1777,7 @@ DEFINE_STUB_FUNCTION(JSObject*, op_construct_JSConstruct)
else
structure = constructor->scope().node()->globalObject()->emptyObjectStructure();
#ifdef QT_BUILD_SCRIPT_LIB
- return new (stackFrame.globalData) QScriptObject(structure);
+ return new (stackFrame.globalData) QT_PREPEND_NAMESPACE(QScriptObject)(structure);
#else
return new (stackFrame.globalData) JSObject(structure);
#endif
@@ -3108,4 +3108,4 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, vm_throw)
} // namespace JSC
-#endif // ENABLE(JIT)
+ #endif // ENABLE(JIT)
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h
index cc40336..39cafab 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h
@@ -257,7 +257,8 @@
#define WTF_PLATFORM_MIDDLE_ENDIAN 1
#endif
#define ARM_ARCH_VERSION 3
-#if defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__)
+#if defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) || defined(ARMV4I) \
+ || defined(_ARMV4I_) || defined(armv4i)
#undef ARM_ARCH_VERSION
#define ARM_ARCH_VERSION 4
#endif
diff --git a/src/3rdparty/javascriptcore/VERSION b/src/3rdparty/javascriptcore/VERSION
index 6160986..ae70d26 100644
--- a/src/3rdparty/javascriptcore/VERSION
+++ b/src/3rdparty/javascriptcore/VERSION
@@ -4,8 +4,8 @@ This is a snapshot of JavaScriptCore from
The commit imported was from the
- jsc-for-qtscript-4.6-staging-24092009 branch/tag
+ jsc-for-qtscript-4.6-staging-28092009 branch/tag
and has the sha1 checksum
- 6906f46c84e6b20612db58018334cb6823d0a18a
+ b98dec961e9389ddd5e10d7c4086de9a297cb984
diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/ExecutableAllocator.h b/src/3rdparty/webkit/JavaScriptCore/jit/ExecutableAllocator.h
index 12e2a32..3274fcc 100644
--- a/src/3rdparty/webkit/JavaScriptCore/jit/ExecutableAllocator.h
+++ b/src/3rdparty/webkit/JavaScriptCore/jit/ExecutableAllocator.h
@@ -191,11 +191,6 @@ public:
{
User::IMB_Range(code, static_cast<char*>(code) + size);
}
-#elif PLATFORM(ARM) && COMPILER(GCC) && (GCC_VERSION >= 30406) && !defined(DISABLE_BUILTIN_CLEAR_CACHE)
- static void cacheFlush(void* code, size_t size)
- {
- __clear_cache(reinterpret_cast<char*>(code), reinterpret_cast<char*>(code) + size);
- }
#elif PLATFORM(ARM_TRADITIONAL) && PLATFORM(LINUX)
static void cacheFlush(void* code, size_t size)
{
diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h b/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h
index e508f77..bd82d8f 100644
--- a/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h
+++ b/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h
@@ -238,7 +238,8 @@
#define WTF_PLATFORM_MIDDLE_ENDIAN 1
#endif
#define ARM_ARCH_VERSION 3
-#if defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__)
+#if defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) || defined(ARMV4I) \
+ || defined(_ARMV4I_) || defined(armv4i)
#undef ARM_ARCH_VERSION
#define ARM_ARCH_VERSION 4
#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector_p.h
index b7af4f8..4d327cc 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector_p.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector_p.h
@@ -20,10 +20,12 @@
#ifndef QWEBINSPECTOR_P_H
#define QWEBINSPECTOR_P_H
+QT_BEGIN_NAMESPACE
class QSize;
+class QWidget;
+QT_END_NAMESPACE
class QWebInspector;
class QWebPage;
-class QWidget;
class QWebInspectorPrivate {
public:
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
index a6942a4..af27788 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
@@ -1491,9 +1491,11 @@ QWebPage::QWebPage(QObject *parent)
*/
QWebPage::~QWebPage()
{
- FrameLoader *loader = d->mainFrame->d->frame->loader();
- if (loader)
- loader->detachFromParent();
+ if (d->mainFrame) {
+ FrameLoader *loader = d->mainFrame->d->frame->loader();
+ if (loader)
+ loader->detachFromParent();
+ }
if (d->inspector)
d->inspector->setPage(0);
delete d;
@@ -1520,6 +1522,7 @@ QWebFrame *QWebPage::mainFrame() const
*/
QWebFrame *QWebPage::currentFrame() const
{
+ d->createMainFrame();
return static_cast<WebCore::FrameLoaderClientQt *>(d->page->focusController()->focusedOrMainFrame()->loader()->client())->webFrame();
}
@@ -1545,6 +1548,7 @@ QWebFrame* QWebPage::frameAt(const QPoint& pos) const
*/
QWebHistory *QWebPage::history() const
{
+ d->createMainFrame();
return &d->history;
}
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index 9027be0..f92c22d 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -194,12 +194,6 @@ QUnifiedTimer *QUnifiedTimer::instance()
void QUnifiedTimer::timerEvent(QTimerEvent *event)
{
- //this is simply the time we last received a tick
- const int oldLastTick = lastTick;
- if (time.isValid())
- lastTick = consistentTiming ? oldLastTick + timingInterval : time.elapsed();
-
-
if (event->timerId() == startStopAnimationTimer.timerId()) {
startStopAnimationTimer.stop();
//we transfer the waiting animations into the "really running" state
@@ -207,13 +201,16 @@ void QUnifiedTimer::timerEvent(QTimerEvent *event)
animationsToStart.clear();
if (animations.isEmpty()) {
animationTimer.stop();
- time = QTime();
} else if (!animationTimer.isActive()) {
animationTimer.start(timingInterval, this);
lastTick = 0;
time.start();
}
} else if (event->timerId() == animationTimer.timerId()) {
+ //this is simply the time we last received a tick
+ const int oldLastTick = lastTick;
+ lastTick = consistentTiming ? oldLastTick + timingInterval : time.elapsed();
+
//we make sure we only call update time if the time has actually changed
//it might happen in some cases that the time doesn't change because events are delayed
//when the CPU load is high
@@ -604,7 +601,7 @@ void QAbstractAnimation::setCurrentTime(int msecs)
}
}
- updateCurrentTime();
+ updateCurrentTime(d->currentTime);
if (d->currentLoop != oldLoop)
emit currentLoopChanged(d->currentLoop);
@@ -705,10 +702,10 @@ bool QAbstractAnimation::event(QEvent *event)
}
/*!
- \fn virtual void QAbstractAnimation::updateCurrentTime() = 0;
+ \fn virtual void QAbstractAnimation::updateCurrentTime(int currentTime) = 0;
- This pure virtual function is called every time the animation's current
- time changes.
+ This pure virtual function is called every time the animation's
+ \a currentTime changes.
\sa updateState()
*/
diff --git a/src/corelib/animation/qabstractanimation.h b/src/corelib/animation/qabstractanimation.h
index 516f5e9..50b07d7 100644
--- a/src/corelib/animation/qabstractanimation.h
+++ b/src/corelib/animation/qabstractanimation.h
@@ -119,7 +119,7 @@ protected:
QAbstractAnimation(QAbstractAnimationPrivate &dd, QObject *parent = 0);
bool event(QEvent *event);
- virtual void updateCurrentTime() = 0;
+ virtual void updateCurrentTime(int currentTime) = 0;
virtual void updateState(QAbstractAnimation::State oldState, QAbstractAnimation::State newState);
virtual void updateDirection(QAbstractAnimation::Direction direction);
diff --git a/src/corelib/animation/qparallelanimationgroup.cpp b/src/corelib/animation/qparallelanimationgroup.cpp
index 82d5224..5b7fd22 100644
--- a/src/corelib/animation/qparallelanimationgroup.cpp
+++ b/src/corelib/animation/qparallelanimationgroup.cpp
@@ -125,7 +125,7 @@ int QParallelAnimationGroup::duration() const
/*!
\reimp
*/
-void QParallelAnimationGroup::updateCurrentTime()
+void QParallelAnimationGroup::updateCurrentTime(int currentTime)
{
Q_D(QParallelAnimationGroup);
if (d->animations.isEmpty())
@@ -148,7 +148,7 @@ void QParallelAnimationGroup::updateCurrentTime()
}
}
- bool timeFwd = ((d->currentLoop == d->lastLoop && d->currentTime >= d->lastCurrentTime)
+ bool timeFwd = ((d->currentLoop == d->lastLoop && currentTime >= d->lastCurrentTime)
|| d->currentLoop > d->lastLoop);
#ifdef QANIMATION_DEBUG
qDebug("QParallellAnimationGroup %5d: setCurrentTime(%d), loop:%d, last:%d, timeFwd:%d, lastcurrent:%d, %d",
@@ -160,7 +160,7 @@ void QParallelAnimationGroup::updateCurrentTime()
const int dura = animation->totalDuration();
if (dura == -1 && d->isUncontrolledAnimationFinished(animation))
continue;
- if (dura == -1 || (d->currentTime <= dura && dura != 0)
+ if (dura == -1 || (currentTime <= dura && dura != 0)
|| (dura == 0 && d->currentLoop != d->lastLoop)) {
switch (state()) {
case Running:
@@ -177,18 +177,18 @@ void QParallelAnimationGroup::updateCurrentTime()
if (dura <= 0) {
if (dura == -1)
- animation->setCurrentTime(d->currentTime);
+ animation->setCurrentTime(currentTime);
continue;
}
if ((timeFwd && d->lastCurrentTime <= dura)
|| (!timeFwd && d->currentTime <= dura))
- animation->setCurrentTime(d->currentTime);
- if (d->currentTime > dura)
+ animation->setCurrentTime(currentTime);
+ if (currentTime > dura)
animation->stop();
}
d->lastLoop = d->currentLoop;
- d->lastCurrentTime = d->currentTime;
+ d->lastCurrentTime = currentTime;
}
/*!
diff --git a/src/corelib/animation/qparallelanimationgroup.h b/src/corelib/animation/qparallelanimationgroup.h
index 6afe4a7..1cab91e 100644
--- a/src/corelib/animation/qparallelanimationgroup.h
+++ b/src/corelib/animation/qparallelanimationgroup.h
@@ -67,7 +67,7 @@ protected:
QParallelAnimationGroup(QParallelAnimationGroupPrivate &dd, QObject *parent);
bool event(QEvent *event);
- void updateCurrentTime();
+ void updateCurrentTime(int currentTime);
void updateState(QAbstractAnimation::State oldState, QAbstractAnimation::State newState);
void updateDirection(QAbstractAnimation::Direction direction);
diff --git a/src/corelib/animation/qpauseanimation.cpp b/src/corelib/animation/qpauseanimation.cpp
index c382b19..2fd12aa 100644
--- a/src/corelib/animation/qpauseanimation.cpp
+++ b/src/corelib/animation/qpauseanimation.cpp
@@ -141,7 +141,7 @@ bool QPauseAnimation::event(QEvent *e)
/*!
\reimp
*/
-void QPauseAnimation::updateCurrentTime()
+void QPauseAnimation::updateCurrentTime(int)
{
}
diff --git a/src/corelib/animation/qpauseanimation.h b/src/corelib/animation/qpauseanimation.h
index caac9e9..1b81472 100644
--- a/src/corelib/animation/qpauseanimation.h
+++ b/src/corelib/animation/qpauseanimation.h
@@ -68,7 +68,7 @@ public:
protected:
bool event(QEvent *e);
- void updateCurrentTime();
+ void updateCurrentTime(int);
private:
Q_DISABLE_COPY(QPauseAnimation)
diff --git a/src/corelib/animation/qsequentialanimationgroup.cpp b/src/corelib/animation/qsequentialanimationgroup.cpp
index 9ad433f..5ca560a 100644
--- a/src/corelib/animation/qsequentialanimationgroup.cpp
+++ b/src/corelib/animation/qsequentialanimationgroup.cpp
@@ -334,7 +334,7 @@ int QSequentialAnimationGroup::duration() const
/*!
\reimp
*/
-void QSequentialAnimationGroup::updateCurrentTime()
+void QSequentialAnimationGroup::updateCurrentTime(int currentTime)
{
Q_D(QSequentialAnimationGroup);
if (!d->currentAnimation)
@@ -359,7 +359,7 @@ void QSequentialAnimationGroup::updateCurrentTime()
d->setCurrentAnimation(newAnimationIndex.index);
- const int newCurrentTime = d->currentTime - newAnimationIndex.timeOffset;
+ const int newCurrentTime = currentTime - newAnimationIndex.timeOffset;
if (d->currentAnimation) {
d->currentAnimation->setCurrentTime(newCurrentTime);
diff --git a/src/corelib/animation/qsequentialanimationgroup.h b/src/corelib/animation/qsequentialanimationgroup.h
index 1c9e4cc..f30f851 100644
--- a/src/corelib/animation/qsequentialanimationgroup.h
+++ b/src/corelib/animation/qsequentialanimationgroup.h
@@ -77,7 +77,7 @@ protected:
QSequentialAnimationGroup(QSequentialAnimationGroupPrivate &dd, QObject *parent);
bool event(QEvent *event);
- void updateCurrentTime();
+ void updateCurrentTime(int);
void updateState(QAbstractAnimation::State oldState, QAbstractAnimation::State newState);
void updateDirection(QAbstractAnimation::Direction direction);
diff --git a/src/corelib/animation/qvariantanimation.cpp b/src/corelib/animation/qvariantanimation.cpp
index ae8bf2f..de8185b 100644
--- a/src/corelib/animation/qvariantanimation.cpp
+++ b/src/corelib/animation/qvariantanimation.cpp
@@ -656,7 +656,7 @@ QVariant QVariantAnimation::interpolated(const QVariant &from, const QVariant &t
/*!
\reimp
*/
-void QVariantAnimation::updateCurrentTime()
+void QVariantAnimation::updateCurrentTime(int)
{
d_func()->recalculateCurrentInterval();
}
diff --git a/src/corelib/animation/qvariantanimation.h b/src/corelib/animation/qvariantanimation.h
index 98c1aec..bc57b1c 100644
--- a/src/corelib/animation/qvariantanimation.h
+++ b/src/corelib/animation/qvariantanimation.h
@@ -102,7 +102,7 @@ protected:
QVariantAnimation(QVariantAnimationPrivate &dd, QObject *parent = 0);
bool event(QEvent *event);
- void updateCurrentTime();
+ void updateCurrentTime(int);
void updateState(QAbstractAnimation::State oldState, QAbstractAnimation::State newState);
virtual void updateCurrentValue(const QVariant &value) = 0;
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 97362af..63e2891 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -1066,6 +1066,7 @@ bool qSharedBuild()
/*!
\fn QSysInfo::SymbianVersion QSysInfo::symbianVersion()
+ \since 4.6
Returns the version of the Symbian operating system on which the
application is run (Symbian only).
@@ -1073,6 +1074,7 @@ bool qSharedBuild()
/*!
\fn QSysInfo::S60Version QSysInfo::s60Version()
+ \since 4.6
Returns the version of the S60 SDK system on which the
application is run (S60 only).
diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp
index 746474c..185c305 100644
--- a/src/corelib/kernel/qcoreevent.cpp
+++ b/src/corelib/kernel/qcoreevent.cpp
@@ -192,6 +192,7 @@ QT_BEGIN_NAMESPACE
\value ShortcutOverride Key press in child, for overriding shortcut key handling (QKeyEvent).
\value Show Widget was shown on screen (QShowEvent).
\value ShowToParent A child widget has been shown.
+ \value Signal A signal delivered to a state machine (QStateMachine::SignalEvent).
\value SockAct Socket activated, used to implement QSocketNotifier.
\value StatusTip A status tip is requested (QStatusTipEvent).
\value StyleChange Widget's style has been changed.
@@ -220,7 +221,7 @@ QT_BEGIN_NAMESPACE
\value WindowStateChange The \l{QWidget::windowState()}{window's state} (minimized, maximized or full-screen) has changed (QWindowStateChangeEvent).
\value WindowTitleChange The window title has changed.
\value WindowUnblocked The window is unblocked after a modal dialog exited.
- \value Wrapped The event is a wrapper for, i.e., contains, another event (QWrappedEvent).
+ \value Wrapped The event is a wrapper for, i.e., contains, another event (QStateMachine::WrappedEvent).
\value ZOrderChange The widget's z-order has changed. This event is never sent to top level windows.
\value KeyboardLayoutChange The keyboard layout has changed.
\value DynamicPropertyChange A dynamic property was added, changed or removed from the object.
@@ -269,8 +270,8 @@ QT_BEGIN_NAMESPACE
\omitvalue NetworkReplyUpdated
\omitvalue FutureCallOut
\omitvalue CocoaRequestModal
- \omitvalue Signal
\omitvalue SymbianDeferredFocusChanged
+ \omitvalue UpdateSoftKeys
\omitvalue NativeGesture
*/
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index 83114dc..0474bf3 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -678,7 +678,8 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags)
|| (msg.message >= WM_MOUSEFIRST
&& msg.message <= WM_MOUSELAST)
|| msg.message == WM_MOUSEWHEEL
- || msg.message == WM_MOUSEHWHEEL)) {
+ || msg.message == WM_MOUSEHWHEEL
+ || msg.message == WM_CLOSE)) {
// queue user input events for later processing
haveMessage = false;
d->queuedUserInputEvents.append(msg);
diff --git a/src/corelib/statemachine/qeventtransition.cpp b/src/corelib/statemachine/qeventtransition.cpp
index 2ce7b4a..f278371 100644
--- a/src/corelib/statemachine/qeventtransition.cpp
+++ b/src/corelib/statemachine/qeventtransition.cpp
@@ -44,7 +44,6 @@
#ifndef QT_NO_STATEMACHINE
#include "qeventtransition_p.h"
-#include "qwrappedevent.h"
#include "qstate.h"
#include "qstate_p.h"
#include "qstatemachine.h"
@@ -83,10 +82,11 @@ QT_BEGIN_NAMESPACE
\section1 Subclassing
When reimplementing the eventTest() function, you should first call the base
- implementation to verify that the event is a QWrappedEvent for the proper
- object and event type. You may then cast the event to a QWrappedEvent and
- get the original event by calling QWrappedEvent::event(), and perform
- additional checks on that object.
+ implementation to verify that the event is a QStateMachine::WrappedEvent for
+ the proper object and event type. You may then cast the event to a
+ QStateMachine::WrappedEvent and get the original event by calling
+ QStateMachine::WrappedEvent::event(), and perform additional checks on that
+ object.
\sa QState::addTransition()
*/
@@ -232,7 +232,7 @@ bool QEventTransition::eventTest(QEvent *event)
{
Q_D(const QEventTransition);
if (event->type() == QEvent::Wrapped) {
- QWrappedEvent *we = static_cast<QWrappedEvent*>(event);
+ QStateMachine::WrappedEvent *we = static_cast<QStateMachine::WrappedEvent*>(event);
return (we->object() == d->object)
&& (we->event()->type() == d->eventType);
}
diff --git a/src/corelib/statemachine/qsignalevent.h b/src/corelib/statemachine/qsignalevent.h
deleted file mode 100644
index 6d2bd63..0000000
--- a/src/corelib/statemachine/qsignalevent.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QSIGNALEVENT_H
-#define QSIGNALEVENT_H
-
-#include <QtCore/qcoreevent.h>
-
-#include <QtCore/qlist.h>
-#include <QtCore/qvariant.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Core)
-
-#ifndef QT_NO_STATEMACHINE
-
-class Q_CORE_EXPORT QSignalEvent : public QEvent
-{
-public:
- QSignalEvent(QObject *sender, int signalIndex,
- const QList<QVariant> &arguments);
- ~QSignalEvent();
-
- inline QObject *sender() const { return m_sender; }
- inline int signalIndex() const { return m_signalIndex; }
- inline QList<QVariant> arguments() const { return m_arguments; }
-
-private:
- QObject *m_sender;
- int m_signalIndex;
- QList<QVariant> m_arguments;
-
- friend class QSignalTransitionPrivate;
-};
-
-#endif //QT_NO_STATEMACHINE
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/corelib/statemachine/qsignaltransition.cpp b/src/corelib/statemachine/qsignaltransition.cpp
index 74655e6..9811725 100644
--- a/src/corelib/statemachine/qsignaltransition.cpp
+++ b/src/corelib/statemachine/qsignaltransition.cpp
@@ -44,7 +44,6 @@
#ifndef QT_NO_STATEMACHINE
#include "qsignaltransition_p.h"
-#include "qsignalevent.h"
#include "qstate.h"
#include "qstate_p.h"
#include "qstatemachine.h"
@@ -68,7 +67,7 @@ QT_BEGIN_NAMESPACE
You can subclass QSignalTransition and reimplement eventTest() to make a
signal transition conditional; the event object passed to eventTest() will
- be a QSignalEvent object. Example:
+ be a QStateMachine::SignalEvent object. Example:
\code
class CheckedTransition : public QSignalTransition
@@ -80,7 +79,7 @@ QT_BEGIN_NAMESPACE
bool eventTest(QEvent *e) const {
if (!QSignalTransition::eventTest(e))
return false;
- QSignalEvent *se = static_cast<QSignalEvent*>(e);
+ QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent*>(e);
return (se->arguments().at(0).toInt() == Qt::Checked);
}
};
@@ -212,9 +211,9 @@ void QSignalTransition::setSignal(const QByteArray &signal)
/*!
\reimp
- The \a event is a QSignalEvent object. The default implementation returns
- true if the event's sender and signal index match this transition, and
- returns false otherwise.
+ The default implementation returns true if the \a event is a
+ QStateMachine::SignalEvent object and the event's sender and signal index
+ match this transition, and returns false otherwise.
*/
bool QSignalTransition::eventTest(QEvent *event)
{
@@ -222,7 +221,7 @@ bool QSignalTransition::eventTest(QEvent *event)
if (event->type() == QEvent::Signal) {
if (d->signalIndex == -1)
return false;
- QSignalEvent *se = static_cast<QSignalEvent*>(event);
+ QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent*>(event);
return (se->sender() == d->sender)
&& (se->signalIndex() == d->signalIndex);
}
@@ -250,7 +249,7 @@ void QSignalTransitionPrivate::callOnTransition(QEvent *e)
Q_Q(QSignalTransition);
if (e->type() == QEvent::Signal) {
- QSignalEvent *se = static_cast<QSignalEvent *>(e);
+ QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent *>(e);
int savedSignalIndex = se->m_signalIndex;
se->m_signalIndex = originalSignalIndex;
q->onTransition(e);
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp
index 7876d43..503eec0 100644
--- a/src/corelib/statemachine/qstatemachine.cpp
+++ b/src/corelib/statemachine/qstatemachine.cpp
@@ -50,7 +50,6 @@
#include "qabstracttransition_p.h"
#include "qsignaltransition.h"
#include "qsignaltransition_p.h"
-#include "qsignalevent.h"
#include "qsignaleventgenerator_p.h"
#include "qabstractstate.h"
#include "qabstractstate_p.h"
@@ -63,7 +62,6 @@
#ifndef QT_NO_STATEMACHINE_EVENTFILTER
#include "qeventtransition.h"
#include "qeventtransition_p.h"
-#include "qwrappedevent.h"
#endif
#ifndef QT_NO_ANIMATION
@@ -1534,7 +1532,7 @@ void QStateMachinePrivate::handleTransitionSignal(QObject *sender, int signalInd
qDebug() << q_func() << ": sending signal event ( sender =" << sender
<< ", signal =" << sender->metaObject()->method(signalIndex).signature() << ')';
#endif
- internalEventQueue.append(new QSignalEvent(sender, signalIndex, vargs));
+ internalEventQueue.append(new QStateMachine::SignalEvent(sender, signalIndex, vargs));
scheduleProcess();
}
@@ -1880,7 +1878,7 @@ bool QStateMachine::eventFilter(QObject *watched, QEvent *event)
Q_D(QStateMachine);
Q_ASSERT(d->qobjectEvents.contains(watched));
if (d->qobjectEvents[watched].contains(event->type()))
- postEvent(new QWrappedEvent(watched, d->handler->cloneEvent(event)));
+ postEvent(new QStateMachine::WrappedEvent(watched, d->handler->cloneEvent(event)));
return false;
}
#endif
@@ -2076,16 +2074,16 @@ QSignalEventGenerator::QSignalEventGenerator(QStateMachine *parent)
}
/*!
- \class QSignalEvent
+ \class QStateMachine::SignalEvent
- \brief The QSignalEvent class represents a Qt signal event.
+ \brief The SignalEvent class represents a Qt signal event.
\since 4.6
\ingroup statemachine
A signal event is generated by a QStateMachine in response to a Qt
signal. The QSignalTransition class provides a transition associated with a
- signal event. QSignalEvent is part of \l{The State Machine Framework}.
+ signal event. QStateMachine::SignalEvent is part of \l{The State Machine Framework}.
The sender() function returns the object that generated the signal. The
signalIndex() function returns the index of the signal. The arguments()
@@ -2097,25 +2095,25 @@ QSignalEventGenerator::QSignalEventGenerator(QStateMachine *parent)
/*!
\internal
- Constructs a new QSignalEvent object with the given \a sender, \a
+ Constructs a new SignalEvent object with the given \a sender, \a
signalIndex and \a arguments.
*/
-QSignalEvent::QSignalEvent(QObject *sender, int signalIndex,
- const QList<QVariant> &arguments)
+QStateMachine::SignalEvent::SignalEvent(QObject *sender, int signalIndex,
+ const QList<QVariant> &arguments)
: QEvent(QEvent::Signal), m_sender(sender),
m_signalIndex(signalIndex), m_arguments(arguments)
{
}
/*!
- Destroys this QSignalEvent.
+ Destroys this SignalEvent.
*/
-QSignalEvent::~QSignalEvent()
+QStateMachine::SignalEvent::~SignalEvent()
{
}
/*!
- \fn QSignalEvent::sender() const
+ \fn QStateMachine::SignalEvent::sender() const
Returns the object that emitted the signal.
@@ -2123,7 +2121,7 @@ QSignalEvent::~QSignalEvent()
*/
/*!
- \fn QSignalEvent::signalIndex() const
+ \fn QStateMachine::SignalEvent::signalIndex() const
Returns the index of the signal.
@@ -2131,23 +2129,24 @@ QSignalEvent::~QSignalEvent()
*/
/*!
- \fn QSignalEvent::arguments() const
+ \fn QStateMachine::SignalEvent::arguments() const
Returns the arguments of the signal.
*/
/*!
- \class QWrappedEvent
+ \class QStateMachine::WrappedEvent
- \brief The QWrappedEvent class holds a clone of an event associated with a QObject.
+ \brief The WrappedEvent class holds a clone of an event associated with a QObject.
\since 4.6
\ingroup statemachine
A wrapped event is generated by a QStateMachine in response to a Qt
event. The QEventTransition class provides a transition associated with a
- such an event. QWrappedEvent is part of \l{The State Machine Framework}.
+ such an event. QStateMachine::WrappedEvent is part of \l{The State Machine
+ Framework}.
The object() function returns the object that generated the event. The
event() function returns a clone of the original event.
@@ -2158,32 +2157,32 @@ QSignalEvent::~QSignalEvent()
/*!
\internal
- Constructs a new QWrappedEvent object with the given \a object
+ Constructs a new WrappedEvent object with the given \a object
and \a event.
- The QWrappedEvent object takes ownership of \a event.
+ The WrappedEvent object takes ownership of \a event.
*/
-QWrappedEvent::QWrappedEvent(QObject *object, QEvent *event)
+QStateMachine::WrappedEvent::WrappedEvent(QObject *object, QEvent *event)
: QEvent(QEvent::Wrapped), m_object(object), m_event(event)
{
}
/*!
- Destroys this QWrappedEvent.
+ Destroys this WrappedEvent.
*/
-QWrappedEvent::~QWrappedEvent()
+QStateMachine::WrappedEvent::~WrappedEvent()
{
delete m_event;
}
/*!
- \fn QWrappedEvent::object() const
+ \fn QStateMachine::WrappedEvent::object() const
Returns the object that the event is associated with.
*/
/*!
- \fn QWrappedEvent::event() const
+ \fn QStateMachine::WrappedEvent::event() const
Returns a clone of the original event.
*/
diff --git a/src/corelib/statemachine/qstatemachine.h b/src/corelib/statemachine/qstatemachine.h
index dd524dd..a0b2b14 100644
--- a/src/corelib/statemachine/qstatemachine.h
+++ b/src/corelib/statemachine/qstatemachine.h
@@ -44,6 +44,7 @@
#include <QtCore/qstate.h>
+#include <QtCore/qcoreevent.h>
#include <QtCore/qlist.h>
#include <QtCore/qobject.h>
#include <QtCore/qset.h>
@@ -56,8 +57,6 @@ QT_MODULE(Core)
#ifndef QT_NO_STATEMACHINE
-class QEvent;
-
class QStateMachinePrivate;
class QAbstractAnimation;
class Q_CORE_EXPORT QStateMachine : public QState
@@ -70,6 +69,39 @@ class Q_CORE_EXPORT QStateMachine : public QState
Q_PROPERTY(bool animationsEnabled READ animationsEnabled WRITE setAnimationsEnabled)
#endif
public:
+ class SignalEvent : public QEvent
+ {
+ public:
+ SignalEvent(QObject *sender, int signalIndex,
+ const QList<QVariant> &arguments);
+ ~SignalEvent();
+
+ inline QObject *sender() const { return m_sender; }
+ inline int signalIndex() const { return m_signalIndex; }
+ inline QList<QVariant> arguments() const { return m_arguments; }
+
+ private:
+ QObject *m_sender;
+ int m_signalIndex;
+ QList<QVariant> m_arguments;
+
+ friend class QSignalTransitionPrivate;
+ };
+
+ class WrappedEvent : public QEvent
+ {
+ public:
+ WrappedEvent(QObject *object, QEvent *event);
+ ~WrappedEvent();
+
+ inline QObject *object() const { return m_object; }
+ inline QEvent *event() const { return m_event; }
+
+ private:
+ QObject *m_object;
+ QEvent *m_event;
+ };
+
enum RestorePolicy {
DoNotRestoreProperties,
RestoreProperties
diff --git a/src/corelib/statemachine/qwrappedevent.h b/src/corelib/statemachine/qwrappedevent.h
deleted file mode 100644
index e0a131b..0000000
--- a/src/corelib/statemachine/qwrappedevent.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWRAPPEDEVENT_H
-#define QWRAPPEDEVENT_H
-
-#include <QtCore/qcoreevent.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Core)
-
-#ifndef QT_NO_STATEMACHINE
-
-class QObject;
-
-class Q_CORE_EXPORT QWrappedEvent : public QEvent
-{
-public:
- QWrappedEvent(QObject *object, QEvent *event);
- ~QWrappedEvent();
-
- inline QObject *object() const { return m_object; }
- inline QEvent *event() const { return m_event; }
-
-private:
- QObject *m_object;
- QEvent *m_event;
-
-private:
- Q_DISABLE_COPY(QWrappedEvent)
-};
-
-#endif //QT_NO_STATEMACHINE
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/corelib/statemachine/statemachine.pri b/src/corelib/statemachine/statemachine.pri
index 5b19bc1..910cf5e 100644
--- a/src/corelib/statemachine/statemachine.pri
+++ b/src/corelib/statemachine/statemachine.pri
@@ -10,7 +10,6 @@ HEADERS += $$PWD/qstatemachine.h \
$$PWD/qhistorystate_p.h \
$$PWD/qabstracttransition.h \
$$PWD/qabstracttransition_p.h \
- $$PWD/qsignalevent.h \
$$PWD/qsignaltransition.h \
$$PWD/qsignaltransition_p.h
@@ -23,8 +22,7 @@ SOURCES += $$PWD/qstatemachine.cpp \
$$PWD/qsignaltransition.cpp
!contains(DEFINES, QT_NO_STATEMACHINE_EVENTFILTER) {
-HEADERS += $$PWD/qwrappedevent.h \
- $$PWD/qeventtransition.h \
+HEADERS += $$PWD/qeventtransition.h \
$$PWD/qeventtransition_p.h
SOURCES += $$PWD/qeventtransition.cpp
}
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index 136bafa..4a66b92 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -637,7 +637,8 @@ static QString winSystemPMText()
}
/*!
- Returns the fallback locale obtained from the system.
+ \since 4.6
+ Returns the fallback locale obtained from the system.
*/
QLocale QSystemLocale::fallbackLocale() const
{
@@ -1156,7 +1157,7 @@ static void getMacPreferredLanguageAndCountry(QString *language, QString *countr
kCFPreferencesAnyApplication,
kCFPreferencesCurrentUser,
kCFPreferencesAnyHost);
- if (CFArrayGetCount(languages) > 0) {
+ if (languages && CFArrayGetCount(languages) > 0) {
QCFType<CFLocaleRef> locale = CFLocaleCreate(kCFAllocatorDefault,
CFStringRef(CFArrayGetValueAtIndex(languages, 0)));
if (language)
@@ -1283,6 +1284,8 @@ QVariant QSystemLocale::query(QueryType type, QVariant /* in */) const
#elif !defined(Q_OS_SYMBIAN)
/*!
+ \since 4.6
+
Returns a fallback locale, that will get used for everything that
is not explicitly overridden by the system locale.
*/
diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h
index 4f05eda..2acbf17 100644
--- a/src/corelib/tools/qsharedpointer_impl.h
+++ b/src/corelib/tools/qsharedpointer_impl.h
@@ -478,7 +478,7 @@ public:
{ BaseClass::internalSet(other.d, other.value); return *this; }
inline void swap(QSharedPointer &other)
- { internalSwap(other); }
+ { QSharedPointer<T>::internalSwap(other); }
template <class X>
QSharedPointer<X> staticCast() const
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout.cpp b/src/gui/graphicsview/qgraphicsanchorlayout.cpp
index 78b6b53..b3ebb2b 100644
--- a/src/gui/graphicsview/qgraphicsanchorlayout.cpp
+++ b/src/gui/graphicsview/qgraphicsanchorlayout.cpp
@@ -171,23 +171,23 @@ QGraphicsAnchorLayout::~QGraphicsAnchorLayout()
}
/*!
- * Creates an anchor between the edge \a firstEdge of item \a firstItem and the edge \a secondEdge
- * of item \a secondItem. The magnitude of the anchor is picked up from the style. Anchors
- * between a layout edge and an item edge will have a size of 0.
- * If there is already an anchor between the edges, the the new anchor will replace the old one.
- *
- * \a firstItem and \a secondItem are automatically added to the layout if they are not part
- * of the layout. This means that count() can increase with up to 2.
- *
- * The spacing an anchor will get depends on the type of anchor. For instance, anchors from the
- * Right edge of one item to the Left edge of another (or vice versa) will use the default
- * horizontal spacing. The same behaviour applies to Bottom to Top anchors, (but they will use
- * the default vertical spacing). For all other anchor combinations, the spacing will be 0.
- * All anchoring functions will follow this rule.
- *
- * The spacing can also be set manually by using QGraphicsAnchor::setSpacing() method.
- *
- * \sa addCornerAnchors(), addAnchors()
+ Creates an anchor between the edge \a firstEdge of item \a firstItem and the edge \a secondEdge
+ of item \a secondItem. The magnitude of the anchor is picked up from the style. Anchors
+ between a layout edge and an item edge will have a size of 0.
+ If there is already an anchor between the edges, the the new anchor will replace the old one.
+
+ \a firstItem and \a secondItem are automatically added to the layout if they are not part
+ of the layout. This means that count() can increase with up to 2.
+
+ The spacing an anchor will get depends on the type of anchor. For instance, anchors from the
+ Right edge of one item to the Left edge of another (or vice versa) will use the default
+ horizontal spacing. The same behaviour applies to Bottom to Top anchors, (but they will use
+ the default vertical spacing). For all other anchor combinations, the spacing will be 0.
+ All anchoring functions will follow this rule.
+
+ The spacing can also be set manually by using QGraphicsAnchor::setSpacing() method.
+
+ \sa addCornerAnchors(), addAnchors()
*/
QGraphicsAnchor *
QGraphicsAnchorLayout::addAnchor(QGraphicsLayoutItem *firstItem, Qt::AnchorPoint firstEdge,
@@ -200,8 +200,8 @@ QGraphicsAnchorLayout::addAnchor(QGraphicsLayoutItem *firstItem, Qt::AnchorPoint
}
/*!
- Returns the anchor between the anchor points defined by \a firstItem and \a firstEdge and
- \a secondItem and \a secondEdge. If there is no such anchor, the function will return 0.
+ Returns the anchor between the anchor points defined by \a firstItem and \a firstEdge and
+ \a secondItem and \a secondEdge. If there is no such anchor, the function will return 0.
*/
QGraphicsAnchor *
QGraphicsAnchorLayout::anchor(QGraphicsLayoutItem *firstItem, Qt::AnchorPoint firstEdge,
@@ -212,30 +212,30 @@ QGraphicsAnchorLayout::anchor(QGraphicsLayoutItem *firstItem, Qt::AnchorPoint fi
}
/*!
- * Creates two anchors between \a firstItem and \a secondItem, where one is for the horizontal
- * edge and another one for the vertical edge that the corners \a firstCorner and \a
- * secondCorner specifies.
- * The magnitude of the anchors is picked up from the style.
- *
- * This is a convenience function, since anchoring corners can be expressed as anchoring two edges.
- * For instance,
- * \code
- * layout->addAnchor(layout, Qt::AnchorTop, b, Qt::AnchorTop);
- * layout->addAnchor(layout, Qt::AnchorLeft, b, Qt::AnchorLeft);
- * \endcode
- *
- * has the same effect as
- *
- * \code
- * layout->addCornerAnchors(layout, Qt::TopLeft, b, Qt::TopLeft);
- * \endcode
- *
- * If there is already an anchor between the edge pairs, it will be replaced by the anchors that
- * this function specifies.
- *
- * \a firstItem and \a secondItem are automatically added to the layout if they are not part
- * of the layout. This means that count() can increase with up to 2.
- */
+ Creates two anchors between \a firstItem and \a secondItem, where one is for the horizontal
+ edge and another one for the vertical edge that the corners \a firstCorner and \a
+ secondCorner specifies.
+ The magnitude of the anchors is picked up from the style.
+
+ This is a convenience function, since anchoring corners can be expressed as anchoring two edges.
+ For instance,
+ \code
+ layout->addAnchor(layout, Qt::AnchorTop, b, Qt::AnchorTop);
+ layout->addAnchor(layout, Qt::AnchorLeft, b, Qt::AnchorLeft);
+ \endcode
+
+ has the same effect as
+
+ \code
+ layout->addCornerAnchors(layout, Qt::TopLeft, b, Qt::TopLeft);
+ \endcode
+
+ If there is already an anchor between the edge pairs, it will be replaced by the anchors that
+ this function specifies.
+
+ \a firstItem and \a secondItem are automatically added to the layout if they are not part of the
+ layout. This means that count() can increase with up to 2.
+*/
void QGraphicsAnchorLayout::addCornerAnchors(QGraphicsLayoutItem *firstItem,
Qt::Corner firstCorner,
QGraphicsLayoutItem *secondItem,
@@ -360,7 +360,7 @@ qreal QGraphicsAnchorLayout::verticalSpacing() const
}
/*!
- \reimp
+ \reimp
*/
void QGraphicsAnchorLayout::setGeometry(const QRectF &geom)
{
diff --git a/src/gui/graphicsview/qgraphicslayout.cpp b/src/gui/graphicsview/qgraphicslayout.cpp
index f9800bc..2e9a30c 100644
--- a/src/gui/graphicsview/qgraphicslayout.cpp
+++ b/src/gui/graphicsview/qgraphicslayout.cpp
@@ -420,6 +420,8 @@ void QGraphicsLayout::widgetEvent(QEvent *e)
*/
/*!
+ \since 4.6
+
This function is a convenience function provided for custom layouts, and will go through
all items in the layout and reparent their graphics items to the closest QGraphicsWidget
ancestor of the layout.
diff --git a/src/gui/graphicsview/qsimplex_p.cpp b/src/gui/graphicsview/qsimplex_p.cpp
index 1ba24a3..1ece8b1 100644
--- a/src/gui/graphicsview/qsimplex_p.cpp
+++ b/src/gui/graphicsview/qsimplex_p.cpp
@@ -49,6 +49,7 @@
QT_BEGIN_NAMESPACE
/*!
+ \internal
\class QSimplex
The QSimplex class is a Linear Programming problem solver based on the two-phase
@@ -111,6 +112,7 @@ void QSimplex::clearDataStructures()
}
/*!
+ \internal
Sets the new constraints in the simplex solver and returns whether the problem
is feasible.
@@ -509,6 +511,7 @@ qreal QSimplex::solver(solverFactor factor)
}
/*!
+ \internal
Minimize the original objective.
*/
qreal QSimplex::solveMin()
@@ -517,6 +520,7 @@ qreal QSimplex::solveMin()
}
/*!
+ \internal
Maximize the original objective.
*/
qreal QSimplex::solveMax()
diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp
index aff186b..074f3eb 100644
--- a/src/gui/image/qimagereader.cpp
+++ b/src/gui/image/qimagereader.cpp
@@ -696,14 +696,17 @@ bool QImageReader::autoDetectImageFormat() const
/*!
- Specifies that the image reader should decide which plugin to use
- solely based on the contents in the datastream.
+ If \a ignored is set to true, then the image reader will ignore
+ specified formats or file extensions and decide which plugin to
+ use only based on the contents in the datastream.
Setting this flag means that all image plugins gets loaded. Each
plugin will read the first bytes in the image data and decide if
- the plugin is compatible or not. The flag is set to \a ignored.
+ the plugin is compatible or not.
- This also disables auto detecting image format.
+ This also disables auto detecting the image format.
+
+ \sa decideFormatFromContent()
*/
void QImageReader::setDecideFormatFromContent(bool ignored)
@@ -713,8 +716,11 @@ void QImageReader::setDecideFormatFromContent(bool ignored)
/*!
- Returns wether the image reader should decide which plugin to use
- sloley based on the contents of the datastream
+ Returns whether the image reader should decide which plugin to use
+ only based on the contents of the datastream rather than on the file
+ extension.
+
+ \sa setDecideFormatFromContent()
*/
bool QImageReader::decideFormatFromContent() const
diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp
index cab6116..dccc691 100644
--- a/src/gui/image/qpixmap_s60.cpp
+++ b/src/gui/image/qpixmap_s60.cpp
@@ -64,13 +64,14 @@ const uchar qt_pixmap_bit_mask[] = { 0x01, 0x02, 0x04, 0x08,
0x10, 0x20, 0x40, 0x80 };
-
/*!
+ \class QSymbianFbsClient
\since 4.6
+ \internal
- Symbian Font And Bitmap server client that is
- used to lock the global bitmap heap. Only used in
- S60 v3.1 and S60 v3.2.
+ Symbian Font And Bitmap server client that is
+ used to lock the global bitmap heap. Only used in
+ S60 v3.1 and S60 v3.2.
*/
class QSymbianFbsClient
{
@@ -145,7 +146,9 @@ void QSymbianFbsHeapLock::relock()
}
/*!
+ \class QSymbianBitmapDataAccess
\since 4.6
+ \internal
Data access class that is used to locks/unlocks pixel data
when drawing or modifying CFbsBitmap pixel data.
@@ -297,7 +300,7 @@ QPixmap QPixmap::grabWindow(WId winId, int x, int y, int w, int h)
}
/*!
- \fn CFbsBitmap *QPixmap::toSymbianCFbsBitmap()
+ \fn CFbsBitmap *QPixmap::toSymbianCFbsBitmap() const
\since 4.6
Creates a \c CFbsBitmap that is equivalent to the QPixmap. Internally this
@@ -724,7 +727,7 @@ void QS60PixmapData::endDataAccess(bool readOnly) const
/*!
\since 4.6
- Returns a QPixmap that wraps given \c RSgImage \a graphics resource.
+ Returns a QPixmap that wraps given \a sgImage graphics resource.
The data should be valid even when original RSgImage handle has been
closed.
diff --git a/src/gui/inputmethod/qinputcontext.cpp b/src/gui/inputmethod/qinputcontext.cpp
index 620880a..8ee417f 100644
--- a/src/gui/inputmethod/qinputcontext.cpp
+++ b/src/gui/inputmethod/qinputcontext.cpp
@@ -295,7 +295,7 @@ void QInputContext::sendEvent(const QInputMethodEvent &event)
The \a event parameter is the event that was sent to the editor
widget. The event type is QEvent::MouseButtonPress,
QEvent::MouseButtonRelease, QEvent::MouseButtonDblClick or
- QEvent::MouseButtonMove. The event's button and state indicate
+ QEvent::MouseMove. The event's button and state indicate
the kind of operation that was performed.
*/
void QInputContext::mouseHandler(int /*x*/, QMouseEvent *event)
@@ -469,6 +469,8 @@ bool QInputContext::x11FilterEvent(QWidget * /*keywidget*/, XEvent * /*event*/)
#ifdef Q_WS_S60
/*!
+ \since 4.6
+
This function may be overridden only if input method is depending
on Symbian and you need raw TWsEvent. Otherwise, this function must not.
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 8daac42..0637652 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -1305,6 +1305,7 @@ void QApplication::beep()
/*!
\warning This function is only available on Symbian.
+ \since 4.6
This function processes an individual Symbian window server
\a event. It returns 1 if the event was handled, 0 if
@@ -1427,6 +1428,7 @@ int QApplication::s60ProcessEvent(TWsEvent *event)
/*!
\warning This virtual function is only available on Symbian.
+ \since 4.6
If you create an application that inherits QApplication and reimplement
this function, you get direct access to events that the are received
@@ -1444,6 +1446,7 @@ bool QApplication::s60EventFilter(TWsEvent * /* aEvent */)
/*!
\warning This function is only available on Symbian.
+ \since 4.6
Handles \a{command}s which are typically handled by
CAknAppUi::HandleCommandL(). Qts Ui integration into Symbian is
@@ -1475,6 +1478,7 @@ void QApplication::symbianHandleCommand(int command)
/*!
\warning This function is only available on Symbian.
+ \since 4.6
Handles the resource change specified by \a type.
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index 4ebf8a9..f482d1c 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -64,9 +64,9 @@
#include <qdebug.h>
@interface NSEvent (DeviceDelta)
- - (float)deviceDeltaX;
- - (float)deviceDeltaY;
- - (float)deviceDeltaZ;
+ - (CGFloat)deviceDeltaX;
+ - (CGFloat)deviceDeltaY;
+ - (CGFloat)deviceDeltaZ;
@end
QT_BEGIN_NAMESPACE
diff --git a/src/gui/kernel/qeventdispatcher_x11.cpp b/src/gui/kernel/qeventdispatcher_x11.cpp
index ce1a11f..59977ec 100644
--- a/src/gui/kernel/qeventdispatcher_x11.cpp
+++ b/src/gui/kernel/qeventdispatcher_x11.cpp
@@ -105,7 +105,7 @@ bool QEventDispatcherX11::processEvents(QEventLoop::ProcessEventsFlags flags)
// _qt_scrolldone protocols, queue all other
// client messages
if (event.xclient.format == 32) {
- if (event.xclient.message_type == ATOM(WM_PROTOCOLS) ||
+ if (event.xclient.message_type == ATOM(WM_PROTOCOLS) &&
(Atom) event.xclient.data.l[0] == ATOM(WM_TAKE_FOCUS)) {
break;
} else if (event.xclient.message_type == ATOM(_QT_SCROLL_DONE)) {
diff --git a/src/gui/kernel/qguieventdispatcher_glib.cpp b/src/gui/kernel/qguieventdispatcher_glib.cpp
index 6e98428..f8a638c 100644
--- a/src/gui/kernel/qguieventdispatcher_glib.cpp
+++ b/src/gui/kernel/qguieventdispatcher_glib.cpp
@@ -120,7 +120,7 @@ static gboolean x11EventSourceDispatch(GSource *s, GSourceFunc callback, gpointe
// _qt_scrolldone protocols, queue all other
// client messages
if (event.xclient.format == 32) {
- if (event.xclient.message_type == ATOM(WM_PROTOCOLS) ||
+ if (event.xclient.message_type == ATOM(WM_PROTOCOLS) &&
(Atom) event.xclient.data.l[0] == ATOM(WM_TAKE_FOCUS)) {
break;
} else if (event.xclient.message_type == ATOM(_QT_SCROLL_DONE)) {
diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp
index 45ecb5a..91f4163 100644
--- a/src/gui/kernel/qsoftkeymanager.cpp
+++ b/src/gui/kernel/qsoftkeymanager.cpp
@@ -125,6 +125,7 @@ QAction *QSoftKeyManager::createAction(StandardSoftKey standardKey, QWidget *act
break;
}
action->setSoftKeyRole(softKeyRole);
+ action->setEnabled(actionWidget->isEnabled());
return action;
}
@@ -247,9 +248,17 @@ bool QSoftKeyManager::handleCommand(int command)
if (command >= s60CommandStart && QSoftKeyManagerPrivate::softKeySource) {
int index = command - s60CommandStart;
const QList<QAction*>& softKeys = QSoftKeyManagerPrivate::softKeySource->actions();
- if (index < softKeys.count()) {
- softKeys.at(index)->activate(QAction::Trigger);
- return true;
+ for (int i = 0, j = 0; i < softKeys.count(); ++i) {
+ QAction *action = softKeys.at(i);
+ if (action->softKeyRole() != QAction::NoSoftKey) {
+ if (j == index) {
+ if (action->isEnabled()) {
+ action->activate(QAction::Trigger);
+ return true;
+ }
+ }
+ j++;
+ }
}
}
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 53ef682..2397793 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -10145,7 +10145,8 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
"QWidgetPrivate::high_attributes[] too small to contain all attributes in WidgetAttribute");
#ifdef Q_WS_WIN
- if (attribute == Qt::WA_PaintOnScreen && on) {
+ // ### Don't use PaintOnScreen+paintEngine() to do native painting in 5.0
+ if (attribute == Qt::WA_PaintOnScreen && on && !inherits("QGLWidget")) {
// see qwidget_win.cpp, ::paintEngine for details
paintEngine();
if (d->noPaintOnScreen)
diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp
index 5659aef..62e08f3 100644
--- a/src/gui/painting/qcolor.cpp
+++ b/src/gui/painting/qcolor.cpp
@@ -691,6 +691,8 @@ void QColor::setHsv(int h, int s, int v, int a)
}
/*!
+ \since 4.6
+
Sets the contents pointed to by \a h, \a s, \a l, and \a a, to the hue,
saturation, lightness, and alpha-channel (transparency) components of the
color's HSL value.
@@ -719,6 +721,8 @@ void QColor::getHslF(qreal *h, qreal *s, qreal *l, qreal *a) const
}
/*!
+ \since 4.6
+
Sets the contents pointed to by \a h, \a s, \a l, and \a a, to the hue,
saturation, lightness, and alpha-channel (transparency) components of the
color's HSL value.
@@ -747,6 +751,8 @@ void QColor::getHsl(int *h, int *s, int *l, int *a) const
}
/*!
+ \since 4.6
+
Sets a HSL color lightness; \a h is the hue, \a s is the saturation, \a l is
the lightness and \a a is the alpha component of the HSL color.
@@ -773,6 +779,8 @@ void QColor::setHslF(qreal h, qreal s, qreal l, qreal a)
}
/*!
+ \since 4.6
+
Sets a HSL color value; \a h is the hue, \a s is the saturation, \a l is
the lightness and \a a is the alpha component of the HSL color.
@@ -1332,6 +1340,8 @@ qreal QColor::valueF() const
}
/*!
+ \since 4.6
+
Returns the hue color component of this color.
\sa getHslF(), getHsl()
@@ -1344,6 +1354,8 @@ int QColor::hslHue() const
}
/*!
+ \since 4.6
+
Returns the saturation color component of this color.
\sa saturationF(), getHsv(), {QColor#The HSV Color Model}{The HSV Color
@@ -1357,6 +1369,8 @@ int QColor::hslSaturation() const
}
/*!
+ \since 4.6
+
Returns the lightness color component of this color.
\sa lightnessF(), getHsl()
@@ -1369,6 +1383,8 @@ int QColor::lightness() const
}
/*!
+ \since 4.6
+
Returns the hue color component of this color.
\sa hue(), getHslF()
@@ -1381,6 +1397,8 @@ qreal QColor::hslHueF() const
}
/*!
+ \since 4.6
+
Returns the saturation color component of this color.
\sa saturationF() getHslF()
@@ -1393,6 +1411,8 @@ qreal QColor::hslSaturationF() const
}
/*!
+ \since 4.6
+
Returns the lightness color component of this color.
\sa value() getHslF()
@@ -1979,6 +1999,8 @@ QColor QColor::fromHsvF(qreal h, qreal s, qreal v, qreal a)
}
/*!
+ \since 4.6
+
Static convenience function that returns a QColor constructed from the HSV
color values, \a h (hue), \a s (saturation), \a l (lightness), and \a a
(alpha-channel, i.e. transparency).
@@ -2010,6 +2032,7 @@ QColor QColor::fromHsl(int h, int s, int l, int a)
/*!
\overload
+ \since 4.6
Static convenience function that returns a QColor constructed from the HSV
color values, \a h (hue), \a s (saturation), \a l (lightness), and \a a
diff --git a/src/gui/painting/qdrawhelper_mmx.cpp b/src/gui/painting/qdrawhelper_mmx.cpp
index 0dcc3dd..d81e2a9 100644
--- a/src/gui/painting/qdrawhelper_mmx.cpp
+++ b/src/gui/painting/qdrawhelper_mmx.cpp
@@ -128,7 +128,7 @@ void qt_blend_rgb32_on_rgb32_mmx(uchar *destPixels, int dbpl,
}
}
+QT_END_NAMESPACE
#endif // QT_HAVE_MMX
-QT_END_NAMESPACE
diff --git a/src/gui/painting/qdrawhelper_mmx3dnow.cpp b/src/gui/painting/qdrawhelper_mmx3dnow.cpp
index 0db89f0..2d40ae3 100644
--- a/src/gui/painting/qdrawhelper_mmx3dnow.cpp
+++ b/src/gui/painting/qdrawhelper_mmx3dnow.cpp
@@ -101,6 +101,7 @@ void qt_blend_color_argb_mmx3dnow(int count, const QSpan *spans, void *userData)
(CompositionFunctionSolid*)qt_functionForModeSolid_MMX3DNOW);
}
+QT_END_NAMESPACE
+
#endif // QT_HAVE_3DNOW
-QT_END_NAMESPACE
diff --git a/src/gui/painting/qpaintbuffer.cpp b/src/gui/painting/qpaintbuffer.cpp
index 1038f74..6b9d77c 100644
--- a/src/gui/painting/qpaintbuffer.cpp
+++ b/src/gui/painting/qpaintbuffer.cpp
@@ -44,11 +44,14 @@
//#include <private/qtextengine_p.h>
#include <private/qfontengine_p.h>
#include <private/qemulationpaintengine_p.h>
+#include <private/qimage_p.h>
#include <QDebug>
//#define QPAINTBUFFER_DEBUG_DRAW
+QT_BEGIN_NAMESPACE
+
extern int qt_defaultDpiX();
extern int qt_defaultDpiY();
extern void qt_format_text(const QFont &font,
@@ -890,6 +893,12 @@ void QPaintBufferEngine::drawPixmap(const QPointF &pos, const QPixmap &pm)
buffer->updateBoundingRect(QRectF(pos, pm.size()));
}
+static inline QImage qpaintbuffer_storable_image(const QImage &src)
+{
+ QImageData *d = const_cast<QImage &>(src).data_ptr();
+ return d->own_data ? src : src.copy();
+}
+
void QPaintBufferEngine::drawImage(const QRectF &r, const QImage &image, const QRectF &sr,
Qt::ImageConversionFlags /*flags */)
{
@@ -897,7 +906,8 @@ void QPaintBufferEngine::drawImage(const QRectF &r, const QImage &image, const Q
qDebug() << "QPaintBufferEngine: drawImage: src/dest rects " << r << sr;
#endif
QPaintBufferCommand *cmd =
- buffer->addCommand(QPaintBufferPrivate::Cmd_DrawPixmapRect, QVariant(image));
+ buffer->addCommand(QPaintBufferPrivate::Cmd_DrawImageRect,
+ QVariant(qpaintbuffer_storable_image(image)));
cmd->extra = buffer->addData((qreal *) &r, 4);
buffer->addData((qreal *) &sr, 4);
// ### flags...
@@ -911,7 +921,8 @@ void QPaintBufferEngine::drawImage(const QPointF &pos, const QImage &image)
qDebug() << "QPaintBufferEngine: drawImage: pos:" << pos;
#endif
QPaintBufferCommand *cmd =
- buffer->addCommand(QPaintBufferPrivate::Cmd_DrawImagePos, QVariant(image));
+ buffer->addCommand(QPaintBufferPrivate::Cmd_DrawImagePos,
+ QVariant(qpaintbuffer_storable_image(image)));
cmd->extra = buffer->addData((qreal *) &pos, 2);
if (buffer->calculateBoundingRect)
buffer->updateBoundingRect(QRectF(pos, image.size()));
@@ -1740,7 +1751,9 @@ struct QPaintBufferCacheEntry
QVariant::Type type;
quint64 cacheKey;
};
+QT_END_NAMESPACE
Q_DECLARE_METATYPE(QPaintBufferCacheEntry)
+QT_BEGIN_NAMESPACE
QDataStream &operator<<(QDataStream &stream, const QPaintBufferCacheEntry &entry)
{
@@ -1832,3 +1845,4 @@ QDataStream &operator>>(QDataStream &stream, QPaintBuffer &buffer)
return stream;
}
+QT_END_NAMESPACE
diff --git a/src/gui/painting/qpaintbuffer_p.h b/src/gui/painting/qpaintbuffer_p.h
index a80fa8d..6a7ac73 100644
--- a/src/gui/painting/qpaintbuffer_p.h
+++ b/src/gui/painting/qpaintbuffer_p.h
@@ -59,6 +59,8 @@
#include <private/qtextengine_p.h>
#include <QDebug>
+QT_BEGIN_NAMESPACE
+
class QPaintBufferPrivate;
class QPaintBufferPlayback;
@@ -440,4 +442,6 @@ private:
FreeFunc free;
};
+QT_END_NAMESPACE
+
#endif // QPAINTBUFFER_P_H
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index ed1b5d1..f271af9 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -1895,6 +1895,8 @@ QPaintEngine *QPainter::paintEngine() const
}
/*!
+ \since 4.6
+
Flushes the painting pipeline and prepares for the user issuing
commands directly to the underlying graphics context. Must be
followed by a call to endNativePainting().
@@ -1919,6 +1921,8 @@ void QPainter::beginNativePainting()
}
/*!
+ \since 4.6
+
Restores the painter after manually issuing native painting commands.
Lets the painter restore any native state that it relies on before
calling any other painter commands.
diff --git a/src/gui/painting/qprinter.cpp b/src/gui/painting/qprinter.cpp
index eb9b11b..5ff0b96 100644
--- a/src/gui/painting/qprinter.cpp
+++ b/src/gui/painting/qprinter.cpp
@@ -1275,7 +1275,7 @@ QPrinter::ColorMode QPrinter::colorMode() const
buffering up the copies and in those cases the application must make an
explicit call to the print code for each copy.
- \sa setNumCopies()
+ \sa setNumCopies(), actualNumCopies()
*/
int QPrinter::numCopies() const
@@ -1286,13 +1286,15 @@ int QPrinter::numCopies() const
/*!
+ \since 4.6
+
Returns the number of copies that will be printed. The default
value is 1.
This function always returns the actual value specified in the print
dialog or using setNumCopies().
- \sa setNumCopies(), numCopies();
+ \sa setNumCopies(), numCopies()
*/
int QPrinter::actualNumCopies() const
{
diff --git a/src/gui/statemachine/qkeyeventtransition.cpp b/src/gui/statemachine/qkeyeventtransition.cpp
index 825b2ec..dee3168 100644
--- a/src/gui/statemachine/qkeyeventtransition.cpp
+++ b/src/gui/statemachine/qkeyeventtransition.cpp
@@ -44,7 +44,7 @@
#ifndef QT_NO_STATEMACHINE
#include "qbasickeyeventtransition_p.h"
-#include <QtCore/qwrappedevent.h>
+#include <QtCore/qstatemachine.h>
#include <private/qeventtransition_p.h>
QT_BEGIN_NAMESPACE
@@ -160,7 +160,7 @@ bool QKeyEventTransition::eventTest(QEvent *event)
Q_D(const QKeyEventTransition);
if (!QEventTransition::eventTest(event))
return false;
- QWrappedEvent *we = static_cast<QWrappedEvent*>(event);
+ QStateMachine::WrappedEvent *we = static_cast<QStateMachine::WrappedEvent*>(event);
d->transition->setEventType(we->event()->type());
return QAbstractTransitionPrivate::get(d->transition)->callEventTest(we->event());
}
diff --git a/src/gui/statemachine/qmouseeventtransition.cpp b/src/gui/statemachine/qmouseeventtransition.cpp
index 564c8d2..86cacf7 100644
--- a/src/gui/statemachine/qmouseeventtransition.cpp
+++ b/src/gui/statemachine/qmouseeventtransition.cpp
@@ -44,7 +44,7 @@
#ifndef QT_NO_STATEMACHINE
#include "qbasicmouseeventtransition_p.h"
-#include <QtCore/qwrappedevent.h>
+#include <QtCore/qstatemachine.h>
#include <QtGui/qpainterpath.h>
#include <private/qeventtransition_p.h>
@@ -188,7 +188,7 @@ bool QMouseEventTransition::eventTest(QEvent *event)
Q_D(const QMouseEventTransition);
if (!QEventTransition::eventTest(event))
return false;
- QWrappedEvent *we = static_cast<QWrappedEvent*>(event);
+ QStateMachine::WrappedEvent *we = static_cast<QStateMachine::WrappedEvent*>(event);
d->transition->setEventType(we->event()->type());
return QAbstractTransitionPrivate::get(d->transition)->callEventTest(we->event());
}
diff --git a/src/gui/text/qtextobject.cpp b/src/gui/text/qtextobject.cpp
index b6ff39f..d9438fd 100644
--- a/src/gui/text/qtextobject.cpp
+++ b/src/gui/text/qtextobject.cpp
@@ -1370,7 +1370,7 @@ int QTextBlock::firstLineNumber() const
Sets the line count to \a count.
-/sa lineCount()
+\sa lineCount()
*/
void QTextBlock::setLineCount(int count)
{
diff --git a/src/gui/widgets/qcalendarwidget.cpp b/src/gui/widgets/qcalendarwidget.cpp
index 71588c4..08ed7f6 100644
--- a/src/gui/widgets/qcalendarwidget.cpp
+++ b/src/gui/widgets/qcalendarwidget.cpp
@@ -3022,11 +3022,21 @@ bool QCalendarWidget::event(QEvent *event)
bool QCalendarWidget::eventFilter(QObject *watched, QEvent *event)
{
Q_D(QCalendarWidget);
- if (event->type() == QEvent::MouseButtonPress && d->yearEdit->hasFocus() && !QRect(d->yearEdit->mapToGlobal(QPoint(0, 0)), d->yearEdit->size()).contains(static_cast<QMouseEvent *>(event)->globalPos())) {
- event->accept();
- d->_q_yearEditingFinished();
- setFocus();
- return true;
+ if (event->type() == QEvent::MouseButtonPress && d->yearEdit->hasFocus()) {
+ QWidget *tlw = window();
+ QWidget *widget = static_cast<QWidget*>(watched);
+ //as we have a event filter on the whole application we first make sure that the top level widget
+ //of both this and the watched widget are the same to decide if we should finish the year edition.
+ if (widget->window() == tlw) {
+ QPoint mousePos = widget->mapTo(tlw, static_cast<QMouseEvent *>(event)->pos());
+ QRect geom = QRect(d->yearEdit->mapTo(tlw, QPoint(0, 0)), d->yearEdit->size());
+ if (!geom.contains(mousePos)) {
+ event->accept();
+ d->_q_yearEditingFinished();
+ setFocus();
+ return true;
+ }
+ }
}
return QWidget::eventFilter(watched, event);
}
diff --git a/src/gui/widgets/qdialogbuttonbox.cpp b/src/gui/widgets/qdialogbuttonbox.cpp
index 39566ef..6cc720d 100644
--- a/src/gui/widgets/qdialogbuttonbox.cpp
+++ b/src/gui/widgets/qdialogbuttonbox.cpp
@@ -593,6 +593,7 @@ QAction* QDialogButtonBoxPrivate::createSoftKey(QAbstractButton *button, QDialog
}
QObject::connect(action, SIGNAL(triggered()), button, SIGNAL(clicked()));
action->setSoftKeyRole(softkeyRole);
+ action->setEnabled(button->isEnabled());
return action;
}
#endif
diff --git a/src/gui/widgets/qspinbox.cpp b/src/gui/widgets/qspinbox.cpp
index e682364..9eb07ac 100644
--- a/src/gui/widgets/qspinbox.cpp
+++ b/src/gui/widgets/qspinbox.cpp
@@ -61,8 +61,6 @@ QT_BEGIN_NAMESPACE
# define QSBDEBUG if (false) qDebug
#endif
-static bool isIntermediateValueHelper(qint64 num, qint64 minimum, qint64 maximum, qint64 *match = 0);
-
class QSpinBoxPrivate : public QAbstractSpinBoxPrivate
{
Q_DECLARE_PUBLIC(QSpinBox)
@@ -74,7 +72,6 @@ public:
virtual QString textFromValue(const QVariant &n) const;
QVariant validateAndInterpret(QString &input, int &pos,
QValidator::State &state) const;
- bool isIntermediateValue(const QString &str) const;
QChar thousand;
inline void init() {
@@ -90,7 +87,6 @@ class QDoubleSpinBoxPrivate : public QAbstractSpinBoxPrivate
public:
QDoubleSpinBoxPrivate(QWidget *parent = 0);
void emitSignals(EmitPolicy ep, const QVariant &);
- bool isIntermediateValue(const QString &str) const;
virtual QVariant valueFromText(const QString &n) const;
virtual QString textFromValue(const QVariant &n) const;
@@ -991,51 +987,6 @@ QVariant QSpinBoxPrivate::valueFromText(const QString &text) const
/*!
- \internal
-
- Return true if str can become a number which is between minimum and
- maximum or false if this is not possible.
-*/
-
-bool QSpinBoxPrivate::isIntermediateValue(const QString &str) const
-{
- const int num = locale.toInt(str, 0, 10);
- const int min = minimum.toInt();
- const int max = maximum.toInt();
-
- int numDigits = 0;
- int digits[10];
- int tmp = num;
- if (tmp == 0) {
- numDigits = 1;
- digits[0] = 0;
- } else {
- tmp = num;
- for (int i=0; tmp != 0; ++i) {
- digits[numDigits++] = qAbs(tmp % 10);
- tmp /= 10;
- }
- }
-
- int failures = 0;
- for (int number=min; /*number<=max*/; ++number) {
- tmp = number;
- for (int i=0; tmp != 0;) {
- if (digits[i] == qAbs(tmp % 10)) {
- if (++i == numDigits)
- return true;
- }
- tmp /= 10;
- }
- if (failures++ == 500000) //upper bound
- return true;
- if (number == max) // needed for INT_MAX
- break;
- }
- return false;
-}
-
-/*!
\internal Multi purpose function that parses input, sets state to
the appropriate state and returns the value it will be interpreted
as.
@@ -1089,9 +1040,8 @@ QVariant QSpinBoxPrivate::validateAndInterpret(QString &input, int &pos,
state = QValidator::Invalid;
QSBDEBUG() << __FILE__ << __LINE__<< "state is set to Invalid";
} else {
- state = isIntermediateValue(copy) ? QValidator::Intermediate : QValidator::Invalid;
- QSBDEBUG() << __FILE__ << __LINE__<< "state is set to "
- << (state == QValidator::Intermediate ? "Intermediate" : "Acceptable");
+ state = QValidator::Intermediate;
+ QSBDEBUG() << __FILE__ << __LINE__<< "state is set to Intermediate";
}
}
}
@@ -1151,105 +1101,6 @@ void QDoubleSpinBoxPrivate::emitSignals(EmitPolicy ep, const QVariant &old)
}
-bool QDoubleSpinBoxPrivate::isIntermediateValue(const QString &str) const
-{
- QSBDEBUG() << "input is" << str << minimum << maximum;
- qint64 dec = 1;
- for (int i=0; i<decimals; ++i)
- dec *= 10;
-
- const QLatin1Char dot('.');
-
- // I know QString::number() uses CLocale so I use dot
- const QString minstr = QString::number(minimum.toDouble(), 'f', decimals);
- bool ok;
- qint64 min_left = minstr.left(minstr.indexOf(dot)).toLongLong(&ok);
- if (!ok)
- return false;
- qint64 min_right = minstr.mid(minstr.indexOf(dot) + 1).toLongLong();
-
- const QString maxstr = QString::number(maximum.toDouble(), 'f', decimals);
- qint64 max_left = maxstr.left(maxstr.indexOf(dot)).toLongLong(&ok);
- if (!ok)
- return true;
- qint64 max_right = maxstr.mid(maxstr.indexOf(dot) + 1).toLongLong();
-
- const int dotindex = str.indexOf(delimiter);
- const bool negative = maximum.toDouble() < 0;
- qint64 left = 0, right = 0;
- bool doleft = true;
- bool doright = true;
- if (dotindex == -1) {
- left = str.toLongLong();
- doright = false;
- } else if (dotindex == 0 || (dotindex == 1 && str.at(0) == QLatin1Char('+'))) {
- if (negative) {
- QSBDEBUG() << __FILE__ << __LINE__ << "returns false";
- return false;
- }
- doleft = false;
- right = str.mid(dotindex + 1).toLongLong();
- } else if (dotindex == 1 && str.at(0) == QLatin1Char('-')) {
- if (!negative) {
- QSBDEBUG() << __FILE__ << __LINE__ << "returns false";
- return false;
- }
- doleft = false;
- right = str.mid(dotindex + 1).toLongLong();
- } else {
- left = str.left(dotindex).toLongLong();
- if (dotindex == str.size() - 1) {
- doright = false;
- } else {
- right = str.mid(dotindex + 1).toLongLong();
- }
- }
- if ((left >= 0 && max_left < 0 && !str.startsWith(QLatin1Char('-'))) || (left < 0 && min_left >= 0)) {
- QSBDEBUG("returns false 0");
- return false;
- }
-
- qint64 match = min_left;
- if (doleft && !isIntermediateValueHelper(left, min_left, max_left, &match)) {
- QSBDEBUG() << __FILE__ << __LINE__ << "returns false";
- return false;
- }
- if (doright) {
- QSBDEBUG() << "match" << match << "min_left" << min_left << "max_left" << max_left;
- if (!doleft) {
- if (min_left == max_left) {
- const bool ret = isIntermediateValueHelper(qAbs(left),
- negative ? max_right : min_right,
- negative ? min_right : max_right);
- QSBDEBUG() << __FILE__ << __LINE__ << "returns" << ret;
- return ret;
- } else if (qAbs(max_left - min_left) == 1) {
- const bool ret = isIntermediateValueHelper(qAbs(left), min_right, negative ? 0 : dec)
- || isIntermediateValueHelper(qAbs(left), negative ? dec : 0, max_right);
- QSBDEBUG() << __FILE__ << __LINE__ << "returns" << ret;
- return ret;
- } else {
- const bool ret = isIntermediateValueHelper(qAbs(left), 0, dec);
- QSBDEBUG() << __FILE__ << __LINE__ << "returns" << ret;
- return ret;
- }
- }
- if (match != min_left) {
- min_right = negative ? dec : 0;
- }
- if (match != max_left) {
- max_right = negative ? 0 : dec;
- }
- qint64 tmpl = negative ? max_right : min_right;
- qint64 tmpr = negative ? min_right : max_right;
- const bool ret = isIntermediateValueHelper(right, tmpl, tmpr);
- QSBDEBUG() << __FILE__ << __LINE__ << "returns" << ret;
- return ret;
- }
- QSBDEBUG() << __FILE__ << __LINE__ << "returns true";
- return true;
-}
-
/*!
\internal
\reimp
@@ -1415,9 +1266,8 @@ QVariant QDoubleSpinBoxPrivate::validateAndInterpret(QString &input, int &pos,
state = QValidator::Invalid;
QSBDEBUG() << __FILE__ << __LINE__<< "state is set to Invalid";
} else {
- state = isIntermediateValue(copy) ? QValidator::Intermediate : QValidator::Invalid;
- QSBDEBUG() << __FILE__ << __LINE__<< "state is set to "
- << (state == QValidator::Intermediate ? "Intermediate" : "Acceptable");
+ state = QValidator::Intermediate;
+ QSBDEBUG() << __FILE__ << __LINE__<< "state is set to Intermediate";
}
}
}
@@ -1475,62 +1325,6 @@ QString QDoubleSpinBoxPrivate::textFromValue(const QVariant &f) const
Use minimum() instead.
*/
-/*!
- \internal Returns whether \a str is a string which value cannot be
- parsed but still might turn into something valid.
-*/
-
-static bool isIntermediateValueHelper(qint64 num, qint64 min, qint64 max, qint64 *match)
-{
- QSBDEBUG() << num << min << max;
-
- if (num >= min && num <= max) {
- if (match)
- *match = num;
- QSBDEBUG("returns true 0");
- return true;
- }
- qint64 tmp = num;
-
- int numDigits = 0;
- int digits[10];
- if (tmp == 0) {
- numDigits = 1;
- digits[0] = 0;
- } else {
- tmp = qAbs(num);
- for (int i=0; tmp > 0; ++i) {
- digits[numDigits++] = tmp % 10;
- tmp /= 10;
- }
- }
-
- int failures = 0;
- qint64 number;
- for (number=max; number>=min; --number) {
- tmp = qAbs(number);
- for (int i=0; tmp > 0;) {
- if (digits[i] == (tmp % 10)) {
- if (++i == numDigits) {
- if (match)
- *match = number;
- QSBDEBUG("returns true 1");
- return true;
- }
- }
- tmp /= 10;
- }
- if (failures++ == 500000) { //upper bound
- if (match)
- *match = num;
- QSBDEBUG("returns true 2");
- return true;
- }
- }
- QSBDEBUG("returns false");
- return false;
-}
-
/*! \reimp */
bool QSpinBox::event(QEvent *event)
{
diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp
index 92e4eb4..6c9761c 100644
--- a/src/gui/widgets/qtabbar.cpp
+++ b/src/gui/widgets/qtabbar.cpp
@@ -1100,7 +1100,7 @@ QVariant QTabBar::tabData(int index) const
}
/*!
- Returns the visual rectangle of the of the tab at position \a
+ Returns the visual rectangle of the tab at position \a
index, or a null rectangle if \a index is out of range.
*/
QRect QTabBar::tabRect(int index) const
diff --git a/src/multimedia/audio/qaudioinput.cpp b/src/multimedia/audio/qaudioinput.cpp
index 858846f..7a3be23 100644
--- a/src/multimedia/audio/qaudioinput.cpp
+++ b/src/multimedia/audio/qaudioinput.cpp
@@ -184,7 +184,7 @@ QAudioInput::~QAudioInput()
Passing a QIODevice allows the data to be transfered without any extra code.
All that is required is to open the QIODevice.
- /sa QIODevice
+ \sa QIODevice
*/
QIODevice* QAudioInput::start(QIODevice* device)
diff --git a/src/multimedia/audio/qaudiooutput.cpp b/src/multimedia/audio/qaudiooutput.cpp
index 3d3f5f5..81b9496 100644
--- a/src/multimedia/audio/qaudiooutput.cpp
+++ b/src/multimedia/audio/qaudiooutput.cpp
@@ -195,7 +195,7 @@ QAudioFormat QAudioOutput::format() const
Passing a QIODevice allows the data to be transfered without any extra code.
All that is required is to open the QIODevice.
- /sa QIODevice
+ \sa QIODevice
*/
QIODevice* QAudioOutput::start(QIODevice* device)
diff --git a/src/network/kernel/qhostaddress.cpp b/src/network/kernel/qhostaddress.cpp
index 5d94dc9..0e5cd1e 100644
--- a/src/network/kernel/qhostaddress.cpp
+++ b/src/network/kernel/qhostaddress.cpp
@@ -432,6 +432,9 @@ void QNetmaskAddress::setPrefixLength(QAbstractSocket::NetworkLayerProtocol prot
using isIPv4Address() or isIPv6Address(), and retrieved with
toIPv4Address(), toIPv6Address(), or toString().
+ \note Please note that QHostAddress does not do DNS lookups.
+ QHostInfo is needed for that.
+
The class also supports common predefined addresses: \l Null, \l
LocalHost, \l LocalHostIPv6, \l Broadcast, and \l Any.
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 119c89d..7e45fd9 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -129,7 +129,7 @@ public Q_SLOTS:
// since the context holding the texture is shared, and
// about to be destroyed, we have to transfer ownership
// of the texture to one of the share contexts
- ctx = const_cast<QGLContext *>(shares.at(0));
+ ctx = const_cast<QGLContext *>((ctx == shares.at(0)) ? shares.at(1) : shares.at(0));
}
}
}
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 97a4a73..0ad6772 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -1245,11 +1245,11 @@ QGLFormat::OpenGLVersionFlags QGLFormat::openGLVersionFlags()
if (cachedDefault) {
return defaultVersionFlags;
} else {
- cachedDefault = true;
if (!hasOpenGL())
return defaultVersionFlags;
dummy = new QGLWidget;
dummy->makeCurrent(); // glGetString() needs a current context
+ cachedDefault = true;
}
}
diff --git a/src/opengl/qgl_win.cpp b/src/opengl/qgl_win.cpp
index 2f9e225..5b5820a 100644
--- a/src/opengl/qgl_win.cpp
+++ b/src/opengl/qgl_win.cpp
@@ -660,6 +660,8 @@ public:
int dmy_pf = ChoosePixelFormat(dmy_pdc, &dmy_pfd);
SetPixelFormat(dmy_pdc, dmy_pf, &dmy_pfd);
dmy_rc = wglCreateContext(dmy_pdc);
+ old_dc = wglGetCurrentDC();
+ old_context = wglGetCurrentContext();
wglMakeCurrent(dmy_pdc, dmy_rc);
}
@@ -668,10 +670,14 @@ public:
wglDeleteContext(dmy_rc);
ReleaseDC(dmy_id, dmy_pdc);
DestroyWindow(dmy_id);
+ if (old_dc && old_context)
+ wglMakeCurrent(old_dc, old_context);
}
HDC dmy_pdc;
HGLRC dmy_rc;
+ HDC old_dc;
+ HGLRC old_context;
WId dmy_id;
};
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
index ce9a55c..b15888b 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
@@ -288,7 +288,7 @@ bool QDirectFBPixmapData::fromDataBufferDescription(const DFBDataBufferDescripti
void QDirectFBPixmapData::fromImage(const QImage &img,
Qt::ImageConversionFlags flags)
{
- if (img.depth() == 1) {
+ if (img.depth() == 1 || img.format() == QImage::Format_RGB32) {
fromImage(img.convertToFormat(screen->alphaPixmapFormat()), flags);
return;
}
@@ -308,6 +308,8 @@ void QDirectFBPixmapData::fromImage(const QImage &img,
if (flags != Qt::AutoColor) {
image = img.convertToFormat(imageFormat, flags);
flags = Qt::AutoColor;
+ } else if (img.format() == QImage::Format_RGB32) {
+ image = img.convertToFormat(imageFormat, flags);
} else {
image = img;
}
@@ -332,6 +334,7 @@ void QDirectFBPixmapData::fromImage(const QImage &img,
} else {
dfbSurface->SetBlittingFlags(dfbSurface, DSBLIT_NOFX);
}
+
dfbSurface->Blit(dfbSurface, imageSurface, 0, 0, 0);
imageSurface->Release(imageSurface);
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index 78bbf5f..b27d1be 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -2353,23 +2353,25 @@ JSC::CallFrame *QScriptEnginePrivate::pushContext(JSC::CallFrame *exec, JSC::JSV
//build a frame
JSC::CallFrame *newCallFrame = exec;
if (callee == 0 //called from public QScriptEngine::pushContext
- || exec->returnPC() == 0 || (contextFlags(exec) & NativeContext) //called from native-native call
+ || exec->returnPC() == 0 || (contextFlags(exec) & NativeContext) //called from native-native call
|| (exec->codeBlock() && exec->callee() != callee)) { //the interpreter did not build a frame for us.
//We need to check if the Interpreter might have already created a frame for function called from JS.
JSC::Interpreter *interp = exec->interpreter();
JSC::Register *oldEnd = interp->registerFile().end();
int argc = args.size() + 1; //add "this"
JSC::Register *newEnd = oldEnd + argc + JSC::RegisterFile::CallFrameHeaderSize;
- if (!interp->registerFile().grow(newEnd))
+ //Without + argc + JSC::RegisterFile::CallFrameHeaderSize, it crashes.
+ //It seems that JSC is not consistant with the way the callframe is crated
+ if (!interp->registerFile().grow(newEnd + argc + JSC::RegisterFile::CallFrameHeaderSize))
return 0; //### Stack overflow
- newCallFrame = JSC::CallFrame::create(oldEnd);
+ newCallFrame = JSC::CallFrame::create(newEnd);
newCallFrame[0] = thisObject;
int dst = 0;
JSC::ArgList::const_iterator it;
for (it = args.begin(); it != args.end(); ++it)
newCallFrame[++dst] = *it;
newCallFrame += argc + JSC::RegisterFile::CallFrameHeaderSize;
- newCallFrame->init(0, /*vPC=*/0, exec->scopeChain(), exec, flags, argc, callee);
+ newCallFrame->init(0, /*vPC=*/0, exec->scopeChain(), exec, flags | ShouldRestoreCallFrame, argc, callee);
} else {
setContextFlags(newCallFrame, flags);
#if ENABLE(JIT)
@@ -2411,18 +2413,19 @@ void QScriptEngine::popContext()
*/
void QScriptEnginePrivate::popContext()
{
- bool hasScope = contextFlags(currentFrame) & HasScopeContext;
- if (currentFrame->returnPC() == 0) { //normal case
+ uint flags = contextFlags(currentFrame);
+ bool hasScope = flags & HasScopeContext;
+ if (flags & ShouldRestoreCallFrame) { //normal case
JSC::RegisterFile &registerFile = currentFrame->interpreter()->registerFile();
JSC::Register *const newEnd = currentFrame->registers() - JSC::RegisterFile::CallFrameHeaderSize - currentFrame->argumentCount();
if (hasScope)
currentFrame->scopeChain()->pop()->deref();
- currentFrame = currentFrame->callerFrame();
registerFile.shrink(newEnd);
} else if(hasScope) { //the stack frame was created by the Interpreter, we don't need to rewind it.
currentFrame->setScopeChain(currentFrame->scopeChain()->pop());
currentFrame->scopeChain()->deref();
}
+ currentFrame = currentFrame->callerFrame();
}
/*!
diff --git a/src/script/api/qscriptengine_p.h b/src/script/api/qscriptengine_p.h
index c43ca61..b8b805e 100644
--- a/src/script/api/qscriptengine_p.h
+++ b/src/script/api/qscriptengine_p.h
@@ -170,7 +170,8 @@ public:
enum ContextFlags {
NativeContext = 1,
CalledAsConstructorContext = 2,
- HasScopeContext = 4
+ HasScopeContext = 4, // Specifies that the is a QScriptActivationObject
+ ShouldRestoreCallFrame = 8
};
static uint contextFlags(JSC::ExecState *);
static void setContextFlags(JSC::ExecState *, uint);
diff --git a/src/script/bridge/qscriptactivationobject.cpp b/src/script/bridge/qscriptactivationobject.cpp
index 7982982..edccb3e 100644
--- a/src/script/bridge/qscriptactivationobject.cpp
+++ b/src/script/bridge/qscriptactivationobject.cpp
@@ -46,7 +46,7 @@
namespace JSC
{
- ASSERT_CLASS_FITS_IN_CELL(QScript::QScriptActivationObject);
+ ASSERT_CLASS_FITS_IN_CELL(QT_PREPEND_NAMESPACE(QScript::QScriptActivationObject));
}
QT_BEGIN_NAMESPACE
diff --git a/src/script/bridge/qscriptfunction.cpp b/src/script/bridge/qscriptfunction.cpp
index 5f419ff..d3767bf 100644
--- a/src/script/bridge/qscriptfunction.cpp
+++ b/src/script/bridge/qscriptfunction.cpp
@@ -55,8 +55,8 @@
namespace JSC
{
-ASSERT_CLASS_FITS_IN_CELL(QScript::FunctionWrapper);
-ASSERT_CLASS_FITS_IN_CELL(QScript::FunctionWithArgWrapper);
+ASSERT_CLASS_FITS_IN_CELL(QT_PREPEND_NAMESPACE(QScript::FunctionWrapper));
+ASSERT_CLASS_FITS_IN_CELL(QT_PREPEND_NAMESPACE(QScript::FunctionWithArgWrapper));
}
QT_BEGIN_NAMESPACE
diff --git a/src/script/bridge/qscriptobject.cpp b/src/script/bridge/qscriptobject.cpp
index 0d899f8..55644fe 100644
--- a/src/script/bridge/qscriptobject.cpp
+++ b/src/script/bridge/qscriptobject.cpp
@@ -46,8 +46,8 @@
namespace JSC
{
//QT_USE_NAMESPACE
-ASSERT_CLASS_FITS_IN_CELL(QScriptObject);
-ASSERT_CLASS_FITS_IN_CELL(QScriptObjectPrototype);
+ASSERT_CLASS_FITS_IN_CELL(QT_PREPEND_NAMESPACE(QScriptObject));
+ASSERT_CLASS_FITS_IN_CELL(QT_PREPEND_NAMESPACE(QScriptObjectPrototype));
}
QT_BEGIN_NAMESPACE
diff --git a/src/src.pro b/src/src.pro
index 240e1f7..238f534 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -129,6 +129,7 @@ src_webkit.target = sub-webkit
src_plugins.depends += src_dbus
src_phonon.depends += src_dbus
}
+ contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2): src_plugins.depends += src_opengl
}
!symbian {
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 3392ed7..eb4dee1 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -734,9 +734,10 @@ QT_BEGIN_NAMESPACE
\sa QTest::qSleep()
*/
-/*! \fn void QTest::qWaitForWindowManager(QWidget *window)
+/*! \fn void QTest::qWaitForWindowShown(QWidget *window)
+ \since 4.6
- Waits until the window is shown in the screen. This is mainly useful for
+ Waits until the \a window is shown in the screen. This is mainly useful for
asynchronous systems like X11, where a window will be mapped to screen some
time after being asked to show itself on the screen.
@@ -1517,10 +1518,14 @@ FatalSignalHandler::FatalSignalHandler()
for (int i = 0; fatalSignals[i]; ++i) {
sigaction(fatalSignals[i], &act, &oldact);
+#ifndef Q_WS_QWS
// Don't overwrite any non-default handlers
+ // however, we need to replace the default QWS handlers
if (oldact.sa_flags & SA_SIGINFO || oldact.sa_handler != SIG_DFL) {
sigaction(fatalSignals[i], &oldact, 0);
- } else {
+ } else
+#endif
+ {
sigaddset(&handledSignals, fatalSignals[i]);
}
}
diff --git a/tests/auto/q3popupmenu/tst_q3popupmenu.cpp b/tests/auto/q3popupmenu/tst_q3popupmenu.cpp
index 5585c3a..df8573d 100644
--- a/tests/auto/q3popupmenu/tst_q3popupmenu.cpp
+++ b/tests/auto/q3popupmenu/tst_q3popupmenu.cpp
@@ -135,11 +135,11 @@ void tst_Q3PopupMenu::task177490_highlighted()
QTest::mouseMove(&menu1, QPoint(x, y1));
QTest::mouseMove(&menu1, QPoint(x, y1 + 1));
- QTest::qWait(100);
+ QTest::qWait(1000);
QTest::mouseMove(&menu1, QPoint(x, y2));
QTest::mouseMove(&menu1, QPoint(x, y2 + 1));
- QTest::qWait(100);
+ QTest::qWait(1000);
QCOMPARE(spy.count(), 2); // one per menu item
}
diff --git a/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp b/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp
index cbbab41..6b580df 100644
--- a/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp
+++ b/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp
@@ -646,7 +646,7 @@ void tst_Q3SqlCursor::select()
}
#ifdef QT_DEBUG
- // for people too stupid to read docs we had to insert this debugging message.
+ // Ignore debugging message advising users of a potential pitfall.
QTest::ignoreMessage(QtDebugMsg, "Q3SqlCursor::setValue(): This will not affect actual database values. Use primeInsert(), primeUpdate() or primeDelete().");
#endif
cur4.setValue( "id", 1 );
diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp
index be1cb98..6984a88 100644
--- a/tests/auto/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/qcombobox/tst_qcombobox.cpp
@@ -2120,20 +2120,22 @@ void tst_QComboBox::task248169_popupWithMinimalSize()
comboBox.addItems(initialContent);
QDesktopWidget desktop;
QRect desktopSize = desktop.availableGeometry();
- comboBox.view()->setMinimumWidth(desktopSize.width() - 1);
+ comboBox.view()->setMinimumWidth(desktopSize.width() / 2);
comboBox.setGeometry(desktopSize.width() - (desktopSize.width() / 4), (desktopSize.width() / 4), (desktopSize.width() / 2), (desktopSize.width() / 4));
comboBox.show();
+ QTest::qWaitForWindowShown(&comboBox);
QTRY_VERIFY(comboBox.isVisible());
comboBox.showPopup();
QTRY_VERIFY(comboBox.view());
+ QTest::qWaitForWindowShown(comboBox.view());
QTRY_VERIFY(comboBox.view()->isVisible());
#ifdef QT_BUILD_INTERNAL
QFrame *container = qFindChild<QComboBoxPrivateContainer *>(&comboBox);
QVERIFY(container);
- QVERIFY(desktop.screenGeometry(container).contains(container->geometry()));
+ QTRY_VERIFY(desktop.screenGeometry(container).contains(container->geometry()));
#endif
}
diff --git a/tests/auto/qdom/tst_qdom.cpp b/tests/auto/qdom/tst_qdom.cpp
index 79c0cef..6637202 100644
--- a/tests/auto/qdom/tst_qdom.cpp
+++ b/tests/auto/qdom/tst_qdom.cpp
@@ -130,6 +130,8 @@ private slots:
void setContentWhitespace() const;
void setContentWhitespace_data() const;
+ void taskQTBUG4595_dontAssertWhenDocumentSpecifiesUnknownEncoding() const;
+
void cleanupTestCase() const;
private:
@@ -1897,5 +1899,18 @@ void tst_QDom::setContentWhitespace_data() const
QTest::newRow("") << QString::fromLatin1("\t\t\t\t<?xml version='1.0' ?><e/>") << false;
}
+void tst_QDom::taskQTBUG4595_dontAssertWhenDocumentSpecifiesUnknownEncoding() const
+{
+ QString xmlWithUnknownEncoding("<?xml version='1.0' encoding='unknown-encoding'?>"
+ "<foo>"
+ " <bar>How will this sentence be handled?</bar>"
+ "</foo>");
+ QDomDocument d;
+ QVERIFY(d.setContent(xmlWithUnknownEncoding));
+
+ QString dontAssert = d.toString(); // this should not assert
+ QVERIFY(true);
+}
+
QTEST_MAIN(tst_QDom)
#include "tst_qdom.moc"
diff --git a/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp b/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp
index 502e983..f4ea985 100644
--- a/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp
+++ b/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp
@@ -145,6 +145,7 @@ private slots:
void task224497_fltMax();
void task221221();
+ void task255471_decimalsValidation();
public slots:
void valueChangedHelper(const QString &);
@@ -668,7 +669,7 @@ void tst_QDoubleSpinBox::valueFromTextAndValidate_data()
QTest::addColumn<int>("language");
QTest::addColumn<QString>("expectedText"); // if empty we don't check
- QTest::newRow("data0") << QString("2.2") << Invalid << 3.0 << 5.0 << (int)QLocale::C << QString();
+ QTest::newRow("data0") << QString("2.2") << Intermediate << 3.0 << 5.0 << (int)QLocale::C << QString();
QTest::newRow("data1") << QString() << Intermediate << 0.0 << 100.0 << (int)QLocale::C << QString();
QTest::newRow("data2") << QString("asd") << Invalid << 0.0 << 100.0 << (int)QLocale::C << QString();
QTest::newRow("data3") << QString("2.2") << Acceptable << 0.0 << 100.0 << (int)QLocale::C << QString();
@@ -685,20 +686,20 @@ void tst_QDoubleSpinBox::valueFromTextAndValidate_data()
QTest::newRow("data14") << QString("1, ") << Acceptable << 0.0 << 100.0 << (int)QLocale::Norwegian << QString("1,");
QTest::newRow("data15") << QString("1, ") << Invalid << 0.0 << 100.0 << (int)QLocale::C << QString();
QTest::newRow("data16") << QString("2") << Intermediate << 100.0 << 102.0 << (int)QLocale::C << QString();
- QTest::newRow("data17") << QString("22.0") << Invalid << 100.0 << 102.0 << (int)QLocale::C << QString();
+ QTest::newRow("data17") << QString("22.0") << Intermediate << 100.0 << 102.0 << (int)QLocale::C << QString();
QTest::newRow("data18") << QString("12.0") << Intermediate << 100.0 << 102.0 << (int)QLocale::C << QString();
- QTest::newRow("data19") << QString("12.2") << Invalid << 100. << 102.0 << (int)QLocale::C << QString();
- QTest::newRow("data20") << QString("21.") << Invalid << 100.0 << 102.0 << (int)QLocale::C << QString();
- QTest::newRow("data21") << QString("-21.") << Invalid << -102.0 << -100.0 << (int)QLocale::C << QString();
+ QTest::newRow("data19") << QString("12.2") << Intermediate << 100. << 102.0 << (int)QLocale::C << QString();
+ QTest::newRow("data20") << QString("21.") << Intermediate << 100.0 << 102.0 << (int)QLocale::C << QString();
+ QTest::newRow("data21") << QString("-21.") << Intermediate << -102.0 << -100.0 << (int)QLocale::C << QString();
QTest::newRow("data22") << QString("-12.") << Intermediate << -102.0 << -100.0 << (int)QLocale::C << QString();
- QTest::newRow("data23") << QString("-11.11") << Invalid << -102.0 << -101.2 << (int)QLocale::C << QString();
+ QTest::newRow("data23") << QString("-11.11") << Intermediate << -102.0 << -101.2 << (int)QLocale::C << QString();
QTest::newRow("data24") << QString("-11.4") << Intermediate << -102.0 << -101.3 << (int)QLocale::C << QString();
QTest::newRow("data25") << QString("11.400") << Invalid << 0.0 << 100.0 << (int)QLocale::C << QString();
QTest::newRow("data26") << QString(".4") << Intermediate << 0.45 << 0.5 << (int)QLocale::C << QString();
QTest::newRow("data27") << QString("+.4") << Intermediate << 0.45 << 0.5 << (int)QLocale::C << QString();
QTest::newRow("data28") << QString("-.4") << Intermediate << -0.5 << -0.45 << (int)QLocale::C << QString();
QTest::newRow("data29") << QString(".4") << Intermediate << 1.0 << 2.4 << (int)QLocale::C << QString();
- QTest::newRow("data30") << QString("-.4") << Invalid << -2.3 << -1.9 << (int)QLocale::C << QString();
+ QTest::newRow("data30") << QString("-.4") << Intermediate << -2.3 << -1.9 << (int)QLocale::C << QString();
QTest::newRow("data31") << QString("-42") << Invalid << -2.43 << -1.0 << (int)QLocale::C << QString();
QTest::newRow("data32") << QString("-4") << Invalid << -1.4 << -1.0 << (int)QLocale::C << QString();
QTest::newRow("data33") << QString("-42") << Invalid << -1.4 << -1.0 << (int)QLocale::C << QString();
@@ -712,7 +713,7 @@ void tst_QDoubleSpinBox::valueFromTextAndValidate_data()
QTest::newRow("data41") << QString("103.") << Invalid << -102.0 << 11.0 << (int)QLocale::C << QString();
QTest::newRow("data42") << QString("122") << Invalid << 10.0 << 12.2 << (int)QLocale::C << QString();
QTest::newRow("data43") << QString("-2.2") << Intermediate << -12.2 << -3.2 << (int)QLocale::C << QString();
- QTest::newRow("data44") << QString("-2.20") << Invalid << -12.1 << -3.2 << (int)QLocale::C << QString();
+ QTest::newRow("data44") << QString("-2.20") << Intermediate << -12.1 << -3.2 << (int)QLocale::C << QString();
QTest::newRow("data45") << QString("200,2") << Invalid << 0.0 << 1000.0 << (int)QLocale::C << QString();
QTest::newRow("data46") << QString("200,2") << Acceptable << 0.0 << 1000.0 << (int)QLocale::German << QString();
QTest::newRow("data47") << QString("2.2") << Acceptable << 0.0 << 1000.0 << (int)QLocale::C << QString();
@@ -1008,6 +1009,31 @@ void tst_QDoubleSpinBox::task221221()
QCOMPARE(spin.text(), QLatin1String("1"));
}
+void tst_QDoubleSpinBox::task255471_decimalsValidation()
+{
+ // QDoubleSpinBox shouldn't crash with large numbers of decimals. Even if
+ // the results are useless ;-)
+ for (int i = 0; i < 32; ++i)
+ {
+ QDoubleSpinBox spinBox;
+ spinBox.setDecimals(i);
+ spinBox.setMinimum(0.3);
+ spinBox.setMaximum(12);
+
+ spinBox.show();
+ QTRY_VERIFY(spinBox.isVisible());
+ spinBox.setFocus();
+ QTRY_VERIFY(spinBox.hasFocus());
+
+ QTest::keyPress(&spinBox, Qt::Key_Right);
+ QTest::keyPress(&spinBox, Qt::Key_Right);
+ QTest::keyPress(&spinBox, Qt::Key_Delete);
+
+ // Don't crash!
+ QTest::keyPress(&spinBox, Qt::Key_2);
+ }
+}
+
QTEST_MAIN(tst_QDoubleSpinBox)
#include "tst_qdoublespinbox.moc"
diff --git a/tests/auto/qeasingcurve/tst_qeasingcurve.cpp b/tests/auto/qeasingcurve/tst_qeasingcurve.cpp
index 8e0d37d..8cf686e 100644
--- a/tests/auto/qeasingcurve/tst_qeasingcurve.cpp
+++ b/tests/auto/qeasingcurve/tst_qeasingcurve.cpp
@@ -417,18 +417,18 @@ void tst_QEasingCurve::valueForProgress()
// the least significant digit it is still subject to rounding errors
qreal error = easeConv - ex;
-#ifdef Q_OS_WINCE
+ qreal errorbound = 0.00001;
+#if defined( Q_OS_WINCE ) || defined( Q_OS_SYMBIAN )
// exception values for WINCE(this test should be rewritten, as it only freezes the status quo of QEasingCurve
// The failing (2) values are explicitly excepted here:
// The source values for the comparison table should remain untruncated double and the
// error bound checking function dynamic. Also the source values should come from a "trusted" source and not
// from QEasingCurve itself.
- qreal errorbound = 0.00001;
if ((type == int(QEasingCurve::InOutBounce) && (i == 8 || i == 6) ) || (type == int(QEasingCurve::OutExpo) && i == 2))
- errorbound = 0.0002;
-#endif // accept the potential rounding error in the least significant digit
-
- QVERIFY(error <= errorbound );
+ errorbound = 0.0002;
+#endif
+ // accept the potential rounding error in the least significant digit
+ QVERIFY(error <= errorbound );
}
#endif
}
diff --git a/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp b/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
index 88bf229..7735f30 100644
--- a/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
+++ b/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
@@ -318,9 +318,6 @@ void tst_QFileSystemWatcher::watchDirectory()
#ifdef Q_OS_WINCE
QEXPECT_FAIL("poller", "Directory does not get updated on file removal(See #137910)", Abort);
-#elif defined(Q_OS_SYMBIAN) && defined(Q_CC_RVCT)
- // Since native watcher is always used in real devices, this poller issue is irrelevant
- QEXPECT_FAIL("poller", "Poller doesn't detect directory removal in RVCT builds", Abort);
#endif
QCOMPARE(changedSpy.count(), 2);
QCOMPARE(changedSpy.at(0).count(), 1);
@@ -490,11 +487,6 @@ void tst_QFileSystemWatcher::watchFileAndItsDirectory()
#ifdef Q_OS_WINCE
QEXPECT_FAIL("poller", "Directory does not get updated on file removal(See #137910)", Abort);
#endif
-#if defined(Q_OS_SYMBIAN) && defined(Q_CC_RVCT)
- // Since native watcher is always used in real devices, this poller issue is irrelevant
- // Symbian file system does not change modification time on a directory when a file inside is changed
- QEXPECT_FAIL("poller", "Poller doesn't detect directory changes in RVCT builds", Abort);
-#endif
QCOMPARE(dirChangedSpy.count(), 1);
dirChangedSpy.clear();
diff --git a/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp b/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
index 9c58b24..4e46819 100644
--- a/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
+++ b/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
@@ -143,9 +143,11 @@ public:
// It is only called once.
void tst_QGraphicsLinearLayout::initTestCase()
{
-#ifndef Q_WS_S60
// since the style will influence the results, we have to ensure
// that the tests are run using the same style on all platforms
+#ifdef Q_WS_S60
+ QApplication::setStyle(new QWindowsStyle);
+#else
QApplication::setStyle(new QPlastiqueStyle);
#endif
}
diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
index 1aa515c..95a038b 100644
--- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
@@ -224,6 +224,8 @@ private slots:
void task253415_reconnectUpdateSceneOnSceneChanged();
void task255529_transformationAnchorMouseAndViewportMargins();
void task259503_scrollingArtifacts();
+ void QTBUG_4151_clipAndIgnore_data();
+ void QTBUG_4151_clipAndIgnore();
};
void tst_QGraphicsView::initTestCase()
@@ -3733,5 +3735,50 @@ void tst_QGraphicsView::task259503_scrollingArtifacts()
QTest::qWait(10);
}
+void tst_QGraphicsView::QTBUG_4151_clipAndIgnore_data()
+{
+ QTest::addColumn<bool>("clip");
+ QTest::addColumn<bool>("ignoreTransformations");
+ QTest::addColumn<int>("numItems");
+
+ QTest::newRow("none") << false << false << 3;
+ QTest::newRow("clip") << true << false << 3;
+ QTest::newRow("ignore") << false << true << 3;
+ QTest::newRow("clip+ignore") << true << true << 3;
+}
+
+void tst_QGraphicsView::QTBUG_4151_clipAndIgnore()
+{
+ QFETCH(bool, clip);
+ QFETCH(bool, ignoreTransformations);
+ QFETCH(int, numItems);
+
+ QGraphicsScene scene;
+
+ QGraphicsRectItem *parent = new QGraphicsRectItem(QRectF(0, 0, 50, 50), 0);
+ QGraphicsRectItem *child = new QGraphicsRectItem(QRectF(-10, -10, 40, 40), parent);
+ QGraphicsRectItem *ignore = new QGraphicsRectItem(QRectF(60, 60, 50, 50), 0);
+
+ if (clip)
+ parent->setFlags(QGraphicsItem::ItemClipsChildrenToShape);
+ if (ignoreTransformations)
+ ignore->setFlag(QGraphicsItem::ItemIgnoresTransformations);
+
+ parent->setBrush(Qt::red);
+ child->setBrush(QColor(0, 0, 255, 128));
+ ignore->setBrush(Qt::green);
+
+ scene.addItem(parent);
+ scene.addItem(ignore);
+
+ QGraphicsView view(&scene);
+ view.setFrameStyle(0);
+ view.resize(75, 75);
+ view.show();
+ QTRY_COMPARE(QApplication::activeWindow(), (QWidget *)&view);
+
+ QCOMPARE(view.items(view.rect()).size(), numItems);
+}
+
QTEST_MAIN(tst_QGraphicsView)
#include "tst_qgraphicsview.moc"
diff --git a/tests/auto/qlabel/tst_qlabel.cpp b/tests/auto/qlabel/tst_qlabel.cpp
index 8a5e344..dd03ef3 100644
--- a/tests/auto/qlabel/tst_qlabel.cpp
+++ b/tests/auto/qlabel/tst_qlabel.cpp
@@ -57,6 +57,8 @@
# define SRCDIR ""
#endif
+#include "../../shared/util.h"
+
class Widget : public QWidget
{
public:
@@ -102,11 +104,11 @@ private slots:
void eventPropagation_data();
void eventPropagation();
void focusPolicy();
-
+
void task190318_sizes();
void sizeHint();
-
+
void task226479_movieResize();
void emptyPixmap();
@@ -413,16 +415,17 @@ void tst_QLabel::task226479_movieResize()
paintedRegion += e->region();
QLabel::paintEvent(e);
}
-
+
public:
QRegion paintedRegion;
};
-
+
Label label;
label.resize(350,350);
label.show();
QMovie *movie = new QMovie( &label );
label.setMovie(movie);
+ QTest::qWaitForWindowShown(&label);
movie->setFileName(SRCDIR "red.png");
movie->start();
QTest::qWait(50);
@@ -431,8 +434,8 @@ void tst_QLabel::task226479_movieResize()
movie->setFileName(SRCDIR "green.png");
movie->start();
QTest::qWait(50);
-
- QCOMPARE(label.paintedRegion , QRegion(label.rect()) );
+
+ QTRY_COMPARE(label.paintedRegion , QRegion(label.rect()) );
}
void tst_QLabel::emptyPixmap()
diff --git a/tests/auto/qmdiarea/tst_qmdiarea.cpp b/tests/auto/qmdiarea/tst_qmdiarea.cpp
index 65f1937..b110114 100644
--- a/tests/auto/qmdiarea/tst_qmdiarea.cpp
+++ b/tests/auto/qmdiarea/tst_qmdiarea.cpp
@@ -639,9 +639,7 @@ void tst_QMdiArea::changeWindowTitle()
mw->setCentralWidget( ws );
mw->menuBar();
mw->show();
-#ifdef Q_WS_X11
- qt_x11_wait_for_window_manager(mw);
-#endif
+ QTest::qWaitForWindowShown(mw);
QWidget *widget = new QWidget( ws );
widget->setWindowTitle( wc );
@@ -655,22 +653,17 @@ void tst_QMdiArea::changeWindowTitle()
widget->setWindowState(Qt::WindowMaximized);
#endif
#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE)
- QCOMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc).arg(wc) );
+ QTRY_COMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc).arg(wc) );
#endif
mw->hide();
-#ifdef Q_WS_X11
- qt_x11_wait_for_window_manager(mw);
-#endif
qApp->processEvents();
mw->show();
-#ifdef Q_WS_X11
- qt_x11_wait_for_window_manager(mw);
-#endif
qApp->processEvents();
+ QTest::qWaitForWindowShown(mw);
#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE)
- QCOMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc).arg(wc) );
+ QTRY_COMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc).arg(wc) );
#endif
#ifdef USE_SHOW
@@ -688,7 +681,7 @@ void tst_QMdiArea::changeWindowTitle()
#endif
qApp->processEvents();
#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE)
- QCOMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc).arg(wc) );
+ QTRY_COMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc).arg(wc) );
widget->setWindowTitle( wc2 );
QCOMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc).arg(wc2) );
mw->setWindowTitle( mwc2 );
@@ -1697,11 +1690,8 @@ void tst_QMdiArea::tileSubWindows()
workspace.setActiveSubWindow(windows.at(5));
workspace.resize(workspace.size() - QSize(10, 10));
workspace.setActiveSubWindow(0);
-#ifdef Q_WS_X11
- qt_x11_wait_for_window_manager(&workspace);
-#endif
QTest::qWait(250); // delayed re-arrange of minimized windows
- QCOMPARE(workspace.viewport()->childrenRect(), workspace.viewport()->rect());
+ QTRY_COMPARE(workspace.viewport()->childrenRect(), workspace.viewport()->rect());
// Add another window and verify that the views are not tiled anymore.
workspace.addSubWindow(new QPushButton(QLatin1String("I'd like to mess up tiled views")))->show();
@@ -1732,9 +1722,6 @@ void tst_QMdiArea::tileSubWindows()
// Verify that we try to resize the area such that all sub-windows are visible.
// It's important that tiled windows are NOT overlapping.
workspace.resize(350, 150);
-#ifdef Q_WS_X11
- qt_x11_wait_for_window_manager(&workspace);
-#endif
qApp->processEvents();
QTRY_COMPARE(workspace.size(), QSize(350, 150));
@@ -1761,13 +1748,10 @@ void tst_QMdiArea::tileSubWindows()
#ifdef Q_OS_WINCE
QSKIP("Not fixed yet! See task 197453", SkipAll);
#endif
- QCOMPARE(workspace.viewport()->rect().size(), expectedViewportSize);
+ QTRY_COMPARE(workspace.viewport()->rect().size(), expectedViewportSize);
// Not enough space for all sub-windows to be visible -> provide scroll bars.
workspace.resize(150, 150);
-#ifdef Q_WS_X11
- qt_x11_wait_for_window_manager(&workspace);
-#endif
qApp->processEvents();
QTRY_COMPARE(workspace.size(), QSize(150, 150));
diff --git a/tests/auto/qmdisubwindow/tst_qmdisubwindow.cpp b/tests/auto/qmdisubwindow/tst_qmdisubwindow.cpp
index d5d125a..b897d8f 100644
--- a/tests/auto/qmdisubwindow/tst_qmdisubwindow.cpp
+++ b/tests/auto/qmdisubwindow/tst_qmdisubwindow.cpp
@@ -1648,9 +1648,9 @@ void tst_QMdiSubWindow::resizeTimer()
QMdiArea mdiArea;
QMdiSubWindow *subWindow = mdiArea.addSubWindow(new QWidget);
mdiArea.show();
-#ifdef Q_WS_X11
- qt_x11_wait_for_window_manager(&mdiArea);
-#endif
+ QTest::qWaitForWindowShown(&mdiArea);
+ QTest::qWait(250);
+
EventSpy timerEventSpy(subWindow, QEvent::Timer);
QCOMPARE(timerEventSpy.count(), 0);
diff --git a/tests/auto/qmessagebox/tst_qmessagebox.cpp b/tests/auto/qmessagebox/tst_qmessagebox.cpp
index 64e5a9c..5607fbd 100644
--- a/tests/auto/qmessagebox/tst_qmessagebox.cpp
+++ b/tests/auto/qmessagebox/tst_qmessagebox.cpp
@@ -130,7 +130,7 @@ private slots:
void testSymbols();
void incorrectDefaultButton();
void updateSize();
-
+
void setInformativeText();
void iconPixmap();
@@ -683,7 +683,13 @@ void tst_QMessageBox::incorrectDefaultButton()
void tst_QMessageBox::updateSize()
{
QMessageBox box;
+#ifdef Q_WS_S60
+ // In S60 messagebox is always occupies maximum width, i.e. screen width
+ // so we need to have long enough text to split over several line
+ box.setText("This is awesome long text");
+#else
box.setText("This is awesome");
+#endif
box.show();
QSize oldSize = box.size();
QString longText;
@@ -693,9 +699,12 @@ void tst_QMessageBox::updateSize()
QVERIFY(box.size() != oldSize); // should have grown
QVERIFY(box.width() > oldSize.width() || box.height() > oldSize.height());
oldSize = box.size();
+#ifndef Q_WS_S60
+ // In S60 dialogs buttons are in softkey area -> message box size does not change
box.setStandardButtons(QMessageBox::StandardButtons(0xFFFF));
QVERIFY(box.size() != oldSize); // should have grown
QVERIFY(box.width() > oldSize.width() || box.height() > oldSize.height());
+#endif
}
void tst_QMessageBox::setInformativeText()
diff --git a/tests/auto/qprocess/qprocess.pro b/tests/auto/qprocess/qprocess.pro
index 892686d..77cfc82 100644
--- a/tests/auto/qprocess/qprocess.pro
+++ b/tests/auto/qprocess/qprocess.pro
@@ -1,7 +1,6 @@
TEMPLATE = subdirs
SUBDIRS = \
- testBatFiles \
testProcessCrash \
testProcessEcho \
testProcessEcho2 \
diff --git a/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp b/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp
index f86e81d..51ef2da 100644
--- a/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp
+++ b/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp
@@ -55,10 +55,10 @@ public:
int duration() const { return -1; /* not time driven */ }
protected:
- void updateCurrentTime()
+ void updateCurrentTime(int currentTime)
{
- QPropertyAnimation::updateCurrentTime();
- if (currentTime() >= QPropertyAnimation::duration() || currentLoop() >= 1)
+ QPropertyAnimation::updateCurrentTime(currentTime);
+ if (currentTime >= QPropertyAnimation::duration() || currentLoop() >= 1)
stop();
}
};
diff --git a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp
index 063075d..b193d67 100644
--- a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp
+++ b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp
@@ -568,6 +568,19 @@ static QScriptValue custom_call(QScriptContext *ctx, QScriptEngine *)
return ctx->argumentsObject().property(0).call(QScriptValue(), QScriptValueList() << ctx->argumentsObject().property(1));
}
+static QScriptValue native_recurse(QScriptContext *ctx, QScriptEngine *eng)
+{
+ QScriptValue func = ctx->argumentsObject().property(0);
+ QScriptValue n = ctx->argumentsObject().property(1);
+
+ if(n.toUInt32() <= 1) {
+ return func.call(QScriptValue(), QScriptValueList());
+ } else {
+ return eng->evaluate("native_recurse").call(QScriptValue(),
+ QScriptValueList() << func << QScriptValue(n.toUInt32() - 1));
+ }
+}
+
void tst_QScriptContext::backtrace_data()
{
QTest::addColumn<QString>("code");
@@ -724,6 +737,83 @@ void tst_QScriptContext::backtrace_data()
QTest::newRow("call native") << source << expected;
}
+
+ {
+ QLatin1String func( "function f1() {\n"
+ " eval('var q = 4');\n"
+ " return custom_call(bt, 22);\n"
+ "}");
+
+ QString source = QString::fromLatin1("\n"
+ "function f2() {\n"
+ " func = %1\n"
+ " return custom_call(func, 12);\n"
+ "}\n"
+ "f2();\n").arg(func);
+
+ QStringList expected;
+ expected << "<native>(22) at -1"
+ << "<native>(function () {\n [native code]\n}, 22) at -1"
+ << "f1(12) at testfile:5"
+ << QString::fromLatin1("<native>(%1, 12) at -1").arg(func)
+ << "f2() at testfile:7"
+ << "<global>() at testfile:9";
+
+
+ QTest::newRow("calls with closures") << source << expected;
+ }
+
+ {
+ QLatin1String func( "function js_bt() {\n"
+ " return bt();\n"
+ "}");
+
+ QString source = QString::fromLatin1("\n"
+ "%1\n"
+ "function f() {\n"
+ " return native_recurse(js_bt, 12);\n"
+ "}\n"
+ "f();\n").arg(func);
+
+ QStringList expected;
+ expected << "<native>() at -1" << "js_bt() at testfile:3";
+ for(int n = 1; n <= 12; n++) {
+ expected << QString::fromLatin1("<native>(%1, %2) at -1")
+ .arg(func).arg(n);
+ }
+ expected << "f() at testfile:6";
+ expected << "<global>() at testfile:8";
+
+ QTest::newRow("native recursive") << source << expected;
+ }
+
+ {
+ QString source = QString::fromLatin1("\n"
+ "function finish() {\n"
+ " return bt();\n"
+ "}\n"
+ "function rec(n) {\n"
+ " if(n <= 1)\n"
+ " return finish();\n"
+ " else\n"
+ " return rec (n - 1);\n"
+ "}\n"
+ "function f() {\n"
+ " return rec(12);\n"
+ "}\n"
+ "f();\n");
+
+ QStringList expected;
+ expected << "<native>() at -1" << "finish() at testfile:3";
+ for(int n = 1; n <= 12; n++) {
+ expected << QString::fromLatin1("rec(n = %1) at testfile:%2")
+ .arg(n).arg((n==1) ? 7 : 9);
+ }
+ expected << "f() at testfile:12";
+ expected << "<global>() at testfile:14";
+
+ QTest::newRow("js recursive") << source << expected;
+ }
}
@@ -736,6 +826,7 @@ void tst_QScriptContext::backtrace()
eng.globalObject().setProperty("bt", eng.newFunction(getBacktrace));
eng.globalObject().setProperty("custom_eval", eng.newFunction(custom_eval));
eng.globalObject().setProperty("custom_call", eng.newFunction(custom_call));
+ eng.globalObject().setProperty("native_recurse", eng.newFunction(native_recurse));
QString fileName = "testfile";
QScriptValue ret = eng.evaluate(code, fileName);
diff --git a/tests/auto/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp b/tests/auto/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp
index b14d6f8..aa6801a 100644
--- a/tests/auto/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp
+++ b/tests/auto/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp
@@ -169,10 +169,10 @@ public:
int duration() const { return -1; /* not time driven */ }
protected:
- void updateCurrentTime()
+ void updateCurrentTime(int currentTime)
{
- QPropertyAnimation::updateCurrentTime();
- if (currentTime() >= QPropertyAnimation::duration())
+ QPropertyAnimation::updateCurrentTime(currentTime);
+ if (currentTime >= QPropertyAnimation::duration())
stop();
}
};
diff --git a/tests/auto/qsharedmemory/qsystemlock/qsystemlock.pro b/tests/auto/qsharedmemory/qsystemlock/qsystemlock.pro
index 2628f19..e232443 100644
--- a/tests/auto/qsharedmemory/qsystemlock/qsystemlock.pro
+++ b/tests/auto/qsharedmemory/qsystemlock/qsystemlock.pro
@@ -5,9 +5,9 @@ include(../src/src.pri)
win32: CONFIG += console
mac:CONFIG -= app_bundle
-wince*|symbian {
+wince* {
DEFINES += SRCDIR=\\\"\\\"
-} else {
+} else:!symbian {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/qsharedmemory/qsystemlock/tst_qsystemlock.cpp b/tests/auto/qsharedmemory/qsystemlock/tst_qsystemlock.cpp
index 87fc3ee..35f05d1 100644
--- a/tests/auto/qsharedmemory/qsystemlock/tst_qsystemlock.cpp
+++ b/tests/auto/qsharedmemory/qsystemlock/tst_qsystemlock.cpp
@@ -46,6 +46,13 @@
//TESTED_CLASS=
//TESTED_FILES=
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+// And underlying Open C have application private dir in default search path
+#define SRCDIR ""
+#endif
+
+
#define EXISTING_SHARE "existing"
class tst_QSystemLock : public QObject
@@ -223,7 +230,7 @@ void tst_QSystemLock::processes()
QCOMPARE(consumers.first()->exitCode(), 0);
delete consumers.takeFirst();
}
- QCOMPARE(failedProcesses, unsigned int(0));
+ QCOMPARE(failedProcesses, (unsigned int)(0));
}
QTEST_MAIN(tst_QSystemLock)
diff --git a/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp b/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp
index 81ef498..832605e 100644
--- a/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp
+++ b/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp
@@ -42,6 +42,8 @@
#include <QtTest/QtTest>
#include "qevent.h"
+#include "qdialog.h"
+#include "qdialogbuttonbox.h"
#include "private/qsoftkeymanager_p.h"
class tst_QSoftKeyManager : public QObject
@@ -59,6 +61,8 @@ public slots:
void cleanup();
private slots:
void updateSoftKeysCompressed();
+ void handleCommand();
+ void checkSoftkeyEnableStates();
};
class EventListener : public QObject
@@ -133,6 +137,56 @@ void tst_QSoftKeyManager::updateSoftKeysCompressed()
QVERIFY(listener.numUpdateSoftKeys == 1);
}
+/*
+ This tests that when the S60 environment sends us a command
+ that it actually gets mapped to the correct action.
+*/
+void tst_QSoftKeyManager::handleCommand()
+{
+ QDialog w;
+ QDialogButtonBox *buttons = new QDialogButtonBox(
+ QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
+ Qt::Horizontal,
+ &w);
+
+ w.show();
+ QApplication::processEvents();
+
+ QCOMPARE(w.actions().count(), 2);
+
+ QSignalSpy spy0(w.actions()[0], SIGNAL(triggered()));
+ QSignalSpy spy1(w.actions()[1], SIGNAL(triggered()));
+
+ // These should work eventually, but do not yet
+// QTest::keyPress(&w, Qt::Key_Context1);
+// QTest::keyPress(&w, Qt::Key_Context2);
+
+ qApp->symbianHandleCommand(6000);
+ qApp->symbianHandleCommand(6001);
+
+ QApplication::processEvents();
+
+ QCOMPARE(spy0.count(), 1);
+ QCOMPARE(spy1.count(), 1);
+}
+
+/*
+ This tests that softkey enable state follows the state of widget that owns the action
+ to which the softkey is related to.
+*/
+void tst_QSoftKeyManager::checkSoftkeyEnableStates()
+{
+ QWidget w1, w2;
+ w1.setEnabled(false);
+ w2.setEnabled(true);
+
+ QAction *disabledAction = QSoftKeyManager::createAction(QSoftKeyManager::OkSoftKey, &w1);
+ QAction *enabledAction = QSoftKeyManager::createAction(QSoftKeyManager::OkSoftKey, &w2);
+
+ QVERIFY(disabledAction->isEnabled()==false);
+ QVERIFY(enabledAction->isEnabled()==true);
+}
+
QTEST_MAIN(tst_QSoftKeyManager)
#include "tst_qsoftkeymanager.moc"
diff --git a/tests/auto/qspinbox/tst_qspinbox.cpp b/tests/auto/qspinbox/tst_qspinbox.cpp
index 69347c4..4829b6b 100644
--- a/tests/auto/qspinbox/tst_qspinbox.cpp
+++ b/tests/auto/qspinbox/tst_qspinbox.cpp
@@ -653,21 +653,21 @@ void tst_QSpinBox::valueFromTextAndValidate_data()
QTest::addColumn<int>("maxi");
QTest::addColumn<QString>("expectedText"); // if empty we don't check
- QTest::newRow("data0") << QString("2") << Invalid << 3 << 5 << QString();
+ QTest::newRow("data0") << QString("2") << Intermediate << 3 << 5 << QString();
QTest::newRow("data1") << QString() << Intermediate << 0 << 100 << QString();
QTest::newRow("data2") << QString("asd") << Invalid << 0 << 100 << QString();
QTest::newRow("data3") << QString("2") << Acceptable << 0 << 100 << QString();
QTest::newRow("data4") << QString() << Intermediate << 0 << 1 << QString();
QTest::newRow("data5") << QString() << Invalid << 0 << 0 << QString();
QTest::newRow("data5") << QString("5") << Intermediate << 2004 << 2005 << QString();
- QTest::newRow("data6") << QString("50") << Invalid << 2004 << 2005 << QString();
+ QTest::newRow("data6") << QString("50") << Intermediate << 2004 << 2005 << QString();
QTest::newRow("data7") << QString("205") << Intermediate << 2004 << 2005 << QString();
QTest::newRow("data8") << QString("2005") << Acceptable << 2004 << 2005 << QString();
- QTest::newRow("data9") << QString("3") << Invalid << 2004 << 2005 << QString();
+ QTest::newRow("data9") << QString("3") << Intermediate << 2004 << 2005 << QString();
QTest::newRow("data10") << QString("-") << Intermediate << -20 << -10 << QString();
QTest::newRow("data11") << QString("-1") << Intermediate << -20 << -10 << QString();
QTest::newRow("data12") << QString("-5") << Intermediate << -20 << -10 << QString();
- QTest::newRow("data13") << QString("-5") << Invalid << -20 << -16 << QString();
+ QTest::newRow("data13") << QString("-5") << Intermediate << -20 << -16 << QString();
QTest::newRow("data14") << QString("-2") << Intermediate << -20 << -16 << QString();
QTest::newRow("data15") << QString("2") << Invalid << -20 << -16 << QString();
QTest::newRow("data16") << QString() << Intermediate << -20 << -16 << QString();
diff --git a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
index ce2396d..4175bef 100644
--- a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
+++ b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
@@ -2001,6 +2001,10 @@ void tst_QSqlDatabase::odbc_bindBoolean()
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
+ if (tst_Databases::isMySQL(db)) {
+ QSKIP("MySql has inconsistent behaviour of bit field type across versions.", SkipSingle);
+ return;
+ }
QSqlQuery q(db);
QVERIFY_SQL(q, exec("CREATE TABLE " + qTableName("qtestBindBool") + "(id int, boolvalue bit)"));
diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp
index a3f2f54..7244d72 100644
--- a/tests/auto/qstatemachine/tst_qstatemachine.cpp
+++ b/tests/auto/qstatemachine/tst_qstatemachine.cpp
@@ -1742,11 +1742,18 @@ class TestSignalTransition : public QSignalTransition
{
public:
TestSignalTransition(QState *sourceState = 0)
- : QSignalTransition(sourceState) {}
+ : QSignalTransition(sourceState), m_sender(0)
+ {}
TestSignalTransition(QObject *sender, const char *signal,
QAbstractState *target)
- : QSignalTransition(sender, signal)
+ : QSignalTransition(sender, signal), m_sender(0)
{ setTargetState(target); }
+ QObject *senderReceived() const {
+ return m_sender;
+ }
+ int signalIndexReceived() const {
+ return m_signalIndex;
+ }
QVariantList argumentsReceived() const {
return m_args;
}
@@ -1754,11 +1761,15 @@ protected:
bool eventTest(QEvent *e) {
if (!QSignalTransition::eventTest(e))
return false;
- QSignalEvent *se = static_cast<QSignalEvent*>(e);
- const_cast<TestSignalTransition*>(this)->m_args = se->arguments();
+ QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent*>(e);
+ m_sender = se->sender();
+ m_signalIndex = se->signalIndex();
+ m_args = se->arguments();
return true;
}
private:
+ QObject *m_sender;
+ int m_signalIndex;
QVariantList m_args;
};
@@ -1870,6 +1881,8 @@ void tst_QStateMachine::signalTransitions()
emitter.emitSignalWithIntArg(123);
QTRY_COMPARE(finishedSpy.count(), 1);
+ QCOMPARE(trans->senderReceived(), (QObject*)&emitter);
+ QCOMPARE(trans->signalIndexReceived(), emitter.metaObject()->indexOfSignal("signalWithIntArg(int)"));
QCOMPARE(trans->argumentsReceived().size(), 1);
QCOMPARE(trans->argumentsReceived().at(0).toInt(), 123);
}
@@ -1890,6 +1903,8 @@ void tst_QStateMachine::signalTransitions()
emitter.emitSignalWithStringArg(testString);
QTRY_COMPARE(finishedSpy.count(), 1);
+ QCOMPARE(trans->senderReceived(), (QObject*)&emitter);
+ QCOMPARE(trans->signalIndexReceived(), emitter.metaObject()->indexOfSignal("signalWithStringArg(QString)"));
QCOMPARE(trans->argumentsReceived().size(), 1);
QCOMPARE(trans->argumentsReceived().at(0).toString(), testString);
}
@@ -2028,6 +2043,38 @@ void tst_QStateMachine::signalTransitions()
}
}
+class TestEventTransition : public QEventTransition
+{
+public:
+ TestEventTransition(QState *sourceState = 0)
+ : QEventTransition(sourceState),
+ m_eventSource(0), m_eventType(QEvent::None)
+ {}
+ TestEventTransition(QObject *object, QEvent::Type type,
+ QAbstractState *target)
+ : QEventTransition(object, type),
+ m_eventSource(0), m_eventType(QEvent::None)
+ { setTargetState(target); }
+ QObject *eventSourceReceived() const {
+ return m_eventSource;
+ }
+ QEvent::Type eventTypeReceived() const {
+ return m_eventType;
+ }
+protected:
+ bool eventTest(QEvent *e) {
+ if (!QEventTransition::eventTest(e))
+ return false;
+ QStateMachine::WrappedEvent *we = static_cast<QStateMachine::WrappedEvent*>(e);
+ m_eventSource = we->object();
+ m_eventType = we->event()->type();
+ return true;
+ }
+private:
+ QObject *m_eventSource;
+ QEvent::Type m_eventType;
+};
+
void tst_QStateMachine::eventTransitions()
{
QPushButton button;
@@ -2274,6 +2321,30 @@ void tst_QStateMachine::eventTransitions()
QTest::ignoreMessage(QtWarningMsg, "QObject event transitions are not supported for custom types");
QTRY_COMPARE(startedSpy.count(), 1);
}
+ // custom transition
+ {
+ QStateMachine machine;
+ QState *s0 = new QState(&machine);
+ QFinalState *s1 = new QFinalState(&machine);
+
+ TestEventTransition *trans = new TestEventTransition(&button, QEvent::MouseButtonPress, s1);
+ s0->addTransition(trans);
+ QCOMPARE(trans->eventSourceReceived(), (QObject*)0);
+ QCOMPARE(trans->eventTypeReceived(), QEvent::None);
+
+ QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ machine.setInitialState(s0);
+ machine.start();
+ QCoreApplication::processEvents();
+
+ QTest::mousePress(&button, Qt::LeftButton);
+ QCoreApplication::processEvents();
+
+ QTRY_COMPARE(finishedSpy.count(), 1);
+
+ QCOMPARE(trans->eventSourceReceived(), (QObject*)&button);
+ QCOMPARE(trans->eventTypeReceived(), QEvent::MouseButtonPress);
+ }
}
void tst_QStateMachine::historyStates()
@@ -3954,7 +4025,7 @@ public:
void onTransition(QEvent *e)
{
QSignalTransition::onTransition(e);
- QSignalEvent *se = static_cast<QSignalEvent*>(e);
+ QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent*>(e);
eventSignalIndex = se->signalIndex();
}
diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp
index f5d5040..71218a3 100644
--- a/tests/auto/qtableview/tst_qtableview.cpp
+++ b/tests/auto/qtableview/tst_qtableview.cpp
@@ -2339,6 +2339,7 @@ void tst_QTableView::scrollTo()
// resizing to this size will ensure that there can ONLY_BE_ONE_CELL inside the view.
QSize forcedSize(columnWidth * 2, rowHeight * 2);
view.resize(forcedSize);
+ QTest::qWaitForWindowShown(&view);
QTest::qWait(0);
QTRY_COMPARE(view.size(), forcedSize);
diff --git a/tests/auto/qtextdocument/tst_qtextdocument.cpp b/tests/auto/qtextdocument/tst_qtextdocument.cpp
index c0d7ed3..f393393 100644
--- a/tests/auto/qtextdocument/tst_qtextdocument.cpp
+++ b/tests/auto/qtextdocument/tst_qtextdocument.cpp
@@ -1787,21 +1787,17 @@ void tst_QTextDocument::cursorPositionChangedOnSetText()
{
CursorPosSignalSpy spy(doc);
- cursor = QTextCursor();
+ // doc has one QTextCursor stored in the
+ // cursor member variable, thus the signal
+ // gets emitted once.
doc->setPlainText("Foo\nBar\nBaz\nBlub\nBlah");
- // the signal should still be emitted once for the QTextCursor that
- // QTextDocument::setPlainText creates temporarily. But the signal
- // should not be emitted more often.
QCOMPARE(spy.calls, 1);
spy.calls = 0;
doc->setHtml("<p>Foo<p>Bar<p>Baz<p>Blah");
- // the signal should still be emitted once for the QTextCursor that
- // QTextDocument::setPlainText creates temporarily. But the signal
- // should not be emitted more often.
QCOMPARE(spy.calls, 1);
}
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index 4536ed7..4cf9e8f 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -1756,11 +1756,11 @@ void tst_QWidget::setTabOrder()
container.show();
container.activateWindow();
+ qApp->setActiveWindow(&container);
#ifdef Q_WS_X11
QTest::qWaitForWindowShown(&container);
QTest::qWait(50);
#endif
- qApp->setActiveWindow(&container);
QTest::qWait(100);
@@ -2316,8 +2316,9 @@ void tst_QWidget::showMinimizedKeepsFocus()
QTRY_COMPARE(qApp->focusWidget(), static_cast<QWidget*>(0));
window.showNormal();
- QTest::qWait(30);
qApp->setActiveWindow(&window);
+ QTest::qWaitForWindowShown(&window);
+ QTest::qWait(30);
#ifdef Q_WS_MAC
if (!macHasAccessToWindowsServer())
QEXPECT_FAIL("", "When not having WindowServer access, we lose focus.", Continue);
@@ -3116,7 +3117,7 @@ void tst_QWidget::saveRestoreGeometry()
widget.resize(size);
widget.show();
QTest::qWaitForWindowShown(&widget);
- QTest::qWait(100);
+ QTest::qWait(200);
QTRY_COMPARE(widget.geometry().size(), size);
QRect geom;
@@ -3126,15 +3127,15 @@ void tst_QWidget::saveRestoreGeometry()
geom = widget.geometry();
widget.setWindowState(widget.windowState() | Qt::WindowFullScreen);
QTRY_VERIFY((widget.windowState() & Qt::WindowFullScreen));
- QTest::qWait(100);
+ QTest::qWait(200);
QVERIFY(widget.restoreGeometry(savedGeometry));
- QTest::qWait(20);
+ QTest::qWait(120);
QTRY_VERIFY(!(widget.windowState() & Qt::WindowFullScreen));
QTRY_COMPARE(widget.geometry(), geom);
//Restore to full screen
widget.setWindowState(widget.windowState() | Qt::WindowFullScreen);
- QTest::qWait(20);
+ QTest::qWait(120);
QTRY_VERIFY((widget.windowState() & Qt::WindowFullScreen));
QTest::qWait(200);
savedGeometry = widget.saveGeometry();
@@ -3165,7 +3166,7 @@ void tst_QWidget::saveRestoreGeometry()
QTest::qWait(20);
QTRY_VERIFY((widget.windowState() & Qt::WindowMaximized));
QTRY_VERIFY(widget.geometry() != geom);
- QTest::qWait(100);
+ QTest::qWait(200);
QVERIFY(widget.restoreGeometry(savedGeometry));
QTest::qWait(20);
QTRY_COMPARE(widget.geometry(), geom);
@@ -5388,7 +5389,7 @@ void tst_QWidget::showAndMoveChild()
child.move(desktopDimensions.width()/2, desktopDimensions.height()/2);
qApp->processEvents();
- verifyColor(child.geometry().translated(tlwOffset), Qt::blue);
+ verifyColor(child.geometry().translated(tlwOffset), Qt::blue);
verifyColor(QRegion(parent.geometry()) - child.geometry().translated(tlwOffset), Qt::red);
}
@@ -6407,7 +6408,7 @@ void tst_QWidget::render()
qApp->processEvents();
qApp->sendPostedEvents();
- QTest::qWait(100);
+ QTest::qWait(250);
QImage sourceImage = QPixmap::grabWidget(&source).toImage();
qApp->processEvents();
@@ -6513,6 +6514,7 @@ void tst_QWidget::renderInvisible()
dummyFocusWidget.show();
QTest::qWaitForWindowShown(&dummyFocusWidget);
qApp->processEvents();
+ QTest::qWait(100);
// Create normal reference image.
const QSize calendarSize = calendar->size();
@@ -9152,38 +9154,38 @@ void tst_QWidget::destroyBackingStore()
void tst_QWidget::rectOutsideCoordinatesLimit_task144779()
{
- QWidget main;
+ QApplication::setOverrideCursor(Qt::BlankCursor); //keep the cursor out of screen grabs
+ QWidget main(0,0,Qt::FramelessWindowHint); //don't get confused by the size of the window frame
QPalette palette;
palette.setColor(QPalette::Window, Qt::red);
main.setPalette(palette);
+
QDesktopWidget desktop;
QRect desktopDimensions = desktop.availableGeometry(&main);
- main.setGeometry(desktopDimensions);
+ QSize mainSize(400, 400);
+ mainSize = mainSize.boundedTo(desktopDimensions.size());
+ main.resize(mainSize);
QWidget *offsetWidget = new QWidget(&main);
- offsetWidget->setGeometry(0, -14600, desktopDimensions.width(), 15000);
+ offsetWidget->setGeometry(0, -(15000 - mainSize.height()), mainSize.width(), 15000);
// big widget is too big for the coordinates, it must be limited by wrect
// if wrect is not at the right position because of offsetWidget, bigwidget
// is not painted correctly
QWidget *bigWidget = new QWidget(offsetWidget);
-
- bigWidget->setGeometry(0, 0, desktopDimensions.width(), 50000);
+ bigWidget->setGeometry(0, 0, mainSize.width(), 50000);
palette.setColor(QPalette::Window, Qt::green);
bigWidget->setPalette(palette);
bigWidget->setAutoFillBackground(true);
main.show();
QTest::qWaitForWindowShown(&main);
- QTest::qWait(50);
- QCursor::setPos(main.pos()); //get the cursor out of the picture
- QTest::qWait(50);
QPixmap correct(main.size());
correct.fill(Qt::green);
- QRect center(desktopDimensions.width()/4,desktopDimensions.width()/4, desktopDimensions.width()/2, desktopDimensions.width()/2); // to avoid the decorations
- QTRY_COMPARE(QPixmap::grabWindow(main.winId()).toImage().copy(center), correct.toImage().copy(center));
+ QTRY_COMPARE(QPixmap::grabWindow(main.winId()).toImage(), correct.toImage());
+ QApplication::restoreOverrideCursor();
}
void tst_QWidget::inputFocus_task257832()
diff --git a/tests/auto/qwindowsurface/tst_qwindowsurface.cpp b/tests/auto/qwindowsurface/tst_qwindowsurface.cpp
index 2c5ba72..0a6b7ad 100644
--- a/tests/auto/qwindowsurface/tst_qwindowsurface.cpp
+++ b/tests/auto/qwindowsurface/tst_qwindowsurface.cpp
@@ -230,7 +230,7 @@ void tst_QWindowSurface::grabWidget()
parentWidget.show();
QTest::qWaitForWindowShown(&parentWidget);
- QTest::qWait(20);
+ QTest::qWait(120);
QPixmap parentPixmap = parentWidget.windowSurface()->grabWidget(&parentWidget);
QPixmap childPixmap = childWidget.windowSurface()->grabWidget(&childWidget);
diff --git a/tests/benchmarks/qanimation/rectanimation.cpp b/tests/benchmarks/qanimation/rectanimation.cpp
index 5522847..ab381f4 100644
--- a/tests/benchmarks/qanimation/rectanimation.cpp
+++ b/tests/benchmarks/qanimation/rectanimation.cpp
@@ -73,9 +73,9 @@ int RectAnimation::duration() const
}
-void RectAnimation::updateCurrentTime()
+void RectAnimation::updateCurrentTime(int currentTime)
{
- qreal progress = m_easing.valueForProgress( currentTime() / qreal(m_dura) );
+ qreal progress = m_easing.valueForProgress( currentTime / qreal(m_dura) );
QRect now;
now.setCoords(interpolateInteger(m_start.left(), m_end.left(), progress),
interpolateInteger(m_start.top(), m_end.top(), progress),
diff --git a/tests/benchmarks/qanimation/rectanimation.h b/tests/benchmarks/qanimation/rectanimation.h
index 995becb..ea1f804 100644
--- a/tests/benchmarks/qanimation/rectanimation.h
+++ b/tests/benchmarks/qanimation/rectanimation.h
@@ -58,7 +58,7 @@ public:
void setDuration(int d);
int duration() const;
- virtual void updateCurrentTime();
+ virtual void updateCurrentTime(int currentTime);
virtual void updateState(QAbstractAnimation::State state);
private:
diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp
index 4b5f0c6..ec5ce96 100644
--- a/tools/qdoc3/cppcodeparser.cpp
+++ b/tools/qdoc3/cppcodeparser.cpp
@@ -47,6 +47,7 @@
#include <qfile.h>
#include <stdio.h>
+#include <errno.h>
#include "codechunk.h"
#include "config.h"
@@ -281,7 +282,7 @@ void CppCodeParser::parseSourceFile(const Location& location,
{
FILE *in = fopen(QFile::encodeName(filePath), "r");
if (!in) {
- location.error(tr("Cannot open C++ source file '%1'").arg(filePath));
+ location.error(tr("Cannot open C++ source file '%1' (%2)").arg(filePath).arg(strerror(errno)));
return;
}
diff --git a/tools/qdoc3/test/assistant.qdocconf b/tools/qdoc3/test/assistant.qdocconf
index 9ee8965..4ddc94a 100644
--- a/tools/qdoc3/test/assistant.qdocconf
+++ b/tools/qdoc3/test/assistant.qdocconf
@@ -31,7 +31,7 @@ qhp.Assistant.subprojects.examples.sortPages = true
language = Cpp
-sources = $QT_SOURCE_TREE/doc/src/assistant-manual.qdoc \
+sources = $QT_SOURCE_TREE/doc/src/development/assistant-manual.qdoc \
$QT_SOURCE_TREE/doc/src/examples/simpletextviewer.qdoc
sources.fileextensions = "*.cpp *.qdoc"
diff --git a/tools/qdoc3/test/designer.qdocconf b/tools/qdoc3/test/designer.qdocconf
index 2a65184..9d8bd23 100644
--- a/tools/qdoc3/test/designer.qdocconf
+++ b/tools/qdoc3/test/designer.qdocconf
@@ -31,7 +31,7 @@ qhp.Designer.subprojects.examples.sortPages = true
language = Cpp
-sources = $QT_SOURCE_TREE/doc/src/designer-manual.qdoc \
+sources = $QT_SOURCE_TREE/doc/src/development/designer-manual.qdoc \
$QT_SOURCE_TREE/doc/src/examples/calculatorbuilder.qdoc \
$QT_SOURCE_TREE/doc/src/examples/calculatorform.qdoc \
$QT_SOURCE_TREE/doc/src/examples/customwidgetplugin.qdoc \
diff --git a/tools/qdoc3/test/linguist.qdocconf b/tools/qdoc3/test/linguist.qdocconf
index 6c71993..f433529 100644
--- a/tools/qdoc3/test/linguist.qdocconf
+++ b/tools/qdoc3/test/linguist.qdocconf
@@ -31,7 +31,7 @@ qhp.Linguist.subprojects.examples.sortPages = true
language = Cpp
-sources = $QT_SOURCE_TREE/doc/src/linguist-manual.qdoc \
+sources = $QT_SOURCE_TREE/doc/src/internationalization/linguist-manual.qdoc \
$QT_SOURCE_TREE/doc/src/examples/hellotr.qdoc \
$QT_SOURCE_TREE/doc/src/examples/arrowpad.qdoc \
$QT_SOURCE_TREE/doc/src/examples/trollprint.qdoc
diff --git a/tools/qdoc3/test/qmake.qdocconf b/tools/qdoc3/test/qmake.qdocconf
index 3dc1d3b..dcb3c9a 100644
--- a/tools/qdoc3/test/qmake.qdocconf
+++ b/tools/qdoc3/test/qmake.qdocconf
@@ -27,7 +27,7 @@ qhp.qmake.subprojects.manual.selectors = fake:page
language = Cpp
-sources = $QT_SOURCE_TREE/doc/src/qmake-manual.qdoc
+sources = $QT_SOURCE_TREE/doc/src/development/qmake-manual.qdoc
sources.fileextensions = "*.cpp *.qdoc"
diff --git a/tools/qdoc3/test/qt-api-only-with-xcode.qdocconf b/tools/qdoc3/test/qt-api-only-with-xcode.qdocconf
index 0389386..0d78cda 100644
--- a/tools/qdoc3/test/qt-api-only-with-xcode.qdocconf
+++ b/tools/qdoc3/test/qt-api-only-with-xcode.qdocconf
@@ -9,9 +9,9 @@ url = ./
# Ensures that the documentation for the tools is not included in the generated
# .qhp file.
-qhp.Qt.excluded = $QT_SOURCE_TREE/doc/src/assistant-manual.qdoc \
+qhp.Qt.excluded = $QT_SOURCE_TREE/doc/src/development/assistant-manual.qdoc \
$QT_SOURCE_TREE/doc/src/examples/simpletextviewer.qdoc \
- $QT_SOURCE_TREE/doc/src/designer-manual.qdoc \
+ $QT_SOURCE_TREE/doc/src/development/designer-manual.qdoc \
$QT_SOURCE_TREE/doc/src/examples/calculatorbuilder.qdoc \
$QT_SOURCE_TREE/doc/src/examples/calculatorform.qdoc \
$QT_SOURCE_TREE/doc/src/examples/customwidgetplugin.qdoc \
@@ -19,11 +19,11 @@ qhp.Qt.excluded = $QT_SOURCE_TREE/doc/src/assistant-manual.qdoc \
$QT_SOURCE_TREE/doc/src/examples/containerextension.qdoc \
$QT_SOURCE_TREE/doc/src/examples/worldtimeclockbuilder.qdoc \
$QT_SOURCE_TREE/doc/src/examples/worldtimeclockplugin.qdoc \
- $QT_SOURCE_TREE/doc/src/linguist-manual.qdoc \
+ $QT_SOURCE_TREE/doc/src/internationalization/linguist-manual.qdoc \
$QT_SOURCE_TREE/doc/src/examples/hellotr.qdoc \
$QT_SOURCE_TREE/doc/src/examples/arrowpad.qdoc \
$QT_SOURCE_TREE/doc/src/examples/trollprint.qdoc \
- $QT_SOURCE_TREE/doc/src/qmake-manual.qdoc
+ $QT_SOURCE_TREE/doc/src/development/qmake-manual.qdoc
outputdir = $QT_BUILD_TREE/doc-build/html-qt
base = file:$QT_BUILD_TREE/doc-build/html-qt
diff --git a/tools/qdoc3/test/qt-api-only.qdocconf b/tools/qdoc3/test/qt-api-only.qdocconf
index bc5656b..10b7be5 100644
--- a/tools/qdoc3/test/qt-api-only.qdocconf
+++ b/tools/qdoc3/test/qt-api-only.qdocconf
@@ -9,9 +9,9 @@ url = ./
# Ensures that the documentation for the tools is not included in the generated
# .qhp file.
-qhp.Qt.excluded += $QT_SOURCE_TREE/doc/src/assistant-manual.qdoc \
+qhp.Qt.excluded += $QT_SOURCE_TREE/doc/src/development/assistant-manual.qdoc \
$QT_SOURCE_TREE/doc/src/examples/simpletextviewer.qdoc \
- $QT_SOURCE_TREE/doc/src/designer-manual.qdoc \
+ $QT_SOURCE_TREE/doc/src/development/designer-manual.qdoc \
$QT_SOURCE_TREE/doc/src/examples/calculatorbuilder.qdoc \
$QT_SOURCE_TREE/doc/src/examples/calculatorform.qdoc \
$QT_SOURCE_TREE/doc/src/examples/customwidgetplugin.qdoc \
@@ -19,11 +19,11 @@ qhp.Qt.excluded += $QT_SOURCE_TREE/doc/src/assistant-manual.qdoc \
$QT_SOURCE_TREE/doc/src/examples/containerextension.qdoc \
$QT_SOURCE_TREE/doc/src/examples/worldtimeclockbuilder.qdoc \
$QT_SOURCE_TREE/doc/src/examples/worldtimeclockplugin.qdoc \
- $QT_SOURCE_TREE/doc/src/linguist-manual.qdoc \
+ $QT_SOURCE_TREE/doc/src/internationalization/linguist-manual.qdoc \
$QT_SOURCE_TREE/doc/src/examples/hellotr.qdoc \
$QT_SOURCE_TREE/doc/src/examples/arrowpad.qdoc \
$QT_SOURCE_TREE/doc/src/examples/trollprint.qdoc \
- $QT_SOURCE_TREE/doc/src/qmake-manual.qdoc
+ $QT_SOURCE_TREE/doc/src/development/qmake-manual.qdoc
outputdir = $QT_BUILD_TREE/doc-build/html-qt
tagfile = $QT_BUILD_TREE/doc-build/html-qt/qt.tags