diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 4 | ||||
-rw-r--r-- | tools/qmlviewer/qfxtester.cpp | 48 | ||||
-rw-r--r-- | tools/qmlviewer/qfxtester.h | 32 | ||||
-rw-r--r-- | tools/qmlviewer/qmlviewer.cpp | 2 | ||||
-rw-r--r-- | tools/qmlviewer/qmlviewer.h | 6 |
5 files changed, 46 insertions, 46 deletions
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 18c7916..c5ea308 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -4276,7 +4276,7 @@ void HtmlGenerator::generateQmlInherits(const QmlClassNode* cn, } /*! - Output the "[Xxx instantiates the C++ class QFxXxx]" + Output the "[Xxx instantiates the C++ class QmlGraphicsXxx]" line for the QML element, if there should be one. If there is no class node, or if the class node status @@ -4306,7 +4306,7 @@ void HtmlGenerator::generateQmlInstantiates(const QmlClassNode* qcn, } /*! - Output the "[QFxXxx is instantiated by QML element Xxx]" + Output the "[QmlGraphicsXxx is instantiated by QML element Xxx]" line for the class, if there should be one. If there is no QML element, or if the class node status diff --git a/tools/qmlviewer/qfxtester.cpp b/tools/qmlviewer/qfxtester.cpp index 0ccc9c0..a105701 100644 --- a/tools/qmlviewer/qfxtester.cpp +++ b/tools/qmlviewer/qfxtester.cpp @@ -24,12 +24,12 @@ QT_BEGIN_NAMESPACE -QML_DEFINE_TYPE(Qt.VisualTest, 4, 6, (QT_VERSION&0x00ff00)>>8, VisualTest, QFxVisualTest); -QML_DEFINE_TYPE(Qt.VisualTest, 4, 6, (QT_VERSION&0x00ff00)>>8, Frame, QFxVisualTestFrame); -QML_DEFINE_TYPE(Qt.VisualTest, 4, 6, (QT_VERSION&0x00ff00)>>8, Mouse, QFxVisualTestMouse); -QML_DEFINE_TYPE(Qt.VisualTest, 4, 6, (QT_VERSION&0x00ff00)>>8, Key, QFxVisualTestKey); +QML_DEFINE_TYPE(Qt.VisualTest, 4, 6, (QT_VERSION&0x00ff00)>>8, VisualTest, QmlGraphicsVisualTest); +QML_DEFINE_TYPE(Qt.VisualTest, 4, 6, (QT_VERSION&0x00ff00)>>8, Frame, QmlGraphicsVisualTestFrame); +QML_DEFINE_TYPE(Qt.VisualTest, 4, 6, (QT_VERSION&0x00ff00)>>8, Mouse, QmlGraphicsVisualTestMouse); +QML_DEFINE_TYPE(Qt.VisualTest, 4, 6, (QT_VERSION&0x00ff00)>>8, Key, QmlGraphicsVisualTestKey); -QFxTester::QFxTester(const QString &script, QmlViewer::ScriptOptions opts, +QmlGraphicsTester::QmlGraphicsTester(const QString &script, QmlViewer::ScriptOptions opts, QmlView *parent) : QAbstractAnimation(parent), m_script(script), m_view(parent), filterEvents(true), options(opts), testscript(0), hasCompleted(false), hasFailed(false) @@ -42,7 +42,7 @@ QFxTester::QFxTester(const QString &script, QmlViewer::ScriptOptions opts, start(); } -QFxTester::~QFxTester() +QmlGraphicsTester::~QmlGraphicsTester() { if (!hasFailed && options & QmlViewer::Record && @@ -50,26 +50,26 @@ QFxTester::~QFxTester() save(); } -int QFxTester::duration() const +int QmlGraphicsTester::duration() const { return -1; } -void QFxTester::addMouseEvent(Destination dest, QMouseEvent *me) +void QmlGraphicsTester::addMouseEvent(Destination dest, QMouseEvent *me) { MouseEvent e(me); e.destination = dest; m_mouseEvents << e; } -void QFxTester::addKeyEvent(Destination dest, QKeyEvent *ke) +void QmlGraphicsTester::addKeyEvent(Destination dest, QKeyEvent *ke) { KeyEvent e(ke); e.destination = dest; m_keyEvents << e; } -bool QFxTester::eventFilter(QObject *o, QEvent *e) +bool QmlGraphicsTester::eventFilter(QObject *o, QEvent *e) { if (!filterEvents) return false; @@ -100,7 +100,7 @@ bool QFxTester::eventFilter(QObject *o, QEvent *e) return false; } -void QFxTester::executefailure() +void QmlGraphicsTester::executefailure() { hasFailed = true; @@ -108,7 +108,7 @@ void QFxTester::executefailure() exit(-1); } -void QFxTester::imagefailure() +void QmlGraphicsTester::imagefailure() { hasFailed = true; @@ -116,7 +116,7 @@ void QFxTester::imagefailure() exit(-1); } -void QFxTester::complete() +void QmlGraphicsTester::complete() { if (options & QmlViewer::ExitOnComplete) QApplication::exit(hasFailed?-1:0); @@ -129,17 +129,17 @@ void QFxTester::complete() qWarning("Script playback complete"); } -void QFxTester::run() +void QmlGraphicsTester::run() { QmlComponent c(m_view->engine(), m_script + QLatin1String(".qml")); - testscript = qobject_cast<QFxVisualTest *>(c.create()); + testscript = qobject_cast<QmlGraphicsVisualTest *>(c.create()); if (testscript) testscript->setParent(this); else executefailure(); testscriptidx = 0; } -void QFxTester::save() +void QmlGraphicsTester::save() { QString filename = m_script + QLatin1String(".qml"); QFileInfo filenameInfo(filename); @@ -206,9 +206,9 @@ void QFxTester::save() file.close(); } -void QFxTester::updateCurrentTime(int msec) +void QmlGraphicsTester::updateCurrentTime(int msec) { - QFxItemPrivate::setConsistentTime(msec); + QmlGraphicsItemPrivate::setConsistentTime(msec); QImage img(m_view->width(), m_view->height(), QImage::Format_RGB32); @@ -268,17 +268,17 @@ void QFxTester::updateCurrentTime(int msec) QObject *event = testscript->event(testscriptidx); - if (QFxVisualTestFrame *frame = qobject_cast<QFxVisualTestFrame *>(event)) { + if (QmlGraphicsVisualTestFrame *frame = qobject_cast<QmlGraphicsVisualTestFrame *>(event)) { if (frame->msec() < msec) { if (options & QmlViewer::TestImages) { - qWarning() << "QFxTester: Extra frame. Seen:" + qWarning() << "QmlGraphicsTester: Extra frame. Seen:" << msec << "Expected:" << frame->msec(); imagefailure(); } } else if (frame->msec() == msec) { if (frame->hash().toUtf8() != fe.hash.toHex()) { if (options & QmlViewer::TestImages) { - qWarning() << "QFxTester: Mismatched frame hash. Seen:" + qWarning() << "QmlGraphicsTester: Mismatched frame hash. Seen:" << fe.hash.toHex() << "Expected:" << frame->hash().toUtf8(); imagefailure(); @@ -292,13 +292,13 @@ void QFxTester::updateCurrentTime(int msec) QImage goodImage(frame->image().toLocalFile()); if (goodImage != img) { QString reject(frame->image().toLocalFile() + ".reject.png"); - qWarning() << "QFxTester: Image mismatch. Reject saved to:" + qWarning() << "QmlGraphicsTester: Image mismatch. Reject saved to:" << reject; img.save(reject); imagefailure(); } } - } else if (QFxVisualTestMouse *mouse = qobject_cast<QFxVisualTestMouse *>(event)) { + } else if (QmlGraphicsVisualTestMouse *mouse = qobject_cast<QmlGraphicsVisualTestMouse *>(event)) { QPoint pos(mouse->x(), mouse->y()); QPoint globalPos = m_view->mapToGlobal(QPoint(0, 0)) + pos; QMouseEvent event((QEvent::Type)mouse->type(), pos, globalPos, (Qt::MouseButton)mouse->button(), (Qt::MouseButtons)mouse->buttons(), (Qt::KeyboardModifiers)mouse->modifiers()); @@ -313,7 +313,7 @@ void QFxTester::updateCurrentTime(int msec) me.destination = ViewPort; } m_savedMouseEvents.append(me); - } else if (QFxVisualTestKey *key = qobject_cast<QFxVisualTestKey *>(event)) { + } else if (QmlGraphicsVisualTestKey *key = qobject_cast<QmlGraphicsVisualTestKey *>(event)) { QKeyEvent event((QEvent::Type)key->type(), key->key(), (Qt::KeyboardModifiers)key->modifiers(), QString::fromUtf8(QByteArray::fromHex(key->text().toUtf8())), key->autorep(), key->count()); diff --git a/tools/qmlviewer/qfxtester.h b/tools/qmlviewer/qfxtester.h index 52987db..c3a6f01 100644 --- a/tools/qmlviewer/qfxtester.h +++ b/tools/qmlviewer/qfxtester.h @@ -21,13 +21,13 @@ QT_BEGIN_NAMESPACE -class QFxVisualTest : public QObject +class QmlGraphicsVisualTest : public QObject { Q_OBJECT Q_PROPERTY(QList<QObject *>* events READ events CONSTANT) Q_CLASSINFO("DefaultProperty", "events") public: - QFxVisualTest() {} + QmlGraphicsVisualTest() {} QList<QObject *> *events() { return &m_events; } @@ -37,16 +37,16 @@ public: private: QList<QObject *> m_events; }; -QML_DECLARE_TYPE(QFxVisualTest) +QML_DECLARE_TYPE(QmlGraphicsVisualTest) -class QFxVisualTestFrame : public QObject +class QmlGraphicsVisualTestFrame : public QObject { Q_OBJECT Q_PROPERTY(int msec READ msec WRITE setMsec) Q_PROPERTY(QString hash READ hash WRITE setHash) Q_PROPERTY(QUrl image READ image WRITE setImage) public: - QFxVisualTestFrame() : m_msec(-1) {} + QmlGraphicsVisualTestFrame() : m_msec(-1) {} int msec() const { return m_msec; } void setMsec(int m) { m_msec = m; } @@ -62,9 +62,9 @@ private: QString m_hash; QUrl m_image; }; -QML_DECLARE_TYPE(QFxVisualTestFrame) +QML_DECLARE_TYPE(QmlGraphicsVisualTestFrame) -class QFxVisualTestMouse : public QObject +class QmlGraphicsVisualTestMouse : public QObject { Q_OBJECT Q_PROPERTY(int type READ type WRITE setType) @@ -75,7 +75,7 @@ class QFxVisualTestMouse : public QObject Q_PROPERTY(int modifiers READ modifiers WRITE setModifiers) Q_PROPERTY(bool sendToViewport READ sendToViewport WRITE setSendToViewport) public: - QFxVisualTestMouse() : m_type(0), m_button(0), m_buttons(0), m_x(0), m_y(0), m_modifiers(0), m_viewport(false) {} + QmlGraphicsVisualTestMouse() : m_type(0), m_button(0), m_buttons(0), m_x(0), m_y(0), m_modifiers(0), m_viewport(false) {} int type() const { return m_type; } void setType(int t) { m_type = t; } @@ -106,9 +106,9 @@ private: int m_modifiers; bool m_viewport; }; -QML_DECLARE_TYPE(QFxVisualTestMouse) +QML_DECLARE_TYPE(QmlGraphicsVisualTestMouse) -class QFxVisualTestKey : public QObject +class QmlGraphicsVisualTestKey : public QObject { Q_OBJECT Q_PROPERTY(int type READ type WRITE setType) @@ -119,7 +119,7 @@ class QFxVisualTestKey : public QObject Q_PROPERTY(int count READ count WRITE setCount) Q_PROPERTY(bool sendToViewport READ sendToViewport WRITE setSendToViewport) public: - QFxVisualTestKey() : m_type(0), m_key(0), m_modifiers(0), m_autorep(false), m_count(0), m_viewport(false) {} + QmlGraphicsVisualTestKey() : m_type(0), m_key(0), m_modifiers(0), m_autorep(false), m_count(0), m_viewport(false) {} int type() const { return m_type; } void setType(int t) { m_type = t; } @@ -150,13 +150,13 @@ private: int m_count; bool m_viewport; }; -QML_DECLARE_TYPE(QFxVisualTestKey) +QML_DECLARE_TYPE(QmlGraphicsVisualTestKey) -class QFxTester : public QAbstractAnimation +class QmlGraphicsTester : public QAbstractAnimation { public: - QFxTester(const QString &script, QmlViewer::ScriptOptions options, QmlView *parent); - ~QFxTester(); + QmlGraphicsTester(const QString &script, QmlViewer::ScriptOptions options, QmlView *parent); + ~QmlGraphicsTester(); virtual int duration() const; @@ -222,7 +222,7 @@ private: QmlViewer::ScriptOptions options; int testscriptidx; - QFxVisualTest *testscript; + QmlGraphicsVisualTest *testscript; bool hasCompleted; bool hasFailed; diff --git a/tools/qmlviewer/qmlviewer.cpp b/tools/qmlviewer/qmlviewer.cpp index 3aeb0da..93470eb 100644 --- a/tools/qmlviewer/qmlviewer.cpp +++ b/tools/qmlviewer/qmlviewer.cpp @@ -637,7 +637,7 @@ void QmlViewer::openQml(const QString& file_or_url) setWindowTitle(tr("%1 - Qt Declarative UI Viewer").arg(file_or_url)); if (!m_script.isEmpty()) - tester = new QFxTester(m_script, m_scriptOptions, canvas); + tester = new QmlGraphicsTester(m_script, m_scriptOptions, canvas); canvas->reset(); diff --git a/tools/qmlviewer/qmlviewer.h b/tools/qmlviewer/qmlviewer.h index e1f53f9..bc8fe11 100644 --- a/tools/qmlviewer/qmlviewer.h +++ b/tools/qmlviewer/qmlviewer.h @@ -23,10 +23,10 @@ QT_BEGIN_NAMESPACE class QmlView; class PreviewDeviceSkin; -class QFxTestEngine; +class QmlGraphicsTestEngine; class QProcess; class RecordingDialog; -class QFxTester; +class QmlGraphicsTester; class QmlViewer : public QWidget { @@ -126,7 +126,7 @@ private: QString m_script; ScriptOptions m_scriptOptions; - QFxTester *tester; + QmlGraphicsTester *tester; }; Q_DECLARE_OPERATORS_FOR_FLAGS(QmlViewer::ScriptOptions) |