summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGareth Stockwell <ext-gareth.stockwell@nokia.com>2010-03-24 07:49:32 (GMT)
committerGareth Stockwell <ext-gareth.stockwell@nokia.com>2010-03-24 07:49:32 (GMT)
commitca554e4f13bad9a34db9b79617b1991983b5d227 (patch)
tree21aedabc96b9bcad0cdadb16ef54afa7ccd1e8f0
parent66813ad3dd429c4a8d58a2b4f8b79d14b8af4356 (diff)
parent70f711f1db76f2f675f6c0777a693d243199ab88 (diff)
downloadQt-ca554e4f13bad9a34db9b79617b1991983b5d227.zip
Qt-ca554e4f13bad9a34db9b79617b1991983b5d227.tar.gz
Qt-ca554e4f13bad9a34db9b79617b1991983b5d227.tar.bz2
Merge branch '4.6' of S:\dynamic\git\qt\trolltech\qt-s60-public.git\ into 4.6
-rw-r--r--qmake/generators/symbian/symmake.cpp21
-rw-r--r--src/3rdparty/webkit/VERSION2
-rw-r--r--src/3rdparty/webkit/WebCore/ChangeLog46
-rw-r--r--src/3rdparty/webkit/WebCore/WebCore.pro4
-rw-r--r--src/3rdparty/webkit/WebCore/page/FrameView.cpp75
-rw-r--r--src/3rdparty/webkit/WebCore/page/FrameView.h7
-rw-r--r--src/3rdparty/webkit/WebCore/platform/ScrollView.cpp7
-rw-r--r--src/3rdparty/webkit/WebCore/platform/ScrollView.h3
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderBlock.h1
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderBox.cpp10
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderBoxModelObject.cpp11
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderObject.cpp15
-rw-r--r--src/corelib/statemachine/qstatemachine.cpp11
-rw-r--r--src/corelib/statemachine/qstatemachine_p.h2
-rw-r--r--src/gui/dialogs/qdialog.cpp14
-rw-r--r--src/gui/kernel/qapplication_s60.cpp45
-rw-r--r--src/gui/kernel/qsoftkeymanager.cpp60
-rw-r--r--src/gui/kernel/qsoftkeymanager_p.h5
-rw-r--r--src/gui/kernel/qsoftkeymanager_s60.cpp7
-rw-r--r--src/gui/kernel/qsound.cpp3
-rw-r--r--src/gui/kernel/qt_s60_p.h1
-rw-r--r--src/gui/kernel/qwidget_s60.cpp8
-rw-r--r--src/gui/styles/qs60style.cpp90
-rw-r--r--src/gui/styles/qs60style.h9
-rw-r--r--src/gui/styles/qs60style_p.h9
-rw-r--r--src/gui/styles/qs60style_s60.cpp10
-rw-r--r--src/gui/text/qfontengine.cpp15
-rw-r--r--src/gui/text/qfontengine_p.h3
-rw-r--r--src/gui/text/qfontengine_win.cpp24
-rw-r--r--src/gui/text/qfontengine_win_p.h2
-rw-r--r--src/gui/text/qfontmetrics.cpp21
-rw-r--r--src/gui/text/qtextlayout.cpp6
-rw-r--r--src/gui/widgets/qmenu.cpp4
-rw-r--r--src/gui/widgets/qmenubar.cpp1
-rw-r--r--src/gui/widgets/qspinbox.cpp15
-rw-r--r--src/network/kernel/qhostinfo.cpp1
-rw-r--r--src/network/kernel/qhostinfo_p.h3
-rw-r--r--src/openvg/qpixmapdata_vg.cpp13
-rw-r--r--src/s60installs/s60installs.pro5
-rw-r--r--tests/auto/qfiledialog2/tst_qfiledialog2.cpp76
-rw-r--r--tests/auto/qstatemachine/tst_qstatemachine.cpp59
-rw-r--r--tests/auto/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp22
-rw-r--r--tests/auto/qtconcurrentmap/tst_qtconcurrentmap.cpp62
-rw-r--r--tests/auto/qtconcurrentrun/tst_qtconcurrentrun.cpp22
-rw-r--r--tests/auto/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp24
-rw-r--r--tests/auto/qvectornd/tst_qvectornd.cpp166
-rw-r--r--tests/auto/xmlpatternsdiagnosticsts/tst_xmlpatternsdiagnosticsts.cpp10
47 files changed, 689 insertions, 341 deletions
diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp
index 9aa122a..c6023b5 100644
--- a/qmake/generators/symbian/symmake.cpp
+++ b/qmake/generators/symbian/symmake.cpp
@@ -456,14 +456,29 @@ void SymbianMakefileGenerator::generatePkgFile(const QString &iconFile, Deployme
// deploy any additional DEPLOYMENT files
QString remoteTestPath;
remoteTestPath = QString("!:\\private\\%1").arg(privateDirUid);
+ QString zDir = epocRoot() + QLatin1String("epoc32/data/z");
initProjectDeploySymbian(project, depList, remoteTestPath, true, "$(PLATFORM)", "$(TARGET)", generatedDirs, generatedFiles);
if (depList.size())
t << "; DEPLOYMENT" << endl;
for (int i = 0; i < depList.size(); ++i) {
- t << QString("\"%1\" - \"%2\"")
- .arg(QString(depList.at(i).from).replace('\\','/'))
- .arg(depList.at(i).to) << endl;
+ QString from = depList.at(i).from;
+ QString to = depList.at(i).to;
+
+ // Deploy anything not already deployed from under epoc32 instead from under
+ // \epoc32\data\z\ to enable using pkg file without rebuilding
+ // the project, which can be useful for some binary only distributions.
+ if (!from.contains(QLatin1String("epoc32"), Qt::CaseInsensitive)) {
+ from = to;
+ if (from.size() > 1 && from.at(1) == QLatin1Char(':'))
+ from = from.mid(2);
+ from.prepend(zDir);
+ } else {
+ if (from.size() > 1 && from.at(1) == QLatin1Char(':'))
+ from = from.mid(2);
+ }
+
+ t << QString("\"%1\" - \"%2\"").arg(from.replace('\\','/')).arg(to) << endl;
}
t << endl;
diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION
index a2d5f37..def66ef 100644
--- a/src/3rdparty/webkit/VERSION
+++ b/src/3rdparty/webkit/VERSION
@@ -8,4 +8,4 @@ The commit imported was from the
and has the sha1 checksum
- 266a6c4f1938dd9edf4a8125faf91c62495e3ce2
+ d95c54951e7af2aa7def4346a142b2162bd89bbd
diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog
index a3f70d3..869e225 100644
--- a/src/3rdparty/webkit/WebCore/ChangeLog
+++ b/src/3rdparty/webkit/WebCore/ChangeLog
@@ -1,3 +1,49 @@
+2010-01-31 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ [Qt] Enable FAST_MOBILE_SCROLLING on Qt embedded platforms
+ https://bugs.webkit.org/show_bug.cgi?id=34168
+
+ Enable FAST_MOBILE_SCROLLING for Qt on Maemo 5, Linux embedded
+ and Symbian
+
+ * WebCore.pro:
+
+2010-01-19 Daniel Bates <dbates@rim.com>
+
+ Reviewed by Adam Treat.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33408
+
+ Implements an optimization to ignore fixed background images
+ (i.e. background-attachment: fixed) when a page does not contain
+ any fixed position elements so as to allow fast repaints (via bit
+ blit) when scrolling a page.
+
+ Currently, if a page has elements that specify either a fixed
+ background or a fixed position then we perform a slow repaint
+ (i.e disable blitting) so as to avoid rendering artifacts.
+ However, on low-powered/mobile devices slow repaints can cause
+ noticeable delays when scrolling a page with a fixed background
+ image. By sacrificing support for fixed background images when
+ there are no fixed elements on the page and with come care, we
+ don't need to force slow repaints and can avoid rendering artifacts.
+ Hence, on such devices we can improve the responsiveness of
+ scrolling a page with a fixed background image.
+
+ Note, this optimization is only enabled if the WebKit is built
+ with FAST_MOBILE_SCROLLING enabled.
+
+ Tests: fast/fast-mobile-scrolling/fixed-position-element.html
+ fast/fast-mobile-scrolling/no-fixed-position-elements.html
+
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
+ Disable fixed background attachment if we can blit on scroll.
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::styleWillChange):
+
2010-03-11 Simon Hausmann <simon.hausmann@nokia.com>
Reviewed by Tor Arne Vestbø.
diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro
index 5654a18..735c8ef 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.pro
+++ b/src/3rdparty/webkit/WebCore/WebCore.pro
@@ -162,6 +162,10 @@ contains(DEFINES, ENABLE_SINGLE_THREADED=1) {
DEFINES += ENABLE_SVG_FONTS=0 ENABLE_SVG_FOREIGN_OBJECT=0 ENABLE_SVG_ANIMATION=0 ENABLE_SVG_AS_IMAGE=0 ENABLE_SVG_USE=0
}
+mameo5|symbian|embedded {
+ DEFINES += ENABLE_FAST_MOBILE_SCROLLING=1
+}
+
# HTML5 ruby support
!contains(DEFINES, ENABLE_RUBY=.): DEFINES += ENABLE_RUBY=1
diff --git a/src/3rdparty/webkit/WebCore/page/FrameView.cpp b/src/3rdparty/webkit/WebCore/page/FrameView.cpp
index bc4e4f2..4c3a0ab 100644
--- a/src/3rdparty/webkit/WebCore/page/FrameView.cpp
+++ b/src/3rdparty/webkit/WebCore/page/FrameView.cpp
@@ -106,6 +106,7 @@ struct ScheduledEvent {
FrameView::FrameView(Frame* frame)
: m_frame(frame)
, m_slowRepaintObjectCount(0)
+ , m_fixedObjectCount(0)
, m_layoutTimer(this, &FrameView::layoutTimerFired)
, m_layoutRoot(0)
, m_postLayoutTasksTimer(this, &FrameView::postLayoutTimerFired)
@@ -735,7 +736,7 @@ String FrameView::mediaType() const
bool FrameView::useSlowRepaints() const
{
- return m_useSlowRepaints || m_slowRepaintObjectCount > 0 || m_isOverlapped || !m_contentIsOpaque;
+ return m_useSlowRepaints || m_slowRepaintObjectCount > 0 || (platformWidget() && m_fixedObjectCount > 0) || m_isOverlapped || !m_contentIsOpaque;
}
void FrameView::setUseSlowRepaints()
@@ -759,6 +760,78 @@ void FrameView::removeSlowRepaintObject()
setCanBlitOnScroll(!useSlowRepaints());
}
+void FrameView::addFixedObject()
+{
+ if (!m_fixedObjectCount && platformWidget())
+ setCanBlitOnScroll(false);
+ ++m_fixedObjectCount;
+}
+
+void FrameView::removeFixedObject()
+{
+ ASSERT(m_fixedObjectCount > 0);
+ m_fixedObjectCount--;
+ if (!m_fixedObjectCount)
+ setCanBlitOnScroll(!useSlowRepaints());
+}
+
+void FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
+{
+ const size_t fixedObjectThreshold = 5;
+
+ ListHashSet<RenderBox*>* positionedObjects = 0;
+ if (RenderView* root = m_frame->contentRenderer())
+ positionedObjects = root->positionedObjects();
+
+ if (!positionedObjects || positionedObjects->isEmpty()) {
+ hostWindow()->scroll(scrollDelta, rectToScroll, clipRect);
+ return;
+ }
+
+ // Get the rects of the fixed objects visible in the rectToScroll
+ Vector<IntRect, fixedObjectThreshold> subRectToUpdate;
+ bool updateInvalidatedSubRect = true;
+ ListHashSet<RenderBox*>::const_iterator end = positionedObjects->end();
+ for (ListHashSet<RenderBox*>::const_iterator it = positionedObjects->begin(); it != end; ++it) {
+ RenderBox* renderBox = *it;
+ if (renderBox->style()->position() != FixedPosition)
+ continue;
+ IntRect topLevelRect;
+ IntRect updateRect = renderBox->paintingRootRect(topLevelRect);
+ updateRect.move(-scrollX(), -scrollY());
+ updateRect.intersect(rectToScroll);
+ if (!updateRect.isEmpty()) {
+ if (subRectToUpdate.size() >= fixedObjectThreshold) {
+ updateInvalidatedSubRect = false;
+ break;
+ }
+ subRectToUpdate.append(updateRect);
+ }
+ }
+
+ // Scroll the view
+ if (updateInvalidatedSubRect) {
+ // 1) scroll
+ hostWindow()->scroll(scrollDelta, rectToScroll, clipRect);
+
+ // 2) update the area of fixed objets that has been invalidated
+ size_t fixObjectsCount = subRectToUpdate.size();
+ for (size_t i = 0; i < fixObjectsCount; ++i) {
+ IntRect updateRect = subRectToUpdate[i];
+ IntRect scrolledRect = updateRect;
+ scrolledRect.move(scrollDelta);
+ updateRect.unite(scrolledRect);
+ updateRect.intersect(rectToScroll);
+ hostWindow()->repaint(updateRect, true, false, true);
+ }
+ } else {
+ // the number of fixed objects exceed the threshold, so we repaint everything.
+ IntRect updateRect = clipRect;
+ updateRect.intersect(rectToScroll);
+ hostWindow()->repaint(updateRect, true, false, true);
+ }
+}
+
void FrameView::setIsOverlapped(bool isOverlapped)
{
if (isOverlapped == m_isOverlapped)
diff --git a/src/3rdparty/webkit/WebCore/page/FrameView.h b/src/3rdparty/webkit/WebCore/page/FrameView.h
index 3d17d2c..5243c02 100644
--- a/src/3rdparty/webkit/WebCore/page/FrameView.h
+++ b/src/3rdparty/webkit/WebCore/page/FrameView.h
@@ -143,6 +143,9 @@ public:
void addSlowRepaintObject();
void removeSlowRepaintObject();
+ void addFixedObject();
+ void removeFixedObject();
+
void beginDeferredRepaints();
void endDeferredRepaints();
void checkStopDelayingDeferredRepaints();
@@ -196,6 +199,9 @@ public:
bool isFrameViewScrollCorner(RenderScrollbarPart* scrollCorner) const { return m_scrollCorner == scrollCorner; }
void invalidateScrollCorner();
+protected:
+ virtual void scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
+
private:
FrameView(Frame*);
@@ -261,6 +267,7 @@ private:
bool m_isOverlapped;
bool m_contentIsOpaque;
unsigned m_slowRepaintObjectCount;
+ unsigned m_fixedObjectCount;
int m_borderX, m_borderY;
diff --git a/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp b/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp
index e67daf9..9e15c43 100644
--- a/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp
@@ -509,7 +509,7 @@ void ScrollView::scrollContents(const IntSize& scrollDelta)
if (canBlitOnScroll()) { // The main frame can just blit the WebView window
// FIXME: Find a way to blit subframes without blitting overlapping content
- hostWindow()->scroll(-scrollDelta, scrollViewRect, clipRect);
+ scrollContentsFastPath(-scrollDelta, scrollViewRect, clipRect);
} else {
// We need to go ahead and repaint the entire backing store. Do it now before moving the
// windowed plugins.
@@ -524,6 +524,11 @@ void ScrollView::scrollContents(const IntSize& scrollDelta)
hostWindow()->paint();
}
+void ScrollView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
+{
+ hostWindow()->scroll(scrollDelta, rectToScroll, clipRect);
+}
+
IntPoint ScrollView::windowToContents(const IntPoint& windowPoint) const
{
IntPoint viewPoint = convertFromContainingWindow(windowPoint);
diff --git a/src/3rdparty/webkit/WebCore/platform/ScrollView.h b/src/3rdparty/webkit/WebCore/platform/ScrollView.h
index 5dacff5..7060d07 100644
--- a/src/3rdparty/webkit/WebCore/platform/ScrollView.h
+++ b/src/3rdparty/webkit/WebCore/platform/ScrollView.h
@@ -244,6 +244,9 @@ protected:
IntRect scrollCornerRect() const;
virtual void updateScrollCorner();
virtual void paintScrollCorner(GraphicsContext*, const IntRect& cornerRect);
+
+ // Scroll the content by blitting the pixels
+ virtual void scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
private:
RefPtr<Scrollbar> m_horizontalScrollbar;
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderBlock.h b/src/3rdparty/webkit/WebCore/rendering/RenderBlock.h
index 7ba5fce..3300d01 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderBlock.h
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderBlock.h
@@ -75,6 +75,7 @@ public:
void insertPositionedObject(RenderBox*);
void removePositionedObject(RenderBox*);
void removePositionedObjects(RenderBlock*);
+ ListHashSet<RenderBox*>* positionedObjects() const { return m_positionedObjects; }
void addPercentHeightDescendant(RenderBox*);
static void removePercentHeightDescendant(RenderBox*);
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderBox.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderBox.cpp
index 1df82a4..7ca2ff8 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderBox.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderBox.cpp
@@ -145,6 +145,16 @@ void RenderBox::styleWillChange(StyleDifference diff, const RenderStyle* newStyl
removeFloatingOrPositionedChildFromBlockLists();
}
}
+ if (FrameView *frameView = view()->frameView()) {
+ bool newStyleIsFixed = newStyle && newStyle->position() == FixedPosition;
+ bool oldStyleIsFixed = style() && style()->position() == FixedPosition;
+ if (newStyleIsFixed != oldStyleIsFixed) {
+ if (newStyleIsFixed)
+ frameView->addFixedObject();
+ else
+ frameView->removeFixedObject();
+ }
+ }
RenderBoxModelObject::styleWillChange(diff, newStyle);
}
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderBoxModelObject.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderBoxModelObject.cpp
index 23dad2d..9d0f1ed 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderBoxModelObject.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderBoxModelObject.cpp
@@ -557,6 +557,17 @@ void RenderBoxModelObject::calculateBackgroundImageGeometry(const FillLayer* fil
// Determine the background positioning area and set destRect to the background painting area.
// destRect will be adjusted later if the background is non-repeating.
bool fixedAttachment = fillLayer->attachment() == FixedBackgroundAttachment;
+
+#if ENABLE(FAST_MOBILE_SCROLLING)
+ if (view()->frameView() && view()->frameView()->canBlitOnScroll()) {
+ // As a side effect of an optimization to blit on scroll, we do not honor the CSS
+ // property "background-attachment: fixed" because it may result in rendering
+ // artifacts. Note, these artifacts only appear if we are blitting on scroll of
+ // a page that has fixed background images.
+ fixedAttachment = false;
+ }
+#endif
+
if (!fixedAttachment) {
destRect = IntRect(tx, ty, w, h);
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderObject.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderObject.cpp
index a10ffd9..199de4a 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderObject.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderObject.cpp
@@ -1591,10 +1591,17 @@ void RenderObject::styleWillChange(StyleDifference diff, const RenderStyle* newS
s_affectsParentBlock = false;
if (view()->frameView()) {
- // FIXME: A better solution would be to only invalidate the fixed regions when scrolling. It's overkill to
- // prevent the entire view from blitting on a scroll.
- bool newStyleSlowScroll = newStyle && (newStyle->position() == FixedPosition || newStyle->hasFixedBackgroundImage());
- bool oldStyleSlowScroll = m_style && (m_style->position() == FixedPosition || m_style->hasFixedBackgroundImage());
+ bool shouldBlitOnFixedBackgroundImage = false;
+#if ENABLE(FAST_MOBILE_SCROLLING)
+ // On low-powered/mobile devices, preventing blitting on a scroll can cause noticeable delays
+ // when scrolling a page with a fixed background image. As an optimization, assuming there are
+ // no fixed positoned elements on the page, we can acclerate scrolling (via blitting) if we
+ // ignore the CSS property "background-attachment: fixed".
+ shouldBlitOnFixedBackgroundImage = true;
+#endif
+
+ bool newStyleSlowScroll = newStyle && !shouldBlitOnFixedBackgroundImage && newStyle->hasFixedBackgroundImage();
+ bool oldStyleSlowScroll = m_style && !shouldBlitOnFixedBackgroundImage && m_style->hasFixedBackgroundImage();
if (oldStyleSlowScroll != newStyleSlowScroll) {
if (oldStyleSlowScroll)
view()->frameView()->removeSlowRepaintObject();
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp
index bd7e626..9d5c49f 100644
--- a/src/corelib/statemachine/qstatemachine.cpp
+++ b/src/corelib/statemachine/qstatemachine.cpp
@@ -1175,6 +1175,16 @@ void QStateMachinePrivate::removeStartState()
_startState = 0;
}
+void QStateMachinePrivate::clearHistory()
+{
+ Q_Q(QStateMachine);
+ QList<QHistoryState*> historyStates = qFindChildren<QHistoryState*>(q);
+ for (int i = 0; i < historyStates.size(); ++i) {
+ QHistoryState *h = historyStates.at(i);
+ QHistoryStatePrivate::get(h)->configuration.clear();
+ }
+}
+
void QStateMachinePrivate::_q_start()
{
Q_Q(QStateMachine);
@@ -1186,6 +1196,7 @@ void QStateMachinePrivate::_q_start()
internalEventQueue.clear();
qDeleteAll(externalEventQueue);
externalEventQueue.clear();
+ clearHistory();
#ifdef QSTATEMACHINE_DEBUG
qDebug() << q << ": starting";
diff --git a/src/corelib/statemachine/qstatemachine_p.h b/src/corelib/statemachine/qstatemachine_p.h
index 0fead5d..5e1015f 100644
--- a/src/corelib/statemachine/qstatemachine_p.h
+++ b/src/corelib/statemachine/qstatemachine_p.h
@@ -126,6 +126,8 @@ public:
QState *startState();
void removeStartState();
+ void clearHistory();
+
void microstep(QEvent *event, const QList<QAbstractTransition*> &transitionList);
bool isPreempted(const QAbstractState *s, const QSet<QAbstractTransition*> &transitions) const;
QSet<QAbstractTransition*> selectTransitions(QEvent *event) const;
diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp
index d8ac9a8..25ba016 100644
--- a/src/gui/dialogs/qdialog.cpp
+++ b/src/gui/dialogs/qdialog.cpp
@@ -69,7 +69,6 @@ extern bool qt_wince_is_smartphone(); //is defined in qguifunctions_wce.cpp
# include "qfontdialog.h"
# include "qcolordialog.h"
# include "qwizard.h"
-# include "qmenubar.h"
#endif
#if defined(Q_WS_S60)
@@ -529,12 +528,6 @@ int QDialog::exec()
#endif //Q_WS_WINCE_WM
#ifdef Q_OS_SYMBIAN
-#ifndef QT_NO_MENUBAR
- QMenuBar *menuBar = 0;
- if (!findChild<QMenuBar *>())
- menuBar = new QMenuBar(this);
-#endif
-
if (qobject_cast<QFileDialog *>(this) || qobject_cast<QFontDialog *>(this) ||
qobject_cast<QColorDialog *>(this) || qobject_cast<QWizard *>(this))
showMaximized();
@@ -566,13 +559,6 @@ int QDialog::exec()
delete menuBar;
#endif //QT_NO_MENUBAR
#endif //Q_WS_WINCE_WM
-#ifdef Q_OS_SYMBIAN
-#ifndef QT_NO_MENUBAR
- else if (menuBar)
- delete menuBar;
-#endif //QT_NO_MENUBAR
-#endif //Q_OS_SYMBIAN
-
return res;
}
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index e7a7093..37d1b62 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -1004,16 +1004,32 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */)
// else { We don't touch the active window unless we were explicitly activated or deactivated }
}
+void QSymbianControl::handleClientAreaChange()
+{
+ const bool cbaVisibilityHint = qwidget->windowFlags() & Qt::WindowSoftkeysVisibleHint;
+ if (qwidget->isFullScreen() && !cbaVisibilityHint) {
+ SetExtentToWholeScreen();
+ } else if (qwidget->isMaximized() || (qwidget->isFullScreen() && cbaVisibilityHint)) {
+ TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
+ SetExtent(r.iTl, r.Size());
+ } else if (!qwidget->isMinimized()) { // Normal geometry
+ if (!qwidget->testAttribute(Qt::WA_Resized)) {
+ qwidget->adjustSize();
+ qwidget->setAttribute(Qt::WA_Resized, false); //not a user resize
+ }
+ if (!qwidget->testAttribute(Qt::WA_Moved) && qwidget->windowType() != Qt::Dialog) {
+ TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
+ SetPosition(r.iTl);
+ qwidget->setAttribute(Qt::WA_Moved, false); // not really an explicit position
+ }
+ }
+}
+
void QSymbianControl::HandleResourceChange(int resourceType)
{
switch (resourceType) {
case KInternalStatusPaneChange:
- if (qwidget->isFullScreen()) {
- SetExtentToWholeScreen();
- } else if (qwidget->isMaximized()) {
- TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
- SetExtent(r.iTl, r.Size());
- }
+ handleClientAreaChange();
if (IsFocused() && IsVisible()) {
qwidget->d_func()->setWindowIcon_sys(true);
qwidget->d_func()->setWindowTitle_sys(qwidget->windowTitle());
@@ -1025,22 +1041,7 @@ void QSymbianControl::HandleResourceChange(int resourceType)
#ifdef Q_WS_S60
case KEikDynamicLayoutVariantSwitch:
{
- if (qwidget->isFullScreen()) {
- SetExtentToWholeScreen();
- } else if (qwidget->isMaximized()) {
- TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
- SetExtent(r.iTl, r.Size());
- } else if (!qwidget->isMinimized()){ // Normal geometry
- if (!qwidget->testAttribute(Qt::WA_Resized)) {
- qwidget->adjustSize();
- qwidget->setAttribute(Qt::WA_Resized, false); //not a user resize
- }
- if (!qwidget->testAttribute(Qt::WA_Moved) && qwidget->windowType() != Qt::Dialog) {
- TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
- SetPosition(r.iTl);
- qwidget->setAttribute(Qt::WA_Moved, false); // not really an explicit position
- }
- }
+ handleClientAreaChange();
break;
}
#endif
diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp
index c9a94ee..923144a 100644
--- a/src/gui/kernel/qsoftkeymanager.cpp
+++ b/src/gui/kernel/qsoftkeymanager.cpp
@@ -115,6 +115,8 @@ QAction *QSoftKeyManager::createAction(StandardSoftKey standardKey, QWidget *act
break;
}
action->setSoftKeyRole(softKeyRole);
+ action->setVisible(false);
+ setForceEnabledInSoftkeys(action);
return action;
}
@@ -168,25 +170,55 @@ bool QSoftKeyManager::appendSoftkeys(const QWidget &source, int level)
{
Q_D(QSoftKeyManager);
bool ret = false;
- QList<QAction*> actions = source.actions();
- for (int i = 0; i < actions.count(); ++i) {
- if (actions.at(i)->softKeyRole() != QAction::NoSoftKey) {
- d->requestedSoftKeyActions.insert(level, actions.at(i));
+ foreach(QAction *action, source.actions()) {
+ if (action->softKeyRole() != QAction::NoSoftKey
+ && (action->isVisible() || isForceEnabledInSofkeys(action))) {
+ d->requestedSoftKeyActions.insert(level, action);
ret = true;
}
}
return ret;
}
+
+static bool isChildOf(const QWidget *c, const QWidget *p)
+{
+ while (c) {
+ if (c == p)
+ return true;
+ c = c->parentWidget();
+ }
+ return false;
+}
+
QWidget *QSoftKeyManager::softkeySource(QWidget *previousSource, bool& recursiveMerging)
{
Q_D(QSoftKeyManager);
QWidget *source = NULL;
if (!previousSource) {
// Initial source is primarily focuswidget and secondarily activeWindow
- source = QApplication::focusWidget();
- if (!source)
- source = QApplication::activeWindow();
+ QWidget *focus = QApplication::focusWidget();
+ QWidget *popup = QApplication::activePopupWidget();
+ if (popup) {
+ if (isChildOf(focus, popup))
+ source = focus;
+ else
+ source = popup;
+ }
+ if (!source) {
+ QWidget *modal = QApplication::activeModalWidget();
+ if (modal) {
+ if (isChildOf(focus, modal))
+ source = focus;
+ else
+ source = modal;
+ }
+ }
+ if (!source) {
+ source = focus;
+ if (!source)
+ source = QApplication::activeWindow();
+ }
} else {
// Softkey merging is based on four criterias
// 1. Implicit merging is used whenever focus widget does not specify any softkeys
@@ -220,6 +252,20 @@ bool QSoftKeyManager::handleUpdateSoftKeys()
return true;
}
+void QSoftKeyManager::setForceEnabledInSoftkeys(QAction *action)
+{
+ action->setProperty(FORCE_ENABLED_PROPERTY, QVariant(true));
+}
+
+bool QSoftKeyManager::isForceEnabledInSofkeys(QAction *action)
+{
+ bool ret = false;
+ QVariant property = action->property(FORCE_ENABLED_PROPERTY);
+ if (property.isValid() && property.toBool())
+ ret = true;
+ return ret;
+}
+
bool QSoftKeyManager::event(QEvent *e)
{
#ifndef QT_NO_ACTION
diff --git a/src/gui/kernel/qsoftkeymanager_p.h b/src/gui/kernel/qsoftkeymanager_p.h
index a6fe17e..a5b258b 100644
--- a/src/gui/kernel/qsoftkeymanager_p.h
+++ b/src/gui/kernel/qsoftkeymanager_p.h
@@ -63,7 +63,8 @@ QT_BEGIN_NAMESPACE
class QSoftKeyManagerPrivate;
-const char MENU_ACTION_PROPERTY[] = "_q_menuaction";
+const char MENU_ACTION_PROPERTY[] = "_q_menuAction";
+const char FORCE_ENABLED_PROPERTY[] = "_q_forceEnabledInSoftkeys";
class Q_AUTOTEST_EXPORT QSoftKeyManager : public QObject
{
@@ -88,6 +89,8 @@ public:
static QAction *createAction(StandardSoftKey standardKey, QWidget *actionWidget);
static QAction *createKeyedAction(StandardSoftKey standardKey, Qt::Key key, QWidget *actionWidget);
static QString standardSoftKeyText(StandardSoftKey standardKey);
+ static void setForceEnabledInSoftkeys(QAction *action);
+ static bool isForceEnabledInSofkeys(QAction *action);
protected:
bool event(QEvent *e);
diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp
index 3a0304c..9812d72 100644
--- a/src/gui/kernel/qsoftkeymanager_s60.cpp
+++ b/src/gui/kernel/qsoftkeymanager_s60.cpp
@@ -288,11 +288,7 @@ bool QSoftKeyManagerPrivateS60::setSoftkey(CEikButtonGroupContainer &cba,
TPtrC nativeText = qt_QString2TPtrC(text);
int command = S60_COMMAND_START + position;
setNativeSoftkey(cba, position, command, nativeText);
- // QMainWindow "Options" action is set to invisible in order it does not appear in context menu
- // and all invisible actions are by default disabled.
- // However we never want to dim options softkey, even it is set to invisible
- QVariant property = action->property(MENU_ACTION_PROPERTY);
- const bool dimmed = (property.isValid() && property.toBool()) ? false : !action->isEnabled();
+ const bool dimmed = !action->isEnabled() && !QSoftKeyManager::isForceEnabledInSofkeys(action);
cba.DimCommand(command, dimmed);
realSoftKeyActions.insert(command, action);
return true;
@@ -335,6 +331,7 @@ bool QSoftKeyManagerPrivateS60::setRightSoftkey(CEikButtonGroupContainer &cba)
cbaHasImage[RSK_POSITION] = false;
}
setNativeSoftkey(cba, RSK_POSITION, EAknSoftkeyExit, nativeText);
+ cba.DimCommand(EAknSoftkeyExit, false);
return true;
}
}
diff --git a/src/gui/kernel/qsound.cpp b/src/gui/kernel/qsound.cpp
index 165e6ce..9d8ffa5 100644
--- a/src/gui/kernel/qsound.cpp
+++ b/src/gui/kernel/qsound.cpp
@@ -147,12 +147,13 @@ public:
supports WAVE and AU files.
\row
\o Mac OS X
- \o NSSound is used. All formats that NSSound supports, including QuickTime formats,
+ \o NSSound is used. All formats that NSSound supports, including QuickTime formats,
are supported by Qt for Mac OS X.
\row
\o Qt for Embedded Linux
\o A built-in mixing sound server is used, accessing \c /dev/dsp
directly. Only the WAVE format is supported.
+ \row
\o Symbian
\o CMdaAudioPlayerUtility is used. All formats that Symbian OS or devices support
are supported also by Qt.
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
index cedede1..7c6b754 100644
--- a/src/gui/kernel/qt_s60_p.h
+++ b/src/gui/kernel/qt_s60_p.h
@@ -212,6 +212,7 @@ private:
#ifdef QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER
void translateAdvancedPointerEvent(const TAdvancedPointerEvent *event);
#endif
+ void handleClientAreaChange();
private:
static QSymbianControl *lastFocusedControl;
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 79702af..bfa7050 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -1109,9 +1109,11 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
QTLWExtra *top = d->topData();
const QRect normalGeometry = (top->normalGeometry.width() < 0) ? geometry() : top->normalGeometry;
- if (newstate & Qt::WindowFullScreen)
- setGeometry(qApp->desktop()->availableGeometry(this));
- else if (newstate & Qt::WindowMaximized)
+
+ const bool cbaVisibilityHint = windowFlags() & Qt::WindowSoftkeysVisibleHint;
+ if (newstate & Qt::WindowFullScreen && !cbaVisibilityHint)
+ setGeometry(qApp->desktop()->screenGeometry(this));
+ else if (newstate & Qt::WindowMaximized || ((newstate & Qt::WindowFullScreen) && cbaVisibilityHint))
setGeometry(qApp->desktop()->availableGeometry(this));
else
setGeometry(normalGeometry);
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index 750e19f..af37e6e 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -61,7 +61,6 @@
#include "qscrollarea.h"
#include "qscrollbar.h"
#include "qtabbar.h"
-#include "qtablewidget.h"
#include "qtableview.h"
#include "qtextedit.h"
#include "qtoolbar.h"
@@ -307,6 +306,13 @@ void QS60StylePrivate::drawSkinPart(QS60StyleEnums::SkinParts part,
short QS60StylePrivate::pixelMetric(int metric)
{
+ //If it is a custom value, need to strip away the base to map to internal
+ //pixel metric value table
+ if (metric & QStyle::PM_CustomBase) {
+ metric -= QStyle::PM_CustomBase;
+ metric += MAX_NON_CUSTOM_PIXELMETRICS - 1;
+ }
+
Q_ASSERT(metric < MAX_PIXELMETRICS);
const short returnValue = m_pmPointer[metric];
return returnValue;
@@ -407,8 +413,8 @@ QColor QS60StylePrivate::colorFromFrameGraphics(SkinFrameElements frame) const
{
const bool cachedColorExists = m_colorCache.contains(frame);
if (!cachedColorExists) {
- const int frameCornerWidth = pixelMetric(PM_Custom_FrameCornerWidth);
- const int frameCornerHeight = pixelMetric(PM_Custom_FrameCornerHeight);
+ const int frameCornerWidth = pixelMetric(PM_FrameCornerWidth);
+ const int frameCornerHeight = pixelMetric(PM_FrameCornerHeight);
Q_ASSERT(2 * frameCornerWidth < 32);
Q_ASSERT(2 * frameCornerHeight < 32);
@@ -868,7 +874,7 @@ QSize QS60StylePrivate::partSize(QS60StyleEnums::SkinParts part, SkinElementFlag
case QS60StyleEnums::SP_QgnGrafBarFrameSideL:
case QS60StyleEnums::SP_QgnGrafBarFrameSideR:
- result.setWidth(pixelMetric(PM_Custom_FrameCornerWidth));
+ result.setWidth(pixelMetric(PM_FrameCornerWidth));
break;
case QS60StyleEnums::SP_QsnCpScrollHandleTopPressed:
@@ -895,15 +901,15 @@ QSize QS60StylePrivate::partSize(QS60StyleEnums::SkinParts part, SkinElementFlag
case 7: /* CornerTr */
case 6: /* CornerBl */
case 5: /* CornerBr */
- result.setWidth(pixelMetric(PM_Custom_FrameCornerWidth));
+ result.setWidth(pixelMetric(PM_FrameCornerWidth));
// Falltrough intended...
case 4: /* SideT */
case 3: /* SideB */
- result.setHeight(pixelMetric(PM_Custom_FrameCornerHeight));
+ result.setHeight(pixelMetric(PM_FrameCornerHeight));
break;
case 2: /* SideL */
case 1: /* SideR */
- result.setWidth(pixelMetric(PM_Custom_FrameCornerWidth));
+ result.setWidth(pixelMetric(PM_FrameCornerWidth));
break;
case 0: /* center */
default:
@@ -1002,7 +1008,6 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
QS60StylePrivate::SE_SliderGrooveVertical;
QS60StylePrivate::drawSkinElement(grooveElement, painter, sliderGroove, flags);
} else {
- const QRect sliderGroove = subControlRect(control, optionSlider, SC_SliderGroove, widget);
const QPoint sliderGrooveCenter = sliderGroove.center();
const bool horizontal = optionSlider->orientation == Qt::Horizontal;
painter->save();
@@ -1129,7 +1134,7 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
drawPrimitive(pe, &toolButton, painter, widget);
}
- if (toolBtn->text.length()>0 ||
+ if (toolBtn->text.length() > 0 ||
!toolBtn->icon.isNull()) {
const int frameWidth = pixelMetric(PM_DefaultFrameWidth, option, widget);
toolButton.rect = button.adjusted(frameWidth, frameWidth, -frameWidth, -frameWidth);
@@ -1371,7 +1376,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
}
if (!comboBox->currentText.isEmpty() && !comboBox->editable) {
QCommonStyle::drawItemText(painter,
- editRect.adjusted(QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth), 0, -1, 0),
+ editRect.adjusted(QS60StylePrivate::pixelMetric(PM_FrameCornerWidth), 0, -1, 0),
visualAlignment(comboBox->direction, Qt::AlignLeft | Qt::AlignVCenter),
comboBox->palette, comboBox->state & State_Enabled, comboBox->currentText);
}
@@ -1836,8 +1841,8 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
painter->save();
QPen linePen = QPen(QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnLineColors, 1, header));
const int penWidth = (header->orientation == Qt::Horizontal) ?
- linePen.width() + QS60StylePrivate::pixelMetric(PM_Custom_BoldLineWidth)
- : linePen.width() + QS60StylePrivate::pixelMetric(PM_Custom_ThinLineWidth);
+ linePen.width() + QS60StylePrivate::pixelMetric(PM_BoldLineWidth)
+ : linePen.width() + QS60StylePrivate::pixelMetric(PM_ThinLineWidth);
linePen.setWidth(penWidth);
painter->setPen(linePen);
if (header->orientation == Qt::Horizontal){
@@ -1856,7 +1861,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
//Make cornerButton slightly smaller so that it is not on top of table border graphic.
QStyleOptionHeader subopt = *header;
const int borderTweak =
- QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth) >> 1;
+ QS60StylePrivate::pixelMetric(PM_FrameCornerWidth) >> 1;
if (subopt.direction == Qt::LeftToRight)
subopt.rect.adjust(borderTweak, borderTweak, 0, -borderTweak);
else
@@ -1964,40 +1969,37 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
case CE_MenuScroller:
break;
case CE_FocusFrame: {
- // The pen width should nearly fill the layoutspacings around the widget
- const int penWidth =
- qMin(pixelMetric(QS60Style::PM_LayoutVerticalSpacing), pixelMetric(QS60Style::PM_LayoutHorizontalSpacing))
- - 2; // But keep 1 pixel distance to the focus widget and 1 pixel to the adjacent widgets
-
#ifdef QT_KEYPAD_NAVIGATION
bool editFocus = false;
if (const QFocusFrame *focusFrame = qobject_cast<const QFocusFrame*>(widget)) {
if (focusFrame->widget() && focusFrame->widget()->hasEditFocus())
editFocus = true;
}
- const qreal opacity = editFocus ? 0.65 : 0.45; // Trial and error factors. Feel free to improve.
+ const qreal opacity = editFocus ? 1 : 0.75; // Trial and error factors. Feel free to improve.
#else
- const qreal opacity = 0.5;
+ const qreal opacity = 0.85;
#endif
- // Because of Qts coordinate system, we need to tweak the rect by .5 pixels, otherwise it gets blurred.
- const qreal rectAdjustment = (penWidth % 2) ? -.5 : 0;
-
- // Make sure that the pen stroke is inside the rect
- const QRectF adjustedRect =
- QRectF(option->rect).adjusted(
- rectAdjustment + penWidth,
- rectAdjustment + penWidth,
- -rectAdjustment - penWidth,
- -rectAdjustment - penWidth
- );
-
- const qreal roundRectRadius = penWidth * goldenRatio;
+ // We need to reduce the focus frame size if LayoutSpacing is smaller than FocusFrameMargin
+ // Otherwise, we would overlay adjacent widgets.
+ const int frameHeightReduction =
+ qMin(0, pixelMetric(QStyle::PM_LayoutVerticalSpacing)
+ - pixelMetric(QStyle::PM_FocusFrameVMargin));
+ const int frameWidthReduction =
+ qMin(0, pixelMetric(QStyle::PM_LayoutHorizontalSpacing)
+ - pixelMetric(QStyle::PM_FocusFrameHMargin));
+ const int rounding =
+ qMin(pixelMetric(QStyle::PM_FocusFrameVMargin),
+ pixelMetric(QStyle::PM_LayoutVerticalSpacing));
+ const QRect frameRect =
+ option->rect.adjusted(-frameWidthReduction, -frameHeightReduction,
+ frameWidthReduction, frameHeightReduction);
+ QPainterPath framePath;
+ framePath.addRoundedRect(frameRect, rounding, rounding);
painter->save();
painter->setRenderHint(QPainter::Antialiasing);
painter->setOpacity(opacity);
- painter->setPen(QPen(option->palette.color(QPalette::Text), penWidth));
- painter->drawRoundedRect(adjustedRect, roundRectRadius, roundRectRadius);
+ painter->fillPath(framePath, option->palette.color(QPalette::Text));
painter->restore();
}
break;
@@ -2080,7 +2082,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
// ... or normal "tick" selection at the end.
} else if (option->state & State_Selected) {
QRect tickRect = option->rect;
- const int frameBorderWidth = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth);
+ const int frameBorderWidth = QS60StylePrivate::pixelMetric(PM_FrameCornerWidth);
// adjust tickmark rect to exclude frame border
tickRect.adjust(0, -frameBorderWidth, 0, -frameBorderWidth);
QS60StyleEnums::SkinParts skinPart = QS60StyleEnums::SP_QgnIndiMarkedAdd;
@@ -2161,7 +2163,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
const QS60StyleEnums::SkinParts part = (element == PE_IndicatorSpinUp) ?
QS60StyleEnums::SP_QgnGrafScrollArrowUp :
QS60StyleEnums::SP_QgnGrafScrollArrowDown;
- const int iconMargin = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth) >> 1;
+ const int iconMargin = QS60StylePrivate::pixelMetric(PM_FrameCornerWidth) >> 1;
optionSpinBox.rect.translate(0, (element == PE_IndicatorSpinDown) ? iconMargin : -iconMargin );
QS60StylePrivate::drawSkinPart(part, painter, optionSpinBox.rect, flags);
} else {
@@ -2175,7 +2177,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
// We want to draw down arrow here for comboboxes as well.
QStyleOptionFrame optionsComboBox = *cmb;
const QS60StyleEnums::SkinParts part = QS60StyleEnums::SP_QgnGrafScrollArrowDown;
- const int iconMargin = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth) >> 1;
+ const int iconMargin = QS60StylePrivate::pixelMetric(PM_FrameCornerWidth) >> 1;
optionsComboBox.rect.translate(0, (element == PE_IndicatorSpinDown) ? iconMargin : -iconMargin );
QS60StylePrivate::drawSkinPart(part, painter, optionsComboBox.rect, flags);
} else {
@@ -2309,7 +2311,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
(option->state & State_Open) ? QS60StyleEnums::SP_QgnIndiHlColSuper : QS60StyleEnums::SP_QgnIndiHlExpSuper;
int minDimension = qMin(option->rect.width(), option->rect.height());
QRect iconRect(option->rect.topLeft(), QSize(minDimension, minDimension));
- const int magicTweak = 3;
+ const int magicTweak = 3;
int resizeValue = minDimension >> 1;
if (!QS60StylePrivate::isTouchSupported()) {
minDimension += resizeValue; // Adjust the icon bigger because of empty space in svg icon.
@@ -2454,9 +2456,9 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt,
#ifndef QT_NO_COMBOBOX
case CT_ComboBox: {
// Fixing Ui design issues with too wide QComboBoxes and greedy SizeHints
- // Make sure, that the combobox says within the screen.
+ // Make sure, that the combobox stays within the screen.
const QSize desktopContentSize = QApplication::desktop()->availableGeometry().size()
- -QSize(pixelMetric(PM_LayoutLeftMargin) + pixelMetric(PM_LayoutRightMargin), 0);
+ - QSize(pixelMetric(PM_LayoutLeftMargin) + pixelMetric(PM_LayoutRightMargin), 0);
sz = QCommonStyle::sizeFromContents(ct, opt, csz, widget).
boundedTo(desktopContentSize);
}
@@ -2929,9 +2931,9 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con
if (qstyleoption_cast<const QStyleOptionHeader *>(opt)) {
// Subtract area needed for line
if (opt->state & State_Horizontal)
- ret.setHeight(ret.height() - QS60StylePrivate::pixelMetric(PM_Custom_BoldLineWidth));
+ ret.setHeight(ret.height() - QS60StylePrivate::pixelMetric(PM_BoldLineWidth));
else
- ret.setWidth(ret.width() - QS60StylePrivate::pixelMetric(PM_Custom_ThinLineWidth));
+ ret.setWidth(ret.width() - QS60StylePrivate::pixelMetric(PM_ThinLineWidth));
}
ret = visualRect(opt->direction, opt->rect, ret);
break;
@@ -3242,7 +3244,7 @@ bool QS60Style::eventFilter(QObject *object, QEvent *event)
/*!
\internal
- Handle the timer \a event.
+ Handle the timer \a event.
*/
void QS60Style::timerEvent(QTimerEvent *event)
{
diff --git a/src/gui/styles/qs60style.h b/src/gui/styles/qs60style.h
index 82cc21c..af17843 100644
--- a/src/gui/styles/qs60style.h
+++ b/src/gui/styles/qs60style.h
@@ -52,6 +52,15 @@ QT_MODULE(Gui)
#if !defined(QT_NO_STYLE_S60)
+//Public custom pixel metrics values.
+//These can be used to fetch custom pixel metric value from outside QS60Style.
+enum {
+ PM_FrameCornerWidth = QStyle::PM_CustomBase + 1,
+ PM_FrameCornerHeight,
+ PM_BoldLineWidth,
+ PM_ThinLineWidth
+ };
+
class QS60StylePrivate;
class Q_GUI_EXPORT QS60Style : public QCommonStyle
diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h
index 16d82e7..8bb2f7b 100644
--- a/src/gui/styles/qs60style_p.h
+++ b/src/gui/styles/qs60style_p.h
@@ -61,12 +61,7 @@ QT_BEGIN_NAMESPACE
const int MAX_NON_CUSTOM_PIXELMETRICS = 92;
const int CUSTOMVALUESCOUNT = 4;
-enum {
- PM_Custom_FrameCornerWidth = MAX_NON_CUSTOM_PIXELMETRICS,
- PM_Custom_FrameCornerHeight,
- PM_Custom_BoldLineWidth,
- PM_Custom_ThinLineWidth
- };
+
const int MAX_PIXELMETRICS = MAX_NON_CUSTOM_PIXELMETRICS + CUSTOMVALUESCOUNT;
typedef struct {
@@ -425,7 +420,7 @@ public:
SE_ToolBarButton,
SE_ToolBarButtonPressed,
SE_PanelBackground,
- SE_ScrollBarHandlePressedHorizontal, //only for 5.0+
+ SE_ScrollBarHandlePressedHorizontal,
SE_ScrollBarHandlePressedVertical,
SE_ButtonInactive,
SE_Editor,
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp
index 14782d8..75ed0c7 100644
--- a/src/gui/styles/qs60style_s60.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -755,7 +755,7 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsLX(
if (drawn)
result = fromFbsBitmap(background, NULL, flags, targetSize);
- // if drawing fails in skin server, just ignore the background (probably OOM occured)
+ // if drawing fails in skin server, just ignore the background (probably OOM case)
CleanupStack::PopAndDestroy(4, background); //background, dev, gc, bgContext
// QS60WindowSurface::lockBitmapHeap();
@@ -787,7 +787,7 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsLX(
const int currentFrame = QS60StylePrivate::currentAnimationFrame(part);
if (constructedFromTheme && aknAnimation && aknAnimation->BitmapAnimData()->FrameArray().Count() > 0) {
- //Animation was created succesfully and contains frames, just fetch current frame
+ //Animation was created successfully and contains frames, just fetch current frame
if(currentFrame >= aknAnimation->BitmapAnimData()->FrameArray().Count())
User::Leave(KErrOverflow);
const CBitmapFrameData* frameData = aknAnimation->BitmapAnimData()->FrameArray().At(currentFrame);
@@ -978,8 +978,8 @@ void QS60StyleModeSpecifics::frameIdAndCenterId(QS60StylePrivate::SkinFrameEleme
TRect QS60StyleModeSpecifics::innerRectFromElement(QS60StylePrivate::SkinFrameElements frameElement, const TRect &outerRect)
{
- TInt widthShrink = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth);
- TInt heightShrink = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerHeight);
+ TInt widthShrink = QS60StylePrivate::pixelMetric(PM_FrameCornerWidth);
+ TInt heightShrink = QS60StylePrivate::pixelMetric(PM_FrameCornerHeight);
switch(frameElement) {
case QS60StylePrivate::SF_PanelBackground:
// panel should have slightly slimmer border to enable thin line of background graphics between closest component
@@ -1096,7 +1096,7 @@ void QS60StylePrivate::setActiveLayout()
activeLayoutIndex += (!landscape) ? 1 : 0;
}
- m_pmPointer = data[activeLayoutIndex];
+ setCurrentLayout(activeLayoutIndex);
}
Q_GLOBAL_STATIC(QList<QS60StyleAnimation *>, m_animations)
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp
index c000457..629db66 100644
--- a/src/gui/text/qfontengine.cpp
+++ b/src/gui/text/qfontengine.cpp
@@ -379,6 +379,15 @@ void QFontEngine::getGlyphPositions(const QGlyphLayout &glyphs, const QTransform
Q_ASSERT(positions.size() == glyphs_out.size());
}
+void QFontEngine::getGlyphBearings(glyph_t glyph, qreal *leftBearing, qreal *rightBearing)
+{
+ glyph_metrics_t gi = boundingBox(glyph);
+ bool isValid = gi.isValid();
+ if (leftBearing != 0)
+ *leftBearing = isValid ? gi.x.toReal() : 0.0;
+ if (rightBearing != 0)
+ *rightBearing = isValid ? (gi.xoff - gi.x - gi.width).toReal() : 0.0;
+}
glyph_metrics_t QFontEngine::tightBoundingBox(const QGlyphLayout &glyphs)
{
@@ -1385,6 +1394,12 @@ glyph_metrics_t QFontEngineMulti::boundingBox(const QGlyphLayout &glyphs)
return overall;
}
+void QFontEngineMulti::getGlyphBearings(glyph_t glyph, qreal *leftBearing, qreal *rightBearing)
+{
+ int which = highByte(glyph);
+ engine(which)->getGlyphBearings(stripped(glyph), leftBearing, rightBearing);
+}
+
void QFontEngineMulti::addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs,
QPainterPath *path, QTextItem::RenderFlags flags)
{
diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h
index 71ab5a5..e645caf 100644
--- a/src/gui/text/qfontengine_p.h
+++ b/src/gui/text/qfontengine_p.h
@@ -206,6 +206,8 @@ public:
virtual qreal minLeftBearing() const { return qreal(); }
virtual qreal minRightBearing() const { return qreal(); }
+ virtual void getGlyphBearings(glyph_t glyph, qreal *leftBearing = 0, qreal *rightBearing = 0);
+
virtual const char *name() const = 0;
virtual bool canRender(const QChar *string, int len) = 0;
@@ -374,6 +376,7 @@ public:
virtual void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const;
virtual void doKerning(QGlyphLayout *, QTextEngine::ShaperFlags) const;
virtual void addOutlineToPath(qreal, qreal, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags flags);
+ virtual void getGlyphBearings(glyph_t glyph, qreal *leftBearing = 0, qreal *rightBearing = 0);
virtual QFixed ascent() const;
virtual QFixed descent() const;
diff --git a/src/gui/text/qfontengine_win.cpp b/src/gui/text/qfontengine_win.cpp
index 1a815d3..a133b48 100644
--- a/src/gui/text/qfontengine_win.cpp
+++ b/src/gui/text/qfontengine_win.cpp
@@ -649,6 +649,30 @@ static const ushort char_table[] = {
static const int char_table_entries = sizeof(char_table)/sizeof(ushort);
+void QFontEngineWin::getGlyphBearings(glyph_t glyph, qreal *leftBearing, qreal *rightBearing)
+{
+ HDC hdc = shared_dc();
+ SelectObject(hdc, hfont);
+
+#ifndef Q_WS_WINCE
+ if (ttf)
+#endif
+
+ {
+ ABC abcWidths;
+ GetCharABCWidthsI(hdc, glyph, 1, 0, &abcWidths);
+ if (leftBearing)
+ *leftBearing = abcWidths.abcA;
+ if (rightBearing)
+ *rightBearing = abcWidths.abcC;
+ }
+
+#ifndef Q_WS_WINCE
+ else {
+ QFontEngine::getGlyphBearings(glyph, leftBearing, rightBearing);
+ }
+#endif
+}
qreal QFontEngineWin::minLeftBearing() const
{
diff --git a/src/gui/text/qfontengine_win_p.h b/src/gui/text/qfontengine_win_p.h
index f9d8f8b..f19e48e 100644
--- a/src/gui/text/qfontengine_win_p.h
+++ b/src/gui/text/qfontengine_win_p.h
@@ -106,6 +106,8 @@ public:
virtual QImage alphaMapForGlyph(glyph_t, const QTransform &xform);
virtual QImage alphaRGBMapForGlyph(glyph_t t, int margin, const QTransform &xform);
+ virtual void getGlyphBearings(glyph_t glyph, qreal *leftBearing = 0, qreal *rightBearing = 0);
+
int getGlyphIndexes(const QChar *ch, int numChars, QGlyphLayout *glyphs, bool mirrored) const;
void getCMap();
diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp
index 41d0af1..44a18de 100644
--- a/src/gui/text/qfontmetrics.cpp
+++ b/src/gui/text/qfontmetrics.cpp
@@ -472,8 +472,9 @@ int QFontMetrics::leftBearing(QChar ch) const
int nglyphs = 9;
engine->stringToCMap(&ch, 1, &glyphs, &nglyphs, 0);
// ### can nglyphs != 1 happen at all? Not currently I think
- glyph_metrics_t gi = engine->boundingBox(glyphs.glyphs[0]);
- return qRound(gi.x);
+ qreal lb;
+ engine->getGlyphBearings(glyphs.glyphs[0], &lb);
+ return qRound(lb);
}
/*!
@@ -506,8 +507,9 @@ int QFontMetrics::rightBearing(QChar ch) const
int nglyphs = 9;
engine->stringToCMap(&ch, 1, &glyphs, &nglyphs, 0);
// ### can nglyphs != 1 happen at all? Not currently I think
- glyph_metrics_t gi = engine->boundingBox(glyphs.glyphs[0]);
- return qRound(gi.xoff - gi.x - gi.width);
+ qreal rb;
+ engine->getGlyphBearings(glyphs.glyphs[0], 0, &rb);
+ return qRound(rb);
}
/*!
@@ -1317,8 +1319,9 @@ qreal QFontMetricsF::leftBearing(QChar ch) const
int nglyphs = 9;
engine->stringToCMap(&ch, 1, &glyphs, &nglyphs, 0);
// ### can nglyphs != 1 happen at all? Not currently I think
- glyph_metrics_t gi = engine->boundingBox(glyphs.glyphs[0]);
- return gi.x.toReal();
+ qreal lb;
+ engine->getGlyphBearings(glyphs.glyphs[0], &lb);
+ return lb;
}
/*!
@@ -1351,8 +1354,10 @@ qreal QFontMetricsF::rightBearing(QChar ch) const
int nglyphs = 9;
engine->stringToCMap(&ch, 1, &glyphs, &nglyphs, 0);
// ### can nglyphs != 1 happen at all? Not currently I think
- glyph_metrics_t gi = engine->boundingBox(glyphs.glyphs[0]);
- return (gi.xoff - gi.x - gi.width).toReal();
+ qreal rb;
+ engine->getGlyphBearings(glyphs.glyphs[0], 0, &rb);
+ return rb;
+
}
/*!
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index 204effa..3c0e85e 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -1688,9 +1688,9 @@ namespace {
if (currentPosition <= 0)
return;
- glyph_metrics_t gi = fontEngine->boundingBox(currentGlyph());
- if (gi.isValid())
- rightBearing = qMin(QFixed(), gi.xoff - gi.x - gi.width);
+ qreal rb;
+ fontEngine->getGlyphBearings(currentGlyph(), 0, &rb);
+ rightBearing = qMin(QFixed(), QFixed::fromReal(rb));
}
inline void resetRightBearing()
diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp
index 42b7406..a9978f9 100644
--- a/src/gui/widgets/qmenu.cpp
+++ b/src/gui/widgets/qmenu.cpp
@@ -168,8 +168,8 @@ void QMenuPrivate::init()
#ifdef QT_SOFTKEYS_ENABLED
selectAction = QSoftKeyManager::createKeyedAction(QSoftKeyManager::SelectSoftKey, Qt::Key_Select, q);
cancelAction = QSoftKeyManager::createKeyedAction(QSoftKeyManager::CancelSoftKey, Qt::Key_Back, q);
- selectAction->setVisible(false); // Don't show these in the menu
- cancelAction->setVisible(false);
+ selectAction->setPriority(QAction::HighPriority);
+ cancelAction->setPriority(QAction::HighPriority);
q->addAction(selectAction);
q->addAction(cancelAction);
#endif
diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp
index 13aa02b..e368d3d 100644
--- a/src/gui/widgets/qmenubar.cpp
+++ b/src/gui/widgets/qmenubar.cpp
@@ -1404,7 +1404,6 @@ void QMenuBarPrivate::handleReparent()
if (!menuBarAction) {
if (newParent) {
menuBarAction = QSoftKeyManager::createAction(QSoftKeyManager::MenuSoftKey, newParent);
- menuBarAction->setVisible(false);
newParent->addAction(menuBarAction);
}
} else {
diff --git a/src/gui/widgets/qspinbox.cpp b/src/gui/widgets/qspinbox.cpp
index 726426d..2d871d0 100644
--- a/src/gui/widgets/qspinbox.cpp
+++ b/src/gui/widgets/qspinbox.cpp
@@ -448,11 +448,12 @@ void QSpinBox::setRange(int minimum, int maximum)
}
/*!
- This virtual function is used by the spin box whenever it needs
- to display the given \a value. The default implementation returns
- a string containing \a value printed in the standard way using
- QWidget::locale().toString(). Reimplementations may return anything. (See
- the example in the detailed description.)
+ This virtual function is used by the spin box whenever it needs to
+ display the given \a value. The default implementation returns a
+ string containing \a value printed in the standard way using
+ QWidget::locale().toString(), but with the thousand separator
+ removed. Reimplementations may return anything. (See the example
+ in the detailed description.)
Note: QSpinBox does not call this function for specialValueText()
and that neither prefix() nor suffix() should be included in the
@@ -461,7 +462,7 @@ void QSpinBox::setRange(int minimum, int maximum)
If you reimplement this, you may also need to reimplement
valueFromText() and validate()
- \sa valueFromText(), validate()
+ \sa valueFromText(), validate(), QLocale::groupSeparator()
*/
QString QSpinBox::textFromValue(int value) const
@@ -869,7 +870,7 @@ void QDoubleSpinBox::setDecimals(int decimals)
If you reimplement this, you may also need to reimplement
valueFromText().
- \sa valueFromText()
+ \sa valueFromText(), QLocale::groupSeparator()
*/
diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp
index 7150fb7..6894978 100644
--- a/src/network/kernel/qhostinfo.cpp
+++ b/src/network/kernel/qhostinfo.cpp
@@ -479,6 +479,7 @@ void QHostInfoRunnable::run()
QHostInfoLookupManager::QHostInfoLookupManager() : mutex(QMutex::Recursive), wasDeleted(false)
{
moveToThread(QCoreApplicationPrivate::mainThread());
+ connect(QCoreApplication::instance(), SIGNAL(destroyed()), SLOT(waitForThreadPoolDone()), Qt::DirectConnection);
threadPool.setMaxThreadCount(5); // do 5 DNS lookups in parallel
}
diff --git a/src/network/kernel/qhostinfo_p.h b/src/network/kernel/qhostinfo_p.h
index 2b26b07..4fc74e9 100644
--- a/src/network/kernel/qhostinfo_p.h
+++ b/src/network/kernel/qhostinfo_p.h
@@ -184,6 +184,9 @@ protected:
QMutex mutex;
bool wasDeleted;
+
+private slots:
+ void waitForThreadPoolDone() { threadPool.waitForDone(); }
};
#endif
diff --git a/src/openvg/qpixmapdata_vg.cpp b/src/openvg/qpixmapdata_vg.cpp
index cb5255d..d602790 100644
--- a/src/openvg/qpixmapdata_vg.cpp
+++ b/src/openvg/qpixmapdata_vg.cpp
@@ -464,8 +464,8 @@ void QVGPixmapData::cleanup()
void QVGPixmapData::fromNativeType(void* pixmap, NativeType type)
{
-#if defined(QT_SYMBIAN_SUPPORTS_SGIMAGE) && !defined(QT_NO_EGL)
if (type == QPixmapData::SgImage && pixmap) {
+#if defined(QT_SYMBIAN_SUPPORTS_SGIMAGE) && !defined(QT_NO_EGL)
RSgImage *sgImage = reinterpret_cast<RSgImage*>(pixmap);
destroyImages();
@@ -536,6 +536,7 @@ void QVGPixmapData::fromNativeType(void* pixmap, NativeType type)
// release stuff
eglDestroyImageKHR(QEglContext::display(), eglImage);
driver.Close();
+#endif
} else if (type == QPixmapData::FbsBitmap) {
CFbsBitmap *bitmap = reinterpret_cast<CFbsBitmap*>(pixmap);
@@ -581,16 +582,12 @@ void QVGPixmapData::fromNativeType(void* pixmap, NativeType type)
if(deleteSourceBitmap)
delete bitmap;
}
-#else
- Q_UNUSED(pixmap);
- Q_UNUSED(type);
-#endif
}
void* QVGPixmapData::toNativeType(NativeType type)
{
-#if defined(QT_SYMBIAN_SUPPORTS_SGIMAGE) && !defined(QT_NO_EGL)
if (type == QPixmapData::SgImage) {
+#if defined(QT_SYMBIAN_SUPPORTS_SGIMAGE) && !defined(QT_NO_EGL)
toVGImage();
if (!isValid() || vgImage == VG_INVALID_HANDLE)
@@ -657,6 +654,7 @@ void* QVGPixmapData::toNativeType(NativeType type)
eglDestroyImageKHR(QEglContext::display(), eglImage);
driver.Close();
return reinterpret_cast<void*>(sgImage);
+#endif
} else if (type == QPixmapData::FbsBitmap) {
CFbsBitmap *bitmap = q_check_ptr(new CFbsBitmap);
@@ -678,10 +676,7 @@ void* QVGPixmapData::toNativeType(NativeType type)
return reinterpret_cast<void*>(bitmap);
}
-#else
- Q_UNUSED(type);
return 0;
-#endif
}
#endif //Q_OS_SYMBIAN
diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro
index 1f6e72b..f37cd58 100644
--- a/src/s60installs/s60installs.pro
+++ b/src/s60installs/s60installs.pro
@@ -13,9 +13,12 @@ symbian: {
TARGET.UID3 = 0x2001E61C
# sqlite3 is expected to be already found on phone if infixed configuration is built.
+ BLD_INF_RULES.prj_exports += \
+ "sqlite3.sis $${EPOCROOT}epoc32/data/qt/sis/sqlite3.sis" \
+ "sqlite3_selfsigned.sis $${EPOCROOT}epoc32/data/qt/sis/sqlite3_selfsigned.sis"
sqlitedeployment = \
"; Deploy sqlite onto phone that does not have it already" \
- "@\"$$PWD/sqlite3.sis\", (0x2002af5f)"
+ "@\"$${EPOCROOT}epoc32/data/qt/sis/sqlite3.sis\", (0x2002af5f)"
qtlibraries.pkg_postrules += sqlitedeployment
} else {
# Always use experimental UID for infixed configuration to avoid UID clash
diff --git a/tests/auto/qfiledialog2/tst_qfiledialog2.cpp b/tests/auto/qfiledialog2/tst_qfiledialog2.cpp
index f2e1dbd..6bfa8be 100644
--- a/tests/auto/qfiledialog2/tst_qfiledialog2.cpp
+++ b/tests/auto/qfiledialog2/tst_qfiledialog2.cpp
@@ -87,13 +87,13 @@ public:
}
};
-class tst_QFiledialog : public QObject
+class tst_QFileDialog2 : public QObject
{
Q_OBJECT
public:
- tst_QFiledialog();
- virtual ~tst_QFiledialog();
+ tst_QFileDialog2();
+ virtual ~tst_QFileDialog2();
public slots:
void init();
@@ -138,18 +138,18 @@ private:
QByteArray userSettings;
};
-tst_QFiledialog::tst_QFiledialog()
+tst_QFileDialog2::tst_QFileDialog2()
{
#if defined(Q_OS_WINCE)
qApp->setAutoMaximizeThreshold(-1);
#endif
}
-tst_QFiledialog::~tst_QFiledialog()
+tst_QFileDialog2::~tst_QFileDialog2()
{
}
-void tst_QFiledialog::init()
+void tst_QFileDialog2::init()
{
// Save the developers settings so they don't get mad when their sidebar folders are gone.
QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
@@ -164,14 +164,14 @@ void tst_QFiledialog::init()
#endif
}
-void tst_QFiledialog::cleanup()
+void tst_QFileDialog2::cleanup()
{
QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
settings.beginGroup(QLatin1String("Qt"));
settings.setValue(QLatin1String("filedialog"), userSettings);
}
-void tst_QFiledialog::listRoot()
+void tst_QFileDialog2::listRoot()
{
#if defined QT_BUILD_INTERNAL
QFileInfoGatherer fileInfoGatherer;
@@ -193,7 +193,7 @@ void tst_QFiledialog::listRoot()
#endif
}
-void tst_QFiledialog::heapCorruption()
+void tst_QFileDialog2::heapCorruption()
{
QVector<QNonNativeFileDialog*> dialogs;
for (int i=0; i < 10; i++) {
@@ -205,12 +205,12 @@ void tst_QFiledialog::heapCorruption()
struct FriendlyQFileDialog : public QNonNativeFileDialog
{
- friend class tst_QFileDialog;
+ friend class tst_QFileDialog2;
Q_DECLARE_PRIVATE(QFileDialog)
};
-void tst_QFiledialog::deleteDirAndFiles()
+void tst_QFileDialog2::deleteDirAndFiles()
{
#if defined QT_BUILD_INTERNAL
QString tempPath = QDir::tempPath() + '/' + "QFileDialogTestDir4FullDelete";
@@ -242,7 +242,7 @@ void tst_QFiledialog::deleteDirAndFiles()
#endif
}
-void tst_QFiledialog::filter()
+void tst_QFileDialog2::filter()
{
QNonNativeFileDialog fd;
QAction *hiddenAction = qFindChild<QAction*>(&fd, "qt_show_hidden_action");
@@ -255,7 +255,7 @@ void tst_QFiledialog::filter()
QVERIFY(hiddenAction->isChecked());
}
-void tst_QFiledialog::showNameFilterDetails()
+void tst_QFileDialog2::showNameFilterDetails()
{
QNonNativeFileDialog fd;
QComboBox *filters = qFindChild<QComboBox*>(&fd, "fileTypeCombo");
@@ -280,7 +280,7 @@ void tst_QFiledialog::showNameFilterDetails()
QCOMPARE(filters->itemText(2), filterChoices.at(2));
}
-void tst_QFiledialog::unc()
+void tst_QFileDialog2::unc()
{
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
// Only test UNC on Windows./
@@ -295,7 +295,7 @@ void tst_QFiledialog::unc()
QCOMPARE(model->index(fd.directory().absolutePath()), model->index(dir));
}
-void tst_QFiledialog::emptyUncPath()
+void tst_QFileDialog2::emptyUncPath()
{
QNonNativeFileDialog fd;
fd.show();
@@ -308,7 +308,7 @@ void tst_QFiledialog::emptyUncPath()
QVERIFY(model);
}
-void tst_QFiledialog::task178897_minimumSize()
+void tst_QFileDialog2::task178897_minimumSize()
{
QNonNativeFileDialog fd;
QSize oldMs = fd.layout()->minimumSize();
@@ -322,7 +322,7 @@ void tst_QFiledialog::task178897_minimumSize()
QVERIFY(ms.width() <= oldMs.width());
}
-void tst_QFiledialog::task180459_lastDirectory_data()
+void tst_QFileDialog2::task180459_lastDirectory_data()
{
QTest::addColumn<QString>("path");
QTest::addColumn<QString>("directory");
@@ -345,7 +345,7 @@ void tst_QFiledialog::task180459_lastDirectory_data()
}
-void tst_QFiledialog::task180459_lastDirectory()
+void tst_QFileDialog2::task180459_lastDirectory()
{
//first visit the temp directory and close the dialog
QNonNativeFileDialog *dlg = new QNonNativeFileDialog(0, "", QDir::tempPath());
@@ -449,7 +449,7 @@ QString &dir, const QString &filter)
}
};
-void tst_QFiledialog::task227304_proxyOnFileDialog()
+void tst_QFileDialog2::task227304_proxyOnFileDialog()
{
#if defined QT_BUILD_INTERNAL
QNonNativeFileDialog fd(0, "", QDir::currentPath(), 0);
@@ -488,7 +488,7 @@ void tst_QFiledialog::task227304_proxyOnFileDialog()
#endif
}
-void tst_QFiledialog::task227930_correctNavigationKeyboardBehavior()
+void tst_QFileDialog2::task227930_correctNavigationKeyboardBehavior()
{
QDir current = QDir::currentPath();
current.mkdir("test");
@@ -527,7 +527,7 @@ void tst_QFiledialog::task227930_correctNavigationKeyboardBehavior()
}
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
-void tst_QFiledialog::task226366_lowerCaseHardDriveWindows()
+void tst_QFileDialog2::task226366_lowerCaseHardDriveWindows()
{
QNonNativeFileDialog fd;
fd.setDirectory(QDir::root().path());
@@ -553,7 +553,7 @@ void tst_QFiledialog::task226366_lowerCaseHardDriveWindows()
}
#endif
-void tst_QFiledialog::completionOnLevelAfterRoot()
+void tst_QFileDialog2::completionOnLevelAfterRoot()
{
QNonNativeFileDialog fd;
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
@@ -592,7 +592,7 @@ void tst_QFiledialog::completionOnLevelAfterRoot()
#endif
}
-void tst_QFiledialog::task233037_selectingDirectory()
+void tst_QFileDialog2::task233037_selectingDirectory()
{
QDir current = QDir::currentPath();
current.mkdir("test");
@@ -615,7 +615,7 @@ void tst_QFiledialog::task233037_selectingDirectory()
current.rmdir("test");
}
-void tst_QFiledialog::task235069_hideOnEscape()
+void tst_QFileDialog2::task235069_hideOnEscape()
{
QDir current = QDir::currentPath();
QNonNativeFileDialog fd;
@@ -637,7 +637,7 @@ void tst_QFiledialog::task235069_hideOnEscape()
QCOMPARE(fd2.isVisible(), false);
}
-void tst_QFiledialog::task236402_dontWatchDeletedDir()
+void tst_QFileDialog2::task236402_dontWatchDeletedDir()
{
#if defined QT_BUILD_INTERNAL
//THIS TEST SHOULD NOT DISPLAY WARNINGS
@@ -662,7 +662,7 @@ void tst_QFiledialog::task236402_dontWatchDeletedDir()
#endif
}
-void tst_QFiledialog::task203703_returnProperSeparator()
+void tst_QFileDialog2::task203703_returnProperSeparator()
{
QDir current = QDir::currentPath();
current.mkdir("aaaaaaaaaaaaaaaaaa");
@@ -687,7 +687,7 @@ void tst_QFiledialog::task203703_returnProperSeparator()
current.rmdir("aaaaaaaaaaaaaaaaaa");
}
-void tst_QFiledialog::task228844_ensurePreviousSorting()
+void tst_QFileDialog2::task228844_ensurePreviousSorting()
{
QDir current = QDir::currentPath();
current.mkdir("aaaaaaaaaaaaaaaaaa");
@@ -789,7 +789,7 @@ void tst_QFiledialog::task228844_ensurePreviousSorting()
}
-void tst_QFiledialog::task239706_editableFilterCombo()
+void tst_QFileDialog2::task239706_editableFilterCombo()
{
QNonNativeFileDialog d;
d.setNameFilter("*.cpp *.h");
@@ -812,7 +812,7 @@ void tst_QFiledialog::task239706_editableFilterCombo()
QTest::keyPress(filterCombo, Qt::Key_Enter); // should not trigger assertion failure
}
-void tst_QFiledialog::task218353_relativePaths()
+void tst_QFileDialog2::task218353_relativePaths()
{
QDir appDir = QDir::current();
QVERIFY(appDir.cdUp() != false);
@@ -829,7 +829,7 @@ void tst_QFiledialog::task218353_relativePaths()
appDir.rmdir("test");
}
-void tst_QFiledialog::task251321_sideBarHiddenEntries()
+void tst_QFileDialog2::task251321_sideBarHiddenEntries()
{
#if defined QT_BUILD_INTERNAL
QNonNativeFileDialog fd;
@@ -889,7 +889,7 @@ public :
};
#endif
-void tst_QFiledialog::task251341_sideBarRemoveEntries()
+void tst_QFileDialog2::task251341_sideBarRemoveEntries()
{
#if defined QT_BUILD_INTERNAL
QNonNativeFileDialog fd;
@@ -954,7 +954,7 @@ void tst_QFiledialog::task251341_sideBarRemoveEntries()
#endif
}
-void tst_QFiledialog::task254490_selectFileMultipleTimes()
+void tst_QFileDialog2::task254490_selectFileMultipleTimes()
{
QString tempPath = QDir::tempPath();
QTemporaryFile *t;
@@ -986,7 +986,7 @@ void tst_QFiledialog::task254490_selectFileMultipleTimes()
t->deleteLater();
}
-void tst_QFiledialog::task257579_sideBarWithNonCleanUrls()
+void tst_QFileDialog2::task257579_sideBarWithNonCleanUrls()
{
#if defined QT_BUILD_INTERNAL
QDir tempDir = QDir::temp();
@@ -1012,7 +1012,7 @@ void tst_QFiledialog::task257579_sideBarWithNonCleanUrls()
#endif
}
-void tst_QFiledialog::task259105_filtersCornerCases()
+void tst_QFileDialog2::task259105_filtersCornerCases()
{
QNonNativeFileDialog fd(0, "TestFileDialog");
fd.setNameFilter(QLatin1String("All Files! (*);;Text Files (*.txt)"));
@@ -1056,7 +1056,7 @@ void tst_QFiledialog::task259105_filtersCornerCases()
QCOMPARE(filters->currentText(), QLatin1String("Text Files"));
}
-void tst_QFiledialog::QTBUG4419_lineEditSelectAll()
+void tst_QFileDialog2::QTBUG4419_lineEditSelectAll()
{
QString tempPath = QDir::tempPath();
QTemporaryFile *t;
@@ -1082,7 +1082,7 @@ void tst_QFiledialog::QTBUG4419_lineEditSelectAll()
QCOMPARE(tempPath + QChar('/') + lineEdit->selectedText(), t->fileName());
}
-void tst_QFiledialog::QTBUG6558_showDirsOnly()
+void tst_QFileDialog2::QTBUG6558_showDirsOnly()
{
const QString tempPath = QDir::tempPath();
QDir dirTemp(tempPath);
@@ -1148,7 +1148,7 @@ void tst_QFiledialog::QTBUG6558_showDirsOnly()
dirTemp.rmdir(tempName);
}
-void tst_QFiledialog::QTBUG4842_selectFilterWithHideNameFilterDetails()
+void tst_QFileDialog2::QTBUG4842_selectFilterWithHideNameFilterDetails()
{
QStringList filtersStr;
filtersStr << "Images (*.png *.xpm *.jpg)" << "Text files (*.txt)" << "XML files (*.xml)";
@@ -1188,5 +1188,5 @@ void tst_QFiledialog::QTBUG4842_selectFilterWithHideNameFilterDetails()
}
-QTEST_MAIN(tst_QFiledialog)
+QTEST_MAIN(tst_QFileDialog2)
#include "tst_qfiledialog2.moc"
diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp
index 90b5a22..2bf76e7 100644
--- a/tests/auto/qstatemachine/tst_qstatemachine.cpp
+++ b/tests/auto/qstatemachine/tst_qstatemachine.cpp
@@ -155,6 +155,7 @@ private slots:
void clearError();
void historyStateHasNowhereToGo();
void historyStateAsInitialState();
+ void historyStateAfterRestart();
void brokenStateIsNeverEntered();
void customErrorStateNotInGraph();
void transitionToStateNotInGraph();
@@ -906,6 +907,64 @@ void tst_QStateMachine::historyStateHasNowhereToGo()
QCOMPARE(machine.errorString(), QString::fromLatin1("Missing default state in history state 'historyState'"));
}
+void tst_QStateMachine::historyStateAfterRestart()
+{
+ // QTBUG-8842
+ QStateMachine machine;
+
+ QState *s1 = new QState(&machine);
+ machine.setInitialState(s1);
+ QState *s2 = new QState(&machine);
+ QState *s21 = new QState(s2);
+ QState *s22 = new QState(s2);
+ QHistoryState *s2h = new QHistoryState(s2);
+ s2h->setDefaultState(s21);
+ s1->addTransition(new EventTransition(QEvent::User, s2h));
+ s21->addTransition(new EventTransition(QEvent::User, s22));
+ s2->addTransition(new EventTransition(QEvent::User, s1));
+
+ for (int x = 0; x < 2; ++x) {
+ QSignalSpy startedSpy(&machine, SIGNAL(started()));
+ machine.start();
+ QTRY_COMPARE(startedSpy.count(), 1);
+ QCOMPARE(machine.configuration().count(), 1);
+ QVERIFY(machine.configuration().contains(s1));
+
+ // s1 -> s2h -> s21 (default state)
+ machine.postEvent(new QEvent(QEvent::User));
+ QCoreApplication::processEvents();
+ QCOMPARE(machine.configuration().count(), 2);
+ QVERIFY(machine.configuration().contains(s2));
+ // This used to fail on the 2nd run because the
+ // history had not been cleared.
+ QVERIFY(machine.configuration().contains(s21));
+
+ // s21 -> s22
+ machine.postEvent(new QEvent(QEvent::User));
+ QCoreApplication::processEvents();
+ QCOMPARE(machine.configuration().count(), 2);
+ QVERIFY(machine.configuration().contains(s2));
+ QVERIFY(machine.configuration().contains(s22));
+
+ // s2 -> s1 (s22 saved in s2h)
+ machine.postEvent(new QEvent(QEvent::User));
+ QCoreApplication::processEvents();
+ QCOMPARE(machine.configuration().count(), 1);
+ QVERIFY(machine.configuration().contains(s1));
+
+ // s1 -> s2h -> s22 (saved state)
+ machine.postEvent(new QEvent(QEvent::User));
+ QCoreApplication::processEvents();
+ QCOMPARE(machine.configuration().count(), 2);
+ QVERIFY(machine.configuration().contains(s2));
+ QVERIFY(machine.configuration().contains(s22));
+
+ QSignalSpy stoppedSpy(&machine, SIGNAL(stopped()));
+ machine.stop();
+ QTRY_COMPARE(stoppedSpy.count(), 1);
+ }
+}
+
void tst_QStateMachine::brokenStateIsNeverEntered()
{
QStateMachine machine;
diff --git a/tests/auto/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp b/tests/auto/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp
index 29cb341..4f7822d 100644
--- a/tests/auto/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp
+++ b/tests/auto/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp
@@ -90,7 +90,7 @@ int distance(TestIterator &a, TestIterator &b)
using namespace QtConcurrent;
-class tst_iteratekernel: public QObject
+class tst_QtConcurrentIterateKernel: public QObject
{
Q_OBJECT
private slots:
@@ -149,13 +149,13 @@ public:
};
-void tst_iteratekernel::instantiate()
+void tst_QtConcurrentIterateKernel::instantiate()
{
startThreadEngine(new PrintFor(0, 40)).startBlocking();
QCOMPARE((int)iterations, 40);
}
-void tst_iteratekernel::cancel()
+void tst_QtConcurrentIterateKernel::cancel()
{
{
QFuture<void> f = startThreadEngine(new SleepPrintFor(0, 40)).startAsynchronously();
@@ -182,7 +182,7 @@ public:
}
};
-void tst_iteratekernel::stresstest()
+void tst_QtConcurrentIterateKernel::stresstest()
{
const int iterations = 1000;
const int times = 50;
@@ -194,7 +194,7 @@ void tst_iteratekernel::stresstest()
}
}
-void tst_iteratekernel::noIterations()
+void tst_QtConcurrentIterateKernel::noIterations()
{
const int times = 20000;
for (int i = 0; i < times; ++i)
@@ -242,7 +242,7 @@ public:
bool throttling;
};
-void tst_iteratekernel::throttling()
+void tst_QtConcurrentIterateKernel::throttling()
{
const int totalIterations = 400;
iterations = 0;
@@ -271,7 +271,7 @@ public:
}
};
-void tst_iteratekernel::blockSize()
+void tst_QtConcurrentIterateKernel::blockSize()
{
#ifdef QT_NO_STL
QSKIP("Missing stl iterators prevent correct block size calculation", SkipAll);
@@ -296,7 +296,7 @@ public:
};
-void tst_iteratekernel::multipleResults()
+void tst_QtConcurrentIterateKernel::multipleResults()
{
#ifdef QT_NO_STL
QSKIP("Missing stl iterators prevent correct summation", SkipAll);
@@ -320,7 +320,7 @@ public:
}
};
-void tst_iteratekernel::instantiateWhile()
+void tst_QtConcurrentIterateKernel::instantiateWhile()
{
PrintWhile w;
w.startBlocking();
@@ -339,7 +339,7 @@ public:
}
};
-void tst_iteratekernel::stresstestWhile()
+void tst_QtConcurrentIterateKernel::stresstestWhile()
{
int iterations = 100000;
StressWhile w(iterations);
@@ -348,7 +348,7 @@ void tst_iteratekernel::stresstestWhile()
}
#endif
-QTEST_MAIN(tst_iteratekernel)
+QTEST_MAIN(tst_QtConcurrentIterateKernel)
#include "tst_qtconcurrentiteratekernel.moc"
diff --git a/tests/auto/qtconcurrentmap/tst_qtconcurrentmap.cpp b/tests/auto/qtconcurrentmap/tst_qtconcurrentmap.cpp
index d3417b1..894bac4 100644
--- a/tests/auto/qtconcurrentmap/tst_qtconcurrentmap.cpp
+++ b/tests/auto/qtconcurrentmap/tst_qtconcurrentmap.cpp
@@ -56,7 +56,7 @@ Q_DECLARE_METATYPE(QList<int>);
Q_DECLARE_METATYPE(QList<double>);
Q_DECLARE_METATYPE(QList<QString>);
-class tst_map: public QObject
+class tst_QtConcurrentMap: public QObject
{
Q_OBJECT
private slots:
@@ -114,7 +114,7 @@ public:
Q_DECLARE_METATYPE(QList<Number>);
-void tst_map::map()
+void tst_QtConcurrentMap::map()
{
// functors take arguments by reference, modifying the sequence in place
{
@@ -246,7 +246,7 @@ void tst_map::map()
#endif
}
-void tst_map::blocking_map()
+void tst_QtConcurrentMap::blocking_map()
{
// functors take arguments by reference, modifying the sequence in place
{
@@ -428,7 +428,7 @@ public:
}
};
-void tst_map::mapped()
+void tst_QtConcurrentMap::mapped()
{
QList<int> list;
list << 1 << 2 << 3;
@@ -790,7 +790,7 @@ void tst_map::mapped()
}
}
-void tst_map::blocking_mapped()
+void tst_QtConcurrentMap::blocking_mapped()
{
QList<int> list;
list << 1 << 2 << 3;
@@ -1244,7 +1244,7 @@ public:
}
};
-void tst_map::mappedReduced()
+void tst_QtConcurrentMap::mappedReduced()
{
QList<int> list;
list << 1 << 2 << 3;
@@ -1625,7 +1625,7 @@ void tst_map::mappedReduced()
// ### the same as above, with an initial result value
}
-void tst_map::blocking_mappedReduced()
+void tst_QtConcurrentMap::blocking_mappedReduced()
{
QList<int> list;
list << 1 << 2 << 3;
@@ -2010,7 +2010,7 @@ int sleeper(int val)
return val;
}
-void tst_map::assignResult()
+void tst_QtConcurrentMap::assignResult()
{
const QList<int> startList = QList<int>() << 0 << 1 << 2;
QList<int> list = QtConcurrent::blockingMapped(startList, sleeper);
@@ -2077,7 +2077,7 @@ public:
Q_DECLARE_METATYPE(QVector<MemFnTester>);
Q_DECLARE_METATYPE(QList<MemFnTester>);
-void tst_map::functionOverloads()
+void tst_QtConcurrentMap::functionOverloads()
{
QList<int> intList;
const QList<int> constIntList;
@@ -2159,7 +2159,7 @@ void fastReduce(int &result, const InstanceCounter&)
++result;
}
-void tst_map::throttling()
+void tst_QtConcurrentMap::throttling()
{
const int itemcount = 100;
const int allowedTemporaries = QThread::idealThreadCount() * 40;
@@ -2208,7 +2208,7 @@ void throwMapper(int &e)
throw QtConcurrent::Exception();
}
-void tst_map::exceptions()
+void tst_QtConcurrentMap::exceptions()
{
bool caught = false;
try {
@@ -2228,7 +2228,7 @@ int mapper(const int &i)
return i;
}
-void tst_map::incrementalResults()
+void tst_QtConcurrentMap::incrementalResults()
{
const int count = 200;
QList<int> ints;
@@ -2256,7 +2256,7 @@ void tst_map::incrementalResults()
Test that mapped does not cause deep copies when holding
references to Qt containers.
*/
-void tst_map::noDetatch()
+void tst_QtConcurrentMap::noDetatch()
{
{
QList<int> l = QList<int>() << 1;
@@ -2299,7 +2299,7 @@ void tst_map::noDetatch()
}
-void tst_map::stlContainers()
+void tst_QtConcurrentMap::stlContainers()
{
#ifdef QT_NO_STL
QSKIP("Qt compiled without STL support", SkipAll);
@@ -2331,7 +2331,7 @@ InstanceCounter ic_fn(const InstanceCounter & ic)
// Verify that held results are deleted when a future is
// assigned over with operator ==
-void tst_map::qFutureAssignmentLeak()
+void tst_QtConcurrentMap::qFutureAssignmentLeak()
{
currentInstanceCount = 0;
peakInstanceCount = 0;
@@ -2370,7 +2370,7 @@ void add(int &result, const int &sum)
result += sum;
}
-void tst_map::stressTest()
+void tst_QtConcurrentMap::stressTest()
{
const int listSize = 1000;
const int sum = (listSize - 1) * (listSize / 2);
@@ -2399,26 +2399,26 @@ void tst_map::stressTest()
}
}
-QTEST_MAIN(tst_map)
+QTEST_MAIN(tst_QtConcurrentMap)
#else
-void tst_map::map() {}
-void tst_map::blocking_map() {}
-void tst_map::mapped() {}
-void tst_map::blocking_mapped() {}
-void tst_map::mappedReduced() {}
-void tst_map::blocking_mappedReduced() {}
-void tst_map::assignResult() {}
-void tst_map::functionOverloads() {}
+void tst_QtConcurrentMap::map() {}
+void tst_QtConcurrentMap::blocking_map() {}
+void tst_QtConcurrentMap::mapped() {}
+void tst_QtConcurrentMap::blocking_mapped() {}
+void tst_QtConcurrentMap::mappedReduced() {}
+void tst_QtConcurrentMap::blocking_mappedReduced() {}
+void tst_QtConcurrentMap::assignResult() {}
+void tst_QtConcurrentMap::functionOverloads() {}
#ifndef QT_NO_EXCEPTIONS
-void tst_map::exceptions() {}
+void tst_QtConcurrentMap::exceptions() {}
#endif
-void tst_map::incrementalResults() {}
-void tst_map::stressTest() {}
-void tst_map::throttling() {}
-void tst_map::stlContainers() {}
-void tst_map::noDetatch() {}
+void tst_QtConcurrentMap::incrementalResults() {}
+void tst_QtConcurrentMap::stressTest() {}
+void tst_QtConcurrentMap::throttling() {}
+void tst_QtConcurrentMap::stlContainers() {}
+void tst_QtConcurrentMap::noDetatch() {}
QTEST_NOOP_MAIN
diff --git a/tests/auto/qtconcurrentrun/tst_qtconcurrentrun.cpp b/tests/auto/qtconcurrentrun/tst_qtconcurrentrun.cpp
index b9ab6d3..8fdc50c 100644
--- a/tests/auto/qtconcurrentrun/tst_qtconcurrentrun.cpp
+++ b/tests/auto/qtconcurrentrun/tst_qtconcurrentrun.cpp
@@ -49,7 +49,7 @@
using namespace QtConcurrent;
-class TestRunFunction: public QObject
+class tst_QtConcurrentRun: public QObject
{
Q_OBJECT
private slots:
@@ -73,7 +73,7 @@ private slots:
#endif
-QTEST_MAIN(TestRunFunction)
+QTEST_MAIN(tst_QtConcurrentRun)
void light()
{
@@ -91,7 +91,7 @@ void heavy()
}
-void TestRunFunction::runLightFunction()
+void tst_QtConcurrentRun::runLightFunction()
{
qDebug("starting function");
QFuture<void> future = run(F(light));
@@ -100,7 +100,7 @@ void TestRunFunction::runLightFunction()
qDebug("done");
}
-void TestRunFunction::runHeavyFunction()
+void tst_QtConcurrentRun::runHeavyFunction()
{
qDebug("starting function");
QFuture<void> future = run(F(heavy));
@@ -141,7 +141,7 @@ public:
int operator()(int in) const { return in; }
};
-void TestRunFunction::returnValue()
+void tst_QtConcurrentRun::returnValue()
{
QFuture<int> f;
@@ -217,7 +217,7 @@ struct TestConstClass
void fooInt(int) const { };
};
-void TestRunFunction::functionObject()
+void tst_QtConcurrentRun::functionObject()
{
QFuture<void> f;
TestClass c;
@@ -235,7 +235,7 @@ void TestRunFunction::functionObject()
}
-void TestRunFunction::memberFunctions()
+void tst_QtConcurrentRun::memberFunctions()
{
TestClass c;
@@ -278,7 +278,7 @@ void stringIntFunction(QString)
}
-void TestRunFunction::implicitConvertibleTypes()
+void tst_QtConcurrentRun::implicitConvertibleTypes()
{
double d;
run(F(doubleFunction), d).waitForFinished();
@@ -294,7 +294,7 @@ void TestRunFunction::implicitConvertibleTypes()
void fn() { }
-void TestRunFunction::runWaitLoop()
+void tst_QtConcurrentRun::runWaitLoop()
{
for (int i = 0; i < 1000; ++i)
run(fn).waitForFinished();
@@ -324,7 +324,7 @@ int recursiveResult(int level)
return 1;
}
-void TestRunFunction::recursive()
+void tst_QtConcurrentRun::recursive()
{
int levels = 15;
@@ -375,7 +375,7 @@ int fn2(double, int *)
}
#if 0
-void TestRunFunction::createFunctor()
+void tst_QtConcurrentRun::createFunctor()
{
e = 0;
::QtConcurrent::createFunctor(vfn0)();
diff --git a/tests/auto/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp b/tests/auto/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp
index 6f586d7..23fd19b 100644
--- a/tests/auto/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp
+++ b/tests/auto/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp
@@ -48,7 +48,7 @@
using namespace QtConcurrent;
-class tst_threadengine: public QObject
+class tst_QtConcurrentThreadEngine: public QObject
{
Q_OBJECT
public:
@@ -79,7 +79,7 @@ public:
}
};
-void tst_threadengine::runDirectly()
+void tst_QtConcurrentThreadEngine::runDirectly()
{
{
PrintUser engine;
@@ -120,7 +120,7 @@ public:
bool done;
};
-void tst_threadengine::result()
+void tst_QtConcurrentThreadEngine::result()
{
StringResultUser engine;
QCOMPARE(*engine.startBlocking(), QString("Foo"));
@@ -147,7 +147,7 @@ public:
bool done;
};
-void tst_threadengine::runThroughStarter()
+void tst_QtConcurrentThreadEngine::runThroughStarter()
{
{
ThreadEngineStarter<QString> starter = startThreadEngine(new StringResultUser());
@@ -180,7 +180,7 @@ public:
}
};
-void tst_threadengine::cancel()
+void tst_QtConcurrentThreadEngine::cancel()
{
{
CancelUser *engine = new CancelUser();
@@ -234,7 +234,7 @@ public:
// Test that a user task with a thread function that always
// want to be throttled still completes. The thread engine
// should make keep one thread running at all times.
-void tst_threadengine::throttle()
+void tst_QtConcurrentThreadEngine::throttle()
{
const int repeats = 10;
for (int i = 0; i < repeats; ++i) {
@@ -280,7 +280,7 @@ public:
bool finishing;
};
-void tst_threadengine::threadCount()
+void tst_QtConcurrentThreadEngine::threadCount()
{
const int repeats = 10;
for (int i = 0; i < repeats; ++i) {
@@ -320,7 +320,7 @@ public:
};
-void tst_threadengine::multipleResults()
+void tst_QtConcurrentThreadEngine::multipleResults()
{
MultipleResultsUser *engine = new MultipleResultsUser();
QFuture<int> f = engine->startAsynchronously();
@@ -351,7 +351,7 @@ public:
}
};
-void tst_threadengine::stresstest()
+void tst_QtConcurrentThreadEngine::stresstest()
{
const int times = 20000;
@@ -379,7 +379,7 @@ public:
ThreadFunctionResult threadFunction() { QTest::qSleep(sleepTime); return ThreadFinished; }
};
-void tst_threadengine::cancelQueuedSlowUser()
+void tst_QtConcurrentThreadEngine::cancelQueuedSlowUser()
{
const int times = 100;
@@ -436,7 +436,7 @@ public:
QThread *blockThread;
};
-void tst_threadengine::exceptions()
+void tst_QtConcurrentThreadEngine::exceptions()
{
// Asynchronous mode:
{
@@ -527,7 +527,7 @@ void tst_threadengine::exceptions()
#endif
-QTEST_MAIN(tst_threadengine)
+QTEST_MAIN(tst_QtConcurrentThreadEngine)
#include "tst_qtconcurrentthreadengine.moc"
diff --git a/tests/auto/qvectornd/tst_qvectornd.cpp b/tests/auto/qvectornd/tst_qvectornd.cpp
index 2be7264..2850f32 100644
--- a/tests/auto/qvectornd/tst_qvectornd.cpp
+++ b/tests/auto/qvectornd/tst_qvectornd.cpp
@@ -45,12 +45,12 @@
#include <QtGui/qvector3d.h>
#include <QtGui/qvector4d.h>
-class tst_QVector : public QObject
+class tst_QVectorND : public QObject
{
Q_OBJECT
public:
- tst_QVector() {}
- ~tst_QVector() {}
+ tst_QVectorND() {}
+ ~tst_QVectorND() {}
private slots:
void create2();
@@ -155,7 +155,7 @@ static bool fuzzyCompare(qreal x, qreal y)
// Test the creation of QVector2D objects in various ways:
// construct, copy, and modify.
-void tst_QVector::create2()
+void tst_QVectorND::create2()
{
QVector2D null;
QCOMPARE(null.x(), (qreal)0.0f);
@@ -244,7 +244,7 @@ void tst_QVector::create2()
// Test the creation of QVector3D objects in various ways:
// construct, copy, and modify.
-void tst_QVector::create3()
+void tst_QVectorND::create3()
{
QVector3D null;
QCOMPARE(null.x(), (qreal)0.0f);
@@ -370,7 +370,7 @@ void tst_QVector::create3()
// Test the creation of QVector4D objects in various ways:
// construct, copy, and modify.
-void tst_QVector::create4()
+void tst_QVectorND::create4()
{
QVector4D null;
QCOMPARE(null.x(), (qreal)0.0f);
@@ -556,7 +556,7 @@ void tst_QVector::create4()
}
// Test vector length computation for 2D vectors.
-void tst_QVector::length2_data()
+void tst_QVectorND::length2_data()
{
QTest::addColumn<qreal>("x");
QTest::addColumn<qreal>("y");
@@ -569,7 +569,7 @@ void tst_QVector::length2_data()
QTest::newRow("-1y") << (qreal)0.0f << (qreal)-1.0f << (qreal)1.0f;
QTest::newRow("two") << (qreal)2.0f << (qreal)-2.0f << (qreal)qSqrt(8.0f);
}
-void tst_QVector::length2()
+void tst_QVectorND::length2()
{
QFETCH(qreal, x);
QFETCH(qreal, y);
@@ -581,7 +581,7 @@ void tst_QVector::length2()
}
// Test vector length computation for 3D vectors.
-void tst_QVector::length3_data()
+void tst_QVectorND::length3_data()
{
QTest::addColumn<qreal>("x");
QTest::addColumn<qreal>("y");
@@ -597,7 +597,7 @@ void tst_QVector::length3_data()
QTest::newRow("-1z") << (qreal)0.0f << (qreal)0.0f << (qreal)-1.0f << (qreal)1.0f;
QTest::newRow("two") << (qreal)2.0f << (qreal)-2.0f << (qreal)2.0f << (qreal)qSqrt(12.0f);
}
-void tst_QVector::length3()
+void tst_QVectorND::length3()
{
QFETCH(qreal, x);
QFETCH(qreal, y);
@@ -610,7 +610,7 @@ void tst_QVector::length3()
}
// Test vector length computation for 4D vectors.
-void tst_QVector::length4_data()
+void tst_QVectorND::length4_data()
{
QTest::addColumn<qreal>("x");
QTest::addColumn<qreal>("y");
@@ -629,7 +629,7 @@ void tst_QVector::length4_data()
QTest::newRow("-1w") << (qreal)0.0f << (qreal)0.0f << (qreal)0.0f << (qreal)-1.0f << (qreal)1.0f;
QTest::newRow("two") << (qreal)2.0f << (qreal)-2.0f << (qreal)2.0f << (qreal)2.0f << (qreal)qSqrt(16.0f);
}
-void tst_QVector::length4()
+void tst_QVectorND::length4()
{
QFETCH(qreal, x);
QFETCH(qreal, y);
@@ -643,12 +643,12 @@ void tst_QVector::length4()
}
// Test the unit vector conversion for 2D vectors.
-void tst_QVector::normalized2_data()
+void tst_QVectorND::normalized2_data()
{
// Use the same test data as the length test.
length2_data();
}
-void tst_QVector::normalized2()
+void tst_QVectorND::normalized2()
{
QFETCH(qreal, x);
QFETCH(qreal, y);
@@ -665,12 +665,12 @@ void tst_QVector::normalized2()
}
// Test the unit vector conversion for 3D vectors.
-void tst_QVector::normalized3_data()
+void tst_QVectorND::normalized3_data()
{
// Use the same test data as the length test.
length3_data();
}
-void tst_QVector::normalized3()
+void tst_QVectorND::normalized3()
{
QFETCH(qreal, x);
QFETCH(qreal, y);
@@ -689,12 +689,12 @@ void tst_QVector::normalized3()
}
// Test the unit vector conversion for 4D vectors.
-void tst_QVector::normalized4_data()
+void tst_QVectorND::normalized4_data()
{
// Use the same test data as the length test.
length4_data();
}
-void tst_QVector::normalized4()
+void tst_QVectorND::normalized4()
{
QFETCH(qreal, x);
QFETCH(qreal, y);
@@ -715,12 +715,12 @@ void tst_QVector::normalized4()
}
// Test the unit vector conversion for 2D vectors.
-void tst_QVector::normalize2_data()
+void tst_QVectorND::normalize2_data()
{
// Use the same test data as the length test.
length2_data();
}
-void tst_QVector::normalize2()
+void tst_QVectorND::normalize2()
{
QFETCH(qreal, x);
QFETCH(qreal, y);
@@ -735,12 +735,12 @@ void tst_QVector::normalize2()
}
// Test the unit vector conversion for 3D vectors.
-void tst_QVector::normalize3_data()
+void tst_QVectorND::normalize3_data()
{
// Use the same test data as the length test.
length3_data();
}
-void tst_QVector::normalize3()
+void tst_QVectorND::normalize3()
{
QFETCH(qreal, x);
QFETCH(qreal, y);
@@ -756,12 +756,12 @@ void tst_QVector::normalize3()
}
// Test the unit vector conversion for 4D vectors.
-void tst_QVector::normalize4_data()
+void tst_QVectorND::normalize4_data()
{
// Use the same test data as the length test.
length4_data();
}
-void tst_QVector::normalize4()
+void tst_QVectorND::normalize4()
{
QFETCH(qreal, x);
QFETCH(qreal, y);
@@ -778,7 +778,7 @@ void tst_QVector::normalize4()
}
// Test the comparison operators for 2D vectors.
-void tst_QVector::compare2()
+void tst_QVectorND::compare2()
{
QVector2D v1(1, 2);
QVector2D v2(1, 2);
@@ -791,7 +791,7 @@ void tst_QVector::compare2()
}
// Test the comparison operators for 3D vectors.
-void tst_QVector::compare3()
+void tst_QVectorND::compare3()
{
QVector3D v1(1, 2, 4);
QVector3D v2(1, 2, 4);
@@ -806,7 +806,7 @@ void tst_QVector::compare3()
}
// Test the comparison operators for 4D vectors.
-void tst_QVector::compare4()
+void tst_QVectorND::compare4()
{
QVector4D v1(1, 2, 4, 8);
QVector4D v2(1, 2, 4, 8);
@@ -823,7 +823,7 @@ void tst_QVector::compare4()
}
// Test vector addition for 2D vectors.
-void tst_QVector::add2_data()
+void tst_QVectorND::add2_data()
{
QTest::addColumn<qreal>("x1");
QTest::addColumn<qreal>("y1");
@@ -852,7 +852,7 @@ void tst_QVector::add2_data()
<< (qreal)4.0f << (qreal)5.0f
<< (qreal)5.0f << (qreal)7.0f;
}
-void tst_QVector::add2()
+void tst_QVectorND::add2()
{
QFETCH(qreal, x1);
QFETCH(qreal, y1);
@@ -876,7 +876,7 @@ void tst_QVector::add2()
}
// Test vector addition for 3D vectors.
-void tst_QVector::add3_data()
+void tst_QVectorND::add3_data()
{
QTest::addColumn<qreal>("x1");
QTest::addColumn<qreal>("y1");
@@ -913,7 +913,7 @@ void tst_QVector::add3_data()
<< (qreal)4.0f << (qreal)5.0f << (qreal)-6.0f
<< (qreal)5.0f << (qreal)7.0f << (qreal)-3.0f;
}
-void tst_QVector::add3()
+void tst_QVectorND::add3()
{
QFETCH(qreal, x1);
QFETCH(qreal, y1);
@@ -941,7 +941,7 @@ void tst_QVector::add3()
}
// Test vector addition for 4D vectors.
-void tst_QVector::add4_data()
+void tst_QVectorND::add4_data()
{
QTest::addColumn<qreal>("x1");
QTest::addColumn<qreal>("y1");
@@ -986,7 +986,7 @@ void tst_QVector::add4_data()
<< (qreal)4.0f << (qreal)5.0f << (qreal)-6.0f << (qreal)9.0f
<< (qreal)5.0f << (qreal)7.0f << (qreal)-3.0f << (qreal)17.0f;
}
-void tst_QVector::add4()
+void tst_QVectorND::add4()
{
QFETCH(qreal, x1);
QFETCH(qreal, y1);
@@ -1018,12 +1018,12 @@ void tst_QVector::add4()
}
// Test vector subtraction for 2D vectors.
-void tst_QVector::subtract2_data()
+void tst_QVectorND::subtract2_data()
{
// Use the same test data as the add test.
add2_data();
}
-void tst_QVector::subtract2()
+void tst_QVectorND::subtract2()
{
QFETCH(qreal, x1);
QFETCH(qreal, y1);
@@ -1055,12 +1055,12 @@ void tst_QVector::subtract2()
}
// Test vector subtraction for 3D vectors.
-void tst_QVector::subtract3_data()
+void tst_QVectorND::subtract3_data()
{
// Use the same test data as the add test.
add3_data();
}
-void tst_QVector::subtract3()
+void tst_QVectorND::subtract3()
{
QFETCH(qreal, x1);
QFETCH(qreal, y1);
@@ -1097,12 +1097,12 @@ void tst_QVector::subtract3()
}
// Test vector subtraction for 4D vectors.
-void tst_QVector::subtract4_data()
+void tst_QVectorND::subtract4_data()
{
// Use the same test data as the add test.
add4_data();
}
-void tst_QVector::subtract4()
+void tst_QVectorND::subtract4()
{
QFETCH(qreal, x1);
QFETCH(qreal, y1);
@@ -1144,7 +1144,7 @@ void tst_QVector::subtract4()
}
// Test component-wise vector multiplication for 2D vectors.
-void tst_QVector::multiply2_data()
+void tst_QVectorND::multiply2_data()
{
QTest::addColumn<qreal>("x1");
QTest::addColumn<qreal>("y1");
@@ -1173,7 +1173,7 @@ void tst_QVector::multiply2_data()
<< (qreal)4.0f << (qreal)5.0f
<< (qreal)4.0f << (qreal)10.0f;
}
-void tst_QVector::multiply2()
+void tst_QVectorND::multiply2()
{
QFETCH(qreal, x1);
QFETCH(qreal, y1);
@@ -1197,7 +1197,7 @@ void tst_QVector::multiply2()
}
// Test component-wise vector multiplication for 3D vectors.
-void tst_QVector::multiply3_data()
+void tst_QVectorND::multiply3_data()
{
QTest::addColumn<qreal>("x1");
QTest::addColumn<qreal>("y1");
@@ -1234,7 +1234,7 @@ void tst_QVector::multiply3_data()
<< (qreal)4.0f << (qreal)5.0f << (qreal)-6.0f
<< (qreal)4.0f << (qreal)10.0f << (qreal)-18.0f;
}
-void tst_QVector::multiply3()
+void tst_QVectorND::multiply3()
{
QFETCH(qreal, x1);
QFETCH(qreal, y1);
@@ -1262,7 +1262,7 @@ void tst_QVector::multiply3()
}
// Test component-wise vector multiplication for 4D vectors.
-void tst_QVector::multiply4_data()
+void tst_QVectorND::multiply4_data()
{
QTest::addColumn<qreal>("x1");
QTest::addColumn<qreal>("y1");
@@ -1307,7 +1307,7 @@ void tst_QVector::multiply4_data()
<< (qreal)4.0f << (qreal)5.0f << (qreal)-6.0f << (qreal)9.0f
<< (qreal)4.0f << (qreal)10.0f << (qreal)-18.0f << (qreal)72.0f;
}
-void tst_QVector::multiply4()
+void tst_QVectorND::multiply4()
{
QFETCH(qreal, x1);
QFETCH(qreal, y1);
@@ -1339,7 +1339,7 @@ void tst_QVector::multiply4()
}
// Test vector multiplication by a factor for 2D vectors.
-void tst_QVector::multiplyFactor2_data()
+void tst_QVectorND::multiplyFactor2_data()
{
QTest::addColumn<qreal>("x1");
QTest::addColumn<qreal>("y1");
@@ -1372,7 +1372,7 @@ void tst_QVector::multiplyFactor2_data()
<< (qreal)0.0f
<< (qreal)0.0f << (qreal)0.0f;
}
-void tst_QVector::multiplyFactor2()
+void tst_QVectorND::multiplyFactor2()
{
QFETCH(qreal, x1);
QFETCH(qreal, y1);
@@ -1395,7 +1395,7 @@ void tst_QVector::multiplyFactor2()
}
// Test vector multiplication by a factor for 3D vectors.
-void tst_QVector::multiplyFactor3_data()
+void tst_QVectorND::multiplyFactor3_data()
{
QTest::addColumn<qreal>("x1");
QTest::addColumn<qreal>("y1");
@@ -1435,7 +1435,7 @@ void tst_QVector::multiplyFactor3_data()
<< (qreal)0.0f
<< (qreal)0.0f << (qreal)0.0f << (qreal)0.0f;
}
-void tst_QVector::multiplyFactor3()
+void tst_QVectorND::multiplyFactor3()
{
QFETCH(qreal, x1);
QFETCH(qreal, y1);
@@ -1461,7 +1461,7 @@ void tst_QVector::multiplyFactor3()
}
// Test vector multiplication by a factor for 4D vectors.
-void tst_QVector::multiplyFactor4_data()
+void tst_QVectorND::multiplyFactor4_data()
{
QTest::addColumn<qreal>("x1");
QTest::addColumn<qreal>("y1");
@@ -1508,7 +1508,7 @@ void tst_QVector::multiplyFactor4_data()
<< (qreal)0.0f
<< (qreal)0.0f << (qreal)0.0f << (qreal)0.0f << (qreal)0.0f;
}
-void tst_QVector::multiplyFactor4()
+void tst_QVectorND::multiplyFactor4()
{
QFETCH(qreal, x1);
QFETCH(qreal, y1);
@@ -1537,12 +1537,12 @@ void tst_QVector::multiplyFactor4()
}
// Test vector division by a factor for 2D vectors.
-void tst_QVector::divide2_data()
+void tst_QVectorND::divide2_data()
{
// Use the same test data as the multiply test.
multiplyFactor2_data();
}
-void tst_QVector::divide2()
+void tst_QVectorND::divide2()
{
QFETCH(qreal, x1);
QFETCH(qreal, y1);
@@ -1567,12 +1567,12 @@ void tst_QVector::divide2()
}
// Test vector division by a factor for 3D vectors.
-void tst_QVector::divide3_data()
+void tst_QVectorND::divide3_data()
{
// Use the same test data as the multiply test.
multiplyFactor3_data();
}
-void tst_QVector::divide3()
+void tst_QVectorND::divide3()
{
QFETCH(qreal, x1);
QFETCH(qreal, y1);
@@ -1600,12 +1600,12 @@ void tst_QVector::divide3()
}
// Test vector division by a factor for 4D vectors.
-void tst_QVector::divide4_data()
+void tst_QVectorND::divide4_data()
{
// Use the same test data as the multiply test.
multiplyFactor4_data();
}
-void tst_QVector::divide4()
+void tst_QVectorND::divide4()
{
QFETCH(qreal, x1);
QFETCH(qreal, y1);
@@ -1636,12 +1636,12 @@ void tst_QVector::divide4()
}
// Test vector negation for 2D vectors.
-void tst_QVector::negate2_data()
+void tst_QVectorND::negate2_data()
{
// Use the same test data as the add test.
add2_data();
}
-void tst_QVector::negate2()
+void tst_QVectorND::negate2()
{
QFETCH(qreal, x1);
QFETCH(qreal, y1);
@@ -1653,12 +1653,12 @@ void tst_QVector::negate2()
}
// Test vector negation for 3D vectors.
-void tst_QVector::negate3_data()
+void tst_QVectorND::negate3_data()
{
// Use the same test data as the add test.
add3_data();
}
-void tst_QVector::negate3()
+void tst_QVectorND::negate3()
{
QFETCH(qreal, x1);
QFETCH(qreal, y1);
@@ -1671,12 +1671,12 @@ void tst_QVector::negate3()
}
// Test vector negation for 4D vectors.
-void tst_QVector::negate4_data()
+void tst_QVectorND::negate4_data()
{
// Use the same test data as the add test.
add4_data();
}
-void tst_QVector::negate4()
+void tst_QVectorND::negate4()
{
QFETCH(qreal, x1);
QFETCH(qreal, y1);
@@ -1690,7 +1690,7 @@ void tst_QVector::negate4()
}
// Test the computation of vector cross-products.
-void tst_QVector::crossProduct_data()
+void tst_QVectorND::crossProduct_data()
{
QTest::addColumn<qreal>("x1");
QTest::addColumn<qreal>("y1");
@@ -1721,7 +1721,7 @@ void tst_QVector::crossProduct_data()
<< (qreal)-3.0f << (qreal)6.0f << (qreal)-3.0f
<< (qreal)32.0f;
}
-void tst_QVector::crossProduct()
+void tst_QVectorND::crossProduct()
{
QFETCH(qreal, x1);
QFETCH(qreal, y1);
@@ -1751,12 +1751,12 @@ void tst_QVector::crossProduct()
}
// Test the computation of normals.
-void tst_QVector::normal_data()
+void tst_QVectorND::normal_data()
{
// Use the same test data as the crossProduct test.
crossProduct_data();
}
-void tst_QVector::normal()
+void tst_QVectorND::normal()
{
QFETCH(qreal, x1);
QFETCH(qreal, y1);
@@ -1780,7 +1780,7 @@ void tst_QVector::normal()
}
// Test distance to plane calculations.
-void tst_QVector::distanceToPlane_data()
+void tst_QVectorND::distanceToPlane_data()
{
QTest::addColumn<qreal>("x1"); // Point on plane
QTest::addColumn<qreal>("y1");
@@ -1823,7 +1823,7 @@ void tst_QVector::distanceToPlane_data()
<< (qreal)0.0f << (qreal)2.0f << (qreal)0.0f
<< (qreal)-2.0f;
}
-void tst_QVector::distanceToPlane()
+void tst_QVectorND::distanceToPlane()
{
QFETCH(qreal, x1);
QFETCH(qreal, y1);
@@ -1853,7 +1853,7 @@ void tst_QVector::distanceToPlane()
}
// Test distance to line calculations.
-void tst_QVector::distanceToLine_data()
+void tst_QVectorND::distanceToLine_data()
{
QTest::addColumn<qreal>("x1"); // Point on line
QTest::addColumn<qreal>("y1");
@@ -1896,7 +1896,7 @@ void tst_QVector::distanceToLine_data()
<< (qreal)0.0f << (qreal)5.0f << (qreal)0.0f
<< (qreal)5.0f;
}
-void tst_QVector::distanceToLine()
+void tst_QVectorND::distanceToLine()
{
QFETCH(qreal, x1);
QFETCH(qreal, y1);
@@ -1917,7 +1917,7 @@ void tst_QVector::distanceToLine()
}
// Test the computation of dot products for 2D vectors.
-void tst_QVector::dotProduct2_data()
+void tst_QVectorND::dotProduct2_data()
{
QTest::addColumn<qreal>("x1");
QTest::addColumn<qreal>("y1");
@@ -1940,7 +1940,7 @@ void tst_QVector::dotProduct2_data()
<< (qreal)4.0f << (qreal)5.0f
<< (qreal)14.0f;
}
-void tst_QVector::dotProduct2()
+void tst_QVectorND::dotProduct2()
{
QFETCH(qreal, x1);
QFETCH(qreal, y1);
@@ -1960,12 +1960,12 @@ void tst_QVector::dotProduct2()
}
// Test the computation of dot products for 3D vectors.
-void tst_QVector::dotProduct3_data()
+void tst_QVectorND::dotProduct3_data()
{
// Use the same test data as the crossProduct test.
crossProduct_data();
}
-void tst_QVector::dotProduct3()
+void tst_QVectorND::dotProduct3()
{
QFETCH(qreal, x1);
QFETCH(qreal, y1);
@@ -1994,7 +1994,7 @@ void tst_QVector::dotProduct3()
}
// Test the computation of dot products for 4D vectors.
-void tst_QVector::dotProduct4_data()
+void tst_QVectorND::dotProduct4_data()
{
QTest::addColumn<qreal>("x1");
QTest::addColumn<qreal>("y1");
@@ -2021,7 +2021,7 @@ void tst_QVector::dotProduct4_data()
<< (qreal)4.0f << (qreal)5.0f << (qreal)6.0f << (qreal)7.0f
<< (qreal)60.0f;
}
-void tst_QVector::dotProduct4()
+void tst_QVectorND::dotProduct4()
{
QFETCH(qreal, x1);
QFETCH(qreal, y1);
@@ -2044,14 +2044,14 @@ void tst_QVector::dotProduct4()
QCOMPARE(QVector4D::dotProduct(v1, v2), d);
}
-class tst_QVectorProperties : public QObject
+class tst_QVectorNDProperties : public QObject
{
Q_OBJECT
Q_PROPERTY(QVector2D vector2D READ vector2D WRITE setVector2D)
Q_PROPERTY(QVector3D vector3D READ vector3D WRITE setVector3D)
Q_PROPERTY(QVector4D vector4D READ vector4D WRITE setVector4D)
public:
- tst_QVectorProperties(QObject *parent = 0) : QObject(parent) {}
+ tst_QVectorNDProperties(QObject *parent = 0) : QObject(parent) {}
QVector2D vector2D() const { return v2; }
void setVector2D(const QVector2D& value) { v2 = value; }
@@ -2069,9 +2069,9 @@ private:
};
// Test getting and setting vector properties via the metaobject system.
-void tst_QVector::properties()
+void tst_QVectorND::properties()
{
- tst_QVectorProperties obj;
+ tst_QVectorNDProperties obj;
obj.setVector2D(QVector2D(1.0f, 2.0f));
obj.setVector3D(QVector3D(3.0f, 4.0f, 5.0f));
@@ -2115,7 +2115,7 @@ void tst_QVector::properties()
QCOMPARE(v4.w(), (qreal)-9.0f);
}
-void tst_QVector::metaTypes()
+void tst_QVectorND::metaTypes()
{
QVERIFY(QMetaType::type("QVector2D") == QMetaType::QVector2D);
QVERIFY(QMetaType::type("QVector3D") == QMetaType::QVector3D);
@@ -2137,6 +2137,6 @@ void tst_QVector::metaTypes()
QVERIFY(qMetaTypeId<QVector4D>() == QMetaType::QVector4D);
}
-QTEST_APPLESS_MAIN(tst_QVector)
+QTEST_APPLESS_MAIN(tst_QVectorND)
#include "tst_qvectornd.moc"
diff --git a/tests/auto/xmlpatternsdiagnosticsts/tst_xmlpatternsdiagnosticsts.cpp b/tests/auto/xmlpatternsdiagnosticsts/tst_xmlpatternsdiagnosticsts.cpp
index 4a11404..f4f6181 100644
--- a/tests/auto/xmlpatternsdiagnosticsts/tst_xmlpatternsdiagnosticsts.cpp
+++ b/tests/auto/xmlpatternsdiagnosticsts/tst_xmlpatternsdiagnosticsts.cpp
@@ -52,25 +52,25 @@
\since 4.5
\brief Test QtXmlPatterns test suite driver in tests/auto/xmlpatternsxqts/lib/.
*/
-class tst_XmlPatternsXSLTS : public tst_SuiteTest
+class tst_XmlPatternsDiagnosticsTS : public tst_SuiteTest
{
Q_OBJECT
public:
- tst_XmlPatternsXSLTS();
+ tst_XmlPatternsDiagnosticsTS();
protected:
virtual void catalogPath(QString &write) const;
};
-tst_XmlPatternsXSLTS::tst_XmlPatternsXSLTS() : tst_SuiteTest(tst_SuiteTest::XQuerySuite, true)
+tst_XmlPatternsDiagnosticsTS::tst_XmlPatternsDiagnosticsTS() : tst_SuiteTest(tst_SuiteTest::XQuerySuite, true)
{
}
-void tst_XmlPatternsXSLTS::catalogPath(QString &write) const
+void tst_XmlPatternsDiagnosticsTS::catalogPath(QString &write) const
{
write = QLatin1String("TestSuite/DiagnosticsCatalog.xml");
}
-QTEST_MAIN(tst_XmlPatternsXSLTS)
+QTEST_MAIN(tst_XmlPatternsDiagnosticsTS)
#include "tst_xmlpatternsdiagnosticsts.moc"
#else