summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrans Englich <frans.englich@nokia.com>2009-09-29 14:29:20 (GMT)
committerFrans Englich <frans.englich@nokia.com>2009-09-29 14:29:20 (GMT)
commitb1c2caf933942b3a77a0332aecb66a7f0fdd2316 (patch)
tree235991caa35a38778aa099d5eaaa3d20b8ac1807
parent17c17adbd706d32723ecedeb207c7e467f9fa8eb (diff)
parent75666d254304746ead69892e92fa4ab39d219df1 (diff)
downloadQt-b1c2caf933942b3a77a0332aecb66a7f0fdd2316.zip
Qt-b1c2caf933942b3a77a0332aecb66a7f0fdd2316.tar.gz
Qt-b1c2caf933942b3a77a0332aecb66a7f0fdd2316.tar.bz2
Merge commit 'qt/4.6' into mmfphonon
-rw-r--r--dist/changes-4.5.3135
-rw-r--r--examples/statemachine/pingpong/main.cpp4
-rw-r--r--examples/webkit/formextractor/formextractor.cpp14
-rw-r--r--src/corelib/statemachine/qstatemachine.cpp98
-rw-r--r--src/corelib/statemachine/qstatemachine.h11
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout.cpp30
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout.h1
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout_p.cpp7
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout_p.h7
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp11
-rw-r--r--src/gui/kernel/qapplication_s60.cpp1
-rw-r--r--src/gui/kernel/qevent.h2
-rw-r--r--src/gui/kernel/qsoftkeymanager.cpp2
-rw-r--r--src/gui/math3d/qmatrix4x4.h40
-rw-r--r--src/gui/math3d/qquaternion.h34
-rw-r--r--src/gui/math3d/qvector2d.h4
-rw-r--r--src/gui/math3d/qvector3d.h6
-rw-r--r--src/gui/math3d/qvector4d.h8
-rw-r--r--src/gui/widgets/qvalidator.h4
-rw-r--r--src/network/kernel/qhostinfo_win.cpp2
-rw-r--r--src/opengl/qgl.cpp5
-rw-r--r--src/s60installs/s60installs.pro5
-rw-r--r--src/scripttools/debugging/qscriptbreakpointsmodel.cpp13
-rw-r--r--src/scripttools/debugging/qscriptbreakpointswidget.cpp6
-rw-r--r--src/scripttools/debugging/qscriptdebugger.cpp58
-rw-r--r--src/scripttools/debugging/qscriptdebuggercodefinderwidget.cpp2
-rw-r--r--src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp5
-rw-r--r--src/scripttools/debugging/qscriptdebuggerstackmodel.cpp7
-rw-r--r--src/scripttools/debugging/qscriptedit.cpp8
-rw-r--r--src/scripttools/debugging/qscriptenginedebugger.cpp20
-rw-r--r--src/testlib/qtestcoreelement.h6
-rw-r--r--tests/auto/qactiongroup/tst_qactiongroup.cpp14
-rw-r--r--tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp21
-rw-r--r--tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp52
-rw-r--r--tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp5
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp31
-rw-r--r--tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp92
-rw-r--r--tests/auto/qmainwindow/tst_qmainwindow.cpp35
-rw-r--r--tests/auto/qmake/testdata/prompt/prompt.pro2
-rw-r--r--tests/auto/qmenu/tst_qmenu.cpp12
-rw-r--r--tests/auto/qprogressbar/tst_qprogressbar.cpp2
-rw-r--r--tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp1
-rw-r--r--tests/auto/qstatemachine/tst_qstatemachine.cpp49
-rw-r--r--tools/configure/configureapp.cpp4
44 files changed, 501 insertions, 375 deletions
diff --git a/dist/changes-4.5.3 b/dist/changes-4.5.3
index d797b4c..1edacac 100644
--- a/dist/changes-4.5.3
+++ b/dist/changes-4.5.3
@@ -17,34 +17,21 @@ Each of these identifiers can be entered in the task tracker to obtain more
information about a particular change.
****************************************************************************
-* General *
-****************************************************************************
-
-General Improvements
---------------------
-
-- Documentation and Examples
-
-Third party components
-----------------------
-
-
-****************************************************************************
* Library *
****************************************************************************
+- QColorDialog
+ * [256164] Fixed the setting of alpha values in QColorDialog.
+
- 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()
+ * [255502] Fixed bug in getDouble().
- QNetworkAccessManager
* [256240] Proper handling of HTTP redirect in AlwaysCache mode.
@@ -52,6 +39,18 @@ Third party components
HTTP request.
* [256630] Fix usage of QProgressDialog together with QNetworkReply.
+- QPainter
+ * [254105] Fixed potential segmentation fault when setting empty clip
+ rectangle.
+ * [256549] Fixed inconsistent behavior between paint engines when
+ setting an IntersectClip after doing setClipping(false).
+ * [254407] Fixed rendering issue with outline drawing using
+ projective transforms.
+ * [258776] Fixed rounding bug in drawImage().
+
+- QPainterPath
+ * [251909] Fixed bug in QPainterPath::united() / simplified().
+
- QSslCertificate
* [256066] Fix loading of a PEM when the length was a multiple of 64.
@@ -62,15 +61,16 @@ Third party components
****************************************************************************
* Database Drivers *
****************************************************************************
-- [QT-353] (ODBC) Fixed issue of forward only datasets failing when not
- explicitly set so.
+
+- [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.
+ 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.
@@ -83,92 +83,45 @@ 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
---------------
+- QClipboard can copy/paste on all screens in a multiscreen configuration.
+- Fixed a bug that prevented QClipboard to work after some time.
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.
-
+- [252088] Drag and drop events will now consider the
+ WA_TransparentForMouseEvents in Cocoa port.
+- [255428] Fixed 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 a 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
----------------------
+Qt for Windows
+-----------------
+- [250188] Fixed size windows will show the maximize button if asked explicitely.
Qt for Windows CE
-----------------
-[260702] Fixed restoring of minimized Windows.
-
-****************************************************************************
-* Compiler Specific Changes *
-****************************************************************************
-
-
-****************************************************************************
-* Tools *
-****************************************************************************
-
-- Build System
-
-- Assistant
-
-
-- Designer
-
-
-- Linguist
- - Linguist GUI
-
- - lupdate
-
- - lrelease
-
-
-- rcc
-
-
-- moc
-
-
-- uic
-
-
-- uic3
-
-
-- qmake
-
-
-- configure
-
-
-- qtconfig
-
-
-- qt3to4
-
+- [260702] Fixed restoring of minimized Windows.
****************************************************************************
* Plugins *
****************************************************************************
-
-****************************************************************************
-* Important Behavior Changes *
-****************************************************************************
+- DirectFB
+ * Make autorepeat work for DirectFB keyboard driver.
+ * Fix a crash when resizing windows.
+ * Fix an off by one when flipping surfaces that could lead to artifacts.
+ * Make painting operations with QRegion clips go to DirectFB rather than
+ Raster (when possible).
+ * Make porter duff operations work for blits.
+ * Various optimizations.
+ * Handle more operations in hw.
diff --git a/examples/statemachine/pingpong/main.cpp b/examples/statemachine/pingpong/main.cpp
index 7e3d8b1..358c499 100644
--- a/examples/statemachine/pingpong/main.cpp
+++ b/examples/statemachine/pingpong/main.cpp
@@ -86,7 +86,7 @@ protected:
}
virtual void onTransition(QEvent *)
{
- machine()->postEvent(new PingEvent(), 500);
+ machine()->postDelayedEvent(new PingEvent(), 500);
fprintf(stdout, "ping?\n");
}
};
@@ -104,7 +104,7 @@ protected:
}
virtual void onTransition(QEvent *)
{
- machine()->postEvent(new PongEvent(), 500);
+ machine()->postDelayedEvent(new PongEvent(), 500);
fprintf(stdout, "pong!\n");
}
};
diff --git a/examples/webkit/formextractor/formextractor.cpp b/examples/webkit/formextractor/formextractor.cpp
index 3ce888c..4b181e8 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.evaluateScript("this.value").toString());
- ui.lastNameEdit->setText(lastName.evaluateScript("this.value").toString());
+ ui.firstNameEdit->setText(firstName.evaluateJavaScript("this.value").toString());
+ ui.lastNameEdit->setText(lastName.evaluateJavaScript("this.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 (maleGender.evaluateJavaScript("this.checked").toBool())
+ ui.genderEdit->setText(maleGender.evaluateJavaScript("this.value").toString());
+ else if (femaleGender.evaluateJavaScript("this.checked").toBool())
+ ui.genderEdit->setText(femaleGender.evaluateJavaScript("this.value").toString());
- if (updates.evaluateScript("this.checked").toBool())
+ if (updates.evaluateJavaScript("this.checked").toBool())
ui.updatesEdit->setText("Yes");
else
ui.updatesEdit->setText("No");
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp
index 8d50870c..256763b 100644
--- a/src/corelib/statemachine/qstatemachine.cpp
+++ b/src/corelib/statemachine/qstatemachine.cpp
@@ -1587,6 +1587,18 @@ QStateMachine::~QStateMachine()
{
}
+/*!
+ \enum QStateMachine::EventPriority
+
+ This enum type specifies the priority of an event posted to the state
+ machine using postEvent().
+
+ Events of high priority are processed before events of normal priority.
+
+ \value NormalPriority The event has normal priority.
+ \value HighPriority The event has high priority.
+*/
+
/*! \enum QStateMachine::Error
This enum type defines errors that can occur in the state machine at run time. When the state
@@ -1798,47 +1810,99 @@ void QStateMachine::stop()
}
/*!
- Posts the given \a event for processing by this state machine, with a delay
- of \a delay milliseconds.
+ Posts the given \a event of the given \a priority for processing by this
+ state machine.
This function returns immediately. The event is added to the state machine's
event queue. Events are processed in the order posted. The state machine
takes ownership of the event and deletes it once it has been processed.
You can only post events when the state machine is running.
+
+ \sa postDelayedEvent()
*/
-void QStateMachine::postEvent(QEvent *event, int delay)
+void QStateMachine::postEvent(QEvent *event, EventPriority priority)
{
Q_D(QStateMachine);
if (d->state != QStateMachinePrivate::Running) {
qWarning("QStateMachine::postEvent: cannot post event when the state machine is not running");
return;
}
+ if (!event) {
+ qWarning("QStateMachine::postEvent: cannot post null event");
+ return;
+ }
#ifdef QSTATEMACHINE_DEBUG
- qDebug() << this << ": posting external event" << event << "with delay" << delay;
+ qDebug() << this << ": posting event" << event;
#endif
- if (delay) {
- int tid = startTimer(delay);
- d->delayedEvents[tid] = event;
- } else {
+ switch (priority) {
+ case NormalPriority:
d->externalEventQueue.append(event);
- d->processEvents(QStateMachinePrivate::QueuedProcessing);
+ break;
+ case HighPriority:
+ d->internalEventQueue.append(event);
+ break;
}
+ d->processEvents(QStateMachinePrivate::QueuedProcessing);
}
/*!
- \internal
+ Posts the given \a event for processing by this state machine, with the
+ given \a delay in milliseconds. Returns an identifier associated with the
+ delayed event, or -1 if the event could not be posted.
+
+ This function returns immediately. When the delay has expired, the event
+ will be added to the state machine's event queue for processing. The state
+ machine takes ownership of the event and deletes it once it has been
+ processed.
+
+ You can only post events when the state machine is running.
- Posts the given internal \a event for processing by this state machine.
+ \sa cancelDelayedEvent(), postEvent()
*/
-void QStateMachine::postInternalEvent(QEvent *event)
+int QStateMachine::postDelayedEvent(QEvent *event, int delay)
{
Q_D(QStateMachine);
+ if (d->state != QStateMachinePrivate::Running) {
+ qWarning("QStateMachine::postDelayedEvent: cannot post event when the state machine is not running");
+ return -1;
+ }
+ if (!event) {
+ qWarning("QStateMachine::postDelayedEvent: cannot post null event");
+ return -1;
+ }
+ if (delay < 0) {
+ qWarning("QStateMachine::postDelayedEvent: delay cannot be negative");
+ return -1;
+ }
#ifdef QSTATEMACHINE_DEBUG
- qDebug() << this << ": posting internal event" << event;
+ qDebug() << this << ": posting event" << event << "with delay" << delay;
#endif
- d->internalEventQueue.append(event);
- d->processEvents(QStateMachinePrivate::QueuedProcessing);
+ int tid = startTimer(delay);
+ d->delayedEvents[tid] = event;
+ return tid;
+}
+
+/*!
+ Cancels the delayed event identified by the given \a id. The id should be a
+ value returned by a call to postDelayedEvent(). Returns true if the event
+ was successfully cancelled, otherwise returns false.
+
+ \sa postDelayedEvent()
+*/
+bool QStateMachine::cancelDelayedEvent(int id)
+{
+ Q_D(QStateMachine);
+ if (d->state != QStateMachinePrivate::Running) {
+ qWarning("QStateMachine::cancelDelayedEvent: the machine is not running");
+ return false;
+ }
+ QEvent *e = d->delayedEvents.take(id);
+ if (!e)
+ return false;
+ killTimer(id);
+ delete e;
+ return true;
}
/*!
@@ -1882,9 +1946,9 @@ bool QStateMachine::event(QEvent *e)
if (e->type() == QEvent::Timer) {
QTimerEvent *te = static_cast<QTimerEvent*>(e);
int tid = te->timerId();
- if (d->delayedEvents.contains(tid)) {
+ QEvent *ee = d->delayedEvents.take(tid);
+ if (ee != 0) {
killTimer(tid);
- QEvent *ee = d->delayedEvents.take(tid);
d->externalEventQueue.append(ee);
d->processEvents(QStateMachinePrivate::DirectProcessing);
return true;
diff --git a/src/corelib/statemachine/qstatemachine.h b/src/corelib/statemachine/qstatemachine.h
index a0b2b14..321a05c 100644
--- a/src/corelib/statemachine/qstatemachine.h
+++ b/src/corelib/statemachine/qstatemachine.h
@@ -102,6 +102,11 @@ public:
QEvent *m_event;
};
+ enum EventPriority {
+ NormalPriority,
+ HighPriority
+ };
+
enum RestorePolicy {
DoNotRestoreProperties,
RestoreProperties
@@ -138,7 +143,9 @@ public:
QStateMachine::RestorePolicy globalRestorePolicy() const;
void setGlobalRestorePolicy(QStateMachine::RestorePolicy restorePolicy);
- void postEvent(QEvent *event, int delay = 0);
+ void postEvent(QEvent *event, EventPriority priority = NormalPriority);
+ int postDelayedEvent(QEvent *event, int delay);
+ bool cancelDelayedEvent(int id);
QSet<QAbstractState*> configuration() const;
@@ -158,8 +165,6 @@ protected:
void onEntry(QEvent *event);
void onExit(QEvent *event);
- void postInternalEvent(QEvent *event);
-
virtual void beginSelectTransitions(QEvent *event);
virtual void endSelectTransitions(QEvent *event);
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout.cpp b/src/gui/graphicsview/qgraphicsanchorlayout.cpp
index b3ebb2b..fdb1708 100644
--- a/src/gui/graphicsview/qgraphicsanchorlayout.cpp
+++ b/src/gui/graphicsview/qgraphicsanchorlayout.cpp
@@ -80,6 +80,24 @@
PM_LayoutHorizontalSpacing (or PM_LayoutVerticalSpacing for vertical anchors).
*/
+/*!
+ \class QGraphicsAnchor
+ \brief The QGraphicsAnchor class represents an anchor between two items in a
+ QGraphicsAnchorLayout.
+ \since 4.6
+ \ingroup appearance
+ \ingroup geomanagement
+ \ingroup graphicsview-api
+
+ The graphics anchor provides an API that enables you to query and manipulate the
+ properties an anchor has. When an anchor is added to the layout with
+ QGraphicsAnchorLayout::addAnchor(), a QGraphicsAnchor instance is returned where the properties
+ are initialized to their default values. The properties can then be further changed, and they
+ will be picked up the next time the layout is activated.
+
+ \sa QGraphicsAnchorLayout::anchor()
+
+*/
#include "qgraphicsanchorlayout_p.h"
QT_BEGIN_NAMESPACE
@@ -288,18 +306,6 @@ void QGraphicsAnchorLayout::addAnchors(QGraphicsLayoutItem *firstItem,
}
/*!
- Returns true if there are no arrangement that satisfies all constraints.
- Otherwise returns false.
-
- \sa addAnchor()
-*/
-bool QGraphicsAnchorLayout::hasConflicts() const
-{
- Q_D(const QGraphicsAnchorLayout);
- return d->hasConflicts();
-}
-
-/*!
Sets the default horizontal spacing for the anchor layout to \a spacing.
\sa horizontalSpacing(), setVerticalSpacing(), setSpacing()
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout.h b/src/gui/graphicsview/qgraphicsanchorlayout.h
index 44074d1..d9a87ba 100644
--- a/src/gui/graphicsview/qgraphicsanchorlayout.h
+++ b/src/gui/graphicsview/qgraphicsanchorlayout.h
@@ -93,7 +93,6 @@ public:
QGraphicsLayoutItem *secondItem,
Qt::Orientations orientations = Qt::Horizontal | Qt::Vertical);
- bool hasConflicts() const;
void setHorizontalSpacing(qreal spacing);
void setVerticalSpacing(qreal spacing);
void setSpacing(qreal spacing);
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
index 49aabf5..f75118b 100644
--- a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
+++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
@@ -2287,6 +2287,13 @@ bool QGraphicsAnchorLayoutPrivate::solvePreferred(QList<QSimplexConstraint *> co
return feasible;
}
+/*!
+ \internal
+ Returns true if there are no arrangement that satisfies all constraints.
+ Otherwise returns false.
+
+ \sa addAnchor()
+*/
bool QGraphicsAnchorLayoutPrivate::hasConflicts() const
{
QGraphicsAnchorLayoutPrivate *that = const_cast<QGraphicsAnchorLayoutPrivate*>(this);
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.h b/src/gui/graphicsview/qgraphicsanchorlayout_p.h
index 4e1bcd4..c86bfa3 100644
--- a/src/gui/graphicsview/qgraphicsanchorlayout_p.h
+++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.h
@@ -343,7 +343,7 @@ public:
QGraphicsAnchorLayout private methods and attributes.
*/
-class QGraphicsAnchorLayoutPrivate : public QGraphicsLayoutPrivate
+class Q_AUTOTEST_EXPORT QGraphicsAnchorLayoutPrivate : public QGraphicsLayoutPrivate
{
Q_DECLARE_PUBLIC(QGraphicsAnchorLayout)
@@ -370,6 +370,11 @@ public:
QGraphicsAnchorLayoutPrivate();
+ static QGraphicsAnchorLayoutPrivate *get(QGraphicsAnchorLayout *q)
+ {
+ return q ? q->d_func() : 0;
+ }
+
static Qt::AnchorPoint oppositeEdge(
Qt::AnchorPoint edge);
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index c3934c7..d7a7bd2 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -5140,14 +5140,8 @@ void QGraphicsItem::update(const QRectF &rect)
} while ((item = item->d_ptr->parent));
if (CacheMode(d_ptr->cacheMode) != NoCache) {
- QGraphicsItemCache *cache = d_ptr->extraItemCache();
- if (d_ptr->discardUpdateRequest(/* ignoreVisibleBit = */ false,
- /* ignoreClipping = */ false,
- /* ignoreDirtyBit = */ true)) {
- return;
- }
-
// Invalidate cache.
+ QGraphicsItemCache *cache = d_ptr->extraItemCache();
if (!cache->allExposed) {
if (rect.isNull()) {
cache->allExposed = true;
@@ -5161,6 +5155,9 @@ void QGraphicsItem::update(const QRectF &rect)
return;
}
+ if (d_ptr->discardUpdateRequest())
+ return;
+
if (d_ptr->scene)
d_ptr->scene->d_func()->markDirty(this, rect);
}
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 71d0cd1..992e754 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -1472,6 +1472,7 @@ bool QApplication::s60EventFilter(TWsEvent * /* aEvent */)
*/
void QApplication::symbianHandleCommand(int command)
{
+ QScopedLoopLevelCounter counter(d_func()->threadData);
switch (command) {
#ifdef Q_WS_S60
case EAknSoftkeyExit: {
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h
index fa2b22f..4396766 100644
--- a/src/gui/kernel/qevent.h
+++ b/src/gui/kernel/qevent.h
@@ -807,7 +807,7 @@ public:
// internal
inline void setWidget(QWidget *awidget) { _widget = awidget; }
inline void setDeviceType(DeviceType adeviceType) { _deviceType = adeviceType; }
- inline void setTouchPointStates(Qt::TouchPointStates touchPointStates) { _touchPointStates = touchPointStates; }
+ inline void setTouchPointStates(Qt::TouchPointStates aTouchPointStates) { _touchPointStates = aTouchPointStates; }
inline void setTouchPoints(const QList<QTouchEvent::TouchPoint> &atouchPoints) { _touchPoints = atouchPoints; }
protected:
diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp
index 91f4163..45695d9 100644
--- a/src/gui/kernel/qsoftkeymanager.cpp
+++ b/src/gui/kernel/qsoftkeymanager.cpp
@@ -238,7 +238,7 @@ void QSoftKeyManagerPrivate::updateSoftKeys_sys(const QList<QAction*> &softkeys)
}
if (needsExitButton)
- QT_TRAP_THROWING(nativeContainer->SetCommandL(2, EAknSoftkeyExit, qt_QString2TPtrC(QObject::tr("Exit"))));
+ QT_TRAP_THROWING(nativeContainer->SetCommandL(2, EAknSoftkeyExit, qt_QString2TPtrC(QSoftKeyManager::tr("Exit"))));
nativeContainer->DrawDeferred(); // 3.1 needs an extra invitation
}
diff --git a/src/gui/math3d/qmatrix4x4.h b/src/gui/math3d/qmatrix4x4.h
index cfa3f2a..b32e00a 100644
--- a/src/gui/math3d/qmatrix4x4.h
+++ b/src/gui/math3d/qmatrix4x4.h
@@ -228,14 +228,14 @@ Q_INLINE_TEMPLATE QMatrix4x4::QMatrix4x4
(const QGenericMatrix<N, M, qreal>& matrix)
{
const qreal *values = matrix.constData();
- for (int col = 0; col < 4; ++col) {
- for (int row = 0; row < 4; ++row) {
- if (col < N && row < M)
- m[col][row] = values[col * M + row];
- else if (col == row)
- m[col][row] = 1.0f;
+ for (int matrixCol = 0; matrixCol < 4; ++matrixCol) {
+ for (int matrixRow = 0; matrixRow < 4; ++matrixRow) {
+ if (matrixCol < N && matrixRow < M)
+ m[matrixCol][matrixRow] = values[matrixCol * M + matrixRow];
+ else if (matrixCol == matrixRow)
+ m[matrixCol][matrixRow] = 1.0f;
else
- m[col][row] = 0.0f;
+ m[matrixCol][matrixRow] = 0.0f;
}
}
flagBits = General;
@@ -246,14 +246,14 @@ QGenericMatrix<N, M, qreal> QMatrix4x4::toGenericMatrix() const
{
QGenericMatrix<N, M, qreal> result;
qreal *values = result.data();
- for (int col = 0; col < N; ++col) {
- for (int row = 0; row < M; ++row) {
- if (col < 4 && row < 4)
- values[col * M + row] = m[col][row];
- else if (col == row)
- values[col * M + row] = 1.0f;
+ for (int matrixCol = 0; matrixCol < N; ++matrixCol) {
+ for (int matrixRow = 0; matrixRow < M; ++matrixRow) {
+ if (matrixCol < 4 && matrixRow < 4)
+ values[matrixCol * M + matrixRow] = m[matrixCol][matrixRow];
+ else if (matrixCol == matrixRow)
+ values[matrixCol * M + matrixRow] = 1.0f;
else
- values[col * M + row] = 0.0f;
+ values[matrixCol * M + matrixRow] = 0.0f;
}
}
return result;
@@ -261,17 +261,17 @@ QGenericMatrix<N, M, qreal> QMatrix4x4::toGenericMatrix() const
#endif
-inline const qreal& QMatrix4x4::operator()(int row, int column) const
+inline const qreal& QMatrix4x4::operator()(int aRow, int aColumn) const
{
- Q_ASSERT(row >= 0 && row < 4 && column >= 0 && column < 4);
- return m[column][row];
+ Q_ASSERT(aRow >= 0 && aRow < 4 && aColumn >= 0 && aColumn < 4);
+ return m[aColumn][aRow];
}
-inline qreal& QMatrix4x4::operator()(int row, int column)
+inline qreal& QMatrix4x4::operator()(int aRow, int aColumn)
{
- Q_ASSERT(row >= 0 && row < 4 && column >= 0 && column < 4);
+ Q_ASSERT(aRow >= 0 && aRow < 4 && aColumn >= 0 && aColumn < 4);
flagBits = General;
- return m[column][row];
+ return m[aColumn][aRow];
}
inline QVector4D QMatrix4x4::column(int index) const
diff --git a/src/gui/math3d/qquaternion.h b/src/gui/math3d/qquaternion.h
index dd5dddc..7480a5c 100644
--- a/src/gui/math3d/qquaternion.h
+++ b/src/gui/math3d/qquaternion.h
@@ -138,7 +138,7 @@ private:
inline QQuaternion::QQuaternion() : wp(1.0f), xp(0.0f), yp(0.0f), zp(0.0f) {}
-inline QQuaternion::QQuaternion(qreal scalar, qreal xpos, qreal ypos, qreal zpos) : wp(scalar), xp(xpos), yp(ypos), zp(zpos) {}
+inline QQuaternion::QQuaternion(qreal aScalar, qreal xpos, qreal ypos, qreal zpos) : wp(aScalar), xp(xpos), yp(ypos), zp(zpos) {}
inline bool QQuaternion::isNull() const
@@ -156,10 +156,10 @@ inline qreal QQuaternion::y() const { return qreal(yp); }
inline qreal QQuaternion::z() const { return qreal(zp); }
inline qreal QQuaternion::scalar() const { return qreal(wp); }
-inline void QQuaternion::setX(qreal x) { xp = x; }
-inline void QQuaternion::setY(qreal y) { yp = y; }
-inline void QQuaternion::setZ(qreal z) { zp = z; }
-inline void QQuaternion::setScalar(qreal scalar) { wp = scalar; }
+inline void QQuaternion::setX(qreal aX) { xp = aX; }
+inline void QQuaternion::setY(qreal aY) { yp = aY; }
+inline void QQuaternion::setZ(qreal aZ) { zp = aZ; }
+inline void QQuaternion::setScalar(qreal aScalar) { wp = aScalar; }
inline QQuaternion QQuaternion::conjugate() const
{
@@ -274,14 +274,14 @@ inline bool qFuzzyCompare(const QQuaternion& q1, const QQuaternion& q2)
#ifndef QT_NO_VECTOR3D
-inline QQuaternion::QQuaternion(qreal scalar, const QVector3D& vector)
- : wp(scalar), xp(vector.x()), yp(vector.y()), zp(vector.z()) {}
+inline QQuaternion::QQuaternion(qreal aScalar, const QVector3D& aVector)
+ : wp(aScalar), xp(aVector.x()), yp(aVector.y()), zp(aVector.z()) {}
-inline void QQuaternion::setVector(const QVector3D& vector)
+inline void QQuaternion::setVector(const QVector3D& aVector)
{
- xp = vector.x();
- yp = vector.y();
- zp = vector.z();
+ xp = aVector.x();
+ yp = aVector.y();
+ zp = aVector.z();
}
inline QVector3D QQuaternion::vector() const
@@ -291,17 +291,17 @@ inline QVector3D QQuaternion::vector() const
#endif
-inline void QQuaternion::setVector(qreal x, qreal y, qreal z)
+inline void QQuaternion::setVector(qreal aX, qreal aY, qreal aZ)
{
- xp = x;
- yp = y;
- zp = z;
+ xp = aX;
+ yp = aY;
+ zp = aZ;
}
#ifndef QT_NO_VECTOR4D
-inline QQuaternion::QQuaternion(const QVector4D& vector)
- : wp(vector.w()), xp(vector.x()), yp(vector.y()), zp(vector.z()) {}
+inline QQuaternion::QQuaternion(const QVector4D& aVector)
+ : wp(aVector.w()), xp(aVector.x()), yp(aVector.y()), zp(aVector.z()) {}
inline QVector4D QQuaternion::toVector4D() const
{
diff --git a/src/gui/math3d/qvector2d.h b/src/gui/math3d/qvector2d.h
index 570e864..cd9a12c 100644
--- a/src/gui/math3d/qvector2d.h
+++ b/src/gui/math3d/qvector2d.h
@@ -144,8 +144,8 @@ inline bool QVector2D::isNull() const
inline qreal QVector2D::x() const { return qreal(xp); }
inline qreal QVector2D::y() const { return qreal(yp); }
-inline void QVector2D::setX(qreal x) { xp = x; }
-inline void QVector2D::setY(qreal y) { yp = y; }
+inline void QVector2D::setX(qreal aX) { xp = aX; }
+inline void QVector2D::setY(qreal aY) { yp = aY; }
inline QVector2D &QVector2D::operator+=(const QVector2D &vector)
{
diff --git a/src/gui/math3d/qvector3d.h b/src/gui/math3d/qvector3d.h
index 1291c96..60bd693 100644
--- a/src/gui/math3d/qvector3d.h
+++ b/src/gui/math3d/qvector3d.h
@@ -160,9 +160,9 @@ inline qreal QVector3D::x() const { return qreal(xp); }
inline qreal QVector3D::y() const { return qreal(yp); }
inline qreal QVector3D::z() const { return qreal(zp); }
-inline void QVector3D::setX(qreal x) { xp = x; }
-inline void QVector3D::setY(qreal y) { yp = y; }
-inline void QVector3D::setZ(qreal z) { zp = z; }
+inline void QVector3D::setX(qreal aX) { xp = aX; }
+inline void QVector3D::setY(qreal aY) { yp = aY; }
+inline void QVector3D::setZ(qreal aZ) { zp = aZ; }
inline QVector3D &QVector3D::operator+=(const QVector3D &vector)
{
diff --git a/src/gui/math3d/qvector4d.h b/src/gui/math3d/qvector4d.h
index ad0718a..c35b536 100644
--- a/src/gui/math3d/qvector4d.h
+++ b/src/gui/math3d/qvector4d.h
@@ -158,10 +158,10 @@ inline qreal QVector4D::y() const { return qreal(yp); }
inline qreal QVector4D::z() const { return qreal(zp); }
inline qreal QVector4D::w() const { return qreal(wp); }
-inline void QVector4D::setX(qreal x) { xp = x; }
-inline void QVector4D::setY(qreal y) { yp = y; }
-inline void QVector4D::setZ(qreal z) { zp = z; }
-inline void QVector4D::setW(qreal w) { wp = w; }
+inline void QVector4D::setX(qreal aX) { xp = aX; }
+inline void QVector4D::setY(qreal aY) { yp = aY; }
+inline void QVector4D::setZ(qreal aZ) { zp = aZ; }
+inline void QVector4D::setW(qreal aW) { wp = aW; }
inline QVector4D &QVector4D::operator+=(const QVector4D &vector)
{
diff --git a/src/gui/widgets/qvalidator.h b/src/gui/widgets/qvalidator.h
index 268ecaa..a0d9534 100644
--- a/src/gui/widgets/qvalidator.h
+++ b/src/gui/widgets/qvalidator.h
@@ -61,7 +61,7 @@ class Q_GUI_EXPORT QValidator : public QObject
{
Q_OBJECT
public:
- explicit QValidator(QObject * parent=0);
+ explicit QValidator(QObject * parent = 0);
~QValidator();
enum State {
@@ -100,7 +100,7 @@ class Q_GUI_EXPORT QIntValidator : public QValidator
Q_PROPERTY(int top READ top WRITE setTop)
public:
- explicit QIntValidator(QObject * parent=0);
+ explicit QIntValidator(QObject * parent = 0);
QIntValidator(int bottom, int top, QObject * parent);
~QIntValidator();
diff --git a/src/network/kernel/qhostinfo_win.cpp b/src/network/kernel/qhostinfo_win.cpp
index 55aa77a..d9d7234 100644
--- a/src/network/kernel/qhostinfo_win.cpp
+++ b/src/network/kernel/qhostinfo_win.cpp
@@ -186,7 +186,7 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName)
results.setHostName(hostName);
if (aceHostname.isEmpty()) {
results.setError(QHostInfo::HostNotFound);
- results.setErrorString(hostName.isEmpty() ? QObject::tr("No host name given") : QObject::tr("Invalid hostname"));
+ results.setErrorString(hostName.isEmpty() ? tr("No host name given") : tr("Invalid hostname"));
return results;
}
} else {
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 0ad6772..1276443 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -1624,9 +1624,8 @@ void QGLTextureCache::pixmapCleanupHook(QPixmap* pixmap)
}
#if defined(Q_WS_X11)
QPixmapData *pd = pixmap->data_ptr().data();
- // Only need to delete the gl surface if the pixmap is about to be deleted
- if (pd->ref == 0)
- QGLContextPrivate::destroyGlSurfaceForPixmap(pd);
+ Q_ASSERT(pd->ref == 1); // Make sure reference counting isn't broken
+ QGLContextPrivate::destroyGlSurfaceForPixmap(pd);
#endif
}
diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro
index 88abc78..d21c524 100644
--- a/src/s60installs/s60installs.pro
+++ b/src/s60installs/s60installs.pro
@@ -19,6 +19,7 @@ symbian: {
QtXml.dll \
QtGui.dll \
QtNetwork.dll \
+ QtScript.dll \
QtTest.dll \
QtSql.dll
@@ -93,6 +94,10 @@ symbian: {
qtlibraries.sources += Phonon.dll
}
+ contains(QT_CONFIG, webkit): {
+ qtlibraries.sources += QtWebKit.dll
+ }
+
graphicssystems_plugins.path = $$QT_PLUGINS_BASE_DIR/graphicssystems
contains(QT_CONFIG, openvg) {
qtlibraries.sources = QtOpenVG.dll
diff --git a/src/scripttools/debugging/qscriptbreakpointsmodel.cpp b/src/scripttools/debugging/qscriptbreakpointsmodel.cpp
index 82a7c6a..40acebb 100644
--- a/src/scripttools/debugging/qscriptbreakpointsmodel.cpp
+++ b/src/scripttools/debugging/qscriptbreakpointsmodel.cpp
@@ -47,6 +47,7 @@
#include "private/qabstractitemmodel_p.h"
#include <QtCore/qpair.h>
+#include <QtCore/qcoreapplication.h>
#include <QtGui/qicon.h>
#include <QtCore/qdebug.h>
@@ -451,17 +452,17 @@ QVariant QScriptBreakpointsModel::headerData(int section, Qt::Orientation orient
if (orient == Qt::Horizontal) {
if (role == Qt::DisplayRole) {
if (section == 0)
- return QObject::tr("ID");
+ return QCoreApplication::translate("QScriptBreakpointsModel", "ID");
else if (section == 1)
- return QObject::tr("Location");
+ return QCoreApplication::translate("QScriptBreakpointsModel", "Location");
else if (section == 2)
- return QObject::tr("Condition");
+ return QCoreApplication::translate("QScriptBreakpointsModel", "Condition");
else if (section == 3)
- return QObject::tr("Ignore-count");
+ return QCoreApplication::translate("QScriptBreakpointsModel", "Ignore-count");
else if (section == 4)
- return QObject::tr("Single-shot");
+ return QCoreApplication::translate("QScriptBreakpointsModel", "Single-shot");
else if (section == 5)
- return QObject::tr("Hit-count");
+ return QCoreApplication::translate("QScriptBreakpointsModel", "Hit-count");
}
}
return QVariant();
diff --git a/src/scripttools/debugging/qscriptbreakpointswidget.cpp b/src/scripttools/debugging/qscriptbreakpointswidget.cpp
index 356c6d5..688c7c8 100644
--- a/src/scripttools/debugging/qscriptbreakpointswidget.cpp
+++ b/src/scripttools/debugging/qscriptbreakpointswidget.cpp
@@ -78,7 +78,7 @@ public:
toolClose = new QToolButton(this);
toolClose->setIcon(QIcon(QString::fromUtf8(":/qt/scripttools/debugging/images/%1/closetab.png").arg(system)));
toolClose->setAutoRaise(true);
- toolClose->setText(QObject::tr("Close"));
+ toolClose->setText(tr("Close"));
hboxLayout->addWidget(toolClose);
fileNameEdit = new QLineEdit();
@@ -295,13 +295,13 @@ QScriptBreakpointsWidget::QScriptBreakpointsWidget(QWidget *parent)
QIcon newBreakpointIcon;
newBreakpointIcon.addPixmap(d->pixmap(QString::fromLatin1("new.png")), QIcon::Normal);
- QAction *newBreakpointAction = new QAction(newBreakpointIcon, QObject::tr("New"), this);
+ QAction *newBreakpointAction = new QAction(newBreakpointIcon, tr("New"), this);
QObject::connect(newBreakpointAction, SIGNAL(triggered()),
this, SLOT(_q_newBreakpoint()));
QIcon deleteBreakpointIcon;
deleteBreakpointIcon.addPixmap(d->pixmap(QString::fromLatin1("delete.png")), QIcon::Normal);
- d->deleteBreakpointAction = new QAction(deleteBreakpointIcon, QObject::tr("Delete"), this);
+ d->deleteBreakpointAction = new QAction(deleteBreakpointIcon, tr("Delete"), this);
d->deleteBreakpointAction->setEnabled(false);
QObject::connect(d->deleteBreakpointAction, SIGNAL(triggered()),
this, SLOT(_q_deleteBreakpoint()));
diff --git a/src/scripttools/debugging/qscriptdebugger.cpp b/src/scripttools/debugging/qscriptdebugger.cpp
index c09e494..58d707f 100644
--- a/src/scripttools/debugging/qscriptdebugger.cpp
+++ b/src/scripttools/debugging/qscriptdebugger.cpp
@@ -882,8 +882,8 @@ void QScriptDebuggerPrivate::_q_goToLine()
if (!view)
return;
bool ok = false;
- int lineNumber = QInputDialog::getInteger(0, QObject::tr("Go to Line"),
- QObject::tr("Line:"),
+ int lineNumber = QInputDialog::getInteger(0, QScriptDebugger::tr("Go to Line"),
+ QScriptDebugger::tr("Line:"),
view->cursorLineNumber(),
1, INT_MAX, 1, &ok);
if (ok)
@@ -1674,9 +1674,9 @@ QAction *QScriptDebugger::interruptAction(QObject *parent) const
interruptIcon.addPixmap(d->pixmap(QString::fromLatin1("interrupt.png")), QIcon::Normal);
interruptIcon.addPixmap(d->pixmap(QString::fromLatin1("d_interrupt.png")), QIcon::Disabled);
QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
- that->d_func()->interruptAction = new QAction(interruptIcon, QObject::tr("Interrupt"), parent);
+ that->d_func()->interruptAction = new QAction(interruptIcon, QScriptDebugger::tr("Interrupt"), parent);
d->interruptAction->setEnabled(!d->interactive);
- d->interruptAction->setShortcut(QObject::tr("Shift+F5"));
+ d->interruptAction->setShortcut(QScriptDebugger::tr("Shift+F5"));
QObject::connect(d->interruptAction, SIGNAL(triggered()),
that, SLOT(_q_interrupt()));
}
@@ -1691,9 +1691,9 @@ QAction *QScriptDebugger::continueAction(QObject *parent) const
continueIcon.addPixmap(d->pixmap(QString::fromLatin1("play.png")), QIcon::Normal);
continueIcon.addPixmap(d->pixmap(QString::fromLatin1("d_play.png")), QIcon::Disabled);
QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
- that->d_func()->continueAction = new QAction(continueIcon, QObject::tr("Continue"), parent);
+ that->d_func()->continueAction = new QAction(continueIcon, QScriptDebugger::tr("Continue"), parent);
d->continueAction->setEnabled(d->interactive);
- d->continueAction->setShortcut(QObject::tr("F5"));
+ d->continueAction->setShortcut(QScriptDebugger::tr("F5"));
QObject::connect(d->continueAction, SIGNAL(triggered()),
that, SLOT(_q_continue()));
}
@@ -1708,9 +1708,9 @@ QAction *QScriptDebugger::stepIntoAction(QObject *parent) const
stepIntoIcon.addPixmap(d->pixmap(QString::fromLatin1("stepinto.png")), QIcon::Normal);
stepIntoIcon.addPixmap(d->pixmap(QString::fromLatin1("d_stepinto.png")), QIcon::Disabled);
QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
- that->d_func()->stepIntoAction = new QAction(stepIntoIcon, QObject::tr("Step Into"), parent);
+ that->d_func()->stepIntoAction = new QAction(stepIntoIcon, QScriptDebugger::tr("Step Into"), parent);
d->stepIntoAction->setEnabled(d->interactive);
- d->stepIntoAction->setShortcut(QObject::tr("F11"));
+ d->stepIntoAction->setShortcut(QScriptDebugger::tr("F11"));
QObject::connect(d->stepIntoAction, SIGNAL(triggered()),
that, SLOT(_q_stepInto()));
}
@@ -1725,9 +1725,9 @@ QAction *QScriptDebugger::stepOverAction(QObject *parent) const
stepOverIcon.addPixmap(d->pixmap(QString::fromLatin1("stepover.png")), QIcon::Normal);
stepOverIcon.addPixmap(d->pixmap(QString::fromLatin1("d_stepover.png")), QIcon::Disabled);
QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
- that->d_func()->stepOverAction = new QAction(stepOverIcon, QObject::tr("Step Over"), parent);
+ that->d_func()->stepOverAction = new QAction(stepOverIcon, QScriptDebugger::tr("Step Over"), parent);
d->stepOverAction->setEnabled(d->interactive);
- d->stepOverAction->setShortcut(QObject::tr("F10"));
+ d->stepOverAction->setShortcut(QScriptDebugger::tr("F10"));
QObject::connect(d->stepOverAction, SIGNAL(triggered()),
that, SLOT(_q_stepOver()));
}
@@ -1742,9 +1742,9 @@ QAction *QScriptDebugger::stepOutAction(QObject *parent) const
stepOutIcon.addPixmap(d->pixmap(QString::fromLatin1("stepout.png")), QIcon::Normal);
stepOutIcon.addPixmap(d->pixmap(QString::fromLatin1("d_stepout.png")), QIcon::Disabled);
QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
- that->d_func()->stepOutAction = new QAction(stepOutIcon, QObject::tr("Step Out"), parent);
+ that->d_func()->stepOutAction = new QAction(stepOutIcon, QScriptDebugger::tr("Step Out"), parent);
d->stepOutAction->setEnabled(d->interactive);
- d->stepOutAction->setShortcut(QObject::tr("Shift+F11"));
+ d->stepOutAction->setShortcut(QScriptDebugger::tr("Shift+F11"));
QObject::connect(d->stepOutAction, SIGNAL(triggered()),
that, SLOT(_q_stepOut()));
}
@@ -1759,9 +1759,9 @@ QAction *QScriptDebugger::runToCursorAction(QObject *parent) const
runToCursorIcon.addPixmap(d->pixmap(QString::fromLatin1("runtocursor.png")), QIcon::Normal);
runToCursorIcon.addPixmap(d->pixmap(QString::fromLatin1("d_runtocursor.png")), QIcon::Disabled);
QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
- that->d_func()->runToCursorAction = new QAction(runToCursorIcon, QObject::tr("Run to Cursor"), parent);
+ that->d_func()->runToCursorAction = new QAction(runToCursorIcon, QScriptDebugger::tr("Run to Cursor"), parent);
d->runToCursorAction->setEnabled(d->interactive);
- d->runToCursorAction->setShortcut(QObject::tr("Ctrl+F10"));
+ d->runToCursorAction->setShortcut(QScriptDebugger::tr("Ctrl+F10"));
QObject::connect(d->runToCursorAction, SIGNAL(triggered()),
that, SLOT(_q_runToCursor()));
}
@@ -1777,7 +1777,7 @@ QAction *QScriptDebugger::runToNewScriptAction(QObject *parent) const
runToNewScriptIcon.addPixmap(d->pixmap(QString::fromLatin1("d_breakonscriptload.png")), QIcon::Disabled);
QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
that->d_func()->runToNewScriptAction = new QAction(runToNewScriptIcon,
- QObject::tr("Run to New Script"), parent);
+ QScriptDebugger::tr("Run to New Script"), parent);
d->runToNewScriptAction->setEnabled(d->interactive);
QObject::connect(d->runToNewScriptAction, SIGNAL(triggered()),
that, SLOT(_q_runToNewScript()));
@@ -1792,8 +1792,8 @@ QAction *QScriptDebugger::toggleBreakpointAction(QObject *parent) const
QIcon toggleBreakpointIcon;
QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
that->d_func()->toggleBreakpointAction = new QAction(toggleBreakpointIcon,
- QObject::tr("Toggle Breakpoint"), parent);
- d->toggleBreakpointAction->setShortcut(QObject::tr("F9"));
+ QScriptDebugger::tr("Toggle Breakpoint"), parent);
+ d->toggleBreakpointAction->setShortcut(QScriptDebugger::tr("F9"));
d->toggleBreakpointAction->setEnabled((d->codeWidget != 0) && (d->codeWidget->currentView() != 0));
QObject::connect(d->toggleBreakpointAction, SIGNAL(triggered()),
that, SLOT(_q_toggleBreakpoint()));
@@ -1807,7 +1807,7 @@ QAction *QScriptDebugger::clearDebugOutputAction(QObject *parent) const
if (!d->clearDebugOutputAction) {
QIcon clearDebugOutputIcon;
QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
- that->d_func()->clearDebugOutputAction = new QAction(clearDebugOutputIcon, QObject::tr("Clear Debug Output"), parent);
+ that->d_func()->clearDebugOutputAction = new QAction(clearDebugOutputIcon, QScriptDebugger::tr("Clear Debug Output"), parent);
QObject::connect(d->clearDebugOutputAction, SIGNAL(triggered()),
that, SLOT(_q_clearDebugOutput()));
}
@@ -1820,7 +1820,7 @@ QAction *QScriptDebugger::clearErrorLogAction(QObject *parent) const
if (!d->clearErrorLogAction) {
QIcon clearErrorLogIcon;
QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
- that->d_func()->clearErrorLogAction = new QAction(clearErrorLogIcon, QObject::tr("Clear Error Log"), parent);
+ that->d_func()->clearErrorLogAction = new QAction(clearErrorLogIcon, QScriptDebugger::tr("Clear Error Log"), parent);
QObject::connect(d->clearErrorLogAction, SIGNAL(triggered()),
that, SLOT(_q_clearErrorLog()));
}
@@ -1833,7 +1833,7 @@ QAction *QScriptDebugger::clearConsoleAction(QObject *parent) const
if (!d->clearConsoleAction) {
QIcon clearConsoleIcon;
QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
- that->d_func()->clearConsoleAction = new QAction(clearConsoleIcon, QObject::tr("Clear Console"), parent);
+ that->d_func()->clearConsoleAction = new QAction(clearConsoleIcon, QScriptDebugger::tr("Clear Console"), parent);
QObject::connect(d->clearConsoleAction, SIGNAL(triggered()),
that, SLOT(_q_clearConsole()));
}
@@ -1847,8 +1847,8 @@ QAction *QScriptDebugger::findInScriptAction(QObject *parent) const
QIcon findInScriptIcon;
findInScriptIcon.addPixmap(d->pixmap(QString::fromLatin1("find.png")), QIcon::Normal);
QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
- that->d_func()->findInScriptAction = new QAction(findInScriptIcon, QObject::tr("&Find in Script..."), parent);
- d->findInScriptAction->setShortcut(QObject::tr("Ctrl+F"));
+ that->d_func()->findInScriptAction = new QAction(findInScriptIcon, QScriptDebugger::tr("&Find in Script..."), parent);
+ d->findInScriptAction->setShortcut(QScriptDebugger::tr("Ctrl+F"));
d->findInScriptAction->setEnabled(
(d->codeFinderWidget != 0)
&& (d->codeWidget != 0)
@@ -1865,9 +1865,9 @@ QAction *QScriptDebugger::findNextInScriptAction(QObject *parent) const
if (!d->findNextInScriptAction) {
QIcon findNextInScriptIcon;
QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
- that->d_func()->findNextInScriptAction = new QAction(findNextInScriptIcon, QObject::tr("Find &Next"), parent);
+ that->d_func()->findNextInScriptAction = new QAction(findNextInScriptIcon, QScriptDebugger::tr("Find &Next"), parent);
d->findNextInScriptAction->setEnabled(d->codeFinderWidget && !d->codeFinderWidget->text().isEmpty());
- d->findNextInScriptAction->setShortcut(QObject::tr("F3"));
+ d->findNextInScriptAction->setShortcut(QScriptDebugger::tr("F3"));
QObject::connect(d->findNextInScriptAction, SIGNAL(triggered()),
that, SLOT(_q_findNextInScript()));
}
@@ -1880,9 +1880,9 @@ QAction *QScriptDebugger::findPreviousInScriptAction(QObject *parent) const
if (!d->findPreviousInScriptAction) {
QIcon findPreviousInScriptIcon;
QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
- that->d_func()->findPreviousInScriptAction = new QAction(findPreviousInScriptIcon, QObject::tr("Find &Previous"), parent);
+ that->d_func()->findPreviousInScriptAction = new QAction(findPreviousInScriptIcon, QScriptDebugger::tr("Find &Previous"), parent);
d->findPreviousInScriptAction->setEnabled(d->codeFinderWidget && !d->codeFinderWidget->text().isEmpty());
- d->findPreviousInScriptAction->setShortcut(QObject::tr("Shift+F3"));
+ d->findPreviousInScriptAction->setShortcut(QScriptDebugger::tr("Shift+F3"));
QObject::connect(d->findPreviousInScriptAction, SIGNAL(triggered()),
that, SLOT(_q_findPreviousInScript()));
}
@@ -1895,8 +1895,8 @@ QAction *QScriptDebugger::goToLineAction(QObject *parent) const
if (!d->goToLineAction) {
QIcon goToLineIcon;
QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
- that->d_func()->goToLineAction = new QAction(goToLineIcon, QObject::tr("Go to Line"), parent);
- d->goToLineAction->setShortcut(QObject::tr("Ctrl+G"));
+ that->d_func()->goToLineAction = new QAction(goToLineIcon, QScriptDebugger::tr("Go to Line"), parent);
+ d->goToLineAction->setShortcut(QScriptDebugger::tr("Ctrl+G"));
d->goToLineAction->setEnabled((d->codeWidget != 0) && (d->codeWidget->currentView() != 0));
QObject::connect(d->goToLineAction, SIGNAL(triggered()),
that, SLOT(_q_goToLine()));
@@ -1907,7 +1907,7 @@ QAction *QScriptDebugger::goToLineAction(QObject *parent) const
QMenu *QScriptDebugger::createStandardMenu(QWidget *widgetParent, QObject *actionParent)
{
QMenu *menu = new QMenu(widgetParent);
- menu->setTitle(QObject::tr("Debug"));
+ menu->setTitle(QScriptDebugger::tr("Debug"));
menu->addAction(action(ContinueAction, actionParent));
menu->addAction(action(InterruptAction, actionParent));
menu->addAction(action(StepIntoAction, actionParent));
diff --git a/src/scripttools/debugging/qscriptdebuggercodefinderwidget.cpp b/src/scripttools/debugging/qscriptdebuggercodefinderwidget.cpp
index 5ef5a0c..8ed0aaa 100644
--- a/src/scripttools/debugging/qscriptdebuggercodefinderwidget.cpp
+++ b/src/scripttools/debugging/qscriptdebuggercodefinderwidget.cpp
@@ -138,7 +138,7 @@ QScriptDebuggerCodeFinderWidget::QScriptDebuggerCodeFinderWidget(QWidget *parent
d->toolClose = new QToolButton(this);
d->toolClose->setIcon(QIcon(QString::fromUtf8(":/qt/scripttools/debugging/images/%1/closetab.png").arg(system)));
d->toolClose->setAutoRaise(true);
- d->toolClose->setText(QObject::tr("Close"));
+ d->toolClose->setText(tr("Close"));
hboxLayout->addWidget(d->toolClose);
d->editFind = new QLineEdit(this);
diff --git a/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp b/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp
index 15d43f4..9caefce 100644
--- a/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp
+++ b/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp
@@ -53,6 +53,7 @@
#include "private/qabstractitemmodel_p.h"
#include <QtCore/qdebug.h>
+#include <QtCore/qcoreapplication.h>
#include <QtGui/qbrush.h>
#include <QtGui/qfont.h>
@@ -868,9 +869,9 @@ QVariant QScriptDebuggerLocalsModel::headerData(int section, Qt::Orientation ori
if (orient == Qt::Horizontal) {
if (role == Qt::DisplayRole) {
if (section == 0)
- return QObject::tr("Name");
+ return QCoreApplication::translate("QScriptDebuggerLocalsModel", "Name");
else if (section == 1)
- return QObject::tr("Value");
+ return QCoreApplication::translate("QScriptDebuggerLocalsModel", "Value");
}
}
return QVariant();
diff --git a/src/scripttools/debugging/qscriptdebuggerstackmodel.cpp b/src/scripttools/debugging/qscriptdebuggerstackmodel.cpp
index a63ea73..2d56e17 100644
--- a/src/scripttools/debugging/qscriptdebuggerstackmodel.cpp
+++ b/src/scripttools/debugging/qscriptdebuggerstackmodel.cpp
@@ -45,6 +45,7 @@
#include <QtScript/qscriptcontextinfo.h>
#include <QtCore/qfileinfo.h>
+#include <QtCore/qcoreapplication.h>
QT_BEGIN_NAMESPACE
@@ -157,11 +158,11 @@ QVariant QScriptDebuggerStackModel::headerData(int section, Qt::Orientation orie
return QVariant();
if (role == Qt::DisplayRole) {
if (section == 0)
- return QObject::tr("Level");
+ return QCoreApplication::translate("QScriptDebuggerStackModel", "Level");
else if (section == 1)
- return QObject::tr("Name");
+ return QCoreApplication::translate("QScriptDebuggerStackModel", "Name");
else if (section == 2)
- return QObject::tr("Location");
+ return QCoreApplication::translate("QScriptDebuggerStackModel", "Location");
}
return QVariant();
}
diff --git a/src/scripttools/debugging/qscriptedit.cpp b/src/scripttools/debugging/qscriptedit.cpp
index 8db9cea..7f0a5e0 100644
--- a/src/scripttools/debugging/qscriptedit.cpp
+++ b/src/scripttools/debugging/qscriptedit.cpp
@@ -408,14 +408,14 @@ void QScriptEdit::extraAreaMouseEvent(QMouseEvent *e)
return;
bool has = m_breakpoints.contains(lineNumber);
QMenu *popup = new QMenu();
- QAction *toggleAct = new QAction(QObject::tr("Toggle Breakpoint"), popup);
+ QAction *toggleAct = new QAction(tr("Toggle Breakpoint"), popup);
popup->addAction(toggleAct);
- QAction *disableAct = new QAction(QObject::tr("Disable Breakpoint"), popup);
- QAction *enableAct = new QAction(QObject::tr("Enable Breakpoint"), popup);
+ QAction *disableAct = new QAction(tr("Disable Breakpoint"), popup);
+ QAction *enableAct = new QAction(tr("Enable Breakpoint"), popup);
QWidget *conditionWidget = new QWidget();
{
QHBoxLayout *hbox = new QHBoxLayout(conditionWidget);
- hbox->addWidget(new QLabel(QObject::tr("Breakpoint Condition:")));
+ hbox->addWidget(new QLabel(tr("Breakpoint Condition:")));
hbox->addWidget(new QLineEdit());
}
// QWidgetAction *conditionAct = new QWidgetAction(popup);
diff --git a/src/scripttools/debugging/qscriptenginedebugger.cpp b/src/scripttools/debugging/qscriptenginedebugger.cpp
index 7456da0..915d511 100644
--- a/src/scripttools/debugging/qscriptenginedebugger.cpp
+++ b/src/scripttools/debugging/qscriptenginedebugger.cpp
@@ -520,43 +520,43 @@ QMainWindow *QScriptEngineDebugger::standardWindow() const
QMainWindow *win = new QMainWindow();
QDockWidget *scriptsDock = new QDockWidget(win);
scriptsDock->setObjectName(QLatin1String("qtscriptdebugger_scriptsDockWidget"));
- scriptsDock->setWindowTitle(QObject::tr("Loaded Scripts"));
+ scriptsDock->setWindowTitle(tr("Loaded Scripts"));
scriptsDock->setWidget(widget(ScriptsWidget));
win->addDockWidget(Qt::LeftDockWidgetArea, scriptsDock);
QDockWidget *breakpointsDock = new QDockWidget(win);
breakpointsDock->setObjectName(QLatin1String("qtscriptdebugger_breakpointsDockWidget"));
- breakpointsDock->setWindowTitle(QObject::tr("Breakpoints"));
+ breakpointsDock->setWindowTitle(tr("Breakpoints"));
breakpointsDock->setWidget(widget(BreakpointsWidget));
win->addDockWidget(Qt::LeftDockWidgetArea, breakpointsDock);
QDockWidget *stackDock = new QDockWidget(win);
stackDock->setObjectName(QLatin1String("qtscriptdebugger_stackDockWidget"));
- stackDock->setWindowTitle(QObject::tr("Stack"));
+ stackDock->setWindowTitle(tr("Stack"));
stackDock->setWidget(widget(StackWidget));
win->addDockWidget(Qt::RightDockWidgetArea, stackDock);
QDockWidget *localsDock = new QDockWidget(win);
localsDock->setObjectName(QLatin1String("qtscriptdebugger_localsDockWidget"));
- localsDock->setWindowTitle(QObject::tr("Locals"));
+ localsDock->setWindowTitle(tr("Locals"));
localsDock->setWidget(widget(LocalsWidget));
win->addDockWidget(Qt::RightDockWidgetArea, localsDock);
QDockWidget *consoleDock = new QDockWidget(win);
consoleDock->setObjectName(QLatin1String("qtscriptdebugger_consoleDockWidget"));
- consoleDock->setWindowTitle(QObject::tr("Console"));
+ consoleDock->setWindowTitle(tr("Console"));
consoleDock->setWidget(widget(ConsoleWidget));
win->addDockWidget(Qt::BottomDockWidgetArea, consoleDock);
QDockWidget *debugOutputDock = new QDockWidget(win);
debugOutputDock->setObjectName(QLatin1String("qtscriptdebugger_debugOutputDockWidget"));
- debugOutputDock->setWindowTitle(QObject::tr("Debug Output"));
+ debugOutputDock->setWindowTitle(tr("Debug Output"));
debugOutputDock->setWidget(widget(DebugOutputWidget));
win->addDockWidget(Qt::BottomDockWidgetArea, debugOutputDock);
QDockWidget *errorLogDock = new QDockWidget(win);
errorLogDock->setObjectName(QLatin1String("qtscriptdebugger_errorLogDockWidget"));
- errorLogDock->setWindowTitle(QObject::tr("Error Log"));
+ errorLogDock->setWindowTitle(tr("Error Log"));
errorLogDock->setWidget(widget(ErrorLogWidget));
win->addDockWidget(Qt::BottomDockWidgetArea, errorLogDock);
@@ -568,14 +568,14 @@ QMainWindow *QScriptEngineDebugger::standardWindow() const
#ifndef QT_NO_MENUBAR
win->menuBar()->addMenu(that->createStandardMenu(win));
- QMenu *editMenu = win->menuBar()->addMenu(QObject::tr("Search"));
+ QMenu *editMenu = win->menuBar()->addMenu(tr("Search"));
editMenu->addAction(action(FindInScriptAction));
editMenu->addAction(action(FindNextInScriptAction));
editMenu->addAction(action(FindPreviousInScriptAction));
editMenu->addSeparator();
editMenu->addAction(action(GoToLineAction));
- QMenu *viewMenu = win->menuBar()->addMenu(QObject::tr("View"));
+ QMenu *viewMenu = win->menuBar()->addMenu(tr("View"));
viewMenu->addAction(scriptsDock->toggleViewAction());
viewMenu->addAction(breakpointsDock->toggleViewAction());
viewMenu->addAction(stackDock->toggleViewAction());
@@ -593,7 +593,7 @@ QMainWindow *QScriptEngineDebugger::standardWindow() const
widget(CodeFinderWidget)->hide();
win->setCentralWidget(central);
- win->setWindowTitle(QObject::tr("Qt Script Debugger"));
+ win->setWindowTitle(tr("Qt Script Debugger"));
win->setUnifiedTitleAndToolBarOnMac(true);
QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
diff --git a/src/testlib/qtestcoreelement.h b/src/testlib/qtestcoreelement.h
index e9691d5..b5e5d0f 100644
--- a/src/testlib/qtestcoreelement.h
+++ b/src/testlib/qtestcoreelement.h
@@ -93,9 +93,9 @@ void QTestCoreElement<ElementType>::addAttribute(const QTest::AttributeIndex att
if (attribute(attributeIndex))
return;
- QTestElementAttribute *attribute = new QTestElementAttribute;
- attribute->setPair(attributeIndex, value);
- attribute->addToList(&listOfAttributes);
+ QTestElementAttribute *testAttribute = new QTestElementAttribute;
+ testAttribute->setPair(attributeIndex, value);
+ testAttribute->addToList(&listOfAttributes);
}
template <class ElementType>
diff --git a/tests/auto/qactiongroup/tst_qactiongroup.cpp b/tests/auto/qactiongroup/tst_qactiongroup.cpp
index c290941..2d215a0 100644
--- a/tests/auto/qactiongroup/tst_qactiongroup.cpp
+++ b/tests/auto/qactiongroup/tst_qactiongroup.cpp
@@ -226,6 +226,14 @@ void tst_QActionGroup::separators()
mw.show();
+#ifdef QT_SOFTKEYS_ENABLED
+ // Softkeys add extra "Select" and "Back" actions to menu by default.
+ // Two first actions will be Select and Back when softkeys are enabled
+ int numSoftkeyActions = 2;
+#else
+ int numSoftkeyActions = 0;
+#endif
+
QAction *action = new QAction(&actGroup);
action->setText("test one");
@@ -237,13 +245,13 @@ void tst_QActionGroup::separators()
while (it.hasNext())
menu.addAction(it.next());
- QCOMPARE((int)menu.actions().size(), 2);
+ QCOMPARE((int)menu.actions().size(), 2 + numSoftkeyActions);
it = QListIterator<QAction*>(actGroup.actions());
while (it.hasNext())
menu.removeAction(it.next());
- QCOMPARE((int)menu.actions().size(), 0);
+ QCOMPARE((int)menu.actions().size(), 0 + numSoftkeyActions);
action = new QAction(&actGroup);
action->setText("test two");
@@ -252,7 +260,7 @@ void tst_QActionGroup::separators()
while (it.hasNext())
menu.addAction(it.next());
- QCOMPARE((int)menu.actions().size(), 3);
+ QCOMPARE((int)menu.actions().size(), 3 + numSoftkeyActions);
}
void tst_QActionGroup::testActionInTwoQActionGroup()
diff --git a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp
index a388f0a..63bc90c 100644
--- a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp
+++ b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp
@@ -823,7 +823,7 @@ void tst_QFileSystemModel::sort()
out2 << "The magic number is : " << 49 << " but i write some stuff in the file \n";
tempFile2.close();
- myModel->setRootPath(QDir::rootPath());
+ myModel->setRootPath("");
myModel->setFilter(QDir::AllEntries | QDir::System | QDir::Hidden);
tree->setSortingEnabled(true);
tree->setModel(myModel);
@@ -846,11 +846,22 @@ void tst_QFileSystemModel::sort()
tree->expand(myModel->index(dirPath, 0));
QTest::qWait(500);
QModelIndex parent = myModel->index(dirPath, 0);
+ QList<QString> expectedOrder;
+ expectedOrder << tempFile2.fileName() << tempFile.fileName() << dirPath + QChar('/') + "." << dirPath + QChar('/') + "..";
//File dialog Mode means sub trees are not sorted, only the current root
- if (fileDialogMode)
- QVERIFY(dirPath + QChar('/') + myModel->index(0, 1, parent).data(QFileSystemModel::FileNameRole).toString() != tempFile2.fileName());
- else
- QCOMPARE(dirPath + QChar('/') + myModel->index(0, 1, parent).data(QFileSystemModel::FileNameRole).toString(), tempFile2.fileName());
+ if (fileDialogMode) {
+ QList<QString> actualRows;
+ for(int i = 0; i < myModel->rowCount(parent); ++i)
+ {
+ actualRows << dirPath + QChar('/') + myModel->index(i, 1, parent).data(QFileSystemModel::FileNameRole).toString();
+ }
+ QVERIFY(actualRows != expectedOrder);
+ } else {
+ for(int i = 0; i < myModel->rowCount(parent); ++i)
+ {
+ QVERIFY(dirPath + QChar('/') + myModel->index(i, 1, parent).data(QFileSystemModel::FileNameRole).toString() == expectedOrder.at(i));
+ }
+ }
delete tree;
delete myModel;
diff --git a/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp b/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
index 2fee98d..9f13aca 100644
--- a/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
+++ b/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
@@ -40,9 +40,10 @@
****************************************************************************/
#include <QtTest/QtTest>
-#include <qgraphicsanchorlayout.h>
-#include <qgraphicswidget.h>
-#include <qgraphicsproxywidget.h>
+#include <QtGui/qgraphicsanchorlayout.h>
+#include <private/qgraphicsanchorlayout_p.h>
+#include <QtGui/qgraphicswidget.h>
+#include <QtGui/qgraphicsproxywidget.h>
#include <QtGui/qgraphicsview.h>
class tst_QGraphicsAnchorLayout : public QObject {
@@ -142,6 +143,11 @@ static bool checkReverseDirection(QGraphicsWidget *w)
return true;
}
+static bool layoutHasConflict(QGraphicsAnchorLayout *l)
+{
+ return QGraphicsAnchorLayoutPrivate::get(l)->hasConflicts();
+}
+
void tst_QGraphicsAnchorLayout::simple()
{
QGraphicsWidget *w1 = createItem();
@@ -154,8 +160,6 @@ void tst_QGraphicsAnchorLayout::simple()
QGraphicsWidget p;
p.setLayout(l);
- QVERIFY(l->hasConflicts() == false);
-
QCOMPARE(l->count(), 2);
}
@@ -185,8 +189,6 @@ void tst_QGraphicsAnchorLayout::simple_center()
setAnchor(l, b, Qt::AnchorBottom, c, Qt::AnchorTop, 0);
setAnchor(l, c, Qt::AnchorBottom, l, Qt::AnchorBottom, 0);
- QVERIFY(l->hasConflicts() == false);
-
QCOMPARE(l->count(), 3);
QGraphicsWidget *p = new QGraphicsWidget(0, Qt::Window);
@@ -234,8 +236,6 @@ void tst_QGraphicsAnchorLayout::simple_semifloat()
setAnchor(l, a, Qt::AnchorBottom, l, Qt::AnchorBottom, 0);
setAnchor(l, b, Qt::AnchorBottom, l, Qt::AnchorBottom, 0);
- QVERIFY(l->hasConflicts() == false);
-
QCOMPARE(l->count(), 4);
QGraphicsWidget *p = new QGraphicsWidget(0, Qt::Window);
@@ -296,7 +296,6 @@ void tst_QGraphicsAnchorLayout::layoutDirection()
view->show();
QCOMPARE(checkReverseDirection(p), true);
- QVERIFY(l->hasConflicts() == false);
delete p;
delete view;
@@ -340,8 +339,6 @@ void tst_QGraphicsAnchorLayout::diagonal()
l->addAnchor(e, Qt::AnchorRight, l, Qt::AnchorRight);
l->addAnchor(d, Qt::AnchorRight, e, Qt::AnchorLeft);
- QVERIFY(l->hasConflicts() == false);
-
QCOMPARE(l->count(), 5);
QGraphicsWidget p;
@@ -391,7 +388,7 @@ void tst_QGraphicsAnchorLayout::diagonal()
QCOMPARE(checkReverseDirection(&p), true);
c->setMinimumWidth(300);
- QVERIFY(l->hasConflicts());
+ QVERIFY(layoutHasConflict(l));
}
void tst_QGraphicsAnchorLayout::parallel()
@@ -484,8 +481,6 @@ void tst_QGraphicsAnchorLayout::parallel()
QCOMPARE(e->geometry(), QRectF(375, 400, 175, 100));
QCOMPARE(f->geometry(), QRectF(550, 500, 200, 100));
QCOMPARE(p.size(), layoutMaximumSize);
-
- QVERIFY(l->hasConflicts() == false);
}
void tst_QGraphicsAnchorLayout::parallel2()
@@ -510,7 +505,6 @@ void tst_QGraphicsAnchorLayout::parallel2()
l->addAnchor(l, Qt::AnchorLeft, b, Qt::AnchorLeft);
l->addAnchor(b, Qt::AnchorRight, a, Qt::AnchorRight);
- QVERIFY(l->hasConflicts() == false);
QCOMPARE(l->count(), 2);
QGraphicsWidget p;
@@ -592,8 +586,6 @@ void tst_QGraphicsAnchorLayout::snake()
QCOMPARE(b->geometry(), QRectF(90.0, 100.0, 10.0, 100.0));
QCOMPARE(c->geometry(), QRectF(90.0, 200.0, 100.0, 100.0));
QCOMPARE(p.size(), layoutMaximumSize);
-
- QVERIFY(l->hasConflicts() == false);
}
void tst_QGraphicsAnchorLayout::snakeOppositeDirections()
@@ -627,7 +619,6 @@ void tst_QGraphicsAnchorLayout::snakeOppositeDirections()
l->addAnchor(c, Qt::AnchorRight, l, Qt::AnchorRight);
- QVERIFY(l->hasConflicts() == false);
QCOMPARE(l->count(), 3);
QGraphicsWidget p;
@@ -731,8 +722,6 @@ void tst_QGraphicsAnchorLayout::fairDistribution()
QCOMPARE(c->geometry(), QRectF(200.0, 200.0, 100.0, 100.0));
QCOMPARE(d->geometry(), QRectF(0.0, 300.0, 300.0, 100.0));
QCOMPARE(p.size(), layoutMaximumSize);
-
- QVERIFY(l->hasConflicts() == false);
}
void tst_QGraphicsAnchorLayout::fairDistributionOppositeDirections()
@@ -809,8 +798,6 @@ void tst_QGraphicsAnchorLayout::fairDistributionOppositeDirections()
QCOMPARE(a->size(), d->size());
QCOMPARE(e->size().width(), 4 * a->size().width());
QCOMPARE(p.size(), layoutMaximumSize);
-
- QVERIFY(l->hasConflicts() == false);
}
void tst_QGraphicsAnchorLayout::proportionalPreferred()
@@ -873,8 +860,6 @@ void tst_QGraphicsAnchorLayout::proportionalPreferred()
QCOMPARE(a->size().width(), 10 * factor);
QCOMPARE(c->size().width(), 14 * factor);
QCOMPARE(p.size(), QSizeF(12, 400));
-
- QVERIFY(l->hasConflicts() == false);
}
void tst_QGraphicsAnchorLayout::example()
@@ -928,7 +913,6 @@ void tst_QGraphicsAnchorLayout::example()
l->addAnchor(l, Qt::AnchorLeft, g, Qt::AnchorLeft);
l->addAnchor(f, Qt::AnchorRight, g, Qt::AnchorRight);
- QVERIFY(l->hasConflicts() == false);
QCOMPARE(l->count(), 7);
QGraphicsWidget p;
@@ -1017,8 +1001,6 @@ void tst_QGraphicsAnchorLayout::setSpacing()
QCOMPARE(b->geometry(), QRectF(24, 0, 20, 20));
QCOMPARE(c->geometry(), QRectF(0, 20, 44, 20));
- QVERIFY(l->hasConflicts() == false);
-
delete p;
delete view;
}
@@ -1103,7 +1085,6 @@ void tst_QGraphicsAnchorLayout::hardComplexS60()
QSizeF layoutMaximumSize = l->effectiveSizeHint(Qt::MaximumSize);
QCOMPARE(layoutMaximumSize, QSizeF(240, 40));
- QVERIFY(l->hasConflicts() == false);
delete p;
}
@@ -1166,7 +1147,6 @@ void tst_QGraphicsAnchorLayout::delete_anchor()
QGraphicsWidget *p = new QGraphicsWidget;
p->setLayout(l);
- QVERIFY(l->hasConflicts() == false);
QCOMPARE(l->count(), 3);
scene.addItem(p);
@@ -1281,6 +1261,12 @@ void tst_QGraphicsAnchorLayout::sizePolicy()
delete view;
}
+/*!
+ \internal
+
+ Uses private API. (We have decided to pull hasConflicts() out of the API). However, it also
+ tests some tight conditions (almost-in-conflict) that we really want to test.
+*/
void tst_QGraphicsAnchorLayout::conflicts()
{
QGraphicsWidget *a = createItem(QSizeF(80,10), QSizeF(90,10), QSizeF(100,10), "a");
@@ -1311,13 +1297,13 @@ void tst_QGraphicsAnchorLayout::conflicts()
p->setLayout(l);
- QCOMPARE(l->hasConflicts(), true);
+ QCOMPARE(layoutHasConflict(l), true);
a->setMinimumSize(QSizeF(29,10));
- QCOMPARE(l->hasConflicts(), false);
+ QCOMPARE(layoutHasConflict(l), false);
a->setMinimumSize(QSizeF(30,10));
- QCOMPARE(l->hasConflicts(), false);
+ QCOMPARE(layoutHasConflict(l), false);
delete p;
}
diff --git a/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp b/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
index a6746db..a521b78 100644
--- a/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
+++ b/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
@@ -43,7 +43,8 @@
#include <QtTest/QtTest>
#include <QTest>
#include <QMetaType>
-#include <QGraphicsAnchorLayout>
+#include <QtGui/qgraphicsanchorlayout.h>
+#include <private/qgraphicsanchorlayout_p.h>
#define TEST_COMPLEX_CASES
@@ -60,7 +61,7 @@ public:
bool isValid()
{
- return !hasConflicts();
+ return !QGraphicsAnchorLayoutPrivate::get(this)->hasConflicts();
}
void setAnchor(
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index 956faa1..d08e74b 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -62,7 +62,6 @@
#include "../../shared/util.h"
-
//TESTED_CLASS=
//TESTED_FILES=
@@ -307,6 +306,7 @@ private slots:
void task240400_clickOnTextItem();
void task243707_addChildBeforeParent();
void task197802_childrenVisibility();
+ void QTBUG_4233_updateCachedWithSceneRect();
private:
QList<QGraphicsItem *> paintedItems;
@@ -8463,5 +8463,34 @@ void tst_QGraphicsItem::stackBefore()
QCOMPARE(scene.items(QPointF(2, 2), Qt::IntersectsItemBoundingRect, Qt::AscendingOrder), (QList<QGraphicsItem *>() << child2 << child4 << child3 << child1));
}
+void tst_QGraphicsItem::QTBUG_4233_updateCachedWithSceneRect()
+{
+ EventTester *tester = new EventTester;
+ tester->setCacheMode(QGraphicsItem::ItemCoordinateCache);
+
+ QGraphicsScene scene;
+ scene.addItem(tester);
+ scene.setSceneRect(-100, -100, 200, 200); // contains the tester item
+
+ QGraphicsView view(&scene);
+ view.show();
+ QTRY_COMPARE(QApplication::activeWindow(), (QWidget *)&view);
+
+ QCOMPARE(tester->repaints, 1);
+
+ scene.update(); // triggers "updateAll" optimization
+ qApp->processEvents();
+ qApp->processEvents(); // in 4.6 only one processEvents is necessary
+
+ QCOMPARE(tester->repaints, 1);
+
+ scene.update(); // triggers "updateAll" optimization
+ tester->update();
+ qApp->processEvents();
+ qApp->processEvents(); // in 4.6 only one processEvents is necessary
+
+ QCOMPARE(tester->repaints, 2);
+}
+
QTEST_MAIN(tst_QGraphicsItem)
#include "tst_qgraphicsitem.moc"
diff --git a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
index 9045acf..b6750ea 100644
--- a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
+++ b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
@@ -824,7 +824,8 @@ void tst_QGraphicsWidget::initStyleOption()
if (underMouse) {
view.resize(300, 300);
view.show();
- QTest::qWait(125);
+ QTest::qWaitForWindowShown(&view);
+ QTest::qWait(20);
sendMouseMove(view.viewport(), view.mapFromScene(widget->mapToScene(widget->boundingRect().center())));
}
@@ -877,7 +878,7 @@ void tst_QGraphicsWidget::layout()
}
widget.setLayout(layout);
- QTest::qWait(250);
+ QTest::qWait(25);
QCOMPARE(widget.layout(), static_cast<QGraphicsLayout*>(layout));
for (int i = 0; i < children.count(); ++i) {
@@ -917,13 +918,13 @@ void tst_QGraphicsWidget::layoutDirection()
widget.setLayoutDirection(layoutDirection);
QCOMPARE(widget.testAttribute(Qt::WA_SetLayoutDirection), true);
view->show();
- QTest::qWait(100);
+ QTest::qWaitForWindowShown(view);
for (int i = 0; i < children.count(); ++i) {
QCOMPARE(children[i]->layoutDirection(), layoutDirection);
QCOMPARE(children[i]->testAttribute(Qt::WA_SetLayoutDirection), false);
view->repaint();
- QTest::qWait(200);
- QCOMPARE(children[i]->m_painterLayoutDirection, layoutDirection);
+ QApplication::processEvents();
+ QTRY_COMPARE(children[i]->m_painterLayoutDirection, layoutDirection);
}
delete view;
}
@@ -1156,8 +1157,8 @@ void tst_QGraphicsWidget::setTabOrder()
if (!children.isEmpty()) {
QGraphicsWidget *first = children.first();
view.viewport()->setFocus();
- QTest::qWait(250);
- QVERIFY(view.viewport()->hasFocus());
+ QApplication::processEvents();
+ QTRY_VERIFY(view.viewport()->hasFocus());
first->setFocus();
QVERIFY(first->hasFocus());
QVERIFY(scene.hasFocus());
@@ -1198,11 +1199,8 @@ void tst_QGraphicsWidget::setTabOrderAndReparent()
QGraphicsScene scene;
QGraphicsView view(&scene);
view.show();
-#ifdef Q_WS_X11
- qt_x11_wait_for_window_manager(&view);
-#endif
QApplication::setActiveWindow(&view);
- QTest::qWait(25);
+ QTest::qWaitForWindowShown(&view);
QTRY_COMPARE(QApplication::activeWindow(), &view);
int i;
@@ -1341,11 +1339,8 @@ void tst_QGraphicsWidget::verifyFocusChain()
QGraphicsScene scene;
QGraphicsView view(&scene);
view.show();
-#ifdef Q_WS_X11
- qt_x11_wait_for_window_manager(&view);
-#endif
QApplication::setActiveWindow(&view);
- QTest::qWait(25);
+ QTest::qWaitForWindowShown(&view);
QTRY_COMPARE(QApplication::activeWindow(), &view);
{
@@ -1419,39 +1414,38 @@ void tst_QGraphicsWidget::verifyFocusChain()
w1_2->setFocusPolicy(Qt::StrongFocus);
scene.addItem(w1_2);
window->show();
-#ifdef Q_WS_X11
- qt_x11_wait_for_window_manager(window);
-#endif
+ QApplication::setActiveWindow(window);
+ QTest::qWaitForWindowShown(window);
lineEdit->setFocus();
- QTest::qWait(250);
- QVERIFY(lineEdit->hasFocus());
+ QTest::qWait(25);
+ QTRY_VERIFY(lineEdit->hasFocus());
QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab);
- QTest::qWait(250);
- QVERIFY(w1_1->hasFocus());
+ QTest::qWait(25);
+ QTRY_VERIFY(w1_1->hasFocus());
QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab);
- QTest::qWait(250);
- QVERIFY(w1_2->hasFocus());
+ QTest::qWait(25);
+ QTRY_VERIFY(w1_2->hasFocus());
// remove the tabFocusFirst and insert new item
delete w1_1; // calls _q_removeItemLater
- QTest::qWait(250);
+ QTest::qWait(25);
SubQGraphicsWidget *w1_3 = new SubQGraphicsWidget;
w1_3->setFocusPolicy(Qt::StrongFocus);
w1_3->setData(0, "w1_3");
w1_3->setGeometry(50,0,25, 25);
scene.addItem(w1_3);
- QVERIFY(w1_2->hasFocus());
+ QTRY_VERIFY(w1_2->hasFocus());
QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab);
- QTest::qWait(250);
- QVERIFY(lineEdit->hasFocus());
+ QTest::qWait(25);
+ QTRY_VERIFY(lineEdit->hasFocus());
// tabFocusFirst should now point to w1_2
QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab);
- QTest::qWait(250);
- QVERIFY(w1_2->hasFocus());
+ QTest::qWait(25);
+ QTRY_VERIFY(w1_2->hasFocus());
QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab);
- QTest::qWait(250);
- QVERIFY(w1_3->hasFocus());
+ QTest::qWait(25);
+ QTRY_VERIFY(w1_3->hasFocus());
scene.removeItem(w1_2); // does not call _q_removeItemLater
delete w1_2; // calls _q_removeItemLater
@@ -1460,18 +1454,18 @@ void tst_QGraphicsWidget::verifyFocusChain()
w1_4->setData(0, "w1_4");
w1_4->setGeometry(75,0,25, 25);
scene.addItem(w1_4);
- QVERIFY(w1_3->hasFocus());
- QTest::qWait(250);
+ QTRY_VERIFY(w1_3->hasFocus());
+ QTest::qWait(25);
QVERIFY(compareFocusChain(view, QList<QGraphicsItem*>() << w1_3 << w1_4));
QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab);
- QTest::qWait(250);
- QVERIFY(lineEdit->hasFocus());
+ QTest::qWait(25);
+ QTRY_VERIFY(lineEdit->hasFocus());
// tabFocusFirst should now point to w1_3
QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab);
- QTest::qWait(250);
- QVERIFY(w1_3->hasFocus());
- QTest::qWait(250);
- QVERIFY(compareFocusChain(view, QList<QGraphicsItem*>() << w1_3 << w1_4));
+ QTest::qWait(25);
+ QTRY_VERIFY(w1_3->hasFocus());
+ QTest::qWait(25);
+ QTRY_VERIFY(compareFocusChain(view, QList<QGraphicsItem*>() << w1_3 << w1_4));
delete window;
}
}
@@ -2353,9 +2347,7 @@ void tst_QGraphicsWidget::painterStateProtectionOnWindowFrame()
QGraphicsView view(&scene);
scene.addItem(widget);
view.show();
-#ifdef Q_WS_X11
- qt_x11_wait_for_window_manager(&view);
-#endif
+ QTest::qWaitForWindowShown(&view);
QTest::qWait(500);
}
@@ -2561,14 +2553,11 @@ void tst_QGraphicsWidget::ensureClipping()
QGraphicsView view(&scene);
view.setOptimizationFlag(QGraphicsView::IndirectPainting);
view.show();
-#ifdef Q_WS_X11
- qt_x11_wait_for_window_manager(&view);
-#endif
- QTest::qWait(250);
+ QTest::qWaitForWindowShown(&view);
QList<QGraphicsItem *> expected;
expected << clipWidget << childWidget << childitem;
- QVERIFY(scene.drawnItems.contains(clipWidget));
+ QTRY_VERIFY(scene.drawnItems.contains(clipWidget));
QVERIFY(scene.drawnItems.contains(childWidget));
QVERIFY(scene.drawnItems.contains(childitem));
}
@@ -2630,11 +2619,12 @@ void tst_QGraphicsWidget::respectHFW()
view->show();
window->setGeometry(0, 0, 70, 70);
+ QTest::qWaitForWindowShown(view);
{ // here we go - simulate a interactive resize of the window
- QTest::qWait(200);
+ QTest::qWait(100);
QTest::mouseMove(view, view->mapFromScene(71, 71)); // bottom right corner
- QTest::qWait(200);
+ QTest::qWait(100);
QTest::mousePress(view->viewport(), Qt::LeftButton, 0, view->mapFromScene(71, 71), 200);
view->grabMouse();
@@ -2648,7 +2638,7 @@ void tst_QGraphicsWidget::respectHFW()
QApplication::sendEvent(view->viewport(), &e);
view->releaseMouse();
}
- QTest::qWait(200);
+ QTest::qWait(100);
const QSizeF winSize = window->size();
qreal minHFW = window->effectiveSizeHint(Qt::MinimumSize, QSizeF(winSize.width(), -1)).height();
QVERIFY(qAbs(minHFW - winSize.height()) < 1);
diff --git a/tests/auto/qmainwindow/tst_qmainwindow.cpp b/tests/auto/qmainwindow/tst_qmainwindow.cpp
index 38d23b6..9615c63 100644
--- a/tests/auto/qmainwindow/tst_qmainwindow.cpp
+++ b/tests/auto/qmainwindow/tst_qmainwindow.cpp
@@ -1297,18 +1297,27 @@ void tst_QMainWindow::createPopupMenu()
mainwindow.addDockWidget(Qt::LeftDockWidgetArea, &dockwidget3);
mainwindow.addDockWidget(Qt::LeftDockWidgetArea, &dockwidget4);
+
+#ifdef QT_SOFTKEYS_ENABLED
+ // Softkeys add extra "Select" and "Back" actions to menu by default.
+ // Two first actions will be Select and Back when softkeys are enabled
+ int numSoftkeyActions = 2;
+#else
+ int numSoftkeyActions = 0;
+#endif
+
QMenu *menu = mainwindow.createPopupMenu();
QVERIFY(menu != 0);
QList<QAction *> actions = menu->actions();
- QCOMPARE(actions.size(), 7);
+ QCOMPARE(actions.size(), 7 + numSoftkeyActions);
- QCOMPARE(actions.at(0), dockwidget1.toggleViewAction());
- QCOMPARE(actions.at(1), dockwidget2.toggleViewAction());
- QCOMPARE(actions.at(2), dockwidget3.toggleViewAction());
- QCOMPARE(actions.at(3), dockwidget4.toggleViewAction());
- QVERIFY(actions.at(4)->isSeparator());
- QCOMPARE(actions.at(5), toolbar1.toggleViewAction());
- QCOMPARE(actions.at(6), toolbar2.toggleViewAction());
+ QCOMPARE(actions.at(0 + numSoftkeyActions), dockwidget1.toggleViewAction());
+ QCOMPARE(actions.at(1 + numSoftkeyActions), dockwidget2.toggleViewAction());
+ QCOMPARE(actions.at(2 + numSoftkeyActions), dockwidget3.toggleViewAction());
+ QCOMPARE(actions.at(3 + numSoftkeyActions), dockwidget4.toggleViewAction());
+ QVERIFY(actions.at(4 + numSoftkeyActions)->isSeparator());
+ QCOMPARE(actions.at(5 + numSoftkeyActions), toolbar1.toggleViewAction());
+ QCOMPARE(actions.at(6 + numSoftkeyActions), toolbar2.toggleViewAction());
delete menu;
@@ -1319,12 +1328,12 @@ void tst_QMainWindow::createPopupMenu()
menu = mainwindow.createPopupMenu();
QVERIFY(menu != 0);
actions = menu->actions();
- QCOMPARE(actions.size(), 4);
+ QCOMPARE(actions.size(), 4 + numSoftkeyActions);
- QCOMPARE(actions.at(0), dockwidget2.toggleViewAction());
- QCOMPARE(actions.at(1), dockwidget3.toggleViewAction());
- QVERIFY(actions.at(2)->isSeparator());
- QCOMPARE(actions.at(3), toolbar2.toggleViewAction());
+ QCOMPARE(actions.at(0 + numSoftkeyActions), dockwidget2.toggleViewAction());
+ QCOMPARE(actions.at(1 + numSoftkeyActions), dockwidget3.toggleViewAction());
+ QVERIFY(actions.at(2 + numSoftkeyActions)->isSeparator());
+ QCOMPARE(actions.at(3 + numSoftkeyActions), toolbar2.toggleViewAction());
delete menu;
}
diff --git a/tests/auto/qmake/testdata/prompt/prompt.pro b/tests/auto/qmake/testdata/prompt/prompt.pro
index 02db4fe..238022c 100644
--- a/tests/auto/qmake/testdata/prompt/prompt.pro
+++ b/tests/auto/qmake/testdata/prompt/prompt.pro
@@ -1,2 +1,2 @@
-a = $$prompt(Prompteroo)
+# a = $$prompt(Prompteroo)
diff --git a/tests/auto/qmenu/tst_qmenu.cpp b/tests/auto/qmenu/tst_qmenu.cpp
index e467229..726ca55 100644
--- a/tests/auto/qmenu/tst_qmenu.cpp
+++ b/tests/auto/qmenu/tst_qmenu.cpp
@@ -260,9 +260,17 @@ void tst_QMenu::onStatusMessageChanged(const QString &s)
void
tst_QMenu::addActionsAndClear()
{
- QCOMPARE(menus[0]->actions().count(), 0);
+#ifdef QT_SOFTKEYS_ENABLED
+ // Softkeys add extra "Select" and "Back" actions to menu by default.
+ // Two first actions will be Select and Back when softkeys are enabled
+ int numSoftkeyActions = 2;
+#else
+ int numSoftkeyActions = 0;
+#endif
+
+ QCOMPARE(menus[0]->actions().count(), 0 + numSoftkeyActions);
createActions();
- QCOMPARE(menus[0]->actions().count(), 8);
+ QCOMPARE(menus[0]->actions().count(), 8 + numSoftkeyActions);
menus[0]->clear();
QCOMPARE(menus[0]->actions().count(), 0);
}
diff --git a/tests/auto/qprogressbar/tst_qprogressbar.cpp b/tests/auto/qprogressbar/tst_qprogressbar.cpp
index d86094d..bc4583e 100644
--- a/tests/auto/qprogressbar/tst_qprogressbar.cpp
+++ b/tests/auto/qprogressbar/tst_qprogressbar.cpp
@@ -175,7 +175,7 @@ void tst_QProgressBar::format()
bar.repainted = false;
bar.setFormat("%v of %m (%p%)");
QTest::qWait(20);
- QVERIFY(bar.repainted);
+ QTRY_VERIFY(bar.repainted);
bar.repainted = false;
bar.setFormat("%v of %m (%p%)");
qApp->processEvents();
diff --git a/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp b/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp
index c305221..94f08d9 100644
--- a/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp
+++ b/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp
@@ -640,6 +640,7 @@ tst_Suite::tst_Suite()
addExpectedFailure("ecma_3/Unicode/regress-352044-01.js", "issues with Unicode escape sequences in JavaScript source code", willFixInNextReleaseMessage);
addExpectedFailure("ecma_3/Unicode/uc-001.js", "Unicode format-control character test (Category Cf.)", willFixInNextReleaseMessage);
+ addFileExclusion(".+/15\\.9\\.2\\..+", "unstable on slow machines");
addFileExclusion(".+/15\\.9\\.5\\..+", "too slooow");
addFileExclusion("regress-130451.js", "asserts");
addFileExclusion("regress-322135-01.js", "asserts");
diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp
index 37b34bf..463dbf6 100644
--- a/tests/auto/qstatemachine/tst_qstatemachine.cpp
+++ b/tests/auto/qstatemachine/tst_qstatemachine.cpp
@@ -119,6 +119,7 @@ private slots:
void assignProperty();
void assignPropertyWithAnimation();
void postEvent();
+ void cancelDelayedEvent();
void stateFinished();
void parallelStates();
void parallelRootState();
@@ -1543,8 +1544,8 @@ private:
class StringEventPoster : public QState
{
public:
- StringEventPoster(QStateMachine *machine, const QString &value, QState *parent = 0)
- : QState(parent), m_machine(machine), m_value(value), m_delay(0) {}
+ StringEventPoster(const QString &value, QState *parent = 0)
+ : QState(parent), m_value(value), m_delay(-1) {}
void setString(const QString &value)
{ m_value = value; }
@@ -1554,12 +1555,14 @@ public:
protected:
virtual void onEntry(QEvent *)
{
- m_machine->postEvent(new StringEvent(m_value), m_delay);
+ if (m_delay == -1)
+ machine()->postEvent(new StringEvent(m_value));
+ else
+ machine()->postDelayedEvent(new StringEvent(m_value), m_delay);
}
virtual void onExit(QEvent *) {}
private:
- QStateMachine *m_machine;
QString m_value;
int m_delay;
};
@@ -1573,7 +1576,7 @@ void tst_QStateMachine::postEvent()
QTest::ignoreMessage(QtWarningMsg, "QStateMachine::postEvent: cannot post event when the state machine is not running");
machine.postEvent(&e);
}
- StringEventPoster *s1 = new StringEventPoster(&machine, "a");
+ StringEventPoster *s1 = new StringEventPoster("a");
if (x == 1)
s1->setDelay(100);
QFinalState *s2 = new QFinalState;
@@ -1599,6 +1602,42 @@ void tst_QStateMachine::postEvent()
}
}
+void tst_QStateMachine::cancelDelayedEvent()
+{
+ QStateMachine machine;
+ QTest::ignoreMessage(QtWarningMsg, "QStateMachine::cancelDelayedEvent: the machine is not running");
+ QVERIFY(!machine.cancelDelayedEvent(-1));
+
+ QState *s1 = new QState(&machine);
+ QFinalState *s2 = new QFinalState(&machine);
+ s1->addTransition(new StringTransition("a", s2));
+ machine.setInitialState(s1);
+
+ QSignalSpy startedSpy(&machine, SIGNAL(started()));
+ machine.start();
+ QTRY_COMPARE(startedSpy.count(), 1);
+ QCOMPARE(machine.configuration().size(), 1);
+ QVERIFY(machine.configuration().contains(s1));
+
+ int id1 = machine.postDelayedEvent(new StringEvent("c"), 50000);
+ QVERIFY(id1 != -1);
+ int id2 = machine.postDelayedEvent(new StringEvent("b"), 25000);
+ QVERIFY(id2 != -1);
+ QVERIFY(id2 != id1);
+ int id3 = machine.postDelayedEvent(new StringEvent("a"), 100);
+ QVERIFY(id3 != -1);
+ QVERIFY(id3 != id2);
+ QVERIFY(machine.cancelDelayedEvent(id1));
+ QVERIFY(!machine.cancelDelayedEvent(id1));
+ QVERIFY(machine.cancelDelayedEvent(id2));
+ QVERIFY(!machine.cancelDelayedEvent(id2));
+
+ QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QTRY_COMPARE(finishedSpy.count(), 1);
+ QCOMPARE(machine.configuration().size(), 1);
+ QVERIFY(machine.configuration().contains(s2));
+}
+
void tst_QStateMachine::stateFinished()
{
QStateMachine machine;
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index 48d9370..b9f8ed8 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -2025,9 +2025,9 @@ bool Configure::checkAvailability(const QString &part)
if (!findFile("msdmo.lib")) cout << "msdmo.lib not found" << endl;
if (!findFile("d3d9.h")) cout << "d3d9.h not found" << endl;
}
- } else if (part == "MULTIMEDIA") {
+ } else if (part == "MULTIMEDIA" || part == "SCRIPT" || part == "SCRIPTTOOLS") {
available = true;
- } else if (part == "WEBKIT" || part == "SCRIPT" || part == "SCRIPTTOOLS") {
+ } else if (part == "WEBKIT") {
available = (dictionary.value("QMAKESPEC") == "win32-msvc2005") || (dictionary.value("QMAKESPEC") == "win32-msvc2008") || (dictionary.value("QMAKESPEC") == "win32-g++");
}