From 62dbc5d0bcae849af1dff393bb045a3ad8174ae7 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Tue, 3 Nov 2009 08:51:14 +1000 Subject: Remember host and port settings. --- tools/qmldebugger/standalone/main.cpp | 3 +++ tools/qmldebugger/standalone/qmldebugger.cpp | 29 +++++++++++++++++++--------- tools/qmldebugger/standalone/qmldebugger.h | 3 +++ 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/tools/qmldebugger/standalone/main.cpp b/tools/qmldebugger/standalone/main.cpp index 2f2a30e..715837e 100644 --- a/tools/qmldebugger/standalone/main.cpp +++ b/tools/qmldebugger/standalone/main.cpp @@ -45,6 +45,9 @@ int main(int argc, char ** argv) { QApplication app(argc, argv); + app.setApplicationName("QtQmlDebugger"); + app.setOrganizationName("Nokia"); + app.setOrganizationDomain("nokia.com"); QStringList args = app.arguments(); diff --git a/tools/qmldebugger/standalone/qmldebugger.cpp b/tools/qmldebugger/standalone/qmldebugger.cpp index afcf84c..4d86377 100644 --- a/tools/qmldebugger/standalone/qmldebugger.cpp +++ b/tools/qmldebugger/standalone/qmldebugger.cpp @@ -40,12 +40,14 @@ ****************************************************************************/ #include #include -#include -#include -#include -#include -#include -#include +#include + +#include +#include +#include +#include +#include +#include #include "canvasframerate.h" #include "engine.h" @@ -64,12 +66,10 @@ QmlDebugger::QmlDebugger(QWidget *parent) m_connectionState = new QLabel(this); connectLayout->addWidget(m_connectionState); m_host = new QLineEdit(this); - m_host->setText("127.0.0.1"); connectLayout->addWidget(m_host); m_port = new QSpinBox(this); m_port->setMinimum(1024); m_port->setMaximum(20000); - m_port->setValue(3768); connectLayout->addWidget(m_port); m_connectButton = new QPushButton(tr("Connect"), this); QObject::connect(m_connectButton, SIGNAL(clicked()), @@ -99,7 +99,9 @@ QmlDebugger::QmlDebugger(QWidget *parent) QObject::connect(&client, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(connectionError(QAbstractSocket::SocketError))); - m_tabs->setCurrentIndex(1); + QSettings settings; + m_host->setText(settings.value("Host", "127.0.0.1").toString()); + m_port->setValue(settings.value("Port", 3768).toInt()); connectToHost(); } @@ -119,6 +121,15 @@ void QmlDebugger::showEngineTab() m_tabs->setCurrentWidget(m_enginePane); } +void QmlDebugger::closeEvent(QCloseEvent *event) +{ + QSettings settings; + settings.setValue("Host", m_host->text()); + settings.setValue("Port", m_port->value()); + + QWidget::closeEvent(event); +} + void QmlDebugger::connectionStateChanged() { switch (client.state()) { diff --git a/tools/qmldebugger/standalone/qmldebugger.h b/tools/qmldebugger/standalone/qmldebugger.h index 7bacce7..da95ef9 100644 --- a/tools/qmldebugger/standalone/qmldebugger.h +++ b/tools/qmldebugger/standalone/qmldebugger.h @@ -67,6 +67,9 @@ public slots: void connectToHost(); void disconnectFromHost(); +protected: + void closeEvent(QCloseEvent *); + private slots: void connectionStateChanged(); void connectionError(QAbstractSocket::SocketError socketError); -- cgit v0.12 From 2eb395fc1bce47599ed9de453a84d102a4920727 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Tue, 3 Nov 2009 08:51:55 +1000 Subject: Various UI changes: added graph labels and 'clear' button, changed 'enabled' checkbox to group box and changed embedded scrollbar to external slider. --- tools/qmldebugger/standalone/canvasframerate.cpp | 213 ++++++++++++++++------- tools/qmldebugger/standalone/canvasframerate.h | 13 +- 2 files changed, 155 insertions(+), 71 deletions(-) diff --git a/tools/qmldebugger/standalone/canvasframerate.cpp b/tools/qmldebugger/standalone/canvasframerate.cpp index 408e8d0..0921be0 100644 --- a/tools/qmldebugger/standalone/canvasframerate.cpp +++ b/tools/qmldebugger/standalone/canvasframerate.cpp @@ -38,23 +38,26 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#include "canvasframerate.h" -#include -#include -#include -#include #include #include #include + +#include +#include +#include +#include +#include #include +#include +#include +#include +#include + #include #include -#include -#include -#include -#include -#include -#include + +#include +#include "canvasframerate.h" QT_BEGIN_NAMESPACE @@ -62,22 +65,23 @@ class QLineGraph : public QWidget { Q_OBJECT public: - QLineGraph(QWidget * = 0); + QLineGraph(QAbstractSlider *slider, QWidget * = 0); void setPosition(int); public slots: void addSample(int, int, int, bool); void setResolutionForHeight(int); + void clear(); protected: virtual void paintEvent(QPaintEvent *); private slots: - void scrollbarChanged(int); + void sliderChanged(int); private: - void updateScrollbar(); + void updateSlider(); void drawSample(QPainter *, int, const QRect &); void drawTime(QPainter *, const QRect &); struct Sample { @@ -86,50 +90,53 @@ private: }; QList _samples; - QScrollBar sb; + QAbstractSlider *slider; int position; int samplesPerWidth; int resolutionForHeight; bool ignoreScroll; }; -QLineGraph::QLineGraph(QWidget *parent) -: QWidget(parent), sb(Qt::Horizontal, this), position(-1), samplesPerWidth(99), resolutionForHeight(50), ignoreScroll(false) +QLineGraph::QLineGraph(QAbstractSlider *slider, QWidget *parent) +: QWidget(parent), slider(slider), position(-1), samplesPerWidth(99), resolutionForHeight(50), ignoreScroll(false) { setMinimumHeight(200); - sb.setMaximum(0); - sb.setMinimum(0); - sb.setSingleStep(1); - - QVBoxLayout *layout = new QVBoxLayout; - setLayout(layout); - layout->addStretch(2); - layout->addWidget(&sb); - QObject::connect(&sb, SIGNAL(valueChanged(int)), this, SLOT(scrollbarChanged(int))); + slider->setMaximum(0); + slider->setMinimum(0); + slider->setSingleStep(1); + + connect(slider, SIGNAL(valueChanged(int)), this, SLOT(sliderChanged(int))); } -void QLineGraph::scrollbarChanged(int v) +void QLineGraph::sliderChanged(int v) { if(ignoreScroll) return; - if (v == sb.maximum()) + if (v == slider->maximum()) position = -1; else position = v; update(); } -void QLineGraph::updateScrollbar() +void QLineGraph::clear() +{ + _samples.clear(); + updateSlider(); + update(); +} + +void QLineGraph::updateSlider() { ignoreScroll = true; - sb.setMaximum(qMax(0, _samples.count() - samplesPerWidth - 1)); + slider->setMaximum(qMax(0, _samples.count() - samplesPerWidth - 1)); if(position == -1) { - sb.setValue(sb.maximum()); + slider->setValue(slider->maximum()); } else { - sb.setValue(position); + slider->setValue(position); } ignoreScroll = false; } @@ -142,13 +149,13 @@ void QLineGraph::addSample(int a, int b, int d, bool isBreak) s.sample[1] = b; s.sample[2] = d; _samples << s; - updateScrollbar(); + updateSlider(); update(); } void QLineGraph::setPosition(int p) { - scrollbarChanged(p); + sliderChanged(p); } void QLineGraph::drawTime(QPainter *p, const QRect &rect) @@ -218,7 +225,14 @@ void QLineGraph::paintEvent(QPaintEvent *) QPainter p(this); p.setRenderHint(QPainter::Antialiasing); - QRect r(50, 10, width() - 60, height() - 60); + QRect r(65, 10, width() - 71, height() - 40); + + p.save(); + p.rotate(-90); + p.translate(-r.height()/2 - r.width()/2 - 71, -r.height()/2); + p.drawText(r, Qt::AlignCenter, tr("Time per frame (ms)")); + p.restore(); + p.setBrush(QColor("lightsteelblue")); drawSample(&p, 0, r); @@ -228,6 +242,8 @@ void QLineGraph::paintEvent(QPaintEvent *) p.setBrush(Qt::NoBrush); p.drawRect(r); + slider->setGeometry(x() + r.x(), slider->y(), r.width(), slider->height()); + for(int ii = 0; ii <= resolutionForHeight; ++ii) { int y = 1 + r.bottom() - ii * r.height() / resolutionForHeight; @@ -249,9 +265,58 @@ void QLineGraph::setResolutionForHeight(int resolution) update(); } + +class GraphWindow : public QWidget +{ + Q_OBJECT +public: + GraphWindow(QWidget *parent = 0); + +public slots: + void addSample(int, int, int, bool); + void setResolutionForHeight(int); + void clear(); + +private: + QLineGraph *m_graph; +}; + +GraphWindow::GraphWindow(QWidget *parent) + : QWidget(parent) +{ + QSlider *scroll = new QSlider(Qt::Horizontal); + m_graph = new QLineGraph(scroll); + + QLabel *label = new QLabel(tr("Total time elapsed (ms)")); + label->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum); + + QVBoxLayout *layout = new QVBoxLayout(this); + layout->setContentsMargins(0, 0, 5, 5); + layout->setSpacing(0); + layout->addWidget(m_graph); + layout->addWidget(label, 0, Qt::AlignHCenter); + layout->addWidget(scroll); +} + +void GraphWindow::addSample(int a, int b, int d, bool isBreak) +{ + m_graph->addSample(a, b, d, isBreak); +} + +void GraphWindow::setResolutionForHeight(int res) +{ + m_graph->setResolutionForHeight(res); +} + +void GraphWindow::clear() +{ + m_graph->clear(); +} + + class CanvasFrameRatePlugin : public QmlDebugClient { -Q_OBJECT + Q_OBJECT public: CanvasFrameRatePlugin(QmlDebugConnection *client); @@ -290,38 +355,44 @@ CanvasFrameRate::CanvasFrameRate(QWidget *parent) : QWidget(parent), m_plugin(0) { - QVBoxLayout *layout = new QVBoxLayout; - layout->setContentsMargins(0,0,0,0); - layout->setSpacing(0); - setLayout(layout); - m_tabs = new QTabWidget(this); - layout->addWidget(m_tabs); QHBoxLayout *bottom = new QHBoxLayout; - bottom->setContentsMargins(5, 0, 5, 0); + bottom->setMargin(0); bottom->setSpacing(10); - layout->addLayout(bottom); - - QLabel *label = new QLabel("Resolution", this); - bottom->addWidget(label); - m_spin = new QSpinBox(this); - m_spin->setRange(50,200); - m_spin->setValue(50); - m_spin->setSuffix("ms"); - bottom->addWidget(m_spin); + m_res = new QSpinBox; + m_res->setRange(50, 200); + m_res->setValue(m_res->minimum()); + m_res->setSingleStep(10); + m_res->setSuffix(QLatin1String("ms")); + bottom->addWidget(new QLabel(tr("Resolution:"))); + bottom->addWidget(m_res); - bottom->addStretch(2); + bottom->addStretch(); - m_enabledCheckBox = new QCheckBox("Enable", this); - bottom->addWidget(m_enabledCheckBox); - QObject::connect(m_enabledCheckBox, SIGNAL(stateChanged(int)), - this, SLOT(enabledStateChanged(int))); + m_clearButton = new QPushButton(tr("Clear")); + connect(m_clearButton, SIGNAL(clicked()), SLOT(clearGraph())); + bottom->addWidget(m_clearButton); - QPushButton *pb = new QPushButton(tr("New Tab"), this); - QObject::connect(pb, SIGNAL(clicked()), this, SLOT(newTab())); + QPushButton *pb = new QPushButton(tr("New Graph"), this); + connect(pb, SIGNAL(clicked()), this, SLOT(newTab())); bottom->addWidget(pb); + + m_group = new QGroupBox(tr("Enabled")); + m_group->setCheckable(true); + m_group->setChecked(false); + connect(m_group, SIGNAL(toggled(bool)), SLOT(enabledToggled(bool))); + + QVBoxLayout *groupLayout = new QVBoxLayout(m_group); + groupLayout->addWidget(m_tabs); + groupLayout->addLayout(bottom); + + QVBoxLayout *layout = new QVBoxLayout; + layout->setMargin(0); + layout->setSpacing(0); + layout->addWidget(m_group); + setLayout(layout); } void CanvasFrameRate::reset(QmlDebugConnection *conn) @@ -358,7 +429,7 @@ void CanvasFrameRate::handleConnected(QmlDebugConnection *conn) { delete m_plugin; m_plugin = new CanvasFrameRatePlugin(conn); - enabledStateChanged(m_enabledCheckBox->checkState()); + enabledToggled(m_group->isChecked()); newTab(); } @@ -372,6 +443,14 @@ QSize CanvasFrameRate::sizeHint() const return m_sizeHint; } +void CanvasFrameRate::clearGraph() +{ + if (m_tabs->count()) { + GraphWindow *w = qobject_cast(m_tabs->widget(m_tabs->count() - 1)); + w->clear(); + } +} + void CanvasFrameRate::newTab() { if (!m_plugin) @@ -385,20 +464,20 @@ void CanvasFrameRate::newTab() int id = m_tabs->count(); - QLineGraph *graph = new QLineGraph(this); - QObject::connect(m_plugin, SIGNAL(sample(int,int,int,bool)), - graph, SLOT(addSample(int,int,int,bool))); - QObject::connect(m_spin, SIGNAL(valueChanged(int)), graph, SLOT(setResolutionForHeight(int))); + GraphWindow *graph = new GraphWindow; + graph->setResolutionForHeight(m_res->value()); + connect(m_plugin, SIGNAL(sample(int,int,int,bool)), + graph, SLOT(addSample(int,int,int,bool))); + connect(m_res, SIGNAL(valueChanged(int)), + graph, SLOT(setResolutionForHeight(int))); QString name = QLatin1String("Graph ") + QString::number(id); m_tabs->addTab(graph, name); m_tabs->setCurrentIndex(id); } -void CanvasFrameRate::enabledStateChanged(int s) +void CanvasFrameRate::enabledToggled(bool checked) { - bool checked = s != 0; - if (m_plugin) static_cast(m_plugin)->setEnabled(checked); } diff --git a/tools/qmldebugger/standalone/canvasframerate.h b/tools/qmldebugger/standalone/canvasframerate.h index be6bbc6..f8eec59 100644 --- a/tools/qmldebugger/standalone/canvasframerate.h +++ b/tools/qmldebugger/standalone/canvasframerate.h @@ -49,8 +49,11 @@ QT_BEGIN_NAMESPACE class QTabWidget; +class QSlider; +class QGroupBox; +class QLabel; class QSpinBox; -class QCheckBox; +class QPushButton; class CanvasFrameRatePlugin; @@ -66,18 +69,20 @@ public: virtual QSize sizeHint() const; private slots: + void clearGraph(); void newTab(); - void enabledStateChanged(int); + void enabledToggled(bool); void connectionStateChanged(QAbstractSocket::SocketState state); private: void handleConnected(QmlDebugConnection *conn); + QGroupBox *m_group; QTabWidget *m_tabs; - QSpinBox *m_spin; + QSpinBox *m_res; + QPushButton *m_clearButton; CanvasFrameRatePlugin *m_plugin; QSize m_sizeHint; - QCheckBox *m_enabledCheckBox; }; QT_END_NAMESPACE -- cgit v0.12 From e0688cfd4d9a31d53b456d0c211ab39565305064 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Tue, 3 Nov 2009 16:02:49 +1000 Subject: Add tooltip and bar highlight when cursor is hovered over a graph bar. --- tools/qmldebugger/standalone/canvasframerate.cpp | 115 ++++++++++++++++++----- 1 file changed, 94 insertions(+), 21 deletions(-) diff --git a/tools/qmldebugger/standalone/canvasframerate.cpp b/tools/qmldebugger/standalone/canvasframerate.cpp index 0921be0..63e04ed 100644 --- a/tools/qmldebugger/standalone/canvasframerate.cpp +++ b/tools/qmldebugger/standalone/canvasframerate.cpp @@ -41,8 +41,10 @@ #include #include #include +#include #include +#include #include #include #include @@ -76,14 +78,17 @@ public slots: protected: virtual void paintEvent(QPaintEvent *); + virtual void mouseMoveEvent(QMouseEvent *); + virtual void leaveEvent(QEvent *); private slots: void sliderChanged(int); private: void updateSlider(); - void drawSample(QPainter *, int, const QRect &); + void drawSample(QPainter *, int, const QRect &, QList *); void drawTime(QPainter *, const QRect &); + QRect findContainingRect(const QList &rects, const QPoint &pos) const; struct Sample { int sample[3]; bool isBreak; @@ -95,12 +100,18 @@ private: int samplesPerWidth; int resolutionForHeight; bool ignoreScroll; + QMargins graphMargins; + + QList rectsPaintTime; // time to do a paintEvent() + QList rectsTimeBetween; // time between frames + QRect highlightedBar; }; QLineGraph::QLineGraph(QAbstractSlider *slider, QWidget *parent) -: QWidget(parent), slider(slider), position(-1), samplesPerWidth(99), resolutionForHeight(50), ignoreScroll(false) +: QWidget(parent), slider(slider), position(-1), samplesPerWidth(99), resolutionForHeight(50), + ignoreScroll(false), graphMargins(65, 10, 71, 40) { - setMinimumHeight(200); + setMouseTracking(true); slider->setMaximum(0); slider->setMinimum(0); @@ -124,6 +135,11 @@ void QLineGraph::sliderChanged(int v) void QLineGraph::clear() { _samples.clear(); + rectsPaintTime.clear(); + rectsTimeBetween.clear(); + highlightedBar = QRect(); + position = -1; + updateSlider(); update(); } @@ -189,7 +205,7 @@ void QLineGraph::drawTime(QPainter *p, const QRect &rect) } -void QLineGraph::drawSample(QPainter *p, int s, const QRect &rect) +void QLineGraph::drawSample(QPainter *p, int s, const QRect &rect, QList *record) { if(_samples.isEmpty()) return; @@ -212,8 +228,11 @@ void QLineGraph::drawSample(QPainter *p, int s, const QRect &rect) xEnd = rect.left() + scaleX * (ii - first); int yEnd = rect.bottom() - _samples.at(ii).sample[s] * scaleY; - if (!(s == 0 && _samples.at(ii).isBreak)) - p->drawRect(QRect(lastXEnd, yEnd, scaleX, _samples.at(ii).sample[s] * scaleY)); + if (!(s == 0 && _samples.at(ii).isBreak)) { + QRect bar(lastXEnd, yEnd, scaleX, _samples.at(ii).sample[s] * scaleY); + record->append(bar); + p->drawRect(bar); + } lastXEnd = xEnd; } @@ -225,19 +244,27 @@ void QLineGraph::paintEvent(QPaintEvent *) QPainter p(this); p.setRenderHint(QPainter::Antialiasing); - QRect r(65, 10, width() - 71, height() - 40); + QRect r(graphMargins.left(), graphMargins.top(), + width() - graphMargins.right(), height() - graphMargins.bottom()); p.save(); p.rotate(-90); - p.translate(-r.height()/2 - r.width()/2 - 71, -r.height()/2); + p.translate(-r.height()/2 - r.width()/2 - graphMargins.right(), -r.height()/2); p.drawText(r, Qt::AlignCenter, tr("Time per frame (ms)")); p.restore(); p.setBrush(QColor("lightsteelblue")); - drawSample(&p, 0, r); + rectsTimeBetween.clear(); + drawSample(&p, 0, r, &rectsTimeBetween); p.setBrush(QColor("pink")); - drawSample(&p, 1, r); + rectsPaintTime.clear(); + drawSample(&p, 1, r, &rectsPaintTime); + + if (!highlightedBar.isNull()) { + p.setBrush(Qt::darkGreen); + p.drawRect(highlightedBar); + } p.setBrush(Qt::NoBrush); p.drawRect(r); @@ -259,12 +286,50 @@ void QLineGraph::paintEvent(QPaintEvent *) drawTime(&p, r); } +void QLineGraph::mouseMoveEvent(QMouseEvent *event) +{ + QPoint pos = event->pos(); + + QRect rect = findContainingRect(rectsPaintTime, pos); + if (rect.isNull()) + rect = findContainingRect(rectsTimeBetween, pos); + + if (!highlightedBar.isNull()) + update(highlightedBar.adjusted(-1, -1, 1, 1)); + highlightedBar = rect; + + if (!rect.isNull()) { + QRect graph(graphMargins.left(), graphMargins.top(), + width() - graphMargins.right(), height() - graphMargins.bottom()); + qreal scaleY = qreal(graph.height()) / resolutionForHeight; + QToolTip::showText(event->globalPos(), QString::number(qRound(rect.height() / scaleY)), this, rect); + update(rect.adjusted(-1, -1, 1, 1)); + } +} + +void QLineGraph::leaveEvent(QEvent *) +{ + if (!highlightedBar.isNull()) { + highlightedBar = QRect(); + update(highlightedBar.adjusted(-1, -1, 1, 1)); + } +} + void QLineGraph::setResolutionForHeight(int resolution) { resolutionForHeight = resolution; update(); } +QRect QLineGraph::findContainingRect(const QList &rects, const QPoint &pos) const +{ + for (int i=0; isetFocusPolicy(Qt::WheelFocus); m_graph = new QLineGraph(scroll); - QLabel *label = new QLabel(tr("Total time elapsed (ms)")); - label->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum); + setFocusPolicy(Qt::WheelFocus); + setFocusProxy(scroll); QVBoxLayout *layout = new QVBoxLayout(this); layout->setContentsMargins(0, 0, 5, 5); layout->setSpacing(0); - layout->addWidget(m_graph); - layout->addWidget(label, 0, Qt::AlignHCenter); + layout->addWidget(m_graph, 2); + layout->addWidget(new QLabel(tr("Total time elapsed (ms)")), 0, Qt::AlignHCenter); layout->addWidget(scroll); + + setMinimumSize(QSize(400, 200)); } void GraphWindow::addSample(int a, int b, int d, bool isBreak) @@ -362,7 +430,7 @@ CanvasFrameRate::CanvasFrameRate(QWidget *parent) bottom->setSpacing(10); m_res = new QSpinBox; - m_res->setRange(50, 200); + m_res->setRange(30, 200); m_res->setValue(m_res->minimum()); m_res->setSingleStep(10); m_res->setSuffix(QLatin1String("ms")); @@ -385,14 +453,18 @@ CanvasFrameRate::CanvasFrameRate(QWidget *parent) connect(m_group, SIGNAL(toggled(bool)), SLOT(enabledToggled(bool))); QVBoxLayout *groupLayout = new QVBoxLayout(m_group); + groupLayout->setContentsMargins(5, 0, 5, 0); + groupLayout->setSpacing(5); groupLayout->addWidget(m_tabs); groupLayout->addLayout(bottom); QVBoxLayout *layout = new QVBoxLayout; - layout->setMargin(0); + layout->setContentsMargins(0, 15, 0, 0); layout->setSpacing(0); layout->addWidget(m_group); setLayout(layout); + + setFocusPolicy(Qt::StrongFocus); } void CanvasFrameRate::reset(QmlDebugConnection *conn) @@ -446,8 +518,9 @@ QSize CanvasFrameRate::sizeHint() const void CanvasFrameRate::clearGraph() { if (m_tabs->count()) { - GraphWindow *w = qobject_cast(m_tabs->widget(m_tabs->count() - 1)); - w->clear(); + GraphWindow *w = qobject_cast(m_tabs->currentWidget()); + if (w) + w->clear(); } } @@ -462,7 +535,7 @@ void CanvasFrameRate::newTab() w, SLOT(addSample(int,int,int,bool))); } - int id = m_tabs->count(); + int count = m_tabs->count(); GraphWindow *graph = new GraphWindow; graph->setResolutionForHeight(m_res->value()); @@ -471,9 +544,9 @@ void CanvasFrameRate::newTab() connect(m_res, SIGNAL(valueChanged(int)), graph, SLOT(setResolutionForHeight(int))); - QString name = QLatin1String("Graph ") + QString::number(id); + QString name = QLatin1String("Graph ") + QString::number(count + 1); m_tabs->addTab(graph, name); - m_tabs->setCurrentIndex(id); + m_tabs->setCurrentIndex(count); } void CanvasFrameRate::enabledToggled(bool checked) -- cgit v0.12 From 7a249a72f118f5adacc7ca3af498ac6434dc8c65 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Wed, 4 Nov 2009 14:30:21 +1000 Subject: Show source file and line of an object in the text editor when it is double clicked in the object tree. --- tools/qmldebugger/creatorplugin/creatorplugin.pro | 1 + .../qmldebugger/creatorplugin/qmlinspectormode.cpp | 24 ++++++++++++++++++++++ tools/qmldebugger/creatorplugin/qmlinspectormode.h | 2 ++ tools/qmldebugger/standalone/objecttree.cpp | 20 +++++++++++++----- tools/qmldebugger/standalone/objecttree.h | 2 ++ 5 files changed, 44 insertions(+), 5 deletions(-) diff --git a/tools/qmldebugger/creatorplugin/creatorplugin.pro b/tools/qmldebugger/creatorplugin/creatorplugin.pro index d191a37..ff7f3da 100644 --- a/tools/qmldebugger/creatorplugin/creatorplugin.pro +++ b/tools/qmldebugger/creatorplugin/creatorplugin.pro @@ -25,5 +25,6 @@ IDE_BUILD_TREE=$$(CREATOR_BUILD_DIR) include($$(CREATOR_SRC_DIR)/src/qtcreatorplugin.pri) include($$(CREATOR_SRC_DIR)/src/plugins/projectexplorer/projectexplorer.pri) include($$(CREATOR_SRC_DIR)/src/plugins/coreplugin/coreplugin.pri) +include($$(CREATOR_SRC_DIR)/src/plugins/texteditor/texteditor.pri) LIBS += -L$$(CREATOR_BUILD_DIR)/lib/qtcreator diff --git a/tools/qmldebugger/creatorplugin/qmlinspectormode.cpp b/tools/qmldebugger/creatorplugin/qmlinspectormode.cpp index a1ca2fc..ce8ef30 100644 --- a/tools/qmldebugger/creatorplugin/qmlinspectormode.cpp +++ b/tools/qmldebugger/creatorplugin/qmlinspectormode.cpp @@ -65,6 +65,8 @@ #include #include +#include + #include #include #include @@ -435,8 +437,12 @@ void QmlInspectorMode::initWidgets() WatchTableHeaderView *header = new WatchTableHeaderView(m_watchTableModel); m_watchTableView->setHorizontalHeader(header); + connect(m_objectTreeWidget, SIGNAL(activated(QmlDebugObjectReference)), + this, SLOT(treeObjectActivated(QmlDebugObjectReference))); + connect(m_objectTreeWidget, SIGNAL(currentObjectChanged(QmlDebugObjectReference)), m_propertiesWidget, SLOT(reload(QmlDebugObjectReference))); + connect(m_objectTreeWidget, SIGNAL(expressionWatchRequested(QmlDebugObjectReference,QString)), m_watchTableModel, SLOT(expressionWatchRequested(QmlDebugObjectReference,QString))); @@ -536,6 +542,24 @@ void QmlInspectorMode::contextChanged() delete m_contextQuery; m_contextQuery = 0; } +void QmlInspectorMode::treeObjectActivated(const QmlDebugObjectReference &obj) +{ + QmlDebugFileReference source = obj.source(); + QString fileName = source.url().toLocalFile(); + + if (source.lineNumber() < 0 || !QFile::exists(fileName)) + return; + + Core::EditorManager *editorManager = Core::EditorManager::instance(); + TextEditor::ITextEditor *editor = qobject_cast(editorManager->openEditor(fileName)); + if (editor) { + editorManager->ensureEditorManagerVisible(); + editorManager->addCurrentPositionToNavigationHistory(); + editor->gotoLine(source.lineNumber()); + editor->widget()->setFocus(); + } +} + QT_END_NAMESPACE #include "qmlinspectormode.moc" diff --git a/tools/qmldebugger/creatorplugin/qmlinspectormode.h b/tools/qmldebugger/creatorplugin/qmlinspectormode.h index 93c2e44..b4158f1 100644 --- a/tools/qmldebugger/creatorplugin/qmlinspectormode.h +++ b/tools/qmldebugger/creatorplugin/qmlinspectormode.h @@ -57,6 +57,7 @@ class QmlEngineDebug; class QmlDebugConnection; class QmlDebugEnginesQuery; class QmlDebugRootContextQuery; +class QmlDebugObjectReference; class ObjectTree; class WatchTableModel; class WatchTableView; @@ -92,6 +93,7 @@ private slots: void enginesChanged(); void queryEngineContext(int); void contextChanged(); + void treeObjectActivated(const QmlDebugObjectReference &obj); private: struct Actions { diff --git a/tools/qmldebugger/standalone/objecttree.cpp b/tools/qmldebugger/standalone/objecttree.cpp index b06d377..4dbc1a7 100644 --- a/tools/qmldebugger/standalone/objecttree.cpp +++ b/tools/qmldebugger/standalone/objecttree.cpp @@ -59,9 +59,12 @@ ObjectTree::ObjectTree(QmlEngineDebug *client, QWidget *parent) { setHeaderHidden(true); setMinimumWidth(250); + setExpandsOnDoubleClick(false); connect(this, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), - this, SLOT(currentItemChanged(QTreeWidgetItem *))); + SLOT(currentItemChanged(QTreeWidgetItem *))); + connect(this, SIGNAL(itemActivated(QTreeWidgetItem *, int)), + SLOT(activated(QTreeWidgetItem *))); } void ObjectTree::setEngineDebug(QmlEngineDebug *client) @@ -113,11 +116,18 @@ void ObjectTree::currentItemChanged(QTreeWidgetItem *item) return; QmlDebugObjectReference obj = item->data(0, Qt::UserRole).value(); - if (obj.debugId() < 0) { - qWarning("QML Object Tree: bad object id"); + if (obj.debugId() >= 0) + emit currentObjectChanged(obj); +} + +void ObjectTree::activated(QTreeWidgetItem *item) +{ + if (!item) return; - } - emit currentObjectChanged(obj); + + QmlDebugObjectReference obj = item->data(0, Qt::UserRole).value(); + if (obj.debugId() >= 0) + emit activated(obj); } void ObjectTree::buildTree(const QmlDebugObjectReference &obj, QTreeWidgetItem *parent) diff --git a/tools/qmldebugger/standalone/objecttree.h b/tools/qmldebugger/standalone/objecttree.h index f7b3a3f..c8d625c 100644 --- a/tools/qmldebugger/standalone/objecttree.h +++ b/tools/qmldebugger/standalone/objecttree.h @@ -64,6 +64,7 @@ public: signals: void currentObjectChanged(const QmlDebugObjectReference &); + void activated(const QmlDebugObjectReference &); void expressionWatchRequested(const QmlDebugObjectReference &, const QString &); public slots: @@ -76,6 +77,7 @@ protected: private slots: void objectFetched(); void currentItemChanged(QTreeWidgetItem *); + void activated(QTreeWidgetItem *); private: QTreeWidgetItem *findItemByObjectId(int debugId) const; -- cgit v0.12 From f447e64f378fdebea3b8f2fca5624f48546a0529 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Wed, 4 Nov 2009 16:20:56 +1000 Subject: Use QML type names in object tree --- src/declarative/qml/qmlenginedebug.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/declarative/qml/qmlenginedebug.cpp b/src/declarative/qml/qmlenginedebug.cpp index 2d8acf7..52d54b9 100644 --- a/src/declarative/qml/qmlenginedebug.cpp +++ b/src/declarative/qml/qmlenginedebug.cpp @@ -271,10 +271,18 @@ QmlEngineDebugServer::objectData(QObject *object) } rv.objectName = object->objectName(); - rv.objectType = QString::fromUtf8(object->metaObject()->className()); rv.objectId = QmlDebugService::idForObject(object); rv.contextId = QmlDebugService::idForObject(qmlContext(object)); + QmlType *type = QmlMetaType::qmlType(object->metaObject()); + if (type) { + QString typeName = type->qmlTypeName(); + int lastSlash = typeName.lastIndexOf(QLatin1Char('/')); + rv.objectType = lastSlash < 0 ? typeName : typeName.mid(lastSlash+1); + } else { + rv.objectType = QString::fromUtf8(object->metaObject()->className()); + } + return rv; } -- cgit v0.12 From 3babe49011d363aaaabafb70bfb0626217ec8959 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Thu, 5 Nov 2009 13:54:25 +1000 Subject: Move graph slider when graph gets wheel event. --- tools/qmldebugger/standalone/canvasframerate.cpp | 43 ++++++++++++++++++------ 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/tools/qmldebugger/standalone/canvasframerate.cpp b/tools/qmldebugger/standalone/canvasframerate.cpp index 63e04ed..d956029 100644 --- a/tools/qmldebugger/standalone/canvasframerate.cpp +++ b/tools/qmldebugger/standalone/canvasframerate.cpp @@ -43,6 +43,7 @@ #include #include +#include #include #include #include @@ -80,6 +81,7 @@ protected: virtual void paintEvent(QPaintEvent *); virtual void mouseMoveEvent(QMouseEvent *); virtual void leaveEvent(QEvent *); + virtual void wheelEvent(QWheelEvent *event); private slots: void sliderChanged(int); @@ -109,7 +111,7 @@ private: QLineGraph::QLineGraph(QAbstractSlider *slider, QWidget *parent) : QWidget(parent), slider(slider), position(-1), samplesPerWidth(99), resolutionForHeight(50), - ignoreScroll(false), graphMargins(65, 10, 71, 40) + ignoreScroll(false), graphMargins(65, 10, 71, 35) { setMouseTracking(true); @@ -129,7 +131,16 @@ void QLineGraph::sliderChanged(int v) position = -1; else position = v; + update(); + + // update highlightedRect + QPoint pos = mapFromGlobal(QCursor::pos()); + if (geometry().contains(pos)) { + QMouseEvent *me = new QMouseEvent(QEvent::MouseMove, pos, + Qt::NoButton, Qt::NoButton, Qt::NoModifier); + QApplication::postEvent(this, me); + } } void QLineGraph::clear() @@ -153,7 +164,7 @@ void QLineGraph::updateSlider() slider->setValue(slider->maximum()); } else { slider->setValue(position); - } + } ignoreScroll = false; } @@ -250,7 +261,7 @@ void QLineGraph::paintEvent(QPaintEvent *) p.save(); p.rotate(-90); p.translate(-r.height()/2 - r.width()/2 - graphMargins.right(), -r.height()/2); - p.drawText(r, Qt::AlignCenter, tr("Time per frame (ms)")); + p.drawText(r, Qt::AlignCenter, tr("Frame rate")); p.restore(); p.setBrush(QColor("lightsteelblue")); @@ -310,11 +321,18 @@ void QLineGraph::mouseMoveEvent(QMouseEvent *event) void QLineGraph::leaveEvent(QEvent *) { if (!highlightedBar.isNull()) { + QRect bar = highlightedBar.adjusted(-1, -1, 1, 1); highlightedBar = QRect(); - update(highlightedBar.adjusted(-1, -1, 1, 1)); + update(bar); } } +void QLineGraph::wheelEvent(QWheelEvent *event) +{ + QWheelEvent we(QPoint(0,0), event->delta(), event->buttons(), event->modifiers(), event->orientation()); + QApplication::sendEvent(slider, &we); +} + void QLineGraph::setResolutionForHeight(int resolution) { resolutionForHeight = resolution; @@ -337,6 +355,8 @@ class GraphWindow : public QWidget public: GraphWindow(QWidget *parent = 0); + virtual QSize sizeHint() const; + public slots: void addSample(int, int, int, bool); void setResolutionForHeight(int); @@ -357,13 +377,11 @@ GraphWindow::GraphWindow(QWidget *parent) setFocusProxy(scroll); QVBoxLayout *layout = new QVBoxLayout(this); - layout->setContentsMargins(0, 0, 5, 5); + layout->setContentsMargins(0, 0, 5, 0); layout->setSpacing(0); layout->addWidget(m_graph, 2); layout->addWidget(new QLabel(tr("Total time elapsed (ms)")), 0, Qt::AlignHCenter); layout->addWidget(scroll); - - setMinimumSize(QSize(400, 200)); } void GraphWindow::addSample(int a, int b, int d, bool isBreak) @@ -381,6 +399,11 @@ void GraphWindow::clear() m_graph->clear(); } +QSize GraphWindow::sizeHint() const +{ + return QSize(400, 220); +} + class CanvasFrameRatePlugin : public QmlDebugClient { @@ -454,17 +477,15 @@ CanvasFrameRate::CanvasFrameRate(QWidget *parent) QVBoxLayout *groupLayout = new QVBoxLayout(m_group); groupLayout->setContentsMargins(5, 0, 5, 0); - groupLayout->setSpacing(5); + groupLayout->setSpacing(2); groupLayout->addWidget(m_tabs); groupLayout->addLayout(bottom); QVBoxLayout *layout = new QVBoxLayout; - layout->setContentsMargins(0, 15, 0, 0); + layout->setContentsMargins(0, 10, 0, 0); layout->setSpacing(0); layout->addWidget(m_group); setLayout(layout); - - setFocusPolicy(Qt::StrongFocus); } void CanvasFrameRate::reset(QmlDebugConnection *conn) -- cgit v0.12 From 32c0739fa396829048c9a25d799adb4101a284e7 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Fri, 6 Nov 2009 11:59:21 +1000 Subject: visualtest webPageWidth --- .../visual/webview/zooming/data/pageWidth.qml | 227 +++++++++++++++++++++ .../visual/webview/zooming/pageWidth.qml | 9 + 2 files changed, 236 insertions(+) create mode 100644 tests/auto/declarative/visual/webview/zooming/data/pageWidth.qml create mode 100644 tests/auto/declarative/visual/webview/zooming/pageWidth.qml diff --git a/tests/auto/declarative/visual/webview/zooming/data/pageWidth.qml b/tests/auto/declarative/visual/webview/zooming/data/pageWidth.qml new file mode 100644 index 0000000..1a993e1 --- /dev/null +++ b/tests/auto/declarative/visual/webview/zooming/data/pageWidth.qml @@ -0,0 +1,227 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 32 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 48 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 64 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 80 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 96 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 112 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 128 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 144 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 160 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 176 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 192 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 208 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 224 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 240 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 256 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 272 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 288 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 304 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 320 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 336 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 352 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 368 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 384 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 400 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 416 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 432 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 448 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 464 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 480 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 496 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 512 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 528 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 544 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 560 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 576 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 592 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 608 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 624 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 640 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 656 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 672 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 688 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 704 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 720 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 736 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 752 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 768 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 784 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 800 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 816 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 832 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 848 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 864 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } + Frame { + msec: 880 + hash: "9a2554b1b322ea71115fa91d0100d2ff" + } +} diff --git a/tests/auto/declarative/visual/webview/zooming/pageWidth.qml b/tests/auto/declarative/visual/webview/zooming/pageWidth.qml new file mode 100644 index 0000000..86dd7d2 --- /dev/null +++ b/tests/auto/declarative/visual/webview/zooming/pageWidth.qml @@ -0,0 +1,9 @@ +import Qt 4.6 + +WebView { + width: 200 + height: 250 + url: "resolution.html" + webPageWidth: 400 + preferredWidth: 200 +} -- cgit v0.12 From 1641e1845b51c83e95f613486a22a76d9e7f5948 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Fri, 6 Nov 2009 11:59:48 +1000 Subject: doc --- src/declarative/graphicsitems/qmlgraphicswebview.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/declarative/graphicsitems/qmlgraphicswebview.cpp b/src/declarative/graphicsitems/qmlgraphicswebview.cpp index 5ce0ee8..7204767 100644 --- a/src/declarative/graphicsitems/qmlgraphicswebview.cpp +++ b/src/declarative/graphicsitems/qmlgraphicswebview.cpp @@ -464,7 +464,8 @@ void QmlGraphicsWebView::setPreferredWidth(int iw) /*! \qmlproperty int WebView::webPageWidth - This property holds the page width suggested to the web engine. + This property holds the page width suggested to the web engine. The zoomFactor + will be changed to fit this with in preferredWidth. */ int QmlGraphicsWebView::webPageWidth() const { -- cgit v0.12 From 3eb684e909efc9f38f60981a492e0bbd93bc5026 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Fri, 6 Nov 2009 12:59:04 +1000 Subject: more visual tests --- .../javascript/data/evaluateJavaScript.0.png | Bin 0 -> 7999 bytes .../javascript/data/evaluateJavaScript.1.png | Bin 0 -> 8020 bytes .../javascript/data/evaluateJavaScript.2.png | Bin 0 -> 8143 bytes .../javascript/data/evaluateJavaScript.3.png | Bin 0 -> 8158 bytes .../javascript/data/evaluateJavaScript.4.png | Bin 0 -> 8284 bytes .../javascript/data/evaluateJavaScript.5.png | Bin 0 -> 8284 bytes .../javascript/data/evaluateJavaScript.6.png | Bin 0 -> 8284 bytes .../javascript/data/evaluateJavaScript.7.png | Bin 0 -> 8284 bytes .../javascript/data/evaluateJavaScript.8.png | Bin 0 -> 8284 bytes .../webview/javascript/data/evaluateJavaScript.qml | 3759 ++++++++++++++++++++ .../webview/javascript/evaluateJavaScript.qml | 31 + .../webview/zooming/data/renderControl.0.png | Bin 0 -> 7589 bytes .../visual/webview/zooming/data/renderControl.qml | 415 +++ .../visual/webview/zooming/renderControl.qml | 21 + 14 files changed, 4226 insertions(+) create mode 100644 tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.0.png create mode 100644 tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.1.png create mode 100644 tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.2.png create mode 100644 tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.3.png create mode 100644 tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.4.png create mode 100644 tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.5.png create mode 100644 tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.6.png create mode 100644 tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.7.png create mode 100644 tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.8.png create mode 100644 tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.qml create mode 100644 tests/auto/declarative/visual/webview/javascript/evaluateJavaScript.qml create mode 100644 tests/auto/declarative/visual/webview/zooming/data/renderControl.0.png create mode 100644 tests/auto/declarative/visual/webview/zooming/data/renderControl.qml create mode 100644 tests/auto/declarative/visual/webview/zooming/renderControl.qml diff --git a/tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.0.png b/tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.0.png new file mode 100644 index 0000000..139aa9d Binary files /dev/null and b/tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.0.png differ diff --git a/tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.1.png b/tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.1.png new file mode 100644 index 0000000..e2e1644 Binary files /dev/null and b/tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.1.png differ diff --git a/tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.2.png b/tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.2.png new file mode 100644 index 0000000..aa2fb82 Binary files /dev/null and b/tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.2.png differ diff --git a/tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.3.png b/tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.3.png new file mode 100644 index 0000000..1976430 Binary files /dev/null and b/tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.3.png differ diff --git a/tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.4.png b/tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.4.png new file mode 100644 index 0000000..c895a0a Binary files /dev/null and b/tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.4.png differ diff --git a/tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.5.png b/tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.5.png new file mode 100644 index 0000000..c895a0a Binary files /dev/null and b/tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.5.png differ diff --git a/tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.6.png b/tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.6.png new file mode 100644 index 0000000..c895a0a Binary files /dev/null and b/tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.6.png differ diff --git a/tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.7.png b/tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.7.png new file mode 100644 index 0000000..c895a0a Binary files /dev/null and b/tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.7.png differ diff --git a/tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.8.png b/tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.8.png new file mode 100644 index 0000000..c895a0a Binary files /dev/null and b/tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.8.png differ diff --git a/tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.qml b/tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.qml new file mode 100644 index 0000000..957f9d5 --- /dev/null +++ b/tests/auto/declarative/visual/webview/javascript/data/evaluateJavaScript.qml @@ -0,0 +1,3759 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 32 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 48 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 64 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 80 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 96 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 112 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 128 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 144 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 160 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 176 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 192 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 208 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 224 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 240 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 256 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 272 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 288 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 304 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 320 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 336 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 352 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 368 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 384 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 400 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 416 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 195; y: 25 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 187; y: 35 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 432 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 153; y: 77 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 448 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 145; y: 87 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 139; y: 99 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 464 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 135; y: 111 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 129; y: 121 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 480 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 125; y: 131 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 121; y: 139 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 117; y: 149 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 496 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 111; y: 157 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 512 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 107; y: 165 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 101; y: 171 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 528 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 97; y: 177 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 95; y: 185 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 544 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 91; y: 189 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 89; y: 195 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 560 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 85; y: 199 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 84; y: 201 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 576 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 83; y: 203 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 82; y: 204 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 81; y: 204 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 592 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 80; y: 204 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 608 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 79; y: 205 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 78; y: 206 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 624 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 77; y: 207 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 76; y: 208 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 75; y: 210 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 640 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 71; y: 216 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 656 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 70; y: 218 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 70; y: 220 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 672 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 69; y: 222 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 68; y: 224 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 688 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 67; y: 225 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 704 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 720 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 736 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 752 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 768 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 784 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 67; y: 225 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 800 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 66; y: 224 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 816 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 66; y: 222 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 832 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 65; y: 221 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 61; y: 217 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 848 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 60; y: 215 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 864 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 59; y: 214 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 57; y: 213 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 880 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 55; y: 213 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 896 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 912 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 928 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 944 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 960 + image: "evaluateJavaScript.0.png" + } + Frame { + msec: 976 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 992 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1008 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Mouse { + type: 2 + button: 1 + buttons: 1 + x: 55; y: 213 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1024 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1040 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1056 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1072 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1088 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Mouse { + type: 3 + button: 1 + buttons: 0 + x: 55; y: 213 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1104 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1120 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1136 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1152 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1168 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1184 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1200 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1216 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1232 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1248 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1264 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1280 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1296 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 57; y: 212 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 63; y: 210 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1312 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 65; y: 210 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 67; y: 209 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1328 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 69; y: 208 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 71; y: 207 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1344 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 73; y: 207 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 74; y: 206 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 75; y: 206 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1360 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1376 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1392 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1408 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1424 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1440 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1456 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1472 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1488 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1504 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1520 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1536 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1552 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1568 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1584 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1600 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1616 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1632 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1648 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1664 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1680 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Frame { + msec: 1696 + hash: "f35c69aed43a795ff02b46d7b01ef64a" + } + Key { + type: 6 + key: 83 + modifiers: 0 + text: "73" + autorep: false + count: 1 + } + Frame { + msec: 1712 + hash: "244200622435603a75f58366496daf8b" + } + Frame { + msec: 1728 + hash: "244200622435603a75f58366496daf8b" + } + Frame { + msec: 1744 + hash: "244200622435603a75f58366496daf8b" + } + Frame { + msec: 1760 + hash: "244200622435603a75f58366496daf8b" + } + Frame { + msec: 1776 + hash: "244200622435603a75f58366496daf8b" + } + Key { + type: 7 + key: 83 + modifiers: 0 + text: "73" + autorep: false + count: 1 + } + Frame { + msec: 1792 + hash: "244200622435603a75f58366496daf8b" + } + Frame { + msec: 1808 + hash: "244200622435603a75f58366496daf8b" + } + Frame { + msec: 1824 + hash: "244200622435603a75f58366496daf8b" + } + Frame { + msec: 1840 + hash: "244200622435603a75f58366496daf8b" + } + Frame { + msec: 1856 + hash: "244200622435603a75f58366496daf8b" + } + Frame { + msec: 1872 + hash: "244200622435603a75f58366496daf8b" + } + Frame { + msec: 1888 + hash: "244200622435603a75f58366496daf8b" + } + Frame { + msec: 1904 + hash: "244200622435603a75f58366496daf8b" + } + Frame { + msec: 1920 + image: "evaluateJavaScript.1.png" + } + Frame { + msec: 1936 + hash: "244200622435603a75f58366496daf8b" + } + Frame { + msec: 1952 + hash: "244200622435603a75f58366496daf8b" + } + Frame { + msec: 1968 + hash: "244200622435603a75f58366496daf8b" + } + Key { + type: 6 + key: 83 + modifiers: 0 + text: "73" + autorep: false + count: 1 + } + Frame { + msec: 1984 + hash: "44dc10a2914a391b57e68c2002a95adf" + } + Frame { + msec: 2000 + hash: "44dc10a2914a391b57e68c2002a95adf" + } + Frame { + msec: 2016 + hash: "44dc10a2914a391b57e68c2002a95adf" + } + Frame { + msec: 2032 + hash: "44dc10a2914a391b57e68c2002a95adf" + } + Frame { + msec: 2048 + hash: "44dc10a2914a391b57e68c2002a95adf" + } + Key { + type: 7 + key: 83 + modifiers: 0 + text: "73" + autorep: false + count: 1 + } + Frame { + msec: 2064 + hash: "44dc10a2914a391b57e68c2002a95adf" + } + Frame { + msec: 2080 + hash: "44dc10a2914a391b57e68c2002a95adf" + } + Frame { + msec: 2096 + hash: "44dc10a2914a391b57e68c2002a95adf" + } + Frame { + msec: 2112 + hash: "44dc10a2914a391b57e68c2002a95adf" + } + Frame { + msec: 2128 + hash: "44dc10a2914a391b57e68c2002a95adf" + } + Frame { + msec: 2144 + hash: "44dc10a2914a391b57e68c2002a95adf" + } + Frame { + msec: 2160 + hash: "44dc10a2914a391b57e68c2002a95adf" + } + Frame { + msec: 2176 + hash: "44dc10a2914a391b57e68c2002a95adf" + } + Frame { + msec: 2192 + hash: "44dc10a2914a391b57e68c2002a95adf" + } + Key { + type: 6 + key: 83 + modifiers: 0 + text: "73" + autorep: false + count: 1 + } + Frame { + msec: 2208 + hash: "c93921d0611e95373338c14cfcc17481" + } + Frame { + msec: 2224 + hash: "c93921d0611e95373338c14cfcc17481" + } + Frame { + msec: 2240 + hash: "c93921d0611e95373338c14cfcc17481" + } + Frame { + msec: 2256 + hash: "c93921d0611e95373338c14cfcc17481" + } + Key { + type: 7 + key: 83 + modifiers: 0 + text: "73" + autorep: false + count: 1 + } + Frame { + msec: 2272 + hash: "c93921d0611e95373338c14cfcc17481" + } + Frame { + msec: 2288 + hash: "c93921d0611e95373338c14cfcc17481" + } + Frame { + msec: 2304 + hash: "c93921d0611e95373338c14cfcc17481" + } + Frame { + msec: 2320 + hash: "c93921d0611e95373338c14cfcc17481" + } + Frame { + msec: 2336 + hash: "c93921d0611e95373338c14cfcc17481" + } + Frame { + msec: 2352 + hash: "c93921d0611e95373338c14cfcc17481" + } + Frame { + msec: 2368 + hash: "c93921d0611e95373338c14cfcc17481" + } + Frame { + msec: 2384 + hash: "c93921d0611e95373338c14cfcc17481" + } + Frame { + msec: 2400 + hash: "c93921d0611e95373338c14cfcc17481" + } + Frame { + msec: 2416 + hash: "c93921d0611e95373338c14cfcc17481" + } + Key { + type: 6 + key: 83 + modifiers: 0 + text: "73" + autorep: false + count: 1 + } + Frame { + msec: 2432 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2448 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2464 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2480 + hash: "9266775c7f2156977ff56fcd45246229" + } + Key { + type: 7 + key: 83 + modifiers: 0 + text: "73" + autorep: false + count: 1 + } + Frame { + msec: 2496 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2512 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2528 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2544 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2560 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2576 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2592 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2608 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2624 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2640 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2656 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2672 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2688 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2704 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2720 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2736 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2752 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2768 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2784 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2800 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2816 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2832 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2848 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2864 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2880 + image: "evaluateJavaScript.2.png" + } + Frame { + msec: 2896 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2912 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2928 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2944 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2960 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2976 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 2992 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 3008 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 3024 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 3040 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 3056 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 3072 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 3088 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 3104 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 3120 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 3136 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 3152 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 3168 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 3184 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 3200 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 3216 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 3232 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 3248 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 3264 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 3280 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 3296 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 3312 + hash: "9266775c7f2156977ff56fcd45246229" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 74; y: 206 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3328 + hash: "9266775c7f2156977ff56fcd45246229" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 72; y: 206 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3344 + hash: "9266775c7f2156977ff56fcd45246229" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 70; y: 206 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 68; y: 206 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 65; y: 206 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3360 + hash: "9266775c7f2156977ff56fcd45246229" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 63; y: 206 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3376 + hash: "9266775c7f2156977ff56fcd45246229" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 61; y: 206 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 59; y: 206 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3392 + hash: "9266775c7f2156977ff56fcd45246229" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 57; y: 206 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 55; y: 206 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3408 + hash: "9266775c7f2156977ff56fcd45246229" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 54; y: 206 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 53; y: 206 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3424 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 3440 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 3456 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 3472 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 3488 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 3504 + hash: "9266775c7f2156977ff56fcd45246229" + } + Frame { + msec: 3520 + hash: "9266775c7f2156977ff56fcd45246229" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 52; y: 206 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 2 + button: 1 + buttons: 1 + x: 52; y: 206 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3536 + hash: "b62d9027299daa6ab8304d812ed00f83" + } + Frame { + msec: 3552 + hash: "b62d9027299daa6ab8304d812ed00f83" + } + Frame { + msec: 3568 + hash: "b62d9027299daa6ab8304d812ed00f83" + } + Frame { + msec: 3584 + hash: "b62d9027299daa6ab8304d812ed00f83" + } + Frame { + msec: 3600 + hash: "b62d9027299daa6ab8304d812ed00f83" + } + Frame { + msec: 3616 + hash: "b62d9027299daa6ab8304d812ed00f83" + } + Frame { + msec: 3632 + hash: "b62d9027299daa6ab8304d812ed00f83" + } + Frame { + msec: 3648 + hash: "b62d9027299daa6ab8304d812ed00f83" + } + Mouse { + type: 3 + button: 1 + buttons: 0 + x: 52; y: 206 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3664 + hash: "b62d9027299daa6ab8304d812ed00f83" + } + Frame { + msec: 3680 + hash: "b62d9027299daa6ab8304d812ed00f83" + } + Frame { + msec: 3696 + hash: "b62d9027299daa6ab8304d812ed00f83" + } + Frame { + msec: 3712 + hash: "b62d9027299daa6ab8304d812ed00f83" + } + Frame { + msec: 3728 + hash: "b62d9027299daa6ab8304d812ed00f83" + } + Frame { + msec: 3744 + hash: "b62d9027299daa6ab8304d812ed00f83" + } + Frame { + msec: 3760 + hash: "b62d9027299daa6ab8304d812ed00f83" + } + Frame { + msec: 3776 + hash: "b62d9027299daa6ab8304d812ed00f83" + } + Frame { + msec: 3792 + hash: "b62d9027299daa6ab8304d812ed00f83" + } + Frame { + msec: 3808 + hash: "b62d9027299daa6ab8304d812ed00f83" + } + Frame { + msec: 3824 + hash: "b62d9027299daa6ab8304d812ed00f83" + } + Frame { + msec: 3840 + image: "evaluateJavaScript.3.png" + } + Frame { + msec: 3856 + hash: "b62d9027299daa6ab8304d812ed00f83" + } + Frame { + msec: 3872 + hash: "b62d9027299daa6ab8304d812ed00f83" + } + Frame { + msec: 3888 + hash: "b62d9027299daa6ab8304d812ed00f83" + } + Frame { + msec: 3904 + hash: "b62d9027299daa6ab8304d812ed00f83" + } + Frame { + msec: 3920 + hash: "b62d9027299daa6ab8304d812ed00f83" + } + Frame { + msec: 3936 + hash: "b62d9027299daa6ab8304d812ed00f83" + } + Frame { + msec: 3952 + hash: "b62d9027299daa6ab8304d812ed00f83" + } + Frame { + msec: 3968 + hash: "b62d9027299daa6ab8304d812ed00f83" + } + Frame { + msec: 3984 + hash: "b62d9027299daa6ab8304d812ed00f83" + } + Key { + type: 6 + key: 65 + modifiers: 0 + text: "61" + autorep: false + count: 1 + } + Frame { + msec: 4000 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4016 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4032 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4048 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4064 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4080 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4096 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4112 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Key { + type: 7 + key: 65 + modifiers: 0 + text: "61" + autorep: false + count: 1 + } + Frame { + msec: 4128 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4144 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4160 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4176 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4192 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4208 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4224 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4240 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4256 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4272 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4288 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4304 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4320 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4336 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4352 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4368 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4384 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4400 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4416 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4432 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4448 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4464 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4480 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4496 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4512 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4528 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4544 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4560 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4576 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4592 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4608 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4624 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4640 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4656 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4672 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4688 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4704 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4720 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4736 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4752 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4768 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Frame { + msec: 4784 + hash: "6cea5b700e402072a9953c81b605ef22" + } + Key { + type: 6 + key: 65 + modifiers: 0 + text: "61" + autorep: false + count: 1 + } + Frame { + msec: 4800 + image: "evaluateJavaScript.4.png" + } + Frame { + msec: 4816 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 4832 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 4848 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 4864 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 4880 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 4896 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 4912 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 4928 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Key { + type: 7 + key: 65 + modifiers: 0 + text: "61" + autorep: false + count: 1 + } + Frame { + msec: 4944 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 4960 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 4976 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 4992 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5008 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5024 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5040 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5056 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5072 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5088 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5104 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5120 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5136 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5152 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5168 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5184 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5200 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5216 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5232 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5248 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5264 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5280 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5296 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5312 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5328 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5344 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5360 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5376 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5392 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5408 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5424 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5440 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5456 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5472 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5488 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5504 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5520 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5536 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5552 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5568 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5584 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5600 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5616 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5632 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5648 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5664 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5680 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5696 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5712 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5728 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5744 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5760 + image: "evaluateJavaScript.5.png" + } + Frame { + msec: 5776 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5792 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5808 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 5824 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 54; y: 206 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 5840 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 56; y: 206 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 62; y: 204 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 65; y: 204 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 5856 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 71; y: 202 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 79; y: 200 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 5872 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 82; y: 200 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 90; y: 196 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 5888 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 96; y: 192 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 102; y: 188 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 5904 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 108; y: 182 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 112; y: 176 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 5920 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 116; y: 168 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 120; y: 158 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 5936 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 124; y: 148 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 128; y: 136 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 5952 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 130; y: 124 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 134; y: 112 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 5968 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 138; y: 100 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 142; y: 88 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 5984 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 144; y: 78 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 6000 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 150; y: 68 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 154; y: 62 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 158; y: 56 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 6016 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 162; y: 48 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 6032 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 166; y: 44 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 168; y: 38 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 172; y: 32 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 6048 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 174; y: 26 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 176; y: 20 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 6064 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 177; y: 18 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 6080 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 178; y: 16 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 178; y: 14 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 6096 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 178; y: 12 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 6112 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 178; y: 11 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 6128 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 178; y: 10 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 6144 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 179; y: 9 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 6160 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 180; y: 7 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 6176 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 181; y: 5 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 181; y: 4 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 6192 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 182; y: 2 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 183; y: 1 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 6208 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6224 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6240 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6256 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6272 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6288 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6304 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6320 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6336 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6352 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6368 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6384 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6400 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6416 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6432 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6448 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6464 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6480 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6496 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6512 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6528 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6544 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6560 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6576 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6592 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6608 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6624 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6640 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6656 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6672 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6688 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6704 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6720 + image: "evaluateJavaScript.6.png" + } + Frame { + msec: 6736 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6752 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6768 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6784 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6800 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6816 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6832 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6848 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6864 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 176; y: 1 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 174; y: 15 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 172; y: 31 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 6880 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 166; y: 47 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 162; y: 63 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 6896 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 156; y: 81 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 150; y: 95 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 6912 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 144; y: 107 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 138; y: 119 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 6928 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 132; y: 127 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 126; y: 133 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 6944 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 122; y: 137 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 120; y: 138 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 6960 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 120; y: 139 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 6976 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 6992 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 7008 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 7024 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 7040 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 7056 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 7072 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 119; y: 137 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7088 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 7104 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 7120 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 117; y: 137 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7136 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 116; y: 139 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 115; y: 141 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7152 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 113; y: 149 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 109; y: 155 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7168 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 107; y: 165 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 103; y: 171 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7184 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 99; y: 179 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 98; y: 181 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7200 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 96; y: 187 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 95; y: 189 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7216 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 95; y: 190 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7232 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 7248 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 7264 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 7280 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 96; y: 188 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7296 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 96; y: 187 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 96; y: 186 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7312 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 96; y: 185 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 97; y: 184 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7328 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 97; y: 183 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 97; y: 182 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7344 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 98; y: 180 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7360 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 98; y: 178 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7376 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 99; y: 177 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 99; y: 176 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 99; y: 174 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7392 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 7408 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 100; y: 172 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 100; y: 171 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7424 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 100; y: 170 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7440 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 100; y: 169 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7456 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 101; y: 167 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7472 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 7488 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 7504 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 2 + button: 1 + buttons: 1 + x: 101; y: 167 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7520 + hash: "04e2e16813a9cafc37077a675e279f5f" + } + Frame { + msec: 7536 + hash: "04e2e16813a9cafc37077a675e279f5f" + } + Frame { + msec: 7552 + hash: "04e2e16813a9cafc37077a675e279f5f" + } + Frame { + msec: 7568 + hash: "04e2e16813a9cafc37077a675e279f5f" + } + Frame { + msec: 7584 + hash: "04e2e16813a9cafc37077a675e279f5f" + } + Frame { + msec: 7600 + hash: "04e2e16813a9cafc37077a675e279f5f" + } + Frame { + msec: 7616 + hash: "04e2e16813a9cafc37077a675e279f5f" + } + Frame { + msec: 7632 + hash: "04e2e16813a9cafc37077a675e279f5f" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 101; y: 166 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 3 + button: 1 + buttons: 0 + x: 101; y: 166 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7648 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 7664 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 7680 + image: "evaluateJavaScript.7.png" + } + Frame { + msec: 7696 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 7712 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 7728 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 7744 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 7760 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 7776 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 7792 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 7808 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 7824 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 103; y: 166 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7840 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 7856 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 105; y: 166 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7872 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 106; y: 165 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 107; y: 164 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7888 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 108; y: 164 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 109; y: 163 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7904 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 111; y: 163 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 112; y: 162 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7920 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 116; y: 158 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7936 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 118; y: 157 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 122; y: 153 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7952 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 128; y: 147 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 134; y: 139 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7968 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 140; y: 133 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 146; y: 125 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 150; y: 117 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7984 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 156; y: 109 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 160; y: 99 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8000 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 164; y: 89 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 166; y: 77 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8016 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 170; y: 67 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 172; y: 55 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8032 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 176; y: 45 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8048 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 178; y: 35 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 178; y: 27 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 180; y: 19 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8064 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 180; y: 11 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 182; y: 5 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8080 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8096 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8112 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8128 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8144 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8160 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8176 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8192 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8208 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8224 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8240 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8256 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8272 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8288 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8304 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8320 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8336 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8352 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8368 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8384 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8400 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8416 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8432 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8448 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8464 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8480 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8496 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8512 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8528 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8544 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8560 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8576 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8592 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8608 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8624 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8640 + image: "evaluateJavaScript.8.png" + } + Frame { + msec: 8656 + hash: "792140067e09d04b31e78be1fc9a40a2" + } + Frame { + msec: 8672 + hash: "792140067e09d04b31e78be1fc9a40a2" + } +} diff --git a/tests/auto/declarative/visual/webview/javascript/evaluateJavaScript.qml b/tests/auto/declarative/visual/webview/javascript/evaluateJavaScript.qml new file mode 100644 index 0000000..d3cf578 --- /dev/null +++ b/tests/auto/declarative/visual/webview/javascript/evaluateJavaScript.qml @@ -0,0 +1,31 @@ +import Qt 4.6 + +Column { + WebView { + id: webview + width: 200 + height: 200 + url: "test-objects.html" + javaScriptWindowObjects: + Object { + property string text: btntext.text + WebView.windowObjectName: "qmltext" + onTextChanged: { + webview.evaluateJavaScript("{document.getElementById('button').value=window.qmltext.text}") + } + } + } + Row { + Text { text: "Input:" } + Rectangle { + width: btntext.width+10 + height: btntext.height+10 + border.color: "black" + TextInput { + id: btntext + text: "Blah" + cursorDelegate: Rectangle { width: 1; color: "red" } + } + } + } +} diff --git a/tests/auto/declarative/visual/webview/zooming/data/renderControl.0.png b/tests/auto/declarative/visual/webview/zooming/data/renderControl.0.png new file mode 100644 index 0000000..38df70e Binary files /dev/null and b/tests/auto/declarative/visual/webview/zooming/data/renderControl.0.png differ diff --git a/tests/auto/declarative/visual/webview/zooming/data/renderControl.qml b/tests/auto/declarative/visual/webview/zooming/data/renderControl.qml new file mode 100644 index 0000000..d3c5890 --- /dev/null +++ b/tests/auto/declarative/visual/webview/zooming/data/renderControl.qml @@ -0,0 +1,415 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "4f999826cd5ebe4f58bfd255e1c22be0" + } + Frame { + msec: 32 + hash: "3aa9bd1bd75219f82578689ac6d81c7e" + } + Frame { + msec: 48 + hash: "19d5f48f1c73d52483be96c887d3fd76" + } + Frame { + msec: 64 + hash: "9b85eef4e0746cc43aaefd442efdd824" + } + Frame { + msec: 80 + hash: "fca0034fb720e40198ede95a0ab0fadb" + } + Frame { + msec: 96 + hash: "9f63ddbd927a4b08242f3410a9ed7283" + } + Frame { + msec: 112 + hash: "4f5804c3c3ee195470a462293307cfd5" + } + Frame { + msec: 128 + hash: "d0434f08a8097b97b76c1194317a38ba" + } + Frame { + msec: 144 + hash: "921880d300e56f9605923a13fcd8b967" + } + Frame { + msec: 160 + hash: "f5dc87abf36332c68fd4450a6236dcb4" + } + Frame { + msec: 176 + hash: "c54f220cd5768afa1c12579007e17eff" + } + Frame { + msec: 192 + hash: "e1c70c3896d5a937296f205b09991b31" + } + Frame { + msec: 208 + hash: "d135f70f761add1358062a0386c62d18" + } + Frame { + msec: 224 + hash: "53cb2ed2b65e77cf0cd70530f32854ad" + } + Frame { + msec: 240 + hash: "2ff4feb61d958a800b38b282c3400293" + } + Frame { + msec: 256 + hash: "59f5585ec472efa29c5eba8b972ab3bd" + } + Frame { + msec: 272 + hash: "3aef5e1ff6da15e0e9f2e620dbabbab2" + } + Frame { + msec: 288 + hash: "2931299f667752efe9fca727534385e1" + } + Frame { + msec: 304 + hash: "2ed90e61c41b994ccea924191b66fc71" + } + Frame { + msec: 320 + hash: "1424c634067c896973c2c10793957933" + } + Frame { + msec: 336 + hash: "c4d30d511053a7caeefdae753236cf5b" + } + Frame { + msec: 352 + hash: "32300e07e34e8f316770c790a5ef9f6d" + } + Frame { + msec: 368 + hash: "95312dc2a4d88a48605fea170712354d" + } + Frame { + msec: 384 + hash: "3d146357d1532640cefb64fbae75bc0d" + } + Frame { + msec: 400 + hash: "5b78740511a456a3647d8392b2008f7f" + } + Frame { + msec: 416 + hash: "dddb065cefa27a862d108429c9984191" + } + Frame { + msec: 432 + hash: "0857067a0ee381e0f462ef8aceb0b696" + } + Frame { + msec: 448 + hash: "1f5e7e064cc62ff2e0585c98875351df" + } + Frame { + msec: 464 + hash: "c7f6bb852bdb2b99cbb5a8ca34f1585a" + } + Frame { + msec: 480 + hash: "f2284dea5812f167cae08c687fc1a3e9" + } + Frame { + msec: 496 + hash: "deec54bc32c46921e5032bce7daa1dad" + } + Frame { + msec: 512 + hash: "1271d3704de17bfe463c76fd73c3132b" + } + Frame { + msec: 528 + hash: "0568b0ecd47cd1c34b9de477e68e5751" + } + Frame { + msec: 544 + hash: "f070dd88e42697a9e43573f9f41b3540" + } + Frame { + msec: 560 + hash: "f5ced2827b06ea514f05866f1e4099f0" + } + Frame { + msec: 576 + hash: "59f5585ec472efa29c5eba8b972ab3bd" + } + Frame { + msec: 592 + hash: "2ff4feb61d958a800b38b282c3400293" + } + Frame { + msec: 608 + hash: "53cb2ed2b65e77cf0cd70530f32854ad" + } + Frame { + msec: 624 + hash: "d135f70f761add1358062a0386c62d18" + } + Frame { + msec: 640 + hash: "e1c70c3896d5a937296f205b09991b31" + } + Frame { + msec: 656 + hash: "c54f220cd5768afa1c12579007e17eff" + } + Frame { + msec: 672 + hash: "f5dc87abf36332c68fd4450a6236dcb4" + } + Frame { + msec: 688 + hash: "921880d300e56f9605923a13fcd8b967" + } + Frame { + msec: 704 + hash: "d0434f08a8097b97b76c1194317a38ba" + } + Frame { + msec: 720 + hash: "4f5804c3c3ee195470a462293307cfd5" + } + Frame { + msec: 736 + hash: "9f63ddbd927a4b08242f3410a9ed7283" + } + Frame { + msec: 752 + hash: "fca0034fb720e40198ede95a0ab0fadb" + } + Frame { + msec: 768 + hash: "9b85eef4e0746cc43aaefd442efdd824" + } + Frame { + msec: 784 + hash: "19d5f48f1c73d52483be96c887d3fd76" + } + Frame { + msec: 800 + hash: "3aa9bd1bd75219f82578689ac6d81c7e" + } + Frame { + msec: 816 + hash: "4f999826cd5ebe4f58bfd255e1c22be0" + } + Frame { + msec: 832 + hash: "3aa9bd1bd75219f82578689ac6d81c7e" + } + Frame { + msec: 848 + hash: "19d5f48f1c73d52483be96c887d3fd76" + } + Frame { + msec: 864 + hash: "9b85eef4e0746cc43aaefd442efdd824" + } + Frame { + msec: 880 + hash: "fca0034fb720e40198ede95a0ab0fadb" + } + Frame { + msec: 896 + hash: "9f63ddbd927a4b08242f3410a9ed7283" + } + Frame { + msec: 912 + hash: "4f5804c3c3ee195470a462293307cfd5" + } + Frame { + msec: 928 + hash: "d0434f08a8097b97b76c1194317a38ba" + } + Frame { + msec: 944 + hash: "921880d300e56f9605923a13fcd8b967" + } + Frame { + msec: 960 + image: "renderControl.0.png" + } + Frame { + msec: 976 + hash: "c54f220cd5768afa1c12579007e17eff" + } + Frame { + msec: 992 + hash: "e1c70c3896d5a937296f205b09991b31" + } + Frame { + msec: 1008 + hash: "d135f70f761add1358062a0386c62d18" + } + Frame { + msec: 1024 + hash: "53cb2ed2b65e77cf0cd70530f32854ad" + } + Frame { + msec: 1040 + hash: "2ff4feb61d958a800b38b282c3400293" + } + Frame { + msec: 1056 + hash: "59f5585ec472efa29c5eba8b972ab3bd" + } + Frame { + msec: 1072 + hash: "3aef5e1ff6da15e0e9f2e620dbabbab2" + } + Frame { + msec: 1088 + hash: "2931299f667752efe9fca727534385e1" + } + Frame { + msec: 1104 + hash: "2ed90e61c41b994ccea924191b66fc71" + } + Frame { + msec: 1120 + hash: "1424c634067c896973c2c10793957933" + } + Frame { + msec: 1136 + hash: "c4d30d511053a7caeefdae753236cf5b" + } + Frame { + msec: 1152 + hash: "32300e07e34e8f316770c790a5ef9f6d" + } + Frame { + msec: 1168 + hash: "95312dc2a4d88a48605fea170712354d" + } + Frame { + msec: 1184 + hash: "3d146357d1532640cefb64fbae75bc0d" + } + Frame { + msec: 1200 + hash: "5b78740511a456a3647d8392b2008f7f" + } + Frame { + msec: 1216 + hash: "dddb065cefa27a862d108429c9984191" + } + Frame { + msec: 1232 + hash: "0857067a0ee381e0f462ef8aceb0b696" + } + Frame { + msec: 1248 + hash: "1f5e7e064cc62ff2e0585c98875351df" + } + Frame { + msec: 1264 + hash: "c7f6bb852bdb2b99cbb5a8ca34f1585a" + } + Frame { + msec: 1280 + hash: "f2284dea5812f167cae08c687fc1a3e9" + } + Frame { + msec: 1296 + hash: "deec54bc32c46921e5032bce7daa1dad" + } + Frame { + msec: 1312 + hash: "1271d3704de17bfe463c76fd73c3132b" + } + Frame { + msec: 1328 + hash: "0568b0ecd47cd1c34b9de477e68e5751" + } + Frame { + msec: 1344 + hash: "f070dd88e42697a9e43573f9f41b3540" + } + Frame { + msec: 1360 + hash: "f5ced2827b06ea514f05866f1e4099f0" + } + Frame { + msec: 1376 + hash: "59f5585ec472efa29c5eba8b972ab3bd" + } + Frame { + msec: 1392 + hash: "2ff4feb61d958a800b38b282c3400293" + } + Frame { + msec: 1408 + hash: "53cb2ed2b65e77cf0cd70530f32854ad" + } + Frame { + msec: 1424 + hash: "d135f70f761add1358062a0386c62d18" + } + Frame { + msec: 1440 + hash: "e1c70c3896d5a937296f205b09991b31" + } + Frame { + msec: 1456 + hash: "c54f220cd5768afa1c12579007e17eff" + } + Frame { + msec: 1472 + hash: "f5dc87abf36332c68fd4450a6236dcb4" + } + Frame { + msec: 1488 + hash: "921880d300e56f9605923a13fcd8b967" + } + Frame { + msec: 1504 + hash: "d0434f08a8097b97b76c1194317a38ba" + } + Frame { + msec: 1520 + hash: "4f5804c3c3ee195470a462293307cfd5" + } + Frame { + msec: 1536 + hash: "9f63ddbd927a4b08242f3410a9ed7283" + } + Frame { + msec: 1552 + hash: "fca0034fb720e40198ede95a0ab0fadb" + } + Frame { + msec: 1568 + hash: "9b85eef4e0746cc43aaefd442efdd824" + } + Frame { + msec: 1584 + hash: "19d5f48f1c73d52483be96c887d3fd76" + } + Frame { + msec: 1600 + hash: "3aa9bd1bd75219f82578689ac6d81c7e" + } + Frame { + msec: 1616 + hash: "4f999826cd5ebe4f58bfd255e1c22be0" + } + Frame { + msec: 1632 + hash: "3aa9bd1bd75219f82578689ac6d81c7e" + } +} diff --git a/tests/auto/declarative/visual/webview/zooming/renderControl.qml b/tests/auto/declarative/visual/webview/zooming/renderControl.qml new file mode 100644 index 0000000..c2f2c02 --- /dev/null +++ b/tests/auto/declarative/visual/webview/zooming/renderControl.qml @@ -0,0 +1,21 @@ +import Qt 4.6 + +Rectangle { + width: 200 + height: 250 + clip: true + WebView { + id: webview + width: 400 + url: "renderControl.html" + x: SequentialAnimation { + running: true + repeat: true + NumberAnimation { from: 100; to: 0; duration: 200 } + PropertyAction { target: webview; property: "renderingEnabled"; value: false } + NumberAnimation { from: 0; to: -100; duration: 200 } + PropertyAction { target: webview; property: "renderingEnabled"; value: true } + NumberAnimation { from: -100; to: 100; duration: 400 } + } + } +} -- cgit v0.12 From cefc5817a9c39475e55f02922125a66b2a4d515e Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Fri, 6 Nov 2009 12:59:30 +1000 Subject: basic pixelcache test --- tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp b/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp index 864f4b5..e7e9204 100644 --- a/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp +++ b/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp @@ -147,6 +147,11 @@ void tst_qmlgraphicswebview::basicProperties() QVERIFY(!wv->forwardAction()->isEnabled()); QVERIFY(wv->stopAction()); QVERIFY(!wv->stopAction()->isEnabled()); + + wv->setPixelCacheSize(0); // mainly testing that it doesn't crash or anything! + QCOMPARE(wv->pixelCacheSize(),0); + wv->reloadAction()->trigger(); + QTRY_COMPARE(wv->progress(), 1.0); } void tst_qmlgraphicswebview::historyNav() -- cgit v0.12 From 4d285231be1b4404e6161c9b5db4fba413bd44e5 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Fri, 6 Nov 2009 13:10:16 +1000 Subject: Remove textSizeMultiplier - it's broken and obsolete in QtWebKit. --- src/declarative/graphicsitems/qmlgraphicswebview.cpp | 14 -------------- src/declarative/graphicsitems/qmlgraphicswebview_p.h | 4 ---- 2 files changed, 18 deletions(-) diff --git a/src/declarative/graphicsitems/qmlgraphicswebview.cpp b/src/declarative/graphicsitems/qmlgraphicswebview.cpp index 7204767..214117f 100644 --- a/src/declarative/graphicsitems/qmlgraphicswebview.cpp +++ b/src/declarative/graphicsitems/qmlgraphicswebview.cpp @@ -907,20 +907,6 @@ QPixmap QmlGraphicsWebView::icon() const /*! - \qmlproperty real WebView::textSizeMultiplier - This property holds the multiplier used to scale the text in a Web page -*/ -void QmlGraphicsWebView::setTextSizeMultiplier(qreal factor) -{ - page()->mainFrame()->setTextSizeMultiplier(factor); -} - -qreal QmlGraphicsWebView::textSizeMultiplier() const -{ - return page()->mainFrame()->textSizeMultiplier(); -} - -/*! \qmlproperty real WebView::zoomFactor This property holds the multiplier used to scale the contents of a Web page. */ diff --git a/src/declarative/graphicsitems/qmlgraphicswebview_p.h b/src/declarative/graphicsitems/qmlgraphicswebview_p.h index 6852bb0..d574c59 100644 --- a/src/declarative/graphicsitems/qmlgraphicswebview_p.h +++ b/src/declarative/graphicsitems/qmlgraphicswebview_p.h @@ -88,7 +88,6 @@ class Q_DECLARATIVE_EXPORT QmlGraphicsWebView : public QmlGraphicsPaintedItem Q_PROPERTY(QString title READ title NOTIFY titleChanged) Q_PROPERTY(QPixmap icon READ icon NOTIFY iconChanged) - Q_PROPERTY(qreal textSizeMultiplier READ textSizeMultiplier WRITE setTextSizeMultiplier DESIGNABLE false) Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor NOTIFY zoomFactorChanged) Q_PROPERTY(QString statusText READ statusText NOTIFY statusTextChanged) @@ -126,9 +125,6 @@ public: QPixmap icon() const; - qreal textSizeMultiplier() const; - void setTextSizeMultiplier(qreal); - qreal zoomFactor() const; void setZoomFactor(qreal); -- cgit v0.12 From 178ac95dcad8620003704dc12ff462df0df9c89e Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Fri, 6 Nov 2009 13:23:51 +1000 Subject: test text-only zooming. --- .../visual/webview/zooming/data/zoomTextOnly.0.png | Bin 0 -> 5589 bytes .../visual/webview/zooming/data/zoomTextOnly.1.png | Bin 0 -> 6848 bytes .../visual/webview/zooming/data/zoomTextOnly.qml | 655 +++++++++++++++++++++ .../visual/webview/zooming/zoomTextOnly.html | 7 + .../visual/webview/zooming/zoomTextOnly.qml | 15 + 5 files changed, 677 insertions(+) create mode 100644 tests/auto/declarative/visual/webview/zooming/data/zoomTextOnly.0.png create mode 100644 tests/auto/declarative/visual/webview/zooming/data/zoomTextOnly.1.png create mode 100644 tests/auto/declarative/visual/webview/zooming/data/zoomTextOnly.qml create mode 100644 tests/auto/declarative/visual/webview/zooming/zoomTextOnly.html create mode 100644 tests/auto/declarative/visual/webview/zooming/zoomTextOnly.qml diff --git a/tests/auto/declarative/visual/webview/zooming/data/zoomTextOnly.0.png b/tests/auto/declarative/visual/webview/zooming/data/zoomTextOnly.0.png new file mode 100644 index 0000000..4b9abb4 Binary files /dev/null and b/tests/auto/declarative/visual/webview/zooming/data/zoomTextOnly.0.png differ diff --git a/tests/auto/declarative/visual/webview/zooming/data/zoomTextOnly.1.png b/tests/auto/declarative/visual/webview/zooming/data/zoomTextOnly.1.png new file mode 100644 index 0000000..5ce9787 Binary files /dev/null and b/tests/auto/declarative/visual/webview/zooming/data/zoomTextOnly.1.png differ diff --git a/tests/auto/declarative/visual/webview/zooming/data/zoomTextOnly.qml b/tests/auto/declarative/visual/webview/zooming/data/zoomTextOnly.qml new file mode 100644 index 0000000..aaa7583 --- /dev/null +++ b/tests/auto/declarative/visual/webview/zooming/data/zoomTextOnly.qml @@ -0,0 +1,655 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "4e401b5ebff6e442fa108e94a5dba668" + } + Frame { + msec: 32 + hash: "c2f8551d0442d0736b71c54fc965562b" + } + Frame { + msec: 48 + hash: "4fc1ef611b24ec5737310859b12c83d3" + } + Frame { + msec: 64 + hash: "7df07aea83bc5c3213e7871854661820" + } + Frame { + msec: 80 + hash: "0ae4ee18cc675749f008b897fe35cc40" + } + Frame { + msec: 96 + hash: "0ae4ee18cc675749f008b897fe35cc40" + } + Frame { + msec: 112 + hash: "f5c917c7ca26bb916dd4df84eafc8e94" + } + Frame { + msec: 128 + hash: "0696257de0441666bd264f8db6383d15" + } + Frame { + msec: 144 + hash: "0b43fdee23346c30c60b822a20131cc3" + } + Frame { + msec: 160 + hash: "98dbd004cf4809dbc90bfa9272378644" + } + Frame { + msec: 176 + hash: "32d0e9005ebb9dfd410d348e336bcd93" + } + Frame { + msec: 192 + hash: "8a64b18006ad0bd2c373a2a9395ce52e" + } + Frame { + msec: 208 + hash: "7dc26fd658f626b8fe18545cf93dc4ec" + } + Frame { + msec: 224 + hash: "6712be93cf1ed2b7b202367418b6d2d7" + } + Frame { + msec: 240 + hash: "524840a3453af4e97ac82b559308cce3" + } + Frame { + msec: 256 + hash: "11436091b24c02af94dfa75a5fd1a001" + } + Frame { + msec: 272 + hash: "d3689b53474b4b26630d70ba01c057b4" + } + Frame { + msec: 288 + hash: "16e2b66f28ed80d80d9b5264d89624d5" + } + Frame { + msec: 304 + hash: "87636076959de7e5a0a8bd8b31354ed4" + } + Frame { + msec: 320 + hash: "a6916da6bfac27aa87d75da2bbb73f31" + } + Frame { + msec: 336 + hash: "58cfba3aae4bf54a5b445e0e34571d2d" + } + Frame { + msec: 352 + hash: "1475ae722afd169cc0c8e1fde39eb6b7" + } + Frame { + msec: 368 + hash: "14d08c2ca430631af8ede1013f4f4da0" + } + Frame { + msec: 384 + hash: "ace9db9112d147569dc0cf1a1b680d6c" + } + Frame { + msec: 400 + hash: "08bc6815601417f3731eaae398d0861d" + } + Frame { + msec: 416 + hash: "809870dfd9b05ce07170edd945348ddf" + } + Frame { + msec: 432 + hash: "5784deb0f3270cf7a0d0964cd9d31458" + } + Frame { + msec: 448 + hash: "2f06ee407e5175d4b954e31c39c9522c" + } + Frame { + msec: 464 + hash: "48a7dbed293fbbd5ea202190837a411f" + } + Frame { + msec: 480 + hash: "abf3d90803cfa12d35d2752be7ea02d8" + } + Frame { + msec: 496 + hash: "a60edcf8d792f93a839e6ddbafbf993f" + } + Frame { + msec: 512 + hash: "7e8dfe86ea0849022355b12578d4cb1a" + } + Frame { + msec: 528 + hash: "3c84122b0933ee870f178d39469e51e2" + } + Frame { + msec: 544 + hash: "25f463e91febf5b6d8819fd5010bc1c2" + } + Frame { + msec: 560 + hash: "d423a9bc912237d0f20b924849ba0cb1" + } + Frame { + msec: 576 + hash: "5bd3cc309a5fce6183654975543250b2" + } + Frame { + msec: 592 + hash: "4e401b5ebff6e442fa108e94a5dba668" + } + Frame { + msec: 608 + hash: "9a4bf1400da038f2088dd4c49403d852" + } + Frame { + msec: 624 + hash: "a37024356613bd5d678e0b2f7b8f5959" + } + Frame { + msec: 640 + hash: "4f37d72c10e51f68a2359086094da249" + } + Frame { + msec: 656 + hash: "6093bcb7673f8e58fe5a7b0143638822" + } + Frame { + msec: 672 + hash: "c272aeea2b9c450fbd732305ccc01b93" + } + Frame { + msec: 688 + hash: "6a4e2ee45b26037421e2a5f2d6ee517e" + } + Frame { + msec: 704 + hash: "d912afcbce6c9d879a07ffc3c51b36d1" + } + Frame { + msec: 720 + hash: "2578335ac6f21c8aec2c87515562c321" + } + Frame { + msec: 736 + hash: "5b77af55f0a723ba762d283f41e91c98" + } + Frame { + msec: 752 + hash: "b420fc71b22fa608a9c0cdbbbc61c447" + } + Frame { + msec: 768 + hash: "3f7a9cecf2a590e8728137fabfd3f5f3" + } + Frame { + msec: 784 + hash: "c51f12a2f438f137785c70e3af4922fd" + } + Frame { + msec: 800 + hash: "5d97175fc4d986e5b21758d4ac785025" + } + Frame { + msec: 816 + hash: "94f922f3460ad76cd05cb5b321977a94" + } + Frame { + msec: 832 + hash: "5747adbc4f0b22ed359793d72d3e7d1f" + } + Frame { + msec: 848 + hash: "255d1d45d3343972f156dfab7d13ce41" + } + Frame { + msec: 864 + hash: "e5b54132ffb83acad30622e969405bc0" + } + Frame { + msec: 880 + hash: "2c05cf00e3417883e789f58c2728dc97" + } + Frame { + msec: 896 + hash: "9d66290b1aae1de3025d24d3efc4ca1c" + } + Frame { + msec: 912 + hash: "5e9b0783b1b4221145a4febbae56b30f" + } + Frame { + msec: 928 + hash: "21eea497c26600b03d868661232b3ebe" + } + Frame { + msec: 944 + hash: "2383c415170ac6444f1c193ed698f682" + } + Frame { + msec: 960 + image: "zoomTextOnly.0.png" + } + Frame { + msec: 976 + hash: "4ed0f85dec4eb0bb740ac3780b6872c0" + } + Frame { + msec: 992 + hash: "0a18bccca4efeadfced8e5cb1715a1f3" + } + Frame { + msec: 1008 + hash: "823e65df9075eb0e9a3aad6b15ec3342" + } + Frame { + msec: 1024 + hash: "823e65df9075eb0e9a3aad6b15ec3342" + } + Frame { + msec: 1040 + hash: "0a18bccca4efeadfced8e5cb1715a1f3" + } + Frame { + msec: 1056 + hash: "4ed0f85dec4eb0bb740ac3780b6872c0" + } + Frame { + msec: 1072 + hash: "fae77663566351fa3bb506b459496a9d" + } + Frame { + msec: 1088 + hash: "2383c415170ac6444f1c193ed698f682" + } + Frame { + msec: 1104 + hash: "2e05365256bebbdf3229f99b94263b6c" + } + Frame { + msec: 1120 + hash: "5e9b0783b1b4221145a4febbae56b30f" + } + Frame { + msec: 1136 + hash: "9d66290b1aae1de3025d24d3efc4ca1c" + } + Frame { + msec: 1152 + hash: "2c05cf00e3417883e789f58c2728dc97" + } + Frame { + msec: 1168 + hash: "e5b54132ffb83acad30622e969405bc0" + } + Frame { + msec: 1184 + hash: "255d1d45d3343972f156dfab7d13ce41" + } + Frame { + msec: 1200 + hash: "5747adbc4f0b22ed359793d72d3e7d1f" + } + Frame { + msec: 1216 + hash: "94f922f3460ad76cd05cb5b321977a94" + } + Frame { + msec: 1232 + hash: "5d97175fc4d986e5b21758d4ac785025" + } + Frame { + msec: 1248 + hash: "c51f12a2f438f137785c70e3af4922fd" + } + Frame { + msec: 1264 + hash: "3f7a9cecf2a590e8728137fabfd3f5f3" + } + Frame { + msec: 1280 + hash: "b420fc71b22fa608a9c0cdbbbc61c447" + } + Frame { + msec: 1296 + hash: "5b77af55f0a723ba762d283f41e91c98" + } + Frame { + msec: 1312 + hash: "2578335ac6f21c8aec2c87515562c321" + } + Frame { + msec: 1328 + hash: "a9b5438bd48dbafd307d571877416003" + } + Frame { + msec: 1344 + hash: "6a4e2ee45b26037421e2a5f2d6ee517e" + } + Frame { + msec: 1360 + hash: "c272aeea2b9c450fbd732305ccc01b93" + } + Frame { + msec: 1376 + hash: "37c7e50c270e8feb4dd9018580284a85" + } + Frame { + msec: 1392 + hash: "4f37d72c10e51f68a2359086094da249" + } + Frame { + msec: 1408 + hash: "a37024356613bd5d678e0b2f7b8f5959" + } + Frame { + msec: 1424 + hash: "9a4bf1400da038f2088dd4c49403d852" + } + Frame { + msec: 1440 + hash: "4e401b5ebff6e442fa108e94a5dba668" + } + Frame { + msec: 1456 + hash: "5bd3cc309a5fce6183654975543250b2" + } + Frame { + msec: 1472 + hash: "d423a9bc912237d0f20b924849ba0cb1" + } + Frame { + msec: 1488 + hash: "25f463e91febf5b6d8819fd5010bc1c2" + } + Frame { + msec: 1504 + hash: "3c84122b0933ee870f178d39469e51e2" + } + Frame { + msec: 1520 + hash: "7e8dfe86ea0849022355b12578d4cb1a" + } + Frame { + msec: 1536 + hash: "a60edcf8d792f93a839e6ddbafbf993f" + } + Frame { + msec: 1552 + hash: "abf3d90803cfa12d35d2752be7ea02d8" + } + Frame { + msec: 1568 + hash: "48a7dbed293fbbd5ea202190837a411f" + } + Frame { + msec: 1584 + hash: "2f06ee407e5175d4b954e31c39c9522c" + } + Frame { + msec: 1600 + hash: "5784deb0f3270cf7a0d0964cd9d31458" + } + Frame { + msec: 1616 + hash: "809870dfd9b05ce07170edd945348ddf" + } + Frame { + msec: 1632 + hash: "08bc6815601417f3731eaae398d0861d" + } + Frame { + msec: 1648 + hash: "ace9db9112d147569dc0cf1a1b680d6c" + } + Frame { + msec: 1664 + hash: "14d08c2ca430631af8ede1013f4f4da0" + } + Frame { + msec: 1680 + hash: "1475ae722afd169cc0c8e1fde39eb6b7" + } + Frame { + msec: 1696 + hash: "58cfba3aae4bf54a5b445e0e34571d2d" + } + Frame { + msec: 1712 + hash: "a6916da6bfac27aa87d75da2bbb73f31" + } + Frame { + msec: 1728 + hash: "87636076959de7e5a0a8bd8b31354ed4" + } + Frame { + msec: 1744 + hash: "16e2b66f28ed80d80d9b5264d89624d5" + } + Frame { + msec: 1760 + hash: "d3689b53474b4b26630d70ba01c057b4" + } + Frame { + msec: 1776 + hash: "11436091b24c02af94dfa75a5fd1a001" + } + Frame { + msec: 1792 + hash: "524840a3453af4e97ac82b559308cce3" + } + Frame { + msec: 1808 + hash: "6712be93cf1ed2b7b202367418b6d2d7" + } + Frame { + msec: 1824 + hash: "7dc26fd658f626b8fe18545cf93dc4ec" + } + Frame { + msec: 1840 + hash: "8a64b18006ad0bd2c373a2a9395ce52e" + } + Frame { + msec: 1856 + hash: "32d0e9005ebb9dfd410d348e336bcd93" + } + Frame { + msec: 1872 + hash: "98dbd004cf4809dbc90bfa9272378644" + } + Frame { + msec: 1888 + hash: "0b43fdee23346c30c60b822a20131cc3" + } + Frame { + msec: 1904 + hash: "0696257de0441666bd264f8db6383d15" + } + Frame { + msec: 1920 + image: "zoomTextOnly.1.png" + } + Frame { + msec: 1936 + hash: "0ae4ee18cc675749f008b897fe35cc40" + } + Frame { + msec: 1952 + hash: "0ae4ee18cc675749f008b897fe35cc40" + } + Frame { + msec: 1968 + hash: "7df07aea83bc5c3213e7871854661820" + } + Frame { + msec: 1984 + hash: "4fc1ef611b24ec5737310859b12c83d3" + } + Frame { + msec: 2000 + hash: "c2f8551d0442d0736b71c54fc965562b" + } + Frame { + msec: 2016 + hash: "4ec29787e437f9619ce0f0a0f4889d0f" + } + Frame { + msec: 2032 + hash: "c2f8551d0442d0736b71c54fc965562b" + } + Frame { + msec: 2048 + hash: "4fc1ef611b24ec5737310859b12c83d3" + } + Frame { + msec: 2064 + hash: "7df07aea83bc5c3213e7871854661820" + } + Frame { + msec: 2080 + hash: "0ae4ee18cc675749f008b897fe35cc40" + } + Frame { + msec: 2096 + hash: "0ae4ee18cc675749f008b897fe35cc40" + } + Frame { + msec: 2112 + hash: "f5c917c7ca26bb916dd4df84eafc8e94" + } + Frame { + msec: 2128 + hash: "0696257de0441666bd264f8db6383d15" + } + Frame { + msec: 2144 + hash: "0b43fdee23346c30c60b822a20131cc3" + } + Frame { + msec: 2160 + hash: "98dbd004cf4809dbc90bfa9272378644" + } + Frame { + msec: 2176 + hash: "32d0e9005ebb9dfd410d348e336bcd93" + } + Frame { + msec: 2192 + hash: "8a64b18006ad0bd2c373a2a9395ce52e" + } + Frame { + msec: 2208 + hash: "7dc26fd658f626b8fe18545cf93dc4ec" + } + Frame { + msec: 2224 + hash: "6712be93cf1ed2b7b202367418b6d2d7" + } + Frame { + msec: 2240 + hash: "524840a3453af4e97ac82b559308cce3" + } + Frame { + msec: 2256 + hash: "11436091b24c02af94dfa75a5fd1a001" + } + Frame { + msec: 2272 + hash: "d3689b53474b4b26630d70ba01c057b4" + } + Frame { + msec: 2288 + hash: "16e2b66f28ed80d80d9b5264d89624d5" + } + Frame { + msec: 2304 + hash: "87636076959de7e5a0a8bd8b31354ed4" + } + Frame { + msec: 2320 + hash: "a6916da6bfac27aa87d75da2bbb73f31" + } + Frame { + msec: 2336 + hash: "58cfba3aae4bf54a5b445e0e34571d2d" + } + Frame { + msec: 2352 + hash: "1475ae722afd169cc0c8e1fde39eb6b7" + } + Frame { + msec: 2368 + hash: "14d08c2ca430631af8ede1013f4f4da0" + } + Frame { + msec: 2384 + hash: "ace9db9112d147569dc0cf1a1b680d6c" + } + Frame { + msec: 2400 + hash: "08bc6815601417f3731eaae398d0861d" + } + Frame { + msec: 2416 + hash: "809870dfd9b05ce07170edd945348ddf" + } + Frame { + msec: 2432 + hash: "5784deb0f3270cf7a0d0964cd9d31458" + } + Frame { + msec: 2448 + hash: "2f06ee407e5175d4b954e31c39c9522c" + } + Frame { + msec: 2464 + hash: "48a7dbed293fbbd5ea202190837a411f" + } + Frame { + msec: 2480 + hash: "abf3d90803cfa12d35d2752be7ea02d8" + } + Frame { + msec: 2496 + hash: "a60edcf8d792f93a839e6ddbafbf993f" + } + Frame { + msec: 2512 + hash: "7e8dfe86ea0849022355b12578d4cb1a" + } + Frame { + msec: 2528 + hash: "3c84122b0933ee870f178d39469e51e2" + } + Frame { + msec: 2544 + hash: "25f463e91febf5b6d8819fd5010bc1c2" + } + Frame { + msec: 2560 + hash: "d423a9bc912237d0f20b924849ba0cb1" + } + Frame { + msec: 2576 + hash: "5bd3cc309a5fce6183654975543250b2" + } + Frame { + msec: 2592 + hash: "4e401b5ebff6e442fa108e94a5dba668" + } +} diff --git a/tests/auto/declarative/visual/webview/zooming/zoomTextOnly.html b/tests/auto/declarative/visual/webview/zooming/zoomTextOnly.html new file mode 100644 index 0000000..4997712 --- /dev/null +++ b/tests/auto/declarative/visual/webview/zooming/zoomTextOnly.html @@ -0,0 +1,7 @@ + + +

Zoom Text Only

+

+This test shows how zooming can be done just +on text, not images. + diff --git a/tests/auto/declarative/visual/webview/zooming/zoomTextOnly.qml b/tests/auto/declarative/visual/webview/zooming/zoomTextOnly.qml new file mode 100644 index 0000000..55cd9bc --- /dev/null +++ b/tests/auto/declarative/visual/webview/zooming/zoomTextOnly.qml @@ -0,0 +1,15 @@ +import Qt 4.6 + +WebView { + width: 200 + height: 250 + url: "zoomTextOnly.html" + settings.zoomTextOnly: true + zoomFactor: + SequentialAnimation { + running: true + repeat: true + NumberAnimation { from: 2; to: 0.25; duration: 1000 } + NumberAnimation { from: 0.25; to: 2; duration: 1000 } + } +} -- cgit v0.12 From 2e72795565ac73b95ada86a461735cbe8b7721ad Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Fri, 6 Nov 2009 13:28:08 +1000 Subject: better statusText test --- tests/auto/declarative/qmlgraphicswebview/data/basic.html | 5 +++++ tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/auto/declarative/qmlgraphicswebview/data/basic.html b/tests/auto/declarative/qmlgraphicswebview/data/basic.html index c262f12..22e3e24 100644 --- a/tests/auto/declarative/qmlgraphicswebview/data/basic.html +++ b/tests/auto/declarative/qmlgraphicswebview/data/basic.html @@ -1,6 +1,11 @@ Basic + diff --git a/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp b/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp index e7e9204..6cf6741 100644 --- a/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp +++ b/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp @@ -131,7 +131,7 @@ void tst_qmlgraphicswebview::basicProperties() QCOMPARE(wv->title(),QString("Basic")); QTRY_COMPARE(wv->icon().width(), 48); QCOMPARE(wv->icon(),QPixmap(SRCDIR "/data/basic.png")); - QCOMPARE(wv->statusText(),QString("")); + QCOMPARE(wv->statusText(),QString("status here")); QCOMPARE(strippedHtml(fileContents(SRCDIR "/data/basic.html")), strippedHtml(wv->html())); QCOMPARE(wv->width(), 123.0); QCOMPARE(wv->webPageWidth(), 0); @@ -167,7 +167,7 @@ void tst_qmlgraphicswebview::historyNav() QCOMPARE(wv->title(),QString("Basic")); QTRY_COMPARE(wv->icon().width(), 48); QCOMPARE(wv->icon(),QPixmap(SRCDIR "/data/basic.png")); - QCOMPARE(wv->statusText(),QString("")); + QCOMPARE(wv->statusText(),QString("status here")); QCOMPARE(strippedHtml(fileContents(SRCDIR "/data/basic.html")), strippedHtml(wv->html())); QCOMPARE(wv->width(), 123.0); QCOMPARE(wv->webPageWidth(), 0); @@ -193,6 +193,7 @@ void tst_qmlgraphicswebview::historyNav() QCOMPARE(strippedHtml(fileContents(SRCDIR "/data/forward.html")), strippedHtml(wv->html())); QCOMPARE(wv->url(), QUrl::fromLocalFile(SRCDIR "/data/forward.html")); QCOMPARE(wv->status(), QmlGraphicsWebView::Ready); + QCOMPARE(wv->statusText(),QString("")); QVERIFY(wv->reloadAction()); QVERIFY(wv->reloadAction()->isEnabled()); QVERIFY(wv->backAction()); -- cgit v0.12 From 2fb5889ea55209528fd19b7a34faac7c5be2b1b4 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Mon, 9 Nov 2009 08:55:59 +1000 Subject: Fix crash when watch is deleted before calling removeWatch(). --- src/declarative/debugger/qmldebug.cpp | 12 +++++++++++- src/declarative/debugger/qmldebug_p.h | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/declarative/debugger/qmldebug.cpp b/src/declarative/debugger/qmldebug.cpp index b06a250..1403ffa 100644 --- a/src/declarative/debugger/qmldebug.cpp +++ b/src/declarative/debugger/qmldebug.cpp @@ -69,6 +69,7 @@ public: void decode(QDataStream &, QmlDebugContextReference &); void decode(QDataStream &, QmlDebugObjectReference &, bool simple); + static void remove(QmlEngineDebug *, QmlDebugEnginesQuery *); static void remove(QmlEngineDebug *, QmlDebugRootContextQuery *); static void remove(QmlEngineDebug *, QmlDebugObjectQuery *); @@ -133,6 +134,7 @@ void QmlEngineDebugPrivate::remove(QmlEngineDebug *c, QmlDebugExpressionQuery *q p->expressionQuery.remove(q->m_queryId); } + Q_DECLARE_METATYPE(QmlDebugObjectReference); void QmlEngineDebugPrivate::decode(QDataStream &ds, QmlDebugObjectReference &o, bool simple) @@ -345,6 +347,7 @@ QmlDebugPropertyWatch *QmlEngineDebug::addWatch(const QmlDebugPropertyReference if (d->client->isConnected()) { int queryId = d->getId(); watch->m_queryId = queryId; + watch->m_client = this; watch->m_objectDebugId = property.objectDebugId(); watch->m_name = property.name(); d->watched.insert(queryId, watch); @@ -373,6 +376,7 @@ QmlDebugObjectExpressionWatch *QmlEngineDebug::addWatch(const QmlDebugObjectRefe if (d->client->isConnected()) { int queryId = d->getId(); watch->m_queryId = queryId; + watch->m_client = this; watch->m_objectDebugId = object.debugId(); watch->m_expr = expr; d->watched.insert(queryId, watch); @@ -395,6 +399,7 @@ QmlDebugWatch *QmlEngineDebug::addWatch(const QmlDebugObjectReference &object, Q if (d->client->isConnected()) { int queryId = d->getId(); watch->m_queryId = queryId; + watch->m_client = this; watch->m_objectDebugId = object.debugId(); d->watched.insert(queryId, watch); @@ -544,8 +549,13 @@ QmlDebugExpressionQuery *QmlEngineDebug::queryExpressionResult(int objectDebugId } QmlDebugWatch::QmlDebugWatch(QObject *parent) -: QObject(parent), m_state(Waiting), m_queryId(-1), m_objectDebugId(-1) +: QObject(parent), m_state(Waiting), m_queryId(-1), m_client(0), m_objectDebugId(-1) +{ +} + +QmlDebugWatch::~QmlDebugWatch() { + m_client->removeWatch(this); } int QmlDebugWatch::queryId() const diff --git a/src/declarative/debugger/qmldebug_p.h b/src/declarative/debugger/qmldebug_p.h index d7e4f5a..4bc54e8 100644 --- a/src/declarative/debugger/qmldebug_p.h +++ b/src/declarative/debugger/qmldebug_p.h @@ -106,6 +106,7 @@ public: enum State { Waiting, Active, Inactive, Dead }; QmlDebugWatch(QObject *); + ~QmlDebugWatch(); int queryId() const; int objectDebugId() const; @@ -125,6 +126,7 @@ private: void setState(State); State m_state; int m_queryId; + QmlEngineDebug *m_client; int m_objectDebugId; }; -- cgit v0.12 From b615f8667dfc9a36a9bef2bc2e2e509a9a2e478a Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 9 Nov 2009 09:30:15 +1000 Subject: Fix Flickable.flickDeceleration docs --- src/declarative/graphicsitems/qmlgraphicsflickable.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/declarative/graphicsitems/qmlgraphicsflickable.cpp b/src/declarative/graphicsitems/qmlgraphicsflickable.cpp index b030495..ea9c173 100644 --- a/src/declarative/graphicsitems/qmlgraphicsflickable.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsflickable.cpp @@ -1177,7 +1177,7 @@ void QmlGraphicsFlickable::setMaximumFlickVelocity(qreal v) } /*! - \qmlproperty real Flickable::maximumFlickVelocity + \qmlproperty real Flickable::flickDeceleration This property holds the rate at which a flick will decelerate. The default is 500. -- cgit v0.12 From 76c1d526022220f487bee0384eca586d680e5eb2 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 9 Nov 2009 10:51:21 +1000 Subject: Fix initialization of currentIndex and add test. --- .../graphicsitems/qmlgraphicslistview.cpp | 30 ++++++++++++++-------- .../tst_qmlgraphicslistview.cpp | 14 +++++++--- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/src/declarative/graphicsitems/qmlgraphicslistview.cpp b/src/declarative/graphicsitems/qmlgraphicslistview.cpp index a9bc721..33159a7 100644 --- a/src/declarative/graphicsitems/qmlgraphicslistview.cpp +++ b/src/declarative/graphicsitems/qmlgraphicslistview.cpp @@ -434,7 +434,6 @@ void QmlGraphicsListViewPrivate::clear() visibleIndex = 0; releaseItem(currentItem); currentItem = 0; - currentIndex = -1; createHighlight(); trackedItem = 0; } @@ -746,7 +745,7 @@ void QmlGraphicsListViewPrivate::updateCurrentSection() void QmlGraphicsListViewPrivate::updateCurrent(int modelIndex) { Q_Q(QmlGraphicsListView); - if (!isValid() || modelIndex < 0 || modelIndex >= model->count()) { + if (!q->isComponentComplete() || !isValid() || modelIndex < 0 || modelIndex >= model->count()) { if (currentItem) { currentItem->attached->setIsCurrentItem(false); releaseItem(currentItem); @@ -1114,16 +1113,20 @@ void QmlGraphicsListView::setModel(const QVariant &model) dataModel->setModel(model); } if (d->model) { - if (d->currentIndex >= d->model->count() || d->currentIndex < 0) - setCurrentIndex(0); - else - d->updateCurrent(d->currentIndex); + if (isComponentComplete()) { + refill(); + if (d->currentIndex >= d->model->count() || d->currentIndex < 0) { + setCurrentIndex(0); + } else { + d->moveReason = QmlGraphicsListViewPrivate::SetIndex; + d->updateCurrent(d->currentIndex); + } + } connect(d->model, SIGNAL(itemsInserted(int,int)), this, SLOT(itemsInserted(int,int))); connect(d->model, SIGNAL(itemsRemoved(int,int)), this, SLOT(itemsRemoved(int,int))); connect(d->model, SIGNAL(itemsMoved(int,int,int)), this, SLOT(itemsMoved(int,int,int))); connect(d->model, SIGNAL(createdItem(int, QmlGraphicsItem*)), this, SLOT(createdItem(int,QmlGraphicsItem*))); connect(d->model, SIGNAL(destroyingItem(QmlGraphicsItem*)), this, SLOT(destroyingItem(QmlGraphicsItem*))); - refill(); emit countChanged(); } } @@ -1156,8 +1159,11 @@ void QmlGraphicsListView::setDelegate(QmlComponent *delegate) } if (QmlGraphicsVisualDataModel *dataModel = qobject_cast(d->model)) { dataModel->setDelegate(delegate); - d->updateCurrent(d->currentIndex); - refill(); + if (isComponentComplete()) { + refill(); + d->moveReason = QmlGraphicsListViewPrivate::SetIndex; + d->updateCurrent(d->currentIndex); + } } } @@ -1178,7 +1184,7 @@ int QmlGraphicsListView::currentIndex() const void QmlGraphicsListView::setCurrentIndex(int index) { Q_D(QmlGraphicsListView); - if (d->isValid() && index != d->currentIndex && index < d->model->count() && index >= 0) { + if (isComponentComplete() && d->isValid() && index != d->currentIndex && index < d->model->count() && index >= 0) { d->moveReason = QmlGraphicsListViewPrivate::SetIndex; cancelFlick(); d->updateCurrent(index); @@ -1670,9 +1676,11 @@ void QmlGraphicsListView::componentComplete() { Q_D(QmlGraphicsListView); QmlGraphicsFlickable::componentComplete(); + refill(); if (d->currentIndex < 0) d->updateCurrent(0); - refill(); + else + d->updateCurrent(d->currentIndex); d->fixupPosition(); } diff --git a/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp b/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp index 4a33770..de26635 100644 --- a/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp +++ b/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp @@ -69,10 +69,10 @@ private slots: void qListModelInterface_moved(); void qAbstractItemModel_moved(); + void currentIndex(); void enforceRange(); void spacing(); void sections(); - void currentIndex(); private: template void items(); @@ -766,15 +766,22 @@ void tst_QmlGraphicsListView::sections() void tst_QmlGraphicsListView::currentIndex() { - QmlView *canvas = createView(SRCDIR "/data/listview-initCurrent.qml"); - TestModel model; for (int i = 0; i < 30; i++) model.addItem("Item" + QString::number(i), QString::number(i)); + QmlView *canvas = new QmlView(0); + canvas->setFixedSize(240,320); + QmlContext *ctxt = canvas->rootContext(); ctxt->setContextProperty("testModel", &model); + QString filename(SRCDIR "/data/listview-initCurrent.qml"); + QFile file(filename); + file.open(QFile::ReadOnly); + QString qml = file.readAll(); + canvas->setQml(qml, filename); + canvas->execute(); qApp->processEvents(); @@ -785,6 +792,7 @@ void tst_QmlGraphicsListView::currentIndex() QVERIFY(viewport != 0); // current item should be third item + QCOMPARE(listview->currentIndex(), 3); QCOMPARE(listview->currentItem(), findItem(viewport, "wrapper", 3)); // no wrap -- cgit v0.12 From 766251f5eb9af692f6cfc155471c4a58f5d5be3d Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 9 Nov 2009 11:17:16 +1000 Subject: Doc. --- src/declarative/graphicsitems/qmlgraphicslistview.cpp | 14 +++++++------- src/declarative/graphicsitems/qmlgraphicslistview_p.h | 5 +++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/declarative/graphicsitems/qmlgraphicslistview.cpp b/src/declarative/graphicsitems/qmlgraphicslistview.cpp index 33159a7..53287a6 100644 --- a/src/declarative/graphicsitems/qmlgraphicslistview.cpp +++ b/src/declarative/graphicsitems/qmlgraphicslistview.cpp @@ -1260,7 +1260,7 @@ void QmlGraphicsListView::setHighlight(QmlComponent *highlight) is scrolled. This is because the view moves to maintain the highlight within the preferred highlight range (or visible viewport). - \sa highlight + \sa highlight, highlightMoveSpeed */ bool QmlGraphicsListView::highlightFollowsCurrentItem() const { @@ -1479,8 +1479,13 @@ QString QmlGraphicsListView::currentSection() const /*! \qmlproperty real ListView::highlightMoveSpeed + \qmlproperty real ListView::highlightResizeSpeed + These properties hold the move and resize animation speed of the highlight delegate. + + highlightFollowsCurrentItem must be true for these properties + to have effect. - This property holds the moving animation speed of the highlight delegate. + \sa highlightFollowsCurrentItem */ qreal QmlGraphicsListView::highlightMoveSpeed() const { @@ -1500,11 +1505,6 @@ void QmlGraphicsListView::setHighlightMoveSpeed(qreal speed) } } -/*! - \qmlproperty real ListView::highlightResizeSpeed - - This property holds the resizing animation speed of the highlight delegate. -*/ qreal QmlGraphicsListView::highlightResizeSpeed() const { Q_D(const QmlGraphicsListView);\ diff --git a/src/declarative/graphicsitems/qmlgraphicslistview_p.h b/src/declarative/graphicsitems/qmlgraphicslistview_p.h index 446d71a..3f46434 100644 --- a/src/declarative/graphicsitems/qmlgraphicslistview_p.h +++ b/src/declarative/graphicsitems/qmlgraphicslistview_p.h @@ -64,8 +64,11 @@ class Q_DECLARATIVE_EXPORT QmlGraphicsListView : public QmlGraphicsFlickable Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged) Q_PROPERTY(QmlGraphicsItem *currentItem READ currentItem NOTIFY currentIndexChanged) Q_PROPERTY(int count READ count NOTIFY countChanged) + Q_PROPERTY(QmlComponent *highlight READ highlight WRITE setHighlight) Q_PROPERTY(bool highlightFollowsCurrentItem READ highlightFollowsCurrentItem WRITE setHighlightFollowsCurrentItem) + Q_PROPERTY(qreal highlightMoveSpeed READ highlightMoveSpeed WRITE setHighlightMoveSpeed NOTIFY highlightMoveSpeedChanged) + Q_PROPERTY(qreal highlightResizeSpeed READ highlightResizeSpeed WRITE setHighlightResizeSpeed NOTIFY highlightResizeSpeedChanged) Q_PROPERTY(qreal preferredHighlightBegin READ preferredHighlightBegin WRITE setPreferredHighlightBegin) Q_PROPERTY(qreal preferredHighlightEnd READ preferredHighlightEnd WRITE setPreferredHighlightEnd) @@ -78,8 +81,6 @@ class Q_DECLARATIVE_EXPORT QmlGraphicsListView : public QmlGraphicsFlickable Q_PROPERTY(QString sectionExpression READ sectionExpression WRITE setSectionExpression NOTIFY sectionExpressionChanged) Q_PROPERTY(QString currentSection READ currentSection NOTIFY currentSectionChanged) - Q_PROPERTY(qreal highlightMoveSpeed READ highlightMoveSpeed WRITE setHighlightMoveSpeed NOTIFY highlightMoveSpeedChanged) - Q_PROPERTY(qreal highlightResizeSpeed READ highlightResizeSpeed WRITE setHighlightResizeSpeed NOTIFY highlightResizeSpeedChanged) Q_ENUMS(HighlightRangeMode) Q_ENUMS(Orientation) Q_CLASSINFO("DefaultProperty", "data") -- cgit v0.12 From 7b5ecf9d033708bbc86e8b2901e3634970b6d9ab Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Mon, 9 Nov 2009 12:10:34 +1000 Subject: Rename TextEdit and TextInput autotests --- tests/auto/declarative/declarative.pro | 4 +- .../declarative/qfxtextedit/data/cursorTest.qml | 8 - .../declarative/qfxtextedit/data/navigation.qml | 23 - tests/auto/declarative/qfxtextedit/qfxtextedit.pro | 8 - .../declarative/qfxtextedit/tst_qfxtextedit.cpp | 555 --------------------- .../declarative/qfxtextinput/data/cursorTest.qml | 8 - .../declarative/qfxtextinput/data/navigation.qml | 23 - .../auto/declarative/qfxtextinput/qfxtextinput.pro | 8 - .../declarative/qfxtextinput/tst_qfxtextinput.cpp | 422 ---------------- .../qmlgraphicstextedit/data/cursorTest.qml | 8 + .../qmlgraphicstextedit/data/navigation.qml | 23 + .../qmlgraphicstextedit/qmlgraphicstextedit.pro | 8 + .../tst_qmlgraphicstextedit.cpp | 555 +++++++++++++++++++++ .../qmlgraphicstextinput/data/cursorTest.qml | 8 + .../qmlgraphicstextinput/data/navigation.qml | 23 + .../qmlgraphicstextinput/qmlgraphicstextinput.pro | 8 + .../tst_qmlgraphicstextinput.cpp | 422 ++++++++++++++++ 17 files changed, 1057 insertions(+), 1057 deletions(-) delete mode 100644 tests/auto/declarative/qfxtextedit/data/cursorTest.qml delete mode 100644 tests/auto/declarative/qfxtextedit/data/navigation.qml delete mode 100644 tests/auto/declarative/qfxtextedit/qfxtextedit.pro delete mode 100644 tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp delete mode 100644 tests/auto/declarative/qfxtextinput/data/cursorTest.qml delete mode 100644 tests/auto/declarative/qfxtextinput/data/navigation.qml delete mode 100644 tests/auto/declarative/qfxtextinput/qfxtextinput.pro delete mode 100644 tests/auto/declarative/qfxtextinput/tst_qfxtextinput.cpp create mode 100644 tests/auto/declarative/qmlgraphicstextedit/data/cursorTest.qml create mode 100644 tests/auto/declarative/qmlgraphicstextedit/data/navigation.qml create mode 100644 tests/auto/declarative/qmlgraphicstextedit/qmlgraphicstextedit.pro create mode 100644 tests/auto/declarative/qmlgraphicstextedit/tst_qmlgraphicstextedit.cpp create mode 100644 tests/auto/declarative/qmlgraphicstextinput/data/cursorTest.qml create mode 100644 tests/auto/declarative/qmlgraphicstextinput/data/navigation.qml create mode 100644 tests/auto/declarative/qmlgraphicstextinput/qmlgraphicstextinput.pro create mode 100644 tests/auto/declarative/qmlgraphicstextinput/tst_qmlgraphicstextinput.cpp diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index 000ceb3..b6d2241 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -13,8 +13,6 @@ SUBDIRS += \ parserstress \ # Cover pathview \ # Cover qfxloader \ # Cover - qfxtextedit \ # Cover - qfxtextinput \ # Cover qmetaobjectbuilder \ # Cover qmlbinding \ # Cover qmlconnection \ # Cover @@ -27,6 +25,8 @@ SUBDIRS += \ qmlgraphicsborderimage \ # Cover qmlgraphicsparticles \ # Cover qmlgraphicstext \ # Cover + qmlgraphicstextedit \ # Cover + qmlgraphicstextinput \ # Cover qmlgraphicswebview \ # Cover qmlinfo \ # Cover qmllanguage \ # Cover diff --git a/tests/auto/declarative/qfxtextedit/data/cursorTest.qml b/tests/auto/declarative/qfxtextedit/data/cursorTest.qml deleted file mode 100644 index e5df8f1..0000000 --- a/tests/auto/declarative/qfxtextedit/data/cursorTest.qml +++ /dev/null @@ -1,8 +0,0 @@ -import Qt 4.6 - -Rectangle { width: 300; height: 300; color: "white" - TextEdit { text: "Hello world!"; id: textEditObject; objectName: "textEditObject" - resources: [ Component { id:cursor; Item { id:cursorInstance; objectName: "cursorInstance" } } ] - cursorDelegate: cursor - } -} diff --git a/tests/auto/declarative/qfxtextedit/data/navigation.qml b/tests/auto/declarative/qfxtextedit/data/navigation.qml deleted file mode 100644 index 5b8613f..0000000 --- a/tests/auto/declarative/qfxtextedit/data/navigation.qml +++ /dev/null @@ -1,23 +0,0 @@ -import Qt 4.6 - -Rectangle { - property var myInput: Input - - width: 800; height: 600; color: "blue" - - Item { - id: FirstItem; - KeyNavigation.right: Input - } - - TextEdit { id: Input; focus: true - KeyNavigation.left: FirstItem - KeyNavigation.right: LastItem - KeyNavigation.up: FirstItem - KeyNavigation.down: LastItem - } - Item { - id: LastItem - KeyNavigation.left: Input - } -} diff --git a/tests/auto/declarative/qfxtextedit/qfxtextedit.pro b/tests/auto/declarative/qfxtextedit/qfxtextedit.pro deleted file mode 100644 index b5e0464..0000000 --- a/tests/auto/declarative/qfxtextedit/qfxtextedit.pro +++ /dev/null @@ -1,8 +0,0 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative gui -macx:CONFIG -= app_bundle - -SOURCES += tst_qfxtextedit.cpp - -# Define SRCDIR equal to test's source directory -DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp b/tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp deleted file mode 100644 index 19d5998..0000000 --- a/tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp +++ /dev/null @@ -1,555 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include -#include "../../../shared/util.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -class tst_qfxtextedit : public QObject - -{ - Q_OBJECT -public: - tst_qfxtextedit(); - -private slots: - void text(); - void width(); - void wrap(); - - // ### these tests may be trivial - void hAlign(); - void vAlign(); - void font(); - void color(); - void selection(); - - void cursorDelegate(); - void navigation(); - -private: - void simulateKey(QmlView *, int key); - QmlView *createView(const QString &filename); - - QStringList standard; - QStringList richText; - - QStringList hAlignmentStrings; - QStringList vAlignmentStrings; - - QList vAlignments; - QList hAlignments; - - QStringList colorStrings; - - QmlEngine engine; -}; - -tst_qfxtextedit::tst_qfxtextedit() -{ - standard << "the quick brown fox jumped over the lazy dog" - << "the quick brown fox\n jumped over the lazy dog"; - - richText << "the quick brown fox jumped over the lazy dog" - << "the quick brown fox
jumped over the lazy dog
"; - - hAlignmentStrings << "AlignLeft" - << "AlignRight" - << "AlignHCenter"; - - vAlignmentStrings << "AlignTop" - << "AlignBottom" - << "AlignVCenter"; - - hAlignments << Qt::AlignLeft - << Qt::AlignRight - << Qt::AlignHCenter; - - vAlignments << Qt::AlignTop - << Qt::AlignBottom - << Qt::AlignVCenter; - - colorStrings << "aliceblue" - << "antiquewhite" - << "aqua" - << "darkkhaki" - << "darkolivegreen" - << "dimgray" - << "palevioletred" - << "lightsteelblue" - << "#000000" - << "#AAAAAA" - << "#FFFFFF" - << "#2AC05F"; - // - // need a different test to do alpha channel test - // << "#AA0011DD" - // << "#00F16B11"; - // -} - -void tst_qfxtextedit::text() -{ - { - QmlComponent texteditComponent(&engine, "import Qt 4.6\nTextEdit { text: \"\" }", QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->text(), QString("")); - } - - for (int i = 0; i < standard.size(); i++) - { - QString componentStr = "import Qt 4.6\nTextEdit { text: \"" + standard.at(i) + "\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->text(), standard.at(i)); - } - - for (int i = 0; i < richText.size(); i++) - { - QString componentStr = "import Qt 4.6\nTextEdit { text: \"" + richText.at(i) + "\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QString actual = textEditObject->text(); - QString expected = richText.at(i); - actual.replace(QRegExp(".*]*>"),""); - actual.replace(QRegExp("(<[^>]*>)+"),"<>"); - expected.replace(QRegExp("(<[^>]*>)+"),"<>"); - QCOMPARE(actual.simplified(),expected.simplified()); - } -} - -void tst_qfxtextedit::width() -{ - // uses Font metrics to find the width for standard and document to find the width for rich - { - QmlComponent texteditComponent(&engine, "import Qt 4.6\nTextEdit { text: \"\" }", QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->width(), 1.);//+1 for cursor - } - - for (int i = 0; i < standard.size(); i++) - { - QFont f; - QFontMetricsF fm(f); - qreal metricWidth = fm.size(Qt::TextExpandTabs && Qt::TextShowMnemonic, standard.at(i)).width(); - metricWidth = floor(metricWidth); - - QString componentStr = "import Qt 4.6\nTextEdit { text: \"" + standard.at(i) + "\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->width(), qreal(metricWidth + 1 + 3));//+3 is the current way of accounting for space between cursor and last character. - } - - for (int i = 0; i < richText.size(); i++) - { - QTextDocument document; - document.setHtml(richText.at(i)); - document.setDocumentMargin(0); - - int documentWidth = document.idealWidth(); - - QString componentStr = "import Qt 4.6\nTextEdit { text: \"" + richText.at(i) + "\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->width(), qreal(documentWidth + 1 + 3)); - } -} - -void tst_qfxtextedit::wrap() -{ - // for specified width and wrap set true - { - QmlComponent texteditComponent(&engine, "import Qt 4.6\nTextEdit { text: \"\"; wrap: true; width: 300 }", QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->width(), 300.); - } - - for (int i = 0; i < standard.size(); i++) - { - QString componentStr = "import Qt 4.6\nTextEdit { wrap: true; width: 300; text: \"" + standard.at(i) + "\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->width(), 300.); - } - - for (int i = 0; i < richText.size(); i++) - { - QString componentStr = "import Qt 4.6\nTextEdit { wrap: true; width: 300; text: \"" + richText.at(i) + "\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->width(), 300.); - } - -} - -//the alignment tests may be trivial o.oa -void tst_qfxtextedit::hAlign() -{ - //test one align each, and then test if two align fails. - - for (int i = 0; i < standard.size(); i++) - { - for (int j=0; j < hAlignmentStrings.size(); j++) - { - QString componentStr = "import Qt 4.6\nTextEdit { horizontalAlignment: \"" + hAlignmentStrings.at(j) + "\"; text: \"" + standard.at(i) + "\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE((int)textEditObject->hAlign(), (int)hAlignments.at(j)); - } - } - - for (int i = 0; i < richText.size(); i++) - { - for (int j=0; j < hAlignmentStrings.size(); j++) - { - QString componentStr = "import Qt 4.6\nTextEdit { horizontalAlignment: \"" + hAlignmentStrings.at(j) + "\"; text: \"" + richText.at(i) + "\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE((int)textEditObject->hAlign(), (int)hAlignments.at(j)); - } - } - -} - -void tst_qfxtextedit::vAlign() -{ - //test one align each, and then test if two align fails. - - for (int i = 0; i < standard.size(); i++) - { - for (int j=0; j < vAlignmentStrings.size(); j++) - { - QString componentStr = "import Qt 4.6\nTextEdit { verticalAlignment: \"" + vAlignmentStrings.at(j) + "\"; text: \"" + standard.at(i) + "\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE((int)textEditObject->vAlign(), (int)vAlignments.at(j)); - } - } - - for (int i = 0; i < richText.size(); i++) - { - for (int j=0; j < vAlignmentStrings.size(); j++) - { - QString componentStr = "import Qt 4.6\nTextEdit { verticalAlignment: \"" + vAlignmentStrings.at(j) + "\"; text: \"" + richText.at(i) + "\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE((int)textEditObject->vAlign(), (int)vAlignments.at(j)); - } - } - -} - -void tst_qfxtextedit::font() -{ - //test size, then bold, then italic, then family - { - QString componentStr = "import Qt 4.6\nTextEdit { font.pointSize: 40; text: \"Hello World\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->font().pointSize(), 40); - QCOMPARE(textEditObject->font().bold(), false); - QCOMPARE(textEditObject->font().italic(), false); - } - - { - QString componentStr = "import Qt 4.6\nTextEdit { font.bold: true; text: \"Hello World\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->font().bold(), true); - QCOMPARE(textEditObject->font().italic(), false); - } - - { - QString componentStr = "import Qt 4.6\nTextEdit { font.italic: true; text: \"Hello World\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->font().italic(), true); - QCOMPARE(textEditObject->font().bold(), false); - } - - { - QString componentStr = "import Qt 4.6\nTextEdit { font.family: \"Helvetica\"; text: \"Hello World\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->font().family(), QString("Helvetica")); - QCOMPARE(textEditObject->font().bold(), false); - QCOMPARE(textEditObject->font().italic(), false); - } - - { - QString componentStr = "import Qt 4.6\nTextEdit { font.family: \"\"; text: \"Hello World\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->font().family(), QString("")); - } -} - -void tst_qfxtextedit::color() -{ - //test style - for (int i = 0; i < colorStrings.size(); i++) - { - QString componentStr = "import Qt 4.6\nTextEdit { color: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - //qDebug() << "textEditObject: " << textEditObject->color() << "vs. " << QColor(colorStrings.at(i)); - QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->color(), QColor(colorStrings.at(i))); - } - - { - QString colorStr = "#AA001234"; - QColor testColor("#001234"); - testColor.setAlpha(170); - - QString componentStr = "import Qt 4.6\nTextEdit { color: \"" + colorStr + "\"; text: \"Hello World\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->color(), testColor); - } -} - -void tst_qfxtextedit::selection() -{ - QString testStr = standard[0];//TODO: What should happen for multiline/rich text? - QString componentStr = "import Qt 4.6\nTextEdit { text: \""+ testStr +"\"; }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - QVERIFY(textEditObject != 0); - - - //Test selection follows cursor - for(int i=0; i<= testStr.size(); i++) { - textEditObject->setCursorPosition(i); - QCOMPARE(textEditObject->cursorPosition(), i); - QCOMPARE(textEditObject->selectionStart(), i); - QCOMPARE(textEditObject->selectionEnd(), i); - QVERIFY(textEditObject->selectedText().isNull()); - } - - textEditObject->setCursorPosition(0); - QVERIFY(textEditObject->cursorPosition() == 0); - QVERIFY(textEditObject->selectionStart() == 0); - QVERIFY(textEditObject->selectionEnd() == 0); - QVERIFY(textEditObject->selectedText().isNull()); - - //Test selection - for(int i=0; i<= testStr.size(); i++) { - textEditObject->setSelectionEnd(i); - QCOMPARE(testStr.mid(0,i), textEditObject->selectedText()); - } - for(int i=0; i<= testStr.size(); i++) { - textEditObject->setSelectionStart(i); - QCOMPARE(testStr.mid(i,testStr.size()-i), textEditObject->selectedText()); - } - - textEditObject->setCursorPosition(0); - QVERIFY(textEditObject->cursorPosition() == 0); - QVERIFY(textEditObject->selectionStart() == 0); - QVERIFY(textEditObject->selectionEnd() == 0); - QVERIFY(textEditObject->selectedText().isNull()); - - for(int i=0; i< testStr.size(); i++) { - textEditObject->setSelectionStart(i); - QCOMPARE(textEditObject->selectionEnd(), i); - QCOMPARE(testStr.mid(i,0), textEditObject->selectedText()); - textEditObject->setSelectionEnd(i+1); - QCOMPARE(textEditObject->selectionStart(), i); - QCOMPARE(testStr.mid(i,1), textEditObject->selectedText()); - } - - for(int i= testStr.size() - 1; i>0; i--) { - textEditObject->setSelectionEnd(i); - QCOMPARE(testStr.mid(i,0), textEditObject->selectedText()); - textEditObject->setSelectionStart(i-1); - QCOMPARE(testStr.mid(i-1,1), textEditObject->selectedText()); - } - - //Test Error Ignoring behaviour - textEditObject->setCursorPosition(0); - QVERIFY(textEditObject->selectedText().isNull()); - textEditObject->setSelectionStart(-10); - QVERIFY(textEditObject->selectedText().isNull()); - textEditObject->setSelectionStart(100); - QVERIFY(textEditObject->selectedText().isNull()); - textEditObject->setSelectionEnd(-10); - QVERIFY(textEditObject->selectedText().isNull()); - textEditObject->setSelectionEnd(100); - QVERIFY(textEditObject->selectedText().isNull()); - textEditObject->setSelectionStart(0); - textEditObject->setSelectionEnd(10); - QVERIFY(textEditObject->selectedText().size() == 10); - textEditObject->setSelectionStart(-10); - QVERIFY(textEditObject->selectedText().size() == 10); - textEditObject->setSelectionStart(100); - QVERIFY(textEditObject->selectedText().size() == 10); - textEditObject->setSelectionEnd(-10); - QVERIFY(textEditObject->selectedText().size() == 10); - textEditObject->setSelectionEnd(100); - QVERIFY(textEditObject->selectedText().size() == 10); -} - -void tst_qfxtextedit::cursorDelegate() -{ - QmlView* view = createView(SRCDIR "/data/cursorTest.qml"); - view->execute(); - view->show(); - view->setFocus(); - QmlGraphicsTextEdit *textEditObject = view->root()->findChild("textEditObject"); - QVERIFY(textEditObject != 0); - QVERIFY(textEditObject->findChild("cursorInstance")); - //Test Delegate gets created - textEditObject->setFocus(true); - QmlGraphicsItem* delegateObject = textEditObject->findChild("cursorInstance"); - QVERIFY(delegateObject); - //Test Delegate gets moved - for(int i=0; i<= textEditObject->text().length(); i++){ - textEditObject->setCursorPosition(i); - QCOMPARE(textEditObject->cursorRect().x(), qRound(delegateObject->x())); - QCOMPARE(textEditObject->cursorRect().y(), qRound(delegateObject->y())); - } - textEditObject->setCursorPosition(0); - QCOMPARE(textEditObject->cursorRect().x(), qRound(delegateObject->x())); - QCOMPARE(textEditObject->cursorRect().y(), qRound(delegateObject->y())); - //Test Delegate gets deleted - textEditObject->setCursorDelegate(0); - QVERIFY(!textEditObject->findChild("cursorInstance")); -} - -/* -TextEdit element should only handle left/right keys until the cursor reaches -the extent of the text, then they should ignore the keys. -*/ -void tst_qfxtextedit::navigation() -{ - QmlView *canvas = createView(SRCDIR "/data/navigation.qml"); - canvas->execute(); - canvas->show(); - canvas->setFocus(); - - QVERIFY(canvas->root() != 0); - - QmlGraphicsItem *input = qobject_cast(qvariant_cast(canvas->root()->property("myInput"))); - - QVERIFY(input != 0); - QTRY_VERIFY(input->hasFocus() == true); - QEXPECT_FAIL("", "Depends on QT-2236", Abort); - simulateKey(canvas, Qt::Key_Left); - QVERIFY(input->hasFocus() == false); - simulateKey(canvas, Qt::Key_Right); - QVERIFY(input->hasFocus() == true); - simulateKey(canvas, Qt::Key_Right); - QVERIFY(input->hasFocus() == false); - simulateKey(canvas, Qt::Key_Left); - QVERIFY(input->hasFocus() == true); -} - -void tst_qfxtextedit::simulateKey(QmlView *view, int key) -{ - QKeyEvent press(QKeyEvent::KeyPress, key, 0); - QKeyEvent release(QKeyEvent::KeyRelease, key, 0); - - QApplication::sendEvent(view, &press); - QApplication::sendEvent(view, &release); -} - -QmlView *tst_qfxtextedit::createView(const QString &filename) -{ - QmlView *canvas = new QmlView(0); - - QFile file(filename); - file.open(QFile::ReadOnly); - QString xml = file.readAll(); - canvas->setQml(xml, filename); - - return canvas; -} - - -QTEST_MAIN(tst_qfxtextedit) - -#include "tst_qfxtextedit.moc" diff --git a/tests/auto/declarative/qfxtextinput/data/cursorTest.qml b/tests/auto/declarative/qfxtextinput/data/cursorTest.qml deleted file mode 100644 index ddc98cc..0000000 --- a/tests/auto/declarative/qfxtextinput/data/cursorTest.qml +++ /dev/null @@ -1,8 +0,0 @@ -import Qt 4.6 - -Rectangle { width: 300; height: 300; color: "white" - TextInput { text: "Hello world!"; id: textInputObject; objectName: "textInputObject" - resources: [ Component { id:cursor; Item { id:cursorInstance; objectName: "cursorInstance";} } ] - cursorDelegate: cursor - } -} diff --git a/tests/auto/declarative/qfxtextinput/data/navigation.qml b/tests/auto/declarative/qfxtextinput/data/navigation.qml deleted file mode 100644 index 282c52c..0000000 --- a/tests/auto/declarative/qfxtextinput/data/navigation.qml +++ /dev/null @@ -1,23 +0,0 @@ -import Qt 4.6 - -Rectangle { - property var myInput: Input - - width: 800; height: 600; color: "blue" - - Item { - id: FirstItem; - KeyNavigation.right: Input - } - - TextInput { id: Input; focus: true - KeyNavigation.left: FirstItem - KeyNavigation.right: LastItem - KeyNavigation.up: FirstItem - KeyNavigation.down: LastItem - } - Item { - id: LastItem - KeyNavigation.left: Input - } -} diff --git a/tests/auto/declarative/qfxtextinput/qfxtextinput.pro b/tests/auto/declarative/qfxtextinput/qfxtextinput.pro deleted file mode 100644 index fe2e3e3..0000000 --- a/tests/auto/declarative/qfxtextinput/qfxtextinput.pro +++ /dev/null @@ -1,8 +0,0 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative gui -macx:CONFIG -= app_bundle - -SOURCES += tst_qfxtextinput.cpp - -# Define SRCDIR equal to test's source directory -DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/qfxtextinput/tst_qfxtextinput.cpp b/tests/auto/declarative/qfxtextinput/tst_qfxtextinput.cpp deleted file mode 100644 index 8eeb22d..0000000 --- a/tests/auto/declarative/qfxtextinput/tst_qfxtextinput.cpp +++ /dev/null @@ -1,422 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include -#include "../../../shared/util.h" -#include -#include -#include -#include -#include - -class tst_qfxtextinput : public QObject - -{ - Q_OBJECT -public: - tst_qfxtextinput(); - -private slots: - void text(); - void width(); - void font(); - void color(); - void selection(); - - void maxLength(); - void masks(); - void validators(); - - void cursorDelegate(); - void navigation(); - -private: - void simulateKey(QmlView *, int key); - QmlView *createView(const QString &filename); - - QmlEngine engine; - QStringList standard; - QStringList colorStrings; -}; - -tst_qfxtextinput::tst_qfxtextinput() -{ - standard << "the quick brown fox jumped over the lazy dog" - << "It's supercalifragisiticexpialidocious!" - << "Hello, world!"; - - colorStrings << "aliceblue" - << "antiquewhite" - << "aqua" - << "darkkhaki" - << "darkolivegreen" - << "dimgray" - << "palevioletred" - << "lightsteelblue" - << "#000000" - << "#AAAAAA" - << "#FFFFFF" - << "#2AC05F"; -} - -void tst_qfxtextinput::text() -{ - { - QmlComponent textinputComponent(&engine, "import Qt 4.6\nTextInput { text: \"\" }", QUrl()); - QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); - - QVERIFY(textinputObject != 0); - QCOMPARE(textinputObject->text(), QString("")); - } - - for (int i = 0; i < standard.size(); i++) - { - QString componentStr = "import Qt 4.6\nTextInput { text: \"" + standard.at(i) + "\" }"; - QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); - - QVERIFY(textinputObject != 0); - QCOMPARE(textinputObject->text(), standard.at(i)); - } - -} - -void tst_qfxtextinput::width() -{ - // uses Font metrics to find the width for standard - { - QmlComponent textinputComponent(&engine, "import Qt 4.6\nTextInput { text: \"\" }", QUrl()); - QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); - - QVERIFY(textinputObject != 0); - QCOMPARE(textinputObject->width(), 1.);//1 for the cursor - } - - for (int i = 0; i < standard.size(); i++) - { - QFont f; - QFontMetricsF fm(f); - qreal metricWidth = fm.width(standard.at(i)); - - QString componentStr = "import Qt 4.6\nTextInput { text: \"" + standard.at(i) + "\" }"; - QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); - - QVERIFY(textinputObject != 0); - QCOMPARE(textinputObject->width(), qreal(metricWidth) + 1.);//1 for the cursor - } -} - -void tst_qfxtextinput::font() -{ - //test size, then bold, then italic, then family - { - QString componentStr = "import Qt 4.6\nTextInput { font.pointSize: 40; text: \"Hello World\" }"; - QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); - - QVERIFY(textinputObject != 0); - QCOMPARE(textinputObject->font().pointSize(), 40); - QCOMPARE(textinputObject->font().bold(), false); - QCOMPARE(textinputObject->font().italic(), false); - } - - { - QString componentStr = "import Qt 4.6\nTextInput { font.bold: true; text: \"Hello World\" }"; - QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); - - QVERIFY(textinputObject != 0); - QCOMPARE(textinputObject->font().bold(), true); - QCOMPARE(textinputObject->font().italic(), false); - } - - { - QString componentStr = "import Qt 4.6\nTextInput { font.italic: true; text: \"Hello World\" }"; - QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); - - QVERIFY(textinputObject != 0); - QCOMPARE(textinputObject->font().italic(), true); - QCOMPARE(textinputObject->font().bold(), false); - } - - { - QString componentStr = "import Qt 4.6\nTextInput { font.family: \"Helvetica\"; text: \"Hello World\" }"; - QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); - - QVERIFY(textinputObject != 0); - QCOMPARE(textinputObject->font().family(), QString("Helvetica")); - QCOMPARE(textinputObject->font().bold(), false); - QCOMPARE(textinputObject->font().italic(), false); - } - - { - QString componentStr = "import Qt 4.6\nTextInput { font.family: \"\"; text: \"Hello World\" }"; - QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); - - QVERIFY(textinputObject != 0); - QCOMPARE(textinputObject->font().family(), QString("")); - } -} - -void tst_qfxtextinput::color() -{ - //test style - for (int i = 0; i < colorStrings.size(); i++) - { - QString componentStr = "import Qt 4.6\nTextInput { color: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }"; - QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); - //qDebug() << "textinputObject: " << textinputObject->color() << "vs. " << QColor(colorStrings.at(i)); - QVERIFY(textinputObject != 0); - QCOMPARE(textinputObject->color(), QColor(colorStrings.at(i))); - } - - { - QString colorStr = "#AA001234"; - QColor testColor("#001234"); - testColor.setAlpha(170); - - QString componentStr = "import Qt 4.6\nTextInput { color: \"" + colorStr + "\"; text: \"Hello World\" }"; - QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); - - QVERIFY(textinputObject != 0); - QCOMPARE(textinputObject->color(), testColor); - } -} - -void tst_qfxtextinput::selection() -{ - QString testStr = standard[0]; - QString componentStr = "import Qt 4.6\nTextInput { text: \""+ testStr +"\"; }"; - QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); - QVERIFY(textinputObject != 0); - - - //Test selection follows cursor - for(int i=0; i<= testStr.size(); i++) { - textinputObject->setCursorPosition(i); - QCOMPARE(textinputObject->cursorPosition(), i); - QCOMPARE(textinputObject->selectionStart(), i); - QCOMPARE(textinputObject->selectionEnd(), i); - QVERIFY(textinputObject->selectedText().isNull()); - } - - textinputObject->setCursorPosition(0); - QVERIFY(textinputObject->cursorPosition() == 0); - QVERIFY(textinputObject->selectionStart() == 0); - QVERIFY(textinputObject->selectionEnd() == 0); - QVERIFY(textinputObject->selectedText().isNull()); - - //Test selection - for(int i=0; i<= testStr.size(); i++) { - textinputObject->setSelectionEnd(i); - QCOMPARE(testStr.mid(0,i), textinputObject->selectedText()); - } - for(int i=0; i<= testStr.size(); i++) { - textinputObject->setSelectionStart(i); - QCOMPARE(testStr.mid(i,testStr.size()-i), textinputObject->selectedText()); - } - - textinputObject->setCursorPosition(0); - QVERIFY(textinputObject->cursorPosition() == 0); - QVERIFY(textinputObject->selectionStart() == 0); - QVERIFY(textinputObject->selectionEnd() == 0); - QVERIFY(textinputObject->selectedText().isNull()); - - for(int i=0; i< testStr.size(); i++) { - textinputObject->setSelectionStart(i); - QCOMPARE(textinputObject->selectionEnd(), i); - QCOMPARE(testStr.mid(i,0), textinputObject->selectedText()); - textinputObject->setSelectionEnd(i+1); - QCOMPARE(textinputObject->selectionStart(), i); - QCOMPARE(testStr.mid(i,1), textinputObject->selectedText()); - } - - for(int i= testStr.size() - 1; i>0; i--) { - textinputObject->setSelectionEnd(i); - QCOMPARE(testStr.mid(i,0), textinputObject->selectedText()); - textinputObject->setSelectionStart(i-1); - QCOMPARE(testStr.mid(i-1,1), textinputObject->selectedText()); - } - - //Test Error Ignoring behaviour - textinputObject->setCursorPosition(0); - QVERIFY(textinputObject->selectedText().isNull()); - textinputObject->setSelectionStart(-10); - QVERIFY(textinputObject->selectedText().isNull()); - textinputObject->setSelectionStart(100); - QVERIFY(textinputObject->selectedText().isNull()); - textinputObject->setSelectionEnd(-10); - QVERIFY(textinputObject->selectedText().isNull()); - textinputObject->setSelectionEnd(100); - QVERIFY(textinputObject->selectedText().isNull()); - textinputObject->setSelectionStart(0); - textinputObject->setSelectionEnd(10); - QVERIFY(textinputObject->selectedText().size() == 10); - textinputObject->setSelectionStart(-10); - QVERIFY(textinputObject->selectedText().size() == 10); - textinputObject->setSelectionStart(100); - QVERIFY(textinputObject->selectedText().size() == 10); - textinputObject->setSelectionEnd(-10); - QVERIFY(textinputObject->selectedText().size() == 10); - textinputObject->setSelectionEnd(100); - QVERIFY(textinputObject->selectedText().size() == 10); -} - -void tst_qfxtextinput::maxLength() -{ - QString componentStr = "import Qt 4.6\nTextInput { maximumLength: 10; }"; - QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); - QVERIFY(textinputObject != 0); - QVERIFY(textinputObject->text().isEmpty()); - foreach(const QString &str, standard){ - QVERIFY(textinputObject->text().length() <= 10); - textinputObject->setText(str); - QVERIFY(textinputObject->text().length() <= 10); - } - //TODO: Simulated keypress input adding 11 chars at a time -} - -void tst_qfxtextinput::masks() -{ - QString componentStr = "import Qt 4.6\nTextInput { maximumLength: 10; }"; - QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); - QVERIFY(textinputObject != 0); - - //TODO: Me -} - -void tst_qfxtextinput::validators() -{ - QString componentStr = "import Qt 4.6\nTextInput { maximumLength: 10; }"; - QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); - QVERIFY(textinputObject != 0); - - //TODO: Me -} - -/* -TextInput element should only handle left/right keys until the cursor reaches -the extent of the text, then they should ignore the keys. -*/ -void tst_qfxtextinput::navigation() -{ - QmlView *canvas = createView(SRCDIR "/data/navigation.qml"); - canvas->execute(); - canvas->show(); - canvas->setFocus(); - - QVERIFY(canvas->root() != 0); - - QmlGraphicsItem *input = qobject_cast(qvariant_cast(canvas->root()->property("myInput"))); - - QVERIFY(input != 0); - QTRY_VERIFY(input->hasFocus() == true); - simulateKey(canvas, Qt::Key_Left); - QVERIFY(input->hasFocus() == false); - simulateKey(canvas, Qt::Key_Right); - QVERIFY(input->hasFocus() == true); - simulateKey(canvas, Qt::Key_Right); - QVERIFY(input->hasFocus() == false); - simulateKey(canvas, Qt::Key_Left); - QVERIFY(input->hasFocus() == true); -} - -void tst_qfxtextinput::cursorDelegate() -{ - QmlView* view = createView(SRCDIR "/data/cursorTest.qml"); - view->execute(); - view->show(); - view->setFocus(); - QmlGraphicsTextInput *textInputObject = view->root()->findChild("textInputObject"); - QVERIFY(textInputObject != 0); - QVERIFY(textInputObject->findChild("cursorInstance")); - //Test Delegate gets created - textInputObject->setFocus(true); - QmlGraphicsItem* delegateObject = textInputObject->findChild("cursorInstance"); - QVERIFY(delegateObject); - //Test Delegate gets moved - for(int i=0; i<= textInputObject->text().length(); i++){ - textInputObject->setCursorPosition(i); - //+5 is because the TextInput cursorRect is just a 10xHeight area centered on cursor position - QCOMPARE(textInputObject->cursorRect().x() + 5, qRound(delegateObject->x())); - QCOMPARE(textInputObject->cursorRect().y(), qRound(delegateObject->y())); - } - textInputObject->setCursorPosition(0); - QCOMPARE(textInputObject->cursorRect().x()+5, qRound(delegateObject->x())); - QCOMPARE(textInputObject->cursorRect().y(), qRound(delegateObject->y())); - //Test Delegate gets deleted - textInputObject->setCursorDelegate(0); - QVERIFY(!textInputObject->findChild("cursorInstance")); -} - -void tst_qfxtextinput::simulateKey(QmlView *view, int key) -{ - QKeyEvent press(QKeyEvent::KeyPress, key, 0); - QKeyEvent release(QKeyEvent::KeyRelease, key, 0); - - QApplication::sendEvent(view, &press); - QApplication::sendEvent(view, &release); -} - -QmlView *tst_qfxtextinput::createView(const QString &filename) -{ - QmlView *canvas = new QmlView(0); - - QFile file(filename); - file.open(QFile::ReadOnly); - QString xml = file.readAll(); - canvas->setQml(xml, filename); - - return canvas; -} - -QTEST_MAIN(tst_qfxtextinput) - -#include "tst_qfxtextinput.moc" diff --git a/tests/auto/declarative/qmlgraphicstextedit/data/cursorTest.qml b/tests/auto/declarative/qmlgraphicstextedit/data/cursorTest.qml new file mode 100644 index 0000000..e5df8f1 --- /dev/null +++ b/tests/auto/declarative/qmlgraphicstextedit/data/cursorTest.qml @@ -0,0 +1,8 @@ +import Qt 4.6 + +Rectangle { width: 300; height: 300; color: "white" + TextEdit { text: "Hello world!"; id: textEditObject; objectName: "textEditObject" + resources: [ Component { id:cursor; Item { id:cursorInstance; objectName: "cursorInstance" } } ] + cursorDelegate: cursor + } +} diff --git a/tests/auto/declarative/qmlgraphicstextedit/data/navigation.qml b/tests/auto/declarative/qmlgraphicstextedit/data/navigation.qml new file mode 100644 index 0000000..5b8613f --- /dev/null +++ b/tests/auto/declarative/qmlgraphicstextedit/data/navigation.qml @@ -0,0 +1,23 @@ +import Qt 4.6 + +Rectangle { + property var myInput: Input + + width: 800; height: 600; color: "blue" + + Item { + id: FirstItem; + KeyNavigation.right: Input + } + + TextEdit { id: Input; focus: true + KeyNavigation.left: FirstItem + KeyNavigation.right: LastItem + KeyNavigation.up: FirstItem + KeyNavigation.down: LastItem + } + Item { + id: LastItem + KeyNavigation.left: Input + } +} diff --git a/tests/auto/declarative/qmlgraphicstextedit/qmlgraphicstextedit.pro b/tests/auto/declarative/qmlgraphicstextedit/qmlgraphicstextedit.pro new file mode 100644 index 0000000..9e6a71a --- /dev/null +++ b/tests/auto/declarative/qmlgraphicstextedit/qmlgraphicstextedit.pro @@ -0,0 +1,8 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += declarative gui +macx:CONFIG -= app_bundle + +SOURCES += tst_qmlgraphicstextedit.cpp + +# Define SRCDIR equal to test's source directory +DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/qmlgraphicstextedit/tst_qmlgraphicstextedit.cpp b/tests/auto/declarative/qmlgraphicstextedit/tst_qmlgraphicstextedit.cpp new file mode 100644 index 0000000..4287f01 --- /dev/null +++ b/tests/auto/declarative/qmlgraphicstextedit/tst_qmlgraphicstextedit.cpp @@ -0,0 +1,555 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include +#include "../../../shared/util.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class tst_qmlgraphicstextedit : public QObject + +{ + Q_OBJECT +public: + tst_qmlgraphicstextedit(); + +private slots: + void text(); + void width(); + void wrap(); + + // ### these tests may be trivial + void hAlign(); + void vAlign(); + void font(); + void color(); + void selection(); + + void cursorDelegate(); + void navigation(); + +private: + void simulateKey(QmlView *, int key); + QmlView *createView(const QString &filename); + + QStringList standard; + QStringList richText; + + QStringList hAlignmentStrings; + QStringList vAlignmentStrings; + + QList vAlignments; + QList hAlignments; + + QStringList colorStrings; + + QmlEngine engine; +}; + +tst_qmlgraphicstextedit::tst_qmlgraphicstextedit() +{ + standard << "the quick brown fox jumped over the lazy dog" + << "the quick brown fox\n jumped over the lazy dog"; + + richText << "the quick brown fox jumped over the lazy dog" + << "the quick brown fox
jumped over the lazy dog
"; + + hAlignmentStrings << "AlignLeft" + << "AlignRight" + << "AlignHCenter"; + + vAlignmentStrings << "AlignTop" + << "AlignBottom" + << "AlignVCenter"; + + hAlignments << Qt::AlignLeft + << Qt::AlignRight + << Qt::AlignHCenter; + + vAlignments << Qt::AlignTop + << Qt::AlignBottom + << Qt::AlignVCenter; + + colorStrings << "aliceblue" + << "antiquewhite" + << "aqua" + << "darkkhaki" + << "darkolivegreen" + << "dimgray" + << "palevioletred" + << "lightsteelblue" + << "#000000" + << "#AAAAAA" + << "#FFFFFF" + << "#2AC05F"; + // + // need a different test to do alpha channel test + // << "#AA0011DD" + // << "#00F16B11"; + // +} + +void tst_qmlgraphicstextedit::text() +{ + { + QmlComponent texteditComponent(&engine, "import Qt 4.6\nTextEdit { text: \"\" }", QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE(textEditObject->text(), QString("")); + } + + for (int i = 0; i < standard.size(); i++) + { + QString componentStr = "import Qt 4.6\nTextEdit { text: \"" + standard.at(i) + "\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE(textEditObject->text(), standard.at(i)); + } + + for (int i = 0; i < richText.size(); i++) + { + QString componentStr = "import Qt 4.6\nTextEdit { text: \"" + richText.at(i) + "\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QString actual = textEditObject->text(); + QString expected = richText.at(i); + actual.replace(QRegExp(".*]*>"),""); + actual.replace(QRegExp("(<[^>]*>)+"),"<>"); + expected.replace(QRegExp("(<[^>]*>)+"),"<>"); + QCOMPARE(actual.simplified(),expected.simplified()); + } +} + +void tst_qmlgraphicstextedit::width() +{ + // uses Font metrics to find the width for standard and document to find the width for rich + { + QmlComponent texteditComponent(&engine, "import Qt 4.6\nTextEdit { text: \"\" }", QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE(textEditObject->width(), 1.);//+1 for cursor + } + + for (int i = 0; i < standard.size(); i++) + { + QFont f; + QFontMetricsF fm(f); + qreal metricWidth = fm.size(Qt::TextExpandTabs && Qt::TextShowMnemonic, standard.at(i)).width(); + metricWidth = floor(metricWidth); + + QString componentStr = "import Qt 4.6\nTextEdit { text: \"" + standard.at(i) + "\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE(textEditObject->width(), qreal(metricWidth + 1 + 3));//+3 is the current way of accounting for space between cursor and last character. + } + + for (int i = 0; i < richText.size(); i++) + { + QTextDocument document; + document.setHtml(richText.at(i)); + document.setDocumentMargin(0); + + int documentWidth = document.idealWidth(); + + QString componentStr = "import Qt 4.6\nTextEdit { text: \"" + richText.at(i) + "\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE(textEditObject->width(), qreal(documentWidth + 1 + 3)); + } +} + +void tst_qmlgraphicstextedit::wrap() +{ + // for specified width and wrap set true + { + QmlComponent texteditComponent(&engine, "import Qt 4.6\nTextEdit { text: \"\"; wrap: true; width: 300 }", QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE(textEditObject->width(), 300.); + } + + for (int i = 0; i < standard.size(); i++) + { + QString componentStr = "import Qt 4.6\nTextEdit { wrap: true; width: 300; text: \"" + standard.at(i) + "\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE(textEditObject->width(), 300.); + } + + for (int i = 0; i < richText.size(); i++) + { + QString componentStr = "import Qt 4.6\nTextEdit { wrap: true; width: 300; text: \"" + richText.at(i) + "\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE(textEditObject->width(), 300.); + } + +} + +//the alignment tests may be trivial o.oa +void tst_qmlgraphicstextedit::hAlign() +{ + //test one align each, and then test if two align fails. + + for (int i = 0; i < standard.size(); i++) + { + for (int j=0; j < hAlignmentStrings.size(); j++) + { + QString componentStr = "import Qt 4.6\nTextEdit { horizontalAlignment: \"" + hAlignmentStrings.at(j) + "\"; text: \"" + standard.at(i) + "\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE((int)textEditObject->hAlign(), (int)hAlignments.at(j)); + } + } + + for (int i = 0; i < richText.size(); i++) + { + for (int j=0; j < hAlignmentStrings.size(); j++) + { + QString componentStr = "import Qt 4.6\nTextEdit { horizontalAlignment: \"" + hAlignmentStrings.at(j) + "\"; text: \"" + richText.at(i) + "\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE((int)textEditObject->hAlign(), (int)hAlignments.at(j)); + } + } + +} + +void tst_qmlgraphicstextedit::vAlign() +{ + //test one align each, and then test if two align fails. + + for (int i = 0; i < standard.size(); i++) + { + for (int j=0; j < vAlignmentStrings.size(); j++) + { + QString componentStr = "import Qt 4.6\nTextEdit { verticalAlignment: \"" + vAlignmentStrings.at(j) + "\"; text: \"" + standard.at(i) + "\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE((int)textEditObject->vAlign(), (int)vAlignments.at(j)); + } + } + + for (int i = 0; i < richText.size(); i++) + { + for (int j=0; j < vAlignmentStrings.size(); j++) + { + QString componentStr = "import Qt 4.6\nTextEdit { verticalAlignment: \"" + vAlignmentStrings.at(j) + "\"; text: \"" + richText.at(i) + "\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE((int)textEditObject->vAlign(), (int)vAlignments.at(j)); + } + } + +} + +void tst_qmlgraphicstextedit::font() +{ + //test size, then bold, then italic, then family + { + QString componentStr = "import Qt 4.6\nTextEdit { font.pointSize: 40; text: \"Hello World\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE(textEditObject->font().pointSize(), 40); + QCOMPARE(textEditObject->font().bold(), false); + QCOMPARE(textEditObject->font().italic(), false); + } + + { + QString componentStr = "import Qt 4.6\nTextEdit { font.bold: true; text: \"Hello World\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE(textEditObject->font().bold(), true); + QCOMPARE(textEditObject->font().italic(), false); + } + + { + QString componentStr = "import Qt 4.6\nTextEdit { font.italic: true; text: \"Hello World\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE(textEditObject->font().italic(), true); + QCOMPARE(textEditObject->font().bold(), false); + } + + { + QString componentStr = "import Qt 4.6\nTextEdit { font.family: \"Helvetica\"; text: \"Hello World\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE(textEditObject->font().family(), QString("Helvetica")); + QCOMPARE(textEditObject->font().bold(), false); + QCOMPARE(textEditObject->font().italic(), false); + } + + { + QString componentStr = "import Qt 4.6\nTextEdit { font.family: \"\"; text: \"Hello World\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE(textEditObject->font().family(), QString("")); + } +} + +void tst_qmlgraphicstextedit::color() +{ + //test style + for (int i = 0; i < colorStrings.size(); i++) + { + QString componentStr = "import Qt 4.6\nTextEdit { color: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + //qDebug() << "textEditObject: " << textEditObject->color() << "vs. " << QColor(colorStrings.at(i)); + QVERIFY(textEditObject != 0); + QCOMPARE(textEditObject->color(), QColor(colorStrings.at(i))); + } + + { + QString colorStr = "#AA001234"; + QColor testColor("#001234"); + testColor.setAlpha(170); + + QString componentStr = "import Qt 4.6\nTextEdit { color: \"" + colorStr + "\"; text: \"Hello World\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE(textEditObject->color(), testColor); + } +} + +void tst_qmlgraphicstextedit::selection() +{ + QString testStr = standard[0];//TODO: What should happen for multiline/rich text? + QString componentStr = "import Qt 4.6\nTextEdit { text: \""+ testStr +"\"; }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + QVERIFY(textEditObject != 0); + + + //Test selection follows cursor + for(int i=0; i<= testStr.size(); i++) { + textEditObject->setCursorPosition(i); + QCOMPARE(textEditObject->cursorPosition(), i); + QCOMPARE(textEditObject->selectionStart(), i); + QCOMPARE(textEditObject->selectionEnd(), i); + QVERIFY(textEditObject->selectedText().isNull()); + } + + textEditObject->setCursorPosition(0); + QVERIFY(textEditObject->cursorPosition() == 0); + QVERIFY(textEditObject->selectionStart() == 0); + QVERIFY(textEditObject->selectionEnd() == 0); + QVERIFY(textEditObject->selectedText().isNull()); + + //Test selection + for(int i=0; i<= testStr.size(); i++) { + textEditObject->setSelectionEnd(i); + QCOMPARE(testStr.mid(0,i), textEditObject->selectedText()); + } + for(int i=0; i<= testStr.size(); i++) { + textEditObject->setSelectionStart(i); + QCOMPARE(testStr.mid(i,testStr.size()-i), textEditObject->selectedText()); + } + + textEditObject->setCursorPosition(0); + QVERIFY(textEditObject->cursorPosition() == 0); + QVERIFY(textEditObject->selectionStart() == 0); + QVERIFY(textEditObject->selectionEnd() == 0); + QVERIFY(textEditObject->selectedText().isNull()); + + for(int i=0; i< testStr.size(); i++) { + textEditObject->setSelectionStart(i); + QCOMPARE(textEditObject->selectionEnd(), i); + QCOMPARE(testStr.mid(i,0), textEditObject->selectedText()); + textEditObject->setSelectionEnd(i+1); + QCOMPARE(textEditObject->selectionStart(), i); + QCOMPARE(testStr.mid(i,1), textEditObject->selectedText()); + } + + for(int i= testStr.size() - 1; i>0; i--) { + textEditObject->setSelectionEnd(i); + QCOMPARE(testStr.mid(i,0), textEditObject->selectedText()); + textEditObject->setSelectionStart(i-1); + QCOMPARE(testStr.mid(i-1,1), textEditObject->selectedText()); + } + + //Test Error Ignoring behaviour + textEditObject->setCursorPosition(0); + QVERIFY(textEditObject->selectedText().isNull()); + textEditObject->setSelectionStart(-10); + QVERIFY(textEditObject->selectedText().isNull()); + textEditObject->setSelectionStart(100); + QVERIFY(textEditObject->selectedText().isNull()); + textEditObject->setSelectionEnd(-10); + QVERIFY(textEditObject->selectedText().isNull()); + textEditObject->setSelectionEnd(100); + QVERIFY(textEditObject->selectedText().isNull()); + textEditObject->setSelectionStart(0); + textEditObject->setSelectionEnd(10); + QVERIFY(textEditObject->selectedText().size() == 10); + textEditObject->setSelectionStart(-10); + QVERIFY(textEditObject->selectedText().size() == 10); + textEditObject->setSelectionStart(100); + QVERIFY(textEditObject->selectedText().size() == 10); + textEditObject->setSelectionEnd(-10); + QVERIFY(textEditObject->selectedText().size() == 10); + textEditObject->setSelectionEnd(100); + QVERIFY(textEditObject->selectedText().size() == 10); +} + +void tst_qmlgraphicstextedit::cursorDelegate() +{ + QmlView* view = createView(SRCDIR "/data/cursorTest.qml"); + view->execute(); + view->show(); + view->setFocus(); + QmlGraphicsTextEdit *textEditObject = view->root()->findChild("textEditObject"); + QVERIFY(textEditObject != 0); + QVERIFY(textEditObject->findChild("cursorInstance")); + //Test Delegate gets created + textEditObject->setFocus(true); + QmlGraphicsItem* delegateObject = textEditObject->findChild("cursorInstance"); + QVERIFY(delegateObject); + //Test Delegate gets moved + for(int i=0; i<= textEditObject->text().length(); i++){ + textEditObject->setCursorPosition(i); + QCOMPARE(textEditObject->cursorRect().x(), qRound(delegateObject->x())); + QCOMPARE(textEditObject->cursorRect().y(), qRound(delegateObject->y())); + } + textEditObject->setCursorPosition(0); + QCOMPARE(textEditObject->cursorRect().x(), qRound(delegateObject->x())); + QCOMPARE(textEditObject->cursorRect().y(), qRound(delegateObject->y())); + //Test Delegate gets deleted + textEditObject->setCursorDelegate(0); + QVERIFY(!textEditObject->findChild("cursorInstance")); +} + +/* +TextEdit element should only handle left/right keys until the cursor reaches +the extent of the text, then they should ignore the keys. +*/ +void tst_qmlgraphicstextedit::navigation() +{ + QmlView *canvas = createView(SRCDIR "/data/navigation.qml"); + canvas->execute(); + canvas->show(); + canvas->setFocus(); + + QVERIFY(canvas->root() != 0); + + QmlGraphicsItem *input = qobject_cast(qvariant_cast(canvas->root()->property("myInput"))); + + QVERIFY(input != 0); + QTRY_VERIFY(input->hasFocus() == true); + QEXPECT_FAIL("", "Depends on QT-2236", Abort); + simulateKey(canvas, Qt::Key_Left); + QVERIFY(input->hasFocus() == false); + simulateKey(canvas, Qt::Key_Right); + QVERIFY(input->hasFocus() == true); + simulateKey(canvas, Qt::Key_Right); + QVERIFY(input->hasFocus() == false); + simulateKey(canvas, Qt::Key_Left); + QVERIFY(input->hasFocus() == true); +} + +void tst_qmlgraphicstextedit::simulateKey(QmlView *view, int key) +{ + QKeyEvent press(QKeyEvent::KeyPress, key, 0); + QKeyEvent release(QKeyEvent::KeyRelease, key, 0); + + QApplication::sendEvent(view, &press); + QApplication::sendEvent(view, &release); +} + +QmlView *tst_qmlgraphicstextedit::createView(const QString &filename) +{ + QmlView *canvas = new QmlView(0); + + QFile file(filename); + file.open(QFile::ReadOnly); + QString xml = file.readAll(); + canvas->setQml(xml, filename); + + return canvas; +} + + +QTEST_MAIN(tst_qmlgraphicstextedit) + +#include "tst_qmlgraphicstextedit.moc" diff --git a/tests/auto/declarative/qmlgraphicstextinput/data/cursorTest.qml b/tests/auto/declarative/qmlgraphicstextinput/data/cursorTest.qml new file mode 100644 index 0000000..ddc98cc --- /dev/null +++ b/tests/auto/declarative/qmlgraphicstextinput/data/cursorTest.qml @@ -0,0 +1,8 @@ +import Qt 4.6 + +Rectangle { width: 300; height: 300; color: "white" + TextInput { text: "Hello world!"; id: textInputObject; objectName: "textInputObject" + resources: [ Component { id:cursor; Item { id:cursorInstance; objectName: "cursorInstance";} } ] + cursorDelegate: cursor + } +} diff --git a/tests/auto/declarative/qmlgraphicstextinput/data/navigation.qml b/tests/auto/declarative/qmlgraphicstextinput/data/navigation.qml new file mode 100644 index 0000000..282c52c --- /dev/null +++ b/tests/auto/declarative/qmlgraphicstextinput/data/navigation.qml @@ -0,0 +1,23 @@ +import Qt 4.6 + +Rectangle { + property var myInput: Input + + width: 800; height: 600; color: "blue" + + Item { + id: FirstItem; + KeyNavigation.right: Input + } + + TextInput { id: Input; focus: true + KeyNavigation.left: FirstItem + KeyNavigation.right: LastItem + KeyNavigation.up: FirstItem + KeyNavigation.down: LastItem + } + Item { + id: LastItem + KeyNavigation.left: Input + } +} diff --git a/tests/auto/declarative/qmlgraphicstextinput/qmlgraphicstextinput.pro b/tests/auto/declarative/qmlgraphicstextinput/qmlgraphicstextinput.pro new file mode 100644 index 0000000..fd75fec --- /dev/null +++ b/tests/auto/declarative/qmlgraphicstextinput/qmlgraphicstextinput.pro @@ -0,0 +1,8 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += declarative gui +macx:CONFIG -= app_bundle + +SOURCES += tst_qmlgraphicstextinput.cpp + +# Define SRCDIR equal to test's source directory +DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/qmlgraphicstextinput/tst_qmlgraphicstextinput.cpp b/tests/auto/declarative/qmlgraphicstextinput/tst_qmlgraphicstextinput.cpp new file mode 100644 index 0000000..8e9fa5e --- /dev/null +++ b/tests/auto/declarative/qmlgraphicstextinput/tst_qmlgraphicstextinput.cpp @@ -0,0 +1,422 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include +#include "../../../shared/util.h" +#include +#include +#include +#include +#include + +class tst_qmlgraphicstextinput : public QObject + +{ + Q_OBJECT +public: + tst_qmlgraphicstextinput(); + +private slots: + void text(); + void width(); + void font(); + void color(); + void selection(); + + void maxLength(); + void masks(); + void validators(); + + void cursorDelegate(); + void navigation(); + +private: + void simulateKey(QmlView *, int key); + QmlView *createView(const QString &filename); + + QmlEngine engine; + QStringList standard; + QStringList colorStrings; +}; + +tst_qmlgraphicstextinput::tst_qmlgraphicstextinput() +{ + standard << "the quick brown fox jumped over the lazy dog" + << "It's supercalifragisiticexpialidocious!" + << "Hello, world!"; + + colorStrings << "aliceblue" + << "antiquewhite" + << "aqua" + << "darkkhaki" + << "darkolivegreen" + << "dimgray" + << "palevioletred" + << "lightsteelblue" + << "#000000" + << "#AAAAAA" + << "#FFFFFF" + << "#2AC05F"; +} + +void tst_qmlgraphicstextinput::text() +{ + { + QmlComponent textinputComponent(&engine, "import Qt 4.6\nTextInput { text: \"\" }", QUrl()); + QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); + + QVERIFY(textinputObject != 0); + QCOMPARE(textinputObject->text(), QString("")); + } + + for (int i = 0; i < standard.size(); i++) + { + QString componentStr = "import Qt 4.6\nTextInput { text: \"" + standard.at(i) + "\" }"; + QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); + + QVERIFY(textinputObject != 0); + QCOMPARE(textinputObject->text(), standard.at(i)); + } + +} + +void tst_qmlgraphicstextinput::width() +{ + // uses Font metrics to find the width for standard + { + QmlComponent textinputComponent(&engine, "import Qt 4.6\nTextInput { text: \"\" }", QUrl()); + QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); + + QVERIFY(textinputObject != 0); + QCOMPARE(textinputObject->width(), 1.);//1 for the cursor + } + + for (int i = 0; i < standard.size(); i++) + { + QFont f; + QFontMetricsF fm(f); + qreal metricWidth = fm.width(standard.at(i)); + + QString componentStr = "import Qt 4.6\nTextInput { text: \"" + standard.at(i) + "\" }"; + QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); + + QVERIFY(textinputObject != 0); + QCOMPARE(textinputObject->width(), qreal(metricWidth) + 1.);//1 for the cursor + } +} + +void tst_qmlgraphicstextinput::font() +{ + //test size, then bold, then italic, then family + { + QString componentStr = "import Qt 4.6\nTextInput { font.pointSize: 40; text: \"Hello World\" }"; + QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); + + QVERIFY(textinputObject != 0); + QCOMPARE(textinputObject->font().pointSize(), 40); + QCOMPARE(textinputObject->font().bold(), false); + QCOMPARE(textinputObject->font().italic(), false); + } + + { + QString componentStr = "import Qt 4.6\nTextInput { font.bold: true; text: \"Hello World\" }"; + QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); + + QVERIFY(textinputObject != 0); + QCOMPARE(textinputObject->font().bold(), true); + QCOMPARE(textinputObject->font().italic(), false); + } + + { + QString componentStr = "import Qt 4.6\nTextInput { font.italic: true; text: \"Hello World\" }"; + QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); + + QVERIFY(textinputObject != 0); + QCOMPARE(textinputObject->font().italic(), true); + QCOMPARE(textinputObject->font().bold(), false); + } + + { + QString componentStr = "import Qt 4.6\nTextInput { font.family: \"Helvetica\"; text: \"Hello World\" }"; + QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); + + QVERIFY(textinputObject != 0); + QCOMPARE(textinputObject->font().family(), QString("Helvetica")); + QCOMPARE(textinputObject->font().bold(), false); + QCOMPARE(textinputObject->font().italic(), false); + } + + { + QString componentStr = "import Qt 4.6\nTextInput { font.family: \"\"; text: \"Hello World\" }"; + QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); + + QVERIFY(textinputObject != 0); + QCOMPARE(textinputObject->font().family(), QString("")); + } +} + +void tst_qmlgraphicstextinput::color() +{ + //test style + for (int i = 0; i < colorStrings.size(); i++) + { + QString componentStr = "import Qt 4.6\nTextInput { color: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }"; + QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); + //qDebug() << "textinputObject: " << textinputObject->color() << "vs. " << QColor(colorStrings.at(i)); + QVERIFY(textinputObject != 0); + QCOMPARE(textinputObject->color(), QColor(colorStrings.at(i))); + } + + { + QString colorStr = "#AA001234"; + QColor testColor("#001234"); + testColor.setAlpha(170); + + QString componentStr = "import Qt 4.6\nTextInput { color: \"" + colorStr + "\"; text: \"Hello World\" }"; + QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); + + QVERIFY(textinputObject != 0); + QCOMPARE(textinputObject->color(), testColor); + } +} + +void tst_qmlgraphicstextinput::selection() +{ + QString testStr = standard[0]; + QString componentStr = "import Qt 4.6\nTextInput { text: \""+ testStr +"\"; }"; + QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); + QVERIFY(textinputObject != 0); + + + //Test selection follows cursor + for(int i=0; i<= testStr.size(); i++) { + textinputObject->setCursorPosition(i); + QCOMPARE(textinputObject->cursorPosition(), i); + QCOMPARE(textinputObject->selectionStart(), i); + QCOMPARE(textinputObject->selectionEnd(), i); + QVERIFY(textinputObject->selectedText().isNull()); + } + + textinputObject->setCursorPosition(0); + QVERIFY(textinputObject->cursorPosition() == 0); + QVERIFY(textinputObject->selectionStart() == 0); + QVERIFY(textinputObject->selectionEnd() == 0); + QVERIFY(textinputObject->selectedText().isNull()); + + //Test selection + for(int i=0; i<= testStr.size(); i++) { + textinputObject->setSelectionEnd(i); + QCOMPARE(testStr.mid(0,i), textinputObject->selectedText()); + } + for(int i=0; i<= testStr.size(); i++) { + textinputObject->setSelectionStart(i); + QCOMPARE(testStr.mid(i,testStr.size()-i), textinputObject->selectedText()); + } + + textinputObject->setCursorPosition(0); + QVERIFY(textinputObject->cursorPosition() == 0); + QVERIFY(textinputObject->selectionStart() == 0); + QVERIFY(textinputObject->selectionEnd() == 0); + QVERIFY(textinputObject->selectedText().isNull()); + + for(int i=0; i< testStr.size(); i++) { + textinputObject->setSelectionStart(i); + QCOMPARE(textinputObject->selectionEnd(), i); + QCOMPARE(testStr.mid(i,0), textinputObject->selectedText()); + textinputObject->setSelectionEnd(i+1); + QCOMPARE(textinputObject->selectionStart(), i); + QCOMPARE(testStr.mid(i,1), textinputObject->selectedText()); + } + + for(int i= testStr.size() - 1; i>0; i--) { + textinputObject->setSelectionEnd(i); + QCOMPARE(testStr.mid(i,0), textinputObject->selectedText()); + textinputObject->setSelectionStart(i-1); + QCOMPARE(testStr.mid(i-1,1), textinputObject->selectedText()); + } + + //Test Error Ignoring behaviour + textinputObject->setCursorPosition(0); + QVERIFY(textinputObject->selectedText().isNull()); + textinputObject->setSelectionStart(-10); + QVERIFY(textinputObject->selectedText().isNull()); + textinputObject->setSelectionStart(100); + QVERIFY(textinputObject->selectedText().isNull()); + textinputObject->setSelectionEnd(-10); + QVERIFY(textinputObject->selectedText().isNull()); + textinputObject->setSelectionEnd(100); + QVERIFY(textinputObject->selectedText().isNull()); + textinputObject->setSelectionStart(0); + textinputObject->setSelectionEnd(10); + QVERIFY(textinputObject->selectedText().size() == 10); + textinputObject->setSelectionStart(-10); + QVERIFY(textinputObject->selectedText().size() == 10); + textinputObject->setSelectionStart(100); + QVERIFY(textinputObject->selectedText().size() == 10); + textinputObject->setSelectionEnd(-10); + QVERIFY(textinputObject->selectedText().size() == 10); + textinputObject->setSelectionEnd(100); + QVERIFY(textinputObject->selectedText().size() == 10); +} + +void tst_qmlgraphicstextinput::maxLength() +{ + QString componentStr = "import Qt 4.6\nTextInput { maximumLength: 10; }"; + QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); + QVERIFY(textinputObject != 0); + QVERIFY(textinputObject->text().isEmpty()); + foreach(const QString &str, standard){ + QVERIFY(textinputObject->text().length() <= 10); + textinputObject->setText(str); + QVERIFY(textinputObject->text().length() <= 10); + } + //TODO: Simulated keypress input adding 11 chars at a time +} + +void tst_qmlgraphicstextinput::masks() +{ + QString componentStr = "import Qt 4.6\nTextInput { maximumLength: 10; }"; + QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); + QVERIFY(textinputObject != 0); + + //TODO: Me +} + +void tst_qmlgraphicstextinput::validators() +{ + QString componentStr = "import Qt 4.6\nTextInput { maximumLength: 10; }"; + QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); + QVERIFY(textinputObject != 0); + + //TODO: Me +} + +/* +TextInput element should only handle left/right keys until the cursor reaches +the extent of the text, then they should ignore the keys. +*/ +void tst_qmlgraphicstextinput::navigation() +{ + QmlView *canvas = createView(SRCDIR "/data/navigation.qml"); + canvas->execute(); + canvas->show(); + canvas->setFocus(); + + QVERIFY(canvas->root() != 0); + + QmlGraphicsItem *input = qobject_cast(qvariant_cast(canvas->root()->property("myInput"))); + + QVERIFY(input != 0); + QTRY_VERIFY(input->hasFocus() == true); + simulateKey(canvas, Qt::Key_Left); + QVERIFY(input->hasFocus() == false); + simulateKey(canvas, Qt::Key_Right); + QVERIFY(input->hasFocus() == true); + simulateKey(canvas, Qt::Key_Right); + QVERIFY(input->hasFocus() == false); + simulateKey(canvas, Qt::Key_Left); + QVERIFY(input->hasFocus() == true); +} + +void tst_qmlgraphicstextinput::cursorDelegate() +{ + QmlView* view = createView(SRCDIR "/data/cursorTest.qml"); + view->execute(); + view->show(); + view->setFocus(); + QmlGraphicsTextInput *textInputObject = view->root()->findChild("textInputObject"); + QVERIFY(textInputObject != 0); + QVERIFY(textInputObject->findChild("cursorInstance")); + //Test Delegate gets created + textInputObject->setFocus(true); + QmlGraphicsItem* delegateObject = textInputObject->findChild("cursorInstance"); + QVERIFY(delegateObject); + //Test Delegate gets moved + for(int i=0; i<= textInputObject->text().length(); i++){ + textInputObject->setCursorPosition(i); + //+5 is because the TextInput cursorRect is just a 10xHeight area centered on cursor position + QCOMPARE(textInputObject->cursorRect().x() + 5, qRound(delegateObject->x())); + QCOMPARE(textInputObject->cursorRect().y(), qRound(delegateObject->y())); + } + textInputObject->setCursorPosition(0); + QCOMPARE(textInputObject->cursorRect().x()+5, qRound(delegateObject->x())); + QCOMPARE(textInputObject->cursorRect().y(), qRound(delegateObject->y())); + //Test Delegate gets deleted + textInputObject->setCursorDelegate(0); + QVERIFY(!textInputObject->findChild("cursorInstance")); +} + +void tst_qmlgraphicstextinput::simulateKey(QmlView *view, int key) +{ + QKeyEvent press(QKeyEvent::KeyPress, key, 0); + QKeyEvent release(QKeyEvent::KeyRelease, key, 0); + + QApplication::sendEvent(view, &press); + QApplication::sendEvent(view, &release); +} + +QmlView *tst_qmlgraphicstextinput::createView(const QString &filename) +{ + QmlView *canvas = new QmlView(0); + + QFile file(filename); + file.open(QFile::ReadOnly); + QString xml = file.readAll(); + canvas->setQml(xml, filename); + + return canvas; +} + +QTEST_MAIN(tst_qmlgraphicstextinput) + +#include "tst_qmlgraphicstextinput.moc" -- cgit v0.12 From c45309cd037d099dd23e4bce8c5a7d1d41d5ceaa Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Mon, 9 Nov 2009 12:37:16 +1000 Subject: constness fix --- src/declarative/qml/qmlinfo.cpp | 4 ++-- src/declarative/qml/qmlinfo.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/declarative/qml/qmlinfo.cpp b/src/declarative/qml/qmlinfo.cpp index f62f5fd..5ebcd8d 100644 --- a/src/declarative/qml/qmlinfo.cpp +++ b/src/declarative/qml/qmlinfo.cpp @@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE /*! - \fn void qmlInfo(const QString& message, QObject *object) + \fn void qmlInfo(const QString& message, const QObject *object) \brief Prints warnings messages that include the file and line number for QML types. @@ -73,7 +73,7 @@ QT_BEGIN_NAMESPACE \endcode */ -void qmlInfo(const QString& msg, QObject* object) +void qmlInfo(const QString& msg, const QObject* object) { QString pos = QLatin1String("QML"); if (object) { diff --git a/src/declarative/qml/qmlinfo.h b/src/declarative/qml/qmlinfo.h index 2e26ea4..1660aa2 100644 --- a/src/declarative/qml/qmlinfo.h +++ b/src/declarative/qml/qmlinfo.h @@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Declarative) -Q_DECLARATIVE_EXPORT void qmlInfo(const QString& msg, QObject *me=0); +Q_DECLARATIVE_EXPORT void qmlInfo(const QString& msg, const QObject *me=0); QT_END_NAMESPACE -- cgit v0.12 From 9639e8f872feea7592aee5967447623ce04ff96c Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Mon, 9 Nov 2009 12:38:46 +1000 Subject: Improve particles tests Code coverage data suggests some areas are inadequately tested. --- .../tst_qmlgraphicsparticles.cpp | 3 + .../qmlgraphicsparticles/data/particles.0.png | Bin 10022 -> 10361 bytes .../qmlgraphicsparticles/data/particles.1.png | Bin 14142 -> 14447 bytes .../qmlgraphicsparticles/data/particles.2.png | Bin 14214 -> 13793 bytes .../visual/qmlgraphicsparticles/data/particles.qml | 384 ++++++++++----------- .../visual/qmlgraphicsparticles/particles.qml | 3 +- 6 files changed, 193 insertions(+), 197 deletions(-) diff --git a/tests/auto/declarative/qmlgraphicsparticles/tst_qmlgraphicsparticles.cpp b/tests/auto/declarative/qmlgraphicsparticles/tst_qmlgraphicsparticles.cpp index ed68eaf..c8d181b 100644 --- a/tests/auto/declarative/qmlgraphicsparticles/tst_qmlgraphicsparticles.cpp +++ b/tests/auto/declarative/qmlgraphicsparticles/tst_qmlgraphicsparticles.cpp @@ -96,6 +96,9 @@ void tst_QmlGraphicsParticles::properties() particles->setEmissionRate(12); QCOMPARE(particles->emissionRate(), 12); + + particles->setEmitting(false); + QCOMPARE(particles->emitting(), false); } void tst_QmlGraphicsParticles::runs() diff --git a/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.0.png b/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.0.png index 30bdefd..4cc937d 100644 Binary files a/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.0.png and b/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.0.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.1.png b/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.1.png index 799e028..ea04224 100644 Binary files a/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.1.png and b/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.1.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.2.png b/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.2.png index ed267c2..241fd20 100644 Binary files a/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.2.png and b/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.2.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.qml b/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.qml index 3199f31..a4339f8 100644 --- a/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.qml +++ b/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.qml @@ -10,235 +10,235 @@ VisualTest { } Frame { msec: 32 - hash: "1c129b1c4a39412bed2f23d712f2bc90" + hash: "71e690f8339f1829efc113d88d1a9023" } Frame { msec: 48 - hash: "fbcc4bc3fea46a43453aa39b032264c6" + hash: "856a757f3e83e1ede00854d2dacd856a" } Frame { msec: 64 - hash: "2cb13275faca414b7c8ba9d70067fd1f" + hash: "2a7926b693b9950aabc4e3a1ebe4b2d0" } Frame { msec: 80 - hash: "b017afb05f96085ee3395d62e62e457b" + hash: "0564ce95b47a7c3314a56921855b9244" } Frame { msec: 96 - hash: "642851d10c549c8ae72c057563e99e64" + hash: "bf207596dd69e7a872a23448621100cc" } Frame { msec: 112 - hash: "494c0942f7410d455a4b113fb908e570" + hash: "a0bb920166e777ea96afb811353a3488" } Frame { msec: 128 - hash: "cb0a2f9980f27757c0c1d62ef3dcfde0" + hash: "3d6297c684562d099fdb9c413b3e93a3" } Frame { msec: 144 - hash: "2fb9cf782ea106006af8bcd66c62869c" + hash: "29139f93cbd55faa0ea18f11db364d56" } Frame { msec: 160 - hash: "bf68518323f03e4f407831e8b34f247b" + hash: "f3637e44bf1b6c3fd030898e14a15443" } Frame { msec: 176 - hash: "c99abe9c0384ae339fdfa0c75dc8047d" + hash: "d687ef38c1d0e8d12c03a2e7b462a5e5" } Frame { msec: 192 - hash: "96f2eb402633c1aca8a1a2b0d60af5fb" + hash: "0f1f227bbce76122d081759752edf47e" } Frame { msec: 208 - hash: "6cba51a856f1ba54ee702761f196b915" + hash: "1112e4f9ec18958caa4efadbf8b369bd" } Frame { msec: 224 - hash: "9188926caa6c6ba8cb3aee04de635b96" + hash: "5bb7fd7dc06d79aa5ca35fa551753a38" } Frame { msec: 240 - hash: "81132a5e8768de0630311813170f166e" + hash: "c59e159877613eb09ba353bc0ef46086" } Frame { msec: 256 - hash: "a638698d7ccb73f20f6eeba3857f417c" + hash: "b7c583f85d89c833861324b3d06a6c8b" } Frame { msec: 272 - hash: "4761ba6847f6f0769b916106c5f3245b" + hash: "147641f03d92a48f49e0cfb4972bc1c7" } Frame { msec: 288 - hash: "13bc0c681962bada7fcb3b722895ffaa" + hash: "1627827cd3733d1177f111c6c347ab49" } Frame { msec: 304 - hash: "505c5824be16d812b7c339f1f9b8a10b" + hash: "0edccffd718ef10a0ea476201fc00c39" } Frame { msec: 320 - hash: "d191d502d9c685f8497583669147ee73" + hash: "4b7f426aaa31bdabc6c065b298e59c9e" } Frame { msec: 336 - hash: "c17f55cc5d7bf541e235791a157aa8b9" + hash: "4814f77f57bbae8d3c20995e37ec95fb" } Frame { msec: 352 - hash: "3ef401f87830c53b9b277d4420a9a742" + hash: "030092297087df89ab40e894a01f0ee2" } Frame { msec: 368 - hash: "d04816400e66ebbf797f9985a53f7cfb" + hash: "30b0d547b580daee9b1c49f5069570c5" } Frame { msec: 384 - hash: "d7a7df7c2a92449f42d61c0572e7dbac" + hash: "eaee106eaa1505e7d79ed21c36f381fd" } Frame { msec: 400 - hash: "f49a3bcf3842f554136ff9bd5bb470ef" + hash: "6527d1d44a75015d7eb163a660e15b0b" } Frame { msec: 416 - hash: "27bccc5933d7bfaad6d5f6a10efd283b" + hash: "3a3a7b7b36ede4aa1261b5f28c99984c" } Frame { msec: 432 - hash: "3067ac00a4d58c67bb96d813c344871d" + hash: "d2349319b0feeceaa7ef9301ae87d348" } Frame { msec: 448 - hash: "d38d7192688feecc38fd63285d37ce49" + hash: "f483ae316491e367922f6ef7ebfa0298" } Frame { msec: 464 - hash: "4172d1b74cdd6ea89be718977775a9e0" + hash: "3d94b3e9b409a4ca2200df226a25b2d5" } Frame { msec: 480 - hash: "2761a7e58cbfa46fc6d306c8270e4f10" + hash: "ce289f478dafd295ba82ef0c9e13ff3d" } Frame { msec: 496 - hash: "58a851b9fbcb98afc7c1bc58c2f45e4a" + hash: "6d618658faa9403ff9909f6c6a677cb2" } Frame { msec: 512 - hash: "0f7789f04bf20708d9d6f1e818b6b88a" + hash: "9e12eda314483bc5ef5a14a1b1ac26d7" } Frame { msec: 528 - hash: "8d8b8d109dce4c7b05ecb603b4718859" + hash: "ed34b0d26a18145028a5ec4c99e9b569" } Frame { msec: 544 - hash: "0fc6fde589932ac41787e8ebfe3fcbe3" + hash: "ea91dc7e837fa540af260f75c0f8ba49" } Frame { msec: 560 - hash: "e08bffd5a56795488f090a475513e5db" + hash: "a5b277747454ddeda3d66f3702f45a53" } Frame { msec: 576 - hash: "e089ab7c5feefd3d745bb665e2ff49ee" + hash: "7601784afb80a79267ade99961122186" } Frame { msec: 592 - hash: "e7b787fb1b21e991c19ec88b3d985b69" + hash: "e52696c37cc3a245a555c98038b51e76" } Frame { msec: 608 - hash: "a6f4f32287bd926e0eeff68717b80512" + hash: "7d94071d225e0105c794a238eaa8117e" } Frame { msec: 624 - hash: "3344ca9c97473bd922bd8efd5d6ab212" + hash: "60ebfb611c6f7515568574aecdfdcb57" } Frame { msec: 640 - hash: "a330510a9f62acb4f2163728939d0bb5" + hash: "0ea41ef8a82e97e62ed7507606ab6bf4" } Frame { msec: 656 - hash: "1ec473936f2279f13675b6b5fe2ee392" + hash: "009a12491a5f6e4b30942062f93a3f8c" } Frame { msec: 672 - hash: "b193b7d2917ee00c4cb29bf244186bef" + hash: "2fa053880413fc76b53b26b733b2168f" } Frame { msec: 688 - hash: "75137e977941e357bad2ad9af2cbc898" + hash: "fb53a57559de18a5b6f13f21d1daf098" } Frame { msec: 704 - hash: "31773ba8979a31b1691860b7dafe28dc" + hash: "f65a62bf7d5e8fbd996f7151398109a6" } Frame { msec: 720 - hash: "d8922452edbba4f1092b83e87c0330ea" + hash: "b0802484661f6fe4606f4ff915c03f81" } Frame { msec: 736 - hash: "982c80305b54236d1259f5672098652d" + hash: "b63c61e63cb23147a8377d3428d5a4fa" } Frame { msec: 752 - hash: "d8b23fb0867fb75558960216c8d0f2aa" + hash: "a320dcfa3907c85fa983035953b79ba3" } Frame { msec: 768 - hash: "daf7833f93a216d1e025c9129b3a7caa" + hash: "6b94696073ab8e1ef6be1f0b5cb22720" } Frame { msec: 784 - hash: "bb08e8fe2ce74018fc702e5dad8927fe" + hash: "5ed4ff5011c421e40bd0e1d021974efc" } Frame { msec: 800 - hash: "22a30051c87d4de7e734d9de6ce7eed8" + hash: "b183261aca9e8f887f4d489d8c81f583" } Frame { msec: 816 - hash: "d8625628587feace367fc97c1f11aff8" + hash: "c4672d92bb4f0e8cb8e10fcef11a36e2" } Frame { msec: 832 - hash: "e9dbbf715fc094cb22ecd5c6df602f95" + hash: "beb2c18162ea197b486b217f15f784e7" } Frame { msec: 848 - hash: "ca69b2b9f8e6b16e3bc6d93598b6c75a" + hash: "9f5198e08dc16e80f500804ba8ae7afb" } Frame { msec: 864 - hash: "87e09752e39df5042aef163fe4ed0b47" + hash: "d892706fd28d55adcdacdf72a2f7ad83" } Frame { msec: 880 - hash: "80adfaf02838c8bd372e53d0483fbac5" + hash: "1ed182b5b27ed7ed59c56c450a73975d" } Frame { msec: 896 - hash: "9934a1aece14ba7369b00cf2620cd207" + hash: "74756064676c5d5c9eacaea31a7b357d" } Frame { msec: 912 - hash: "954a70a949fdcca4e4412174f30653c3" + hash: "64f79b420b38bda6e102163b90be5f4f" } Frame { msec: 928 - hash: "850fa936516f8b145465eac39c9a74a6" + hash: "0d1f92cafc507af799953771cee7c265" } Frame { msec: 944 - hash: "1d844e8a7c710ccbf31f47470cc9abf2" + hash: "887ef63951fb56fd50f4de9afe8db1a8" } Frame { msec: 960 @@ -246,239 +246,239 @@ VisualTest { } Frame { msec: 976 - hash: "33f4eee3f6e3fb715463254d727ef898" + hash: "f09fc1e1ebc8c627c89c741ac263e3f4" } Frame { msec: 992 - hash: "68648a3f75f58b34dd9770a9edc2caea" + hash: "30bb26df58c83ff70d767e01f0df5140" } Frame { msec: 1008 - hash: "ad0d431ab7e6cfbb43053050a1cf5e40" + hash: "dbd83b1749a42edd6d26097ade1c67ba" } Frame { msec: 1024 - hash: "d1ae74c9bf3826d30fb461ca2fd8e36a" + hash: "7fa50f111158dc6a3e245eb23e57a3f3" } Frame { msec: 1040 - hash: "bda9d77c68a30d491abdfbfcf854c5ea" + hash: "267ef8b555a62abb44e8b5cf88c83110" } Frame { msec: 1056 - hash: "386ea303f8102339f8cd5ae88fd5f6bc" + hash: "78b2d13be078f2e7e94d685994b6488e" } Frame { msec: 1072 - hash: "8c81d3992851ebeb3cb820bc4510af66" + hash: "1d47caf40c85bc1e23bf8d22160d333d" } Frame { msec: 1088 - hash: "566813e312ffdde4a7d3af4276bc8cdd" + hash: "abeaf0a9bedfd62e56f12fa612bf287f" } Frame { msec: 1104 - hash: "d9c8b391b12ee40aa393f4fb39c12a16" + hash: "0f66d12b082398c9f43ef868632529ab" } Frame { msec: 1120 - hash: "f2bf70bda626089437f0ab67ad62d8f6" + hash: "957340efea7ce168889c2ae1b867c6d0" } Frame { msec: 1136 - hash: "88b2d1ecd7d51d0bf8c947a3433b7013" + hash: "4d83e6160f5d9097a4b73bf4104fa11b" } Frame { msec: 1152 - hash: "e93e0553c5dcc6dcd21dad0932d1e3fa" + hash: "d2811de76d3c0cc8ebd67583e50deaae" } Frame { msec: 1168 - hash: "c1ec148772d399ea4934cdfc514f6980" + hash: "cb13f2d6985e841b2da453860d7ddd65" } Frame { msec: 1184 - hash: "14f286793de5452f4677e8b6fd5c1e7e" + hash: "1e48b355ff1e136bcd982a749ba49089" } Frame { msec: 1200 - hash: "220a7df0af53fc9a2442956128091ad8" + hash: "9f9abd7b167a834449510a02d368155b" } Frame { msec: 1216 - hash: "84c49512f5e9f138901b3833a5adbcab" + hash: "6a75c81527b3bb85f70c08f669d46139" } Frame { msec: 1232 - hash: "b05410caa120f5a4191a44b84aa17a8c" + hash: "eafd6f87fb88f6f51cf27d5dd4faa7c8" } Frame { msec: 1248 - hash: "e1f6db204f62394205c1d4d56bbf9f52" + hash: "ba43e681c7f2677b81fa4fe87a5e612c" } Frame { msec: 1264 - hash: "f45033d1350009e09f62e81aeec297a5" + hash: "f83f06320c3e7c2352dd8e8839d63063" } Frame { msec: 1280 - hash: "dfd88b1dba38ab8260e00b3810b89318" + hash: "713afe22640941e9ea4925158099c514" } Frame { msec: 1296 - hash: "17503276f68e365cde03607d66fe4c8e" + hash: "53766caa0ab92bbd2e3d69e6ab9a8fe7" } Frame { msec: 1312 - hash: "28f03c5c0fe5c4647c5b9d3b72a07c76" + hash: "af98650b68d48fd3776d0334904b9e75" } Frame { msec: 1328 - hash: "ea2082529b50543fab22497e01938102" + hash: "62439fba28fbc0d4a129ccd5edf81b8b" } Frame { msec: 1344 - hash: "a700a2f3721625b1ec68107884d1ce67" + hash: "75c67b227f23a3ef5c01aca285f3617c" } Frame { msec: 1360 - hash: "ce717f1f1d98158aeef1cc6a9485dc80" + hash: "3a5e1fe4a9454e9636fbebdfb005e3ac" } Frame { msec: 1376 - hash: "7febe7c67e1c159881de72f62800a505" + hash: "2e4cdc140a9faedc8fbc9a0ec20b1a4c" } Frame { msec: 1392 - hash: "474931cb44a8e18426b9c2cc9f6df482" + hash: "f937d5b14fb0360afb14dbcce1b0ad9a" } Frame { msec: 1408 - hash: "1085b4873b9a4934882a163be72a2710" + hash: "20cb9e30c1a89bae3081427328887361" } Frame { msec: 1424 - hash: "59e7911800e915e6f159cb111ce61a54" + hash: "67f19061f97630a35b59357dcba9c5f0" } Frame { msec: 1440 - hash: "6d0d780ffc726b04f9885c25b08d1009" + hash: "f1b4041797873b7ff9e318542186eaf8" } Frame { msec: 1456 - hash: "bf896d6403dc1ad26536cc1165e71e9e" + hash: "ecbdc77e1b58decad29a6dfc654fba20" } Frame { msec: 1472 - hash: "86397c7dcf5ed34edbbaa465ae6eab43" + hash: "6d0b821c08b024aa8fc71ec5c0e98c53" } Frame { msec: 1488 - hash: "ed1b4967bf14eead9cb4d2dcfbdb46c2" + hash: "5137c7ee6879b98478a4edb1b5a0d79c" } Frame { msec: 1504 - hash: "67b7e59c8f945d1f3bdb1944fa736ecf" + hash: "17c80c758e9d0721a3b791dbabe0d34f" } Frame { msec: 1520 - hash: "b5f95e89f39d1c4821ba38547b0f2e3b" + hash: "abc1fe8d97b87f891ac53673fe64bf0d" } Frame { msec: 1536 - hash: "5bc91c9e35afa255a2dda28db9802b1e" + hash: "fe8c8ce5f0cf676310e4ce85c1755f0f" } Frame { msec: 1552 - hash: "84fab4042e0ff891ca1998cbfbb60e5a" + hash: "40eff7ab7370e7a3de28a55e200812ca" } Frame { msec: 1568 - hash: "7c5ef5025a06e990171dac3e8fd93977" + hash: "8ff86cc730f4b7877ed7890f62dd8f17" } Frame { msec: 1584 - hash: "ab4cd0e103d71a35250668ad850a5213" + hash: "a87e34b8d9e75d03493c94a96ef97c25" } Frame { msec: 1600 - hash: "aa974c4b2290f7febb121344623de86d" + hash: "807a4b4652ed228084660bfdf98efd50" } Frame { msec: 1616 - hash: "ff6ee1b50ca356dc98038a459e318b32" + hash: "ca245fcf490c3bc17bef1a38d793f573" } Frame { msec: 1632 - hash: "022fe9c391514fdd98bc1c38bc383df2" + hash: "6662d0e4e7778f560c8956e9fe4aa079" } Frame { msec: 1648 - hash: "b1a33c9c9cbdcc1c8c9c982eef041ccd" + hash: "c47d90df3dbb1656ef425209f1b528b1" } Frame { msec: 1664 - hash: "0945e66ab5aa81beacf662eb82ec39ed" + hash: "c9dbf06207cf9b8d03cf20f4e4131979" } Frame { msec: 1680 - hash: "ae293f675dbdd88dec8f924140033cc9" + hash: "dfab00fee3cf9f0f76d66f64eed6de84" } Frame { msec: 1696 - hash: "5ace5013e3d51a8db338f65011dd10f8" + hash: "b38a29a29bf30c197e5434a942e805cf" } Frame { msec: 1712 - hash: "9466a4e96d647f2bd8845697fce89399" + hash: "589496ebac7f7ea699b869291db7ed45" } Frame { msec: 1728 - hash: "73bbbfc57e020c6a0acbd5fdfa711c30" + hash: "c7a037e3e755c1c8fecd17db7596a9cd" } Frame { msec: 1744 - hash: "d71d7182107c3d6b004a57a321caee96" + hash: "faca2e1e88556ffd1f71bbc5ceae5cb1" } Frame { msec: 1760 - hash: "0902867c89e536cffcde69bde2eb1994" + hash: "5837a888d83513fb4c0bce11a34fc3df" } Frame { msec: 1776 - hash: "39fc26943f6077272c36e93b7cbf6994" + hash: "07f8fe9ded8271396db503c3927244bb" } Frame { msec: 1792 - hash: "92931d5a6e57fb9df60785a64d3a6f78" + hash: "345fffbc210b55a4bd78cb8a4e12d025" } Frame { msec: 1808 - hash: "fffd632552f88f2979ef85de0ce585c2" + hash: "7b9aa96eb9a1fe77fbb8b607140885b7" } Frame { msec: 1824 - hash: "9f97bfcffbb5d127c5eee852b30a13c4" + hash: "d66748cc52a364231ac8a6a677d9bdc6" } Frame { msec: 1840 - hash: "ea9ee0293fbc45d3467e29c09e42adcd" + hash: "40cf9aece08870358aef6c9836013472" } Frame { msec: 1856 - hash: "b5b75c50f8fae3fb3b88efad536c911b" + hash: "2015ab3c133862222b1375c775af743b" } Frame { msec: 1872 - hash: "25dcd3fa30c057d1a42c19cee1ce444b" + hash: "41e519acb18ed9f7cda2d3cd88fddd2c" } Frame { msec: 1888 - hash: "862d42abe7abd49d4a38e38a8c33a657" + hash: "8e583b74b2b90d7f5c78357f66801358" } Frame { msec: 1904 - hash: "a335f3c8c797c1bb5537b57f952c19d1" + hash: "3a6755e25045d937743371a98792a546" } Frame { msec: 1920 @@ -486,239 +486,239 @@ VisualTest { } Frame { msec: 1936 - hash: "da1cf98fdfe5acbe30cfbe66389aa240" + hash: "f80a8f65def55d556732bfefe3debe72" } Frame { msec: 1952 - hash: "088f3209c0363c06cf0607c58d00ca2d" + hash: "308cbe6344b9aea4c6b7ad2ef606de59" } Frame { msec: 1968 - hash: "47ba3bf2604b21f331a2e00f05926aaf" + hash: "fd2d31f6f4a3b4ce1aec1e309c48ae94" } Frame { msec: 1984 - hash: "5ff0de383abdefad76380af144bd9d80" + hash: "a02ed4aa3783049ffbf7ef6dfb4e8926" } Frame { msec: 2000 - hash: "b972d1c85d3d8777f84b54dc118172fd" + hash: "dde64769b3affc776fe0e747a4d621ef" } Frame { msec: 2016 - hash: "37581c3fbef2088b7d14b6c7bbf3cdc3" + hash: "3fa830b629939520c071b3e6fe94156e" } Frame { msec: 2032 - hash: "4ad6a06ac6de9dea66e9ce873a6618c1" + hash: "ae582350cba12ce47306f2a967e396fd" } Frame { msec: 2048 - hash: "3a0379ad966235044508c144ffbc336b" + hash: "a4483eadd2bf3e3e9fae51279b50e18a" } Frame { msec: 2064 - hash: "cb5a9510400943d77c9a296066f037e2" + hash: "742fc008fab89087b1bceee33889db19" } Frame { msec: 2080 - hash: "7bd5673a1d2ad8079df2569149e5811e" + hash: "5da9546b147737dd671813725cb196f7" } Frame { msec: 2096 - hash: "bd327ff6b8a4081b3a41cb0035403037" + hash: "c979bccf2603c400b4c93d1be6f698d1" } Frame { msec: 2112 - hash: "f0f9f559251f7648cd60e66ac745962d" + hash: "b7c6391ce59e054ae53e3731788dfc05" } Frame { msec: 2128 - hash: "18827630a859b0ce497f682e33558fae" + hash: "0371e17fdaa7be7af0cff132f164d6b4" } Frame { msec: 2144 - hash: "e22d8110cbe34acddba799942872645d" + hash: "6973ce2af671f4d500da3c5a37534693" } Frame { msec: 2160 - hash: "11564e7221524cc3655c2c5f1d7e42b6" + hash: "f9128da47afa801c6b3670752847a8d1" } Frame { msec: 2176 - hash: "6468721ee38209aaf2c82a320bcd122e" + hash: "2e4a7001c3c1bb7153f631da1b273aa1" } Frame { msec: 2192 - hash: "19772d0f422fd206645ae6cf0be30b59" + hash: "65d41139c27a4a94a817e1b5c8aa765d" } Frame { msec: 2208 - hash: "48b6c7e1317b9a66238c17afceb5121f" + hash: "36652e407957b59bad2e0e9b2fa5a8fe" } Frame { msec: 2224 - hash: "82a1af78709b78cce2d9b4eed7f8477c" + hash: "c0fe78ff8fc3119b30a1d9e5b98fafbb" } Frame { msec: 2240 - hash: "36e2366eccbdd2d16c19829c34fbff87" + hash: "41b798eac11e696e5e690d13e8ce88b1" } Frame { msec: 2256 - hash: "271db39ca46c59ddc279fb41a9d191af" + hash: "20efbef05b6eed5a916e55ba25c10a59" } Frame { msec: 2272 - hash: "ee279a90e86aa89b1c3d745ab030180d" + hash: "dc897fb0d232a39215d5d004e322cb2a" } Frame { msec: 2288 - hash: "14e8c72d770644f4cec99e65aeff0d75" + hash: "33c1f9bb344a31a1a0973a527c22edac" } Frame { msec: 2304 - hash: "56fa1756eb11a30f07f8f31c22c99973" + hash: "0b54b02eedc60e8d7b147092b9bd6bca" } Frame { msec: 2320 - hash: "165af677ff3921f06b89b2c8d76a7924" + hash: "02cb9a222c9b109cbff956238a61b31b" } Frame { msec: 2336 - hash: "d64aa248d9b207b87e5ba14bdabf2f6c" + hash: "bfb067d4519861b22e20847083447a22" } Frame { msec: 2352 - hash: "33e9716eb9ca62fe5c5cb1b1ee0e9e68" + hash: "86f599f6844c2046148c682abfe6c417" } Frame { msec: 2368 - hash: "cff2316820c469b84c3bacabfcf1a551" + hash: "fa07ac104183fe94fd3a381595582d76" } Frame { msec: 2384 - hash: "9f1359c4bab95244602254ca3954e2b7" + hash: "8ee792f06fa7e877ce0b160bcf170e70" } Frame { msec: 2400 - hash: "d6246d2aaea895755eab4c839c35ca9d" + hash: "bb39f4374215e9b4eafbc3320d4144b6" } Frame { msec: 2416 - hash: "d446e1ac91fec10482b0c6d38ce86d17" + hash: "d91f778ced58466dd6b79f50cdbfe1a8" } Frame { msec: 2432 - hash: "99f443af76a9e0d2d03638bc9927fda3" + hash: "0fd47896c9d9d74e40c38d0f532aa537" } Frame { msec: 2448 - hash: "a9169e293b8154947332d9754fd23af3" + hash: "0b7ec227fc884616bd17439bf0d40ac1" } Frame { msec: 2464 - hash: "cc6851cc5864615c000fbc8d552eb593" + hash: "e88d4e76d353701c738120e169ccf2a8" } Frame { msec: 2480 - hash: "58a3a6edb5842c88cb73b79a8a187717" + hash: "1564432d4aea1826e543f41dfc9a8113" } Frame { msec: 2496 - hash: "42bcf77c98c9a80508446bd8c66e935b" + hash: "02825fa9174c0a45e19c564030ba9ad0" } Frame { msec: 2512 - hash: "0f99350ae151591fbda95158c046e072" + hash: "c7671a2bb3f0dcb2be48805ef1970dbd" } Frame { msec: 2528 - hash: "9e817e2fd8377b7117f908c4e87d4d57" + hash: "2fa407b026edbb8b9e0edc263fd9ecc5" } Frame { msec: 2544 - hash: "72c105bce75feeeb7a86f823945b4ff9" + hash: "211f3c82cff939cd1ed324180d40aab2" } Frame { msec: 2560 - hash: "653b858445bdd8afdf8abd27f5e53fb8" + hash: "0fb3de6e1865e49ac281ac12e2032f07" } Frame { msec: 2576 - hash: "18bf39154fbf4b42c4d3303e018a2f27" + hash: "a08e0127a0b6172715aa6a10d6e0799e" } Frame { msec: 2592 - hash: "5ed5d52ab7da7ae77e97f3ace09b3b8d" + hash: "57a3d1530042f0d6a6dbf84059a8d730" } Frame { msec: 2608 - hash: "1d382462e5746ee9b6df980364b1c96b" + hash: "9aae6364941f988409b8db63db72fccb" } Frame { msec: 2624 - hash: "2a0a561f38c113a0f177b1c2b99ee5e1" + hash: "9e466ce9c8b54dc95960d21b0b41fdd1" } Frame { msec: 2640 - hash: "0605d3e2dd9132d9c1d25b75a870d647" + hash: "189e0f3c60cd521a6bf52054fa6039c6" } Frame { msec: 2656 - hash: "a1def1576f386c90bb80d46e254bd384" + hash: "1020f18d41a4d83e0b5ae387b486b5ff" } Frame { msec: 2672 - hash: "cf38d4ae577047048d2bd0a4005abfe2" + hash: "26fcea12cc2de8c8cb8caf049937d7c6" } Frame { msec: 2688 - hash: "d7cb6715cd89978bbca5ce4c93b488e5" + hash: "e5b9e752dc668cd4f6803ea772bbb7b0" } Frame { msec: 2704 - hash: "9a5075ee794af14d4f17a52bdbc47f1e" + hash: "a0df9360ed11207076fc77810c1d8605" } Frame { msec: 2720 - hash: "fd3d803a1e5e9e3eeae7d5edcddd0072" + hash: "56dea4551a9532e80dfd6c79031ec08b" } Frame { msec: 2736 - hash: "445114e7d10581a475989e469323d83d" + hash: "900c62773477b2843464b75f67d50c90" } Frame { msec: 2752 - hash: "58328c1d4c0ee7fca78b684697f1922c" + hash: "177de9647549a276256a5e74d5ef7134" } Frame { msec: 2768 - hash: "433df4d872b9565b43af5afce1b42e15" + hash: "cb3eb956096de4f6b51ab249d184a6dd" } Frame { msec: 2784 - hash: "3b694f15722a087c2c9a860cad8bb6de" + hash: "6671e46d013f72bef5e3d0d95ba70301" } Frame { msec: 2800 - hash: "1986c8036bd548ca06a32aa98ab4fc83" + hash: "33910dc69eff13f9c144b7ff84187a59" } Frame { msec: 2816 - hash: "7845dbb0e38145f54a9e4e0bfbd608db" + hash: "dfa20711b0821b66cb2bdd2806e34d03" } Frame { msec: 2832 - hash: "caed393910ae7467c307a314bdf459ef" + hash: "16e2674c2449bf059aa2a0add077e040" } Frame { msec: 2848 - hash: "f3f6b41b7ed04dbc1693c169bdae3b13" + hash: "cdd2a820076cfa9529d93787de61267e" } Frame { msec: 2864 - hash: "b9a87d15d48f951b0a1d6962fb1d5995" + hash: "a851a1e017e90877d6d8027633401bcc" } Frame { msec: 2880 @@ -726,58 +726,50 @@ VisualTest { } Frame { msec: 2896 - hash: "954300274b6a5785e03a6cdae67238e9" + hash: "f159f17caa8df7ae09141462cd9b75ab" } Frame { msec: 2912 - hash: "5b7f51afad796107289369c7d3494843" + hash: "f6a8787008d24bffa6813799042a0d69" } Frame { msec: 2928 - hash: "41164f28cbb94528eda719d590d1cf75" + hash: "18e79f454a628098c41ff8882b663a53" } Frame { msec: 2944 - hash: "5953d4c9a4b4c83ba1dfd83a57ec2742" + hash: "74676f4f2d8612bc02f72e3bf855c060" } Frame { msec: 2960 - hash: "0be7c6187a26b44f12bf71587372a6c7" + hash: "8276c61e080635dd37954837998a14a6" } Frame { msec: 2976 - hash: "a7cab1faf0cdd5649c8ea3c26d2e80d0" + hash: "4cceb2274ce5584315109ac45ef8fce7" } Frame { msec: 2992 - hash: "5f91bef1865623030aea20805993319a" + hash: "c4e87037c2265f85fef3b681b840c6f9" } Frame { msec: 3008 - hash: "69d34e2a27c471ad44f8aba8d906a961" + hash: "aed160bb820dc5cdf1ee320b019436c4" } Frame { msec: 3024 - hash: "5a987879aff30d6c6712c0631bc2f43d" + hash: "593acf3e67bc3428f61b723996093d8d" } Frame { msec: 3040 - hash: "62b9132c58cd5fdcfe7f1bc5e64885cf" + hash: "694d197caff9144204a82a682d47724c" } Frame { msec: 3056 - hash: "d394ef9b504abf94c1d28a9fb7f3c28b" + hash: "12519eda928f8aef0e2a21e9fc0f8756" } Frame { msec: 3072 - hash: "a559cc25af950227fa5fdf70be7fd94c" - } - Frame { - msec: 3088 - hash: "318dde40fc72c5f8ee45b865a68922b1" - } - Frame { - msec: 3104 - hash: "3cbfd55773e52f48f01fe66c28c0b992" + hash: "ae8cba17b25e9567211f4cd20080cb09" } } diff --git a/tests/auto/declarative/visual/qmlgraphicsparticles/particles.qml b/tests/auto/declarative/visual/qmlgraphicsparticles/particles.qml index 8fb793f..a7a8143 100644 --- a/tests/auto/declarative/visual/qmlgraphicsparticles/particles.qml +++ b/tests/auto/declarative/visual/qmlgraphicsparticles/particles.qml @@ -3,11 +3,12 @@ import Qt 4.6 Rectangle { width: 640; height: 480; color: "black" + Particles { emitting: false } Particles { id:particlesA y:0; width: 260; height:30; source: "star.png"; lifeSpan:1000; count: 50; angle:70; angleDeviation:36; velocity:30; velocityDeviation:10; emissionRate: 10 - ParticleMotionWander { xvariance:30; pace:100 } + ParticleMotionWander { yvariance:5; xvariance:30; pace:100 } } Particles { id:particlesB -- cgit v0.12 From f360647095238c9106ea5ece5f3405dd77a78887 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Mon, 9 Nov 2009 12:59:19 +1000 Subject: visual test for Flipable --- .../qmlgraphicsflipable/data/test-flipable.0.png | Bin 0 -> 1092 bytes .../qmlgraphicsflipable/data/test-flipable.1.png | Bin 0 -> 1134 bytes .../qmlgraphicsflipable/data/test-flipable.2.png | Bin 0 -> 961 bytes .../qmlgraphicsflipable/data/test-flipable.3.png | Bin 0 -> 1074 bytes .../qmlgraphicsflipable/data/test-flipable.4.png | Bin 0 -> 1134 bytes .../qmlgraphicsflipable/data/test-flipable.5.png | Bin 0 -> 969 bytes .../qmlgraphicsflipable/data/test-flipable.qml | 1623 ++++++++++++++++++++ .../visual/qmlgraphicsflipable/test-flipable.qml | 83 + 8 files changed, 1706 insertions(+) create mode 100644 tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.0.png create mode 100644 tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.1.png create mode 100644 tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.2.png create mode 100644 tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.3.png create mode 100644 tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.4.png create mode 100644 tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.5.png create mode 100644 tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.qml create mode 100644 tests/auto/declarative/visual/qmlgraphicsflipable/test-flipable.qml diff --git a/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.0.png b/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.0.png new file mode 100644 index 0000000..3d5acbc Binary files /dev/null and b/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.0.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.1.png b/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.1.png new file mode 100644 index 0000000..bebb1aa Binary files /dev/null and b/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.1.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.2.png b/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.2.png new file mode 100644 index 0000000..d092053 Binary files /dev/null and b/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.2.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.3.png b/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.3.png new file mode 100644 index 0000000..aa79f8b Binary files /dev/null and b/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.3.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.4.png b/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.4.png new file mode 100644 index 0000000..98e8817 Binary files /dev/null and b/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.4.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.5.png b/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.5.png new file mode 100644 index 0000000..a3f9d8f Binary files /dev/null and b/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.5.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.qml b/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.qml new file mode 100644 index 0000000..5464d01 --- /dev/null +++ b/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.qml @@ -0,0 +1,1623 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 32 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 48 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 64 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 80 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 96 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 112 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 128 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 144 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 160 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 176 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 192 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 208 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 224 + hash: "90fb4e4ba04ac32b52c10b3258431c04" + } + Frame { + msec: 240 + hash: "90fb4e4ba04ac32b52c10b3258431c04" + } + Frame { + msec: 256 + hash: "90fb4e4ba04ac32b52c10b3258431c04" + } + Frame { + msec: 272 + hash: "73c06997014af4e008b546b53fe349fb" + } + Frame { + msec: 288 + hash: "73c06997014af4e008b546b53fe349fb" + } + Frame { + msec: 304 + hash: "73c06997014af4e008b546b53fe349fb" + } + Frame { + msec: 320 + hash: "451a9408b04826ab35749d9120efd6bb" + } + Frame { + msec: 336 + hash: "451a9408b04826ab35749d9120efd6bb" + } + Frame { + msec: 352 + hash: "1c25b3d65e8590f8c213afa76b722e97" + } + Frame { + msec: 368 + hash: "1c25b3d65e8590f8c213afa76b722e97" + } + Frame { + msec: 384 + hash: "1c25b3d65e8590f8c213afa76b722e97" + } + Frame { + msec: 400 + hash: "e64fa5eba05f81e6f263dc8543f21b1a" + } + Frame { + msec: 416 + hash: "e64fa5eba05f81e6f263dc8543f21b1a" + } + Frame { + msec: 432 + hash: "845581f8d03f4fe9323fc282e84f919b" + } + Frame { + msec: 448 + hash: "845581f8d03f4fe9323fc282e84f919b" + } + Frame { + msec: 464 + hash: "136fb272f4d806927b46a1269b18f63d" + } + Frame { + msec: 480 + hash: "8532ee7ce3488f9e038643e4fa48751d" + } + Frame { + msec: 496 + hash: "8532ee7ce3488f9e038643e4fa48751d" + } + Frame { + msec: 512 + hash: "af5f794f73e16a5c3b9e437418c873ee" + } + Frame { + msec: 528 + hash: "af5f794f73e16a5c3b9e437418c873ee" + } + Frame { + msec: 544 + hash: "d75e53f2cea8e9b61a5e50f95060552e" + } + Frame { + msec: 560 + hash: "0374aae76f8cfd75f119ff4b86dba817" + } + Frame { + msec: 576 + hash: "d36e1a56078d7cfa246b57f886c230b4" + } + Frame { + msec: 592 + hash: "d36e1a56078d7cfa246b57f886c230b4" + } + Frame { + msec: 608 + hash: "30692e6658ac730670a489c880fd4485" + } + Frame { + msec: 624 + hash: "3aace4dc5bc503ed0df1b00b444780f0" + } + Frame { + msec: 640 + hash: "b6936d72cbaff0c6bb64fc08152e8680" + } + Frame { + msec: 656 + hash: "b6936d72cbaff0c6bb64fc08152e8680" + } + Frame { + msec: 672 + hash: "8beee45f26f9f7b94b84a807a0c42217" + } + Frame { + msec: 688 + hash: "80529f6b8d12838b58c4af73c1985792" + } + Frame { + msec: 704 + hash: "967f7e4f58a8e29b5d76eac011af643d" + } + Frame { + msec: 720 + hash: "395863cffd5440b0a4805975b766a3cf" + } + Frame { + msec: 736 + hash: "f9c919f45316d93d2c8693b62930850f" + } + Frame { + msec: 752 + hash: "cf8ffc1132935b5df49da90953009fa0" + } + Frame { + msec: 768 + hash: "8e44d6cf4c29313352ad0118db003958" + } + Frame { + msec: 784 + hash: "31ca6f5b62fd8c08fa17b1008c4e6a22" + } + Frame { + msec: 800 + hash: "96773abcace99ba692a5be096df85a54" + } + Frame { + msec: 816 + hash: "e92daff761c739f231ba2c05785c44fb" + } + Frame { + msec: 832 + hash: "c1b1056ef06a0454680f2146bb87a56b" + } + Frame { + msec: 848 + hash: "dc02f4f6b0ff1572a64fd133819fd794" + } + Frame { + msec: 864 + hash: "9f87d4d33942d32a4048ca2b785a1fed" + } + Frame { + msec: 880 + hash: "57d989f52d8bee06694166bf8bdffef0" + } + Frame { + msec: 896 + hash: "09c3602a08d6d3e2afb654c328606871" + } + Frame { + msec: 912 + hash: "b075ae21dbd3acef5c4d0f11cadce3c9" + } + Frame { + msec: 928 + hash: "d54b5b295a9ca2bc65131a0775d8d009" + } + Frame { + msec: 944 + hash: "599b244ff9b4ddceb682a059338f6f97" + } + Frame { + msec: 960 + image: "test-flipable.0.png" + } + Frame { + msec: 976 + hash: "9fd5a0f023f89511bdd4b7e429f940ab" + } + Frame { + msec: 992 + hash: "ad18f401dc07032ffc52b90fd5581319" + } + Frame { + msec: 1008 + hash: "b12cbf8e97bc48e12d9543ffc1c578a2" + } + Frame { + msec: 1024 + hash: "7c9895dae776c2a4a6d5e1dd50d86336" + } + Frame { + msec: 1040 + hash: "ebd8018990ce867c3308121dccbfc1bc" + } + Frame { + msec: 1056 + hash: "4818f99e2f71c0ec7636aa777f4df875" + } + Frame { + msec: 1072 + hash: "09371a634d7801742075aadc131b5fb6" + } + Frame { + msec: 1088 + hash: "e03e96eaa2640cf6d820d9992c0c51f4" + } + Frame { + msec: 1104 + hash: "daf19227a7e51e437d0a13fdf8b1a26f" + } + Frame { + msec: 1120 + hash: "539ccebf96da504f0c5dfe5496ed95ce" + } + Frame { + msec: 1136 + hash: "63d851b3a8758e4cd95624b44cf9e7c9" + } + Frame { + msec: 1152 + hash: "8ee67f06977858444a775ca8c5109411" + } + Frame { + msec: 1168 + hash: "44849e7b8cc8d187da234daba784bc6e" + } + Frame { + msec: 1184 + hash: "ec9892a5602892ba5a2075b61672d91b" + } + Frame { + msec: 1200 + hash: "b12aec87daa7c09276ae5d4b619276a1" + } + Frame { + msec: 1216 + hash: "816d9d278fecde0867efadae2c4b5839" + } + Frame { + msec: 1232 + hash: "65daf0b21f860cb87c28a11c3d947f3b" + } + Frame { + msec: 1248 + hash: "f3bc5c605ac0cb287e8c1d1cb58d85ca" + } + Frame { + msec: 1264 + hash: "2988cc8030891abd7493294fc2c6964c" + } + Frame { + msec: 1280 + hash: "cbfc98561559f3aa8bdec7c40da559c0" + } + Frame { + msec: 1296 + hash: "636335822b15f32861696439773e1794" + } + Frame { + msec: 1312 + hash: "3fbb7a8920ff95fce7bfefcb540c6de8" + } + Frame { + msec: 1328 + hash: "4036080b6aafa72e5310ce33615ff8f8" + } + Frame { + msec: 1344 + hash: "48fb5685e63e81f1790f5481bc06dac4" + } + Frame { + msec: 1360 + hash: "f1f58f0eebbffc3b389c6669c5419081" + } + Frame { + msec: 1376 + hash: "5481248e889fb4fe9f4cf54f69d9f614" + } + Frame { + msec: 1392 + hash: "efbf81fc1db57a6020fcfe97077233b7" + } + Frame { + msec: 1408 + hash: "67ff11e6143718c95418f4851265081e" + } + Frame { + msec: 1424 + hash: "a403ec3d25e73b557ba08aa903cb9006" + } + Frame { + msec: 1440 + hash: "293b9f1cc31af93f22b4c1369567c4ba" + } + Frame { + msec: 1456 + hash: "8ff7cee41c6f19eeda417052c1b071d6" + } + Frame { + msec: 1472 + hash: "cd8d4484158d7dcdc7662ea8c8daea07" + } + Frame { + msec: 1488 + hash: "b991e62a7d6751bdd3e2d690e690821c" + } + Frame { + msec: 1504 + hash: "c60aca5007dadc628f242db9d593cf1f" + } + Frame { + msec: 1520 + hash: "e78af45d2042130a9d34b654157a9ada" + } + Frame { + msec: 1536 + hash: "cc35b2fcc585191d3f46840fdcacc94f" + } + Frame { + msec: 1552 + hash: "9e33a9f73e1019e7d694d108fd95f2ad" + } + Frame { + msec: 1568 + hash: "f08adfe4286703702c9393a905ec01d2" + } + Frame { + msec: 1584 + hash: "56bdfcb8fbb776b3799676ba7934a354" + } + Frame { + msec: 1600 + hash: "da3b8e41b9639bb71cf95b671d8a2c63" + } + Frame { + msec: 1616 + hash: "92855bf2208369f361b677bc66e9c79d" + } + Frame { + msec: 1632 + hash: "e5403ff384dca3c10b091e166160624f" + } + Frame { + msec: 1648 + hash: "932b5ebeaa4576575179b04a4c131ef5" + } + Frame { + msec: 1664 + hash: "37a23d4a895fa83226f66736caa87281" + } + Frame { + msec: 1680 + hash: "f6926e493dfd7deee613cf9bb7529f5e" + } + Frame { + msec: 1696 + hash: "338e40ae3e047cf7731377fc1b4d3cb7" + } + Frame { + msec: 1712 + hash: "0dfdd9a1d83a706a09318c83fd08b6fe" + } + Frame { + msec: 1728 + hash: "4487366ee7ec1e0fdafc88cfa82e7977" + } + Frame { + msec: 1744 + hash: "28f0b7824b5bb311d46c94afa7d7bb66" + } + Frame { + msec: 1760 + hash: "34b15e5a3602fd7bf2f217c308fa5d09" + } + Frame { + msec: 1776 + hash: "667b9286f32fe43a0cb5d65cdfa965cd" + } + Frame { + msec: 1792 + hash: "629888aae80ea85db07a383df352214a" + } + Frame { + msec: 1808 + hash: "9afbd09687efa09eb3b03570bf8be531" + } + Frame { + msec: 1824 + hash: "0e1dac5b9d2a0acab1516d01a286a0ec" + } + Frame { + msec: 1840 + hash: "dd058795bd3957d02dc296419c17819c" + } + Frame { + msec: 1856 + hash: "158618e8529cba8531183b2f72e90340" + } + Frame { + msec: 1872 + hash: "c9062e6405b3b7fd0b2a794119220b1d" + } + Frame { + msec: 1888 + hash: "8dadb6da9f12dac689406a43e7e61bea" + } + Frame { + msec: 1904 + hash: "fd66704ce98410a7b1dd69f7cd6ddd26" + } + Frame { + msec: 1920 + image: "test-flipable.1.png" + } + Frame { + msec: 1936 + hash: "d4a21104b4f8044486fbe6516e4ae7b5" + } + Frame { + msec: 1952 + hash: "20fd373c13d4d06b9105c80ed6f4edb7" + } + Frame { + msec: 1968 + hash: "ff9bc1aa538b69e72ed1a501ea0d56de" + } + Frame { + msec: 1984 + hash: "3f3d5f3ca770b84e86fea3188e082493" + } + Frame { + msec: 2000 + hash: "fe7de3d2083208993e527b13ae7edadd" + } + Frame { + msec: 2016 + hash: "b5f7c630f6e61c7ddac8493e17a1f53e" + } + Frame { + msec: 2032 + hash: "c80d37b370a4ada6217c81f5e82ecd6f" + } + Frame { + msec: 2048 + hash: "84051de621753e12e3e11316d14dfe73" + } + Frame { + msec: 2064 + hash: "fd238f83a26ed8c2cee3e3d042af903b" + } + Frame { + msec: 2080 + hash: "949d2ed3e1d1c674e77ef3c8a6b779ba" + } + Frame { + msec: 2096 + hash: "42f602bcd7b517cf16554a88998d16a8" + } + Frame { + msec: 2112 + hash: "318bd97d726826398887ff218e61df32" + } + Frame { + msec: 2128 + hash: "5a0699f422475f0d3f17cddb606b4715" + } + Frame { + msec: 2144 + hash: "3eb8e765ff9f38fd56a69a8bc2d534c3" + } + Frame { + msec: 2160 + hash: "dd548f565a0787789ec13e141f808b11" + } + Frame { + msec: 2176 + hash: "a78a6a9f014b8c2e7a202b80e6c2e09f" + } + Frame { + msec: 2192 + hash: "3d0ff083b6f1f994caa660016245876d" + } + Frame { + msec: 2208 + hash: "ce6a7491571ce3d5799791579428b615" + } + Frame { + msec: 2224 + hash: "67e700035648fd5354ec0806a412be89" + } + Frame { + msec: 2240 + hash: "b03f1bfe2bdbf52aae0dff6ae4821914" + } + Frame { + msec: 2256 + hash: "4d75ac3064288c3a56e9fd6ed6022fc6" + } + Frame { + msec: 2272 + hash: "dc6677725f6bf0bdcab25287a096a0e6" + } + Frame { + msec: 2288 + hash: "827e5e274fb331c6f9997172894b1f4d" + } + Frame { + msec: 2304 + hash: "c3cf3b3968441b735684fc6e55ebb1ce" + } + Frame { + msec: 2320 + hash: "01eebde46aff9d7484cffb0b0d27c415" + } + Frame { + msec: 2336 + hash: "614ad3481a993b5ff5ec008aa3d4751f" + } + Frame { + msec: 2352 + hash: "614ad3481a993b5ff5ec008aa3d4751f" + } + Frame { + msec: 2368 + hash: "2f253dcdbe2fabc768cdd5bfa8004a36" + } + Frame { + msec: 2384 + hash: "90b130853f8e28a01c90825c412f98b9" + } + Frame { + msec: 2400 + hash: "567bf7684e4b2f76715bcc588a2b7dfb" + } + Frame { + msec: 2416 + hash: "63412cfccdd8646530ebdb37eba16ee9" + } + Frame { + msec: 2432 + hash: "63412cfccdd8646530ebdb37eba16ee9" + } + Frame { + msec: 2448 + hash: "e1c5381a621dfe50e4b04d881ce2c4b7" + } + Frame { + msec: 2464 + hash: "553bff0aa031ed1279170c19bf024539" + } + Frame { + msec: 2480 + hash: "2b8c079d8526ce4d0640014cca38c6b8" + } + Frame { + msec: 2496 + hash: "2b8c079d8526ce4d0640014cca38c6b8" + } + Frame { + msec: 2512 + hash: "ac356478635b5d34001a50997eb3c82c" + } + Frame { + msec: 2528 + hash: "ac356478635b5d34001a50997eb3c82c" + } + Frame { + msec: 2544 + hash: "93d64e7bec7d9e254066d79c0db41f28" + } + Frame { + msec: 2560 + hash: "010ec13762826006a1dbf60b8c4660c9" + } + Frame { + msec: 2576 + hash: "010ec13762826006a1dbf60b8c4660c9" + } + Frame { + msec: 2592 + hash: "2f882016d4e3e29ec6689cfa1189e00e" + } + Frame { + msec: 2608 + hash: "2f882016d4e3e29ec6689cfa1189e00e" + } + Frame { + msec: 2624 + hash: "676f8aba3379c9935b9bd269bd140cf2" + } + Frame { + msec: 2640 + hash: "676f8aba3379c9935b9bd269bd140cf2" + } + Frame { + msec: 2656 + hash: "78e0dca60c04d3defbd90457685dbab3" + } + Frame { + msec: 2672 + hash: "78e0dca60c04d3defbd90457685dbab3" + } + Frame { + msec: 2688 + hash: "0ff9fd6b09fc14abacb794353b9500f6" + } + Frame { + msec: 2704 + hash: "0ff9fd6b09fc14abacb794353b9500f6" + } + Frame { + msec: 2720 + hash: "0ff9fd6b09fc14abacb794353b9500f6" + } + Frame { + msec: 2736 + hash: "6d813ee777a5900c65aca5939c004d0c" + } + Frame { + msec: 2752 + hash: "6d813ee777a5900c65aca5939c004d0c" + } + Frame { + msec: 2768 + hash: "0acaa3ece071ad4461cf4a79d65a0f03" + } + Frame { + msec: 2784 + hash: "0acaa3ece071ad4461cf4a79d65a0f03" + } + Frame { + msec: 2800 + hash: "0acaa3ece071ad4461cf4a79d65a0f03" + } + Frame { + msec: 2816 + hash: "0acaa3ece071ad4461cf4a79d65a0f03" + } + Frame { + msec: 2832 + hash: "b2ef52b66896649413b3852bcf642e1c" + } + Frame { + msec: 2848 + hash: "b2ef52b66896649413b3852bcf642e1c" + } + Frame { + msec: 2864 + hash: "b2ef52b66896649413b3852bcf642e1c" + } + Frame { + msec: 2880 + image: "test-flipable.2.png" + } + Frame { + msec: 2896 + hash: "b2ef52b66896649413b3852bcf642e1c" + } + Frame { + msec: 2912 + hash: "1daeebce8e7eef80b135d2e4f83f780b" + } + Frame { + msec: 2928 + hash: "1daeebce8e7eef80b135d2e4f83f780b" + } + Frame { + msec: 2944 + hash: "1daeebce8e7eef80b135d2e4f83f780b" + } + Frame { + msec: 2960 + hash: "1daeebce8e7eef80b135d2e4f83f780b" + } + Frame { + msec: 2976 + hash: "1daeebce8e7eef80b135d2e4f83f780b" + } + Frame { + msec: 2992 + hash: "1daeebce8e7eef80b135d2e4f83f780b" + } + Frame { + msec: 3008 + hash: "1daeebce8e7eef80b135d2e4f83f780b" + } + Frame { + msec: 3024 + hash: "1daeebce8e7eef80b135d2e4f83f780b" + } + Frame { + msec: 3040 + hash: "1daeebce8e7eef80b135d2e4f83f780b" + } + Frame { + msec: 3056 + hash: "1daeebce8e7eef80b135d2e4f83f780b" + } + Frame { + msec: 3072 + hash: "1daeebce8e7eef80b135d2e4f83f780b" + } + Frame { + msec: 3088 + hash: "1daeebce8e7eef80b135d2e4f83f780b" + } + Frame { + msec: 3104 + hash: "1daeebce8e7eef80b135d2e4f83f780b" + } + Frame { + msec: 3120 + hash: "1daeebce8e7eef80b135d2e4f83f780b" + } + Frame { + msec: 3136 + hash: "b2ef52b66896649413b3852bcf642e1c" + } + Frame { + msec: 3152 + hash: "b2ef52b66896649413b3852bcf642e1c" + } + Frame { + msec: 3168 + hash: "b2ef52b66896649413b3852bcf642e1c" + } + Frame { + msec: 3184 + hash: "b2ef52b66896649413b3852bcf642e1c" + } + Frame { + msec: 3200 + hash: "b2ef52b66896649413b3852bcf642e1c" + } + Frame { + msec: 3216 + hash: "b2ef52b66896649413b3852bcf642e1c" + } + Frame { + msec: 3232 + hash: "0acaa3ece071ad4461cf4a79d65a0f03" + } + Frame { + msec: 3248 + hash: "0acaa3ece071ad4461cf4a79d65a0f03" + } + Frame { + msec: 3264 + hash: "0acaa3ece071ad4461cf4a79d65a0f03" + } + Frame { + msec: 3280 + hash: "6d813ee777a5900c65aca5939c004d0c" + } + Frame { + msec: 3296 + hash: "6d813ee777a5900c65aca5939c004d0c" + } + Frame { + msec: 3312 + hash: "6d813ee777a5900c65aca5939c004d0c" + } + Frame { + msec: 3328 + hash: "0ff9fd6b09fc14abacb794353b9500f6" + } + Frame { + msec: 3344 + hash: "0ff9fd6b09fc14abacb794353b9500f6" + } + Frame { + msec: 3360 + hash: "78e0dca60c04d3defbd90457685dbab3" + } + Frame { + msec: 3376 + hash: "78e0dca60c04d3defbd90457685dbab3" + } + Frame { + msec: 3392 + hash: "78e0dca60c04d3defbd90457685dbab3" + } + Frame { + msec: 3408 + hash: "676f8aba3379c9935b9bd269bd140cf2" + } + Frame { + msec: 3424 + hash: "676f8aba3379c9935b9bd269bd140cf2" + } + Frame { + msec: 3440 + hash: "2f882016d4e3e29ec6689cfa1189e00e" + } + Frame { + msec: 3456 + hash: "2f882016d4e3e29ec6689cfa1189e00e" + } + Frame { + msec: 3472 + hash: "010ec13762826006a1dbf60b8c4660c9" + } + Frame { + msec: 3488 + hash: "93d64e7bec7d9e254066d79c0db41f28" + } + Frame { + msec: 3504 + hash: "93d64e7bec7d9e254066d79c0db41f28" + } + Frame { + msec: 3520 + hash: "ac356478635b5d34001a50997eb3c82c" + } + Frame { + msec: 3536 + hash: "ac356478635b5d34001a50997eb3c82c" + } + Frame { + msec: 3552 + hash: "2b8c079d8526ce4d0640014cca38c6b8" + } + Frame { + msec: 3568 + hash: "553bff0aa031ed1279170c19bf024539" + } + Frame { + msec: 3584 + hash: "e1c5381a621dfe50e4b04d881ce2c4b7" + } + Frame { + msec: 3600 + hash: "e1c5381a621dfe50e4b04d881ce2c4b7" + } + Frame { + msec: 3616 + hash: "63412cfccdd8646530ebdb37eba16ee9" + } + Frame { + msec: 3632 + hash: "567bf7684e4b2f76715bcc588a2b7dfb" + } + Frame { + msec: 3648 + hash: "90b130853f8e28a01c90825c412f98b9" + } + Frame { + msec: 3664 + hash: "90b130853f8e28a01c90825c412f98b9" + } + Frame { + msec: 3680 + hash: "2f253dcdbe2fabc768cdd5bfa8004a36" + } + Frame { + msec: 3696 + hash: "614ad3481a993b5ff5ec008aa3d4751f" + } + Frame { + msec: 3712 + hash: "01eebde46aff9d7484cffb0b0d27c415" + } + Frame { + msec: 3728 + hash: "c3cf3b3968441b735684fc6e55ebb1ce" + } + Frame { + msec: 3744 + hash: "827e5e274fb331c6f9997172894b1f4d" + } + Frame { + msec: 3760 + hash: "dc6677725f6bf0bdcab25287a096a0e6" + } + Frame { + msec: 3776 + hash: "4d75ac3064288c3a56e9fd6ed6022fc6" + } + Frame { + msec: 3792 + hash: "b03f1bfe2bdbf52aae0dff6ae4821914" + } + Frame { + msec: 3808 + hash: "67e700035648fd5354ec0806a412be89" + } + Frame { + msec: 3824 + hash: "ce6a7491571ce3d5799791579428b615" + } + Frame { + msec: 3840 + image: "test-flipable.3.png" + } + Frame { + msec: 3856 + hash: "a78a6a9f014b8c2e7a202b80e6c2e09f" + } + Frame { + msec: 3872 + hash: "dd548f565a0787789ec13e141f808b11" + } + Frame { + msec: 3888 + hash: "3eb8e765ff9f38fd56a69a8bc2d534c3" + } + Frame { + msec: 3904 + hash: "9729b36fe9dbabf0c46e78b723885530" + } + Frame { + msec: 3920 + hash: "5a0699f422475f0d3f17cddb606b4715" + } + Frame { + msec: 3936 + hash: "318bd97d726826398887ff218e61df32" + } + Frame { + msec: 3952 + hash: "42f602bcd7b517cf16554a88998d16a8" + } + Frame { + msec: 3968 + hash: "fd238f83a26ed8c2cee3e3d042af903b" + } + Frame { + msec: 3984 + hash: "84051de621753e12e3e11316d14dfe73" + } + Frame { + msec: 4000 + hash: "0c6d27488abbfd4f1ee4570a33a2c89e" + } + Frame { + msec: 4016 + hash: "c80d37b370a4ada6217c81f5e82ecd6f" + } + Frame { + msec: 4032 + hash: "fe7de3d2083208993e527b13ae7edadd" + } + Frame { + msec: 4048 + hash: "e5b616cefec125e8ad714d0c739ff902" + } + Frame { + msec: 4064 + hash: "3f3d5f3ca770b84e86fea3188e082493" + } + Frame { + msec: 4080 + hash: "20fd373c13d4d06b9105c80ed6f4edb7" + } + Frame { + msec: 4096 + hash: "2d6f6cf66bbd50a6546bc54e5aa91fb8" + } + Frame { + msec: 4112 + hash: "d4a21104b4f8044486fbe6516e4ae7b5" + } + Frame { + msec: 4128 + hash: "fd66704ce98410a7b1dd69f7cd6ddd26" + } + Frame { + msec: 4144 + hash: "33dcba73c46fa6513d4241e9cc75c417" + } + Frame { + msec: 4160 + hash: "c9062e6405b3b7fd0b2a794119220b1d" + } + Frame { + msec: 4176 + hash: "c1663c9ad895d67981a170f6b67a5331" + } + Frame { + msec: 4192 + hash: "dd058795bd3957d02dc296419c17819c" + } + Frame { + msec: 4208 + hash: "7cf357d1eb96e65f30a0cb4b7315b2f7" + } + Frame { + msec: 4224 + hash: "9afbd09687efa09eb3b03570bf8be531" + } + Frame { + msec: 4240 + hash: "321d29c57276959e095c5cb9366daf03" + } + Frame { + msec: 4256 + hash: "238c029a6be60ca4e1909d4f1de5633b" + } + Frame { + msec: 4272 + hash: "667b9286f32fe43a0cb5d65cdfa965cd" + } + Frame { + msec: 4288 + hash: "51bcca29caecbd92264f271818c400b8" + } + Frame { + msec: 4304 + hash: "4487366ee7ec1e0fdafc88cfa82e7977" + } + Frame { + msec: 4320 + hash: "f3cafcdab8b47c44dcc2222b9021f253" + } + Frame { + msec: 4336 + hash: "e8d25d1b5ea3f580cb46be911ea73556" + } + Frame { + msec: 4352 + hash: "f6926e493dfd7deee613cf9bb7529f5e" + } + Frame { + msec: 4368 + hash: "44e2f675f37feb23b53e58fc356a17aa" + } + Frame { + msec: 4384 + hash: "384478653302b604590c137d1e7289fe" + } + Frame { + msec: 4400 + hash: "fccc582ba920db36e797bdd7c4c329e5" + } + Frame { + msec: 4416 + hash: "92855bf2208369f361b677bc66e9c79d" + } + Frame { + msec: 4432 + hash: "9fc85a4e179b73bb5e92ed982ee13ee7" + } + Frame { + msec: 4448 + hash: "46e199e3311bf5643e4da28c1f1c687a" + } + Frame { + msec: 4464 + hash: "9d8a56893bf62535654fadd8b8a04977" + } + Frame { + msec: 4480 + hash: "b97e5629f4e9e2617e69361a0ca7f84a" + } + Frame { + msec: 4496 + hash: "eea82c42aa4eb22b2a3c5f1eb5a78d53" + } + Frame { + msec: 4512 + hash: "49d9c74894e3f1a5b03c126963296ecb" + } + Frame { + msec: 4528 + hash: "e78af45d2042130a9d34b654157a9ada" + } + Frame { + msec: 4544 + hash: "831fbf842a9107100ed7c91d664edaff" + } + Frame { + msec: 4560 + hash: "d1af7a53eef0b7dcb3da095bba7cdc12" + } + Frame { + msec: 4576 + hash: "8a02f7d3d53e98384d1f05dc7fc5fd37" + } + Frame { + msec: 4592 + hash: "6af3a8305b25a9a769b8cf00479c6ab3" + } + Frame { + msec: 4608 + hash: "f91c42910b17cb19be33a277b03e1cd2" + } + Frame { + msec: 4624 + hash: "67ff11e6143718c95418f4851265081e" + } + Frame { + msec: 4640 + hash: "e8dc4593c974902337ea7d58f26bae4c" + } + Frame { + msec: 4656 + hash: "9176a3f857d73d626bfba01878c5f213" + } + Frame { + msec: 4672 + hash: "08c7f417093c9e9da70c027ee12b0840" + } + Frame { + msec: 4688 + hash: "48fb5685e63e81f1790f5481bc06dac4" + } + Frame { + msec: 4704 + hash: "71e51c2b97140eb7810e489e6d809437" + } + Frame { + msec: 4720 + hash: "e8de71d4a2a253e366b2edf5d475824d" + } + Frame { + msec: 4736 + hash: "636335822b15f32861696439773e1794" + } + Frame { + msec: 4752 + hash: "ebd6d5f535f5356201aae297839777a6" + } + Frame { + msec: 4768 + hash: "ebc8a639c3ef849d47d79b6a91d940fd" + } + Frame { + msec: 4784 + hash: "2988cc8030891abd7493294fc2c6964c" + } + Frame { + msec: 4800 + image: "test-flipable.4.png" + } + Frame { + msec: 4816 + hash: "816d9d278fecde0867efadae2c4b5839" + } + Frame { + msec: 4832 + hash: "b40795c967d37d8cb6b73049a30f40cc" + } + Frame { + msec: 4848 + hash: "ec9892a5602892ba5a2075b61672d91b" + } + Frame { + msec: 4864 + hash: "38bd188beb6633cfe979f6881820c15d" + } + Frame { + msec: 4880 + hash: "8ee67f06977858444a775ca8c5109411" + } + Frame { + msec: 4896 + hash: "d3603c86488b02dc0136cc2588d00d7b" + } + Frame { + msec: 4912 + hash: "539ccebf96da504f0c5dfe5496ed95ce" + } + Frame { + msec: 4928 + hash: "b60450e46a2566d1feaf9749e897fa8b" + } + Frame { + msec: 4944 + hash: "daf19227a7e51e437d0a13fdf8b1a26f" + } + Frame { + msec: 4960 + hash: "09371a634d7801742075aadc131b5fb6" + } + Frame { + msec: 4976 + hash: "40b2a59c83f1223025eca6e2e19a87d8" + } + Frame { + msec: 4992 + hash: "4818f99e2f71c0ec7636aa777f4df875" + } + Frame { + msec: 5008 + hash: "7c9895dae776c2a4a6d5e1dd50d86336" + } + Frame { + msec: 5024 + hash: "b69f034a71b53c885cd177da422d5fc7" + } + Frame { + msec: 5040 + hash: "b12cbf8e97bc48e12d9543ffc1c578a2" + } + Frame { + msec: 5056 + hash: "9fd5a0f023f89511bdd4b7e429f940ab" + } + Frame { + msec: 5072 + hash: "39ed52571b12a9cea5409d5efc80c283" + } + Frame { + msec: 5088 + hash: "2dc05cabc6eb3e73e9946ebafed99fd4" + } + Frame { + msec: 5104 + hash: "599b244ff9b4ddceb682a059338f6f97" + } + Frame { + msec: 5120 + hash: "d54b5b295a9ca2bc65131a0775d8d009" + } + Frame { + msec: 5136 + hash: "b075ae21dbd3acef5c4d0f11cadce3c9" + } + Frame { + msec: 5152 + hash: "57d989f52d8bee06694166bf8bdffef0" + } + Frame { + msec: 5168 + hash: "9f87d4d33942d32a4048ca2b785a1fed" + } + Frame { + msec: 5184 + hash: "dc02f4f6b0ff1572a64fd133819fd794" + } + Frame { + msec: 5200 + hash: "c1b1056ef06a0454680f2146bb87a56b" + } + Frame { + msec: 5216 + hash: "e92daff761c739f231ba2c05785c44fb" + } + Frame { + msec: 5232 + hash: "96773abcace99ba692a5be096df85a54" + } + Frame { + msec: 5248 + hash: "31ca6f5b62fd8c08fa17b1008c4e6a22" + } + Frame { + msec: 5264 + hash: "8e44d6cf4c29313352ad0118db003958" + } + Frame { + msec: 5280 + hash: "cf8ffc1132935b5df49da90953009fa0" + } + Frame { + msec: 5296 + hash: "f9c919f45316d93d2c8693b62930850f" + } + Frame { + msec: 5312 + hash: "395863cffd5440b0a4805975b766a3cf" + } + Frame { + msec: 5328 + hash: "967f7e4f58a8e29b5d76eac011af643d" + } + Frame { + msec: 5344 + hash: "80529f6b8d12838b58c4af73c1985792" + } + Frame { + msec: 5360 + hash: "80529f6b8d12838b58c4af73c1985792" + } + Frame { + msec: 5376 + hash: "8beee45f26f9f7b94b84a807a0c42217" + } + Frame { + msec: 5392 + hash: "b6936d72cbaff0c6bb64fc08152e8680" + } + Frame { + msec: 5408 + hash: "3aace4dc5bc503ed0df1b00b444780f0" + } + Frame { + msec: 5424 + hash: "30692e6658ac730670a489c880fd4485" + } + Frame { + msec: 5440 + hash: "30692e6658ac730670a489c880fd4485" + } + Frame { + msec: 5456 + hash: "d36e1a56078d7cfa246b57f886c230b4" + } + Frame { + msec: 5472 + hash: "0374aae76f8cfd75f119ff4b86dba817" + } + Frame { + msec: 5488 + hash: "d75e53f2cea8e9b61a5e50f95060552e" + } + Frame { + msec: 5504 + hash: "d75e53f2cea8e9b61a5e50f95060552e" + } + Frame { + msec: 5520 + hash: "af5f794f73e16a5c3b9e437418c873ee" + } + Frame { + msec: 5536 + hash: "af5f794f73e16a5c3b9e437418c873ee" + } + Frame { + msec: 5552 + hash: "8532ee7ce3488f9e038643e4fa48751d" + } + Frame { + msec: 5568 + hash: "136fb272f4d806927b46a1269b18f63d" + } + Frame { + msec: 5584 + hash: "136fb272f4d806927b46a1269b18f63d" + } + Frame { + msec: 5600 + hash: "845581f8d03f4fe9323fc282e84f919b" + } + Frame { + msec: 5616 + hash: "845581f8d03f4fe9323fc282e84f919b" + } + Frame { + msec: 5632 + hash: "e64fa5eba05f81e6f263dc8543f21b1a" + } + Frame { + msec: 5648 + hash: "e64fa5eba05f81e6f263dc8543f21b1a" + } + Frame { + msec: 5664 + hash: "1c25b3d65e8590f8c213afa76b722e97" + } + Frame { + msec: 5680 + hash: "1c25b3d65e8590f8c213afa76b722e97" + } + Frame { + msec: 5696 + hash: "451a9408b04826ab35749d9120efd6bb" + } + Frame { + msec: 5712 + hash: "451a9408b04826ab35749d9120efd6bb" + } + Frame { + msec: 5728 + hash: "451a9408b04826ab35749d9120efd6bb" + } + Frame { + msec: 5744 + hash: "73c06997014af4e008b546b53fe349fb" + } + Frame { + msec: 5760 + image: "test-flipable.5.png" + } + Frame { + msec: 5776 + hash: "90fb4e4ba04ac32b52c10b3258431c04" + } + Frame { + msec: 5792 + hash: "90fb4e4ba04ac32b52c10b3258431c04" + } + Frame { + msec: 5808 + hash: "90fb4e4ba04ac32b52c10b3258431c04" + } + Frame { + msec: 5824 + hash: "90fb4e4ba04ac32b52c10b3258431c04" + } + Frame { + msec: 5840 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 5856 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 5872 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 5888 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 5904 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 5920 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 5936 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 5952 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 5968 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 5984 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 6000 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 6016 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 6032 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 6048 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 6064 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 6080 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 6096 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 6112 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 6128 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 6144 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 6160 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 6176 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 6192 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 6208 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Key { + type: 6 + key: 16777249 + modifiers: 67108864 + text: "" + autorep: false + count: 1 + } + Frame { + msec: 6224 + hash: "90fb4e4ba04ac32b52c10b3258431c04" + } + Frame { + msec: 6240 + hash: "90fb4e4ba04ac32b52c10b3258431c04" + } + Frame { + msec: 6256 + hash: "90fb4e4ba04ac32b52c10b3258431c04" + } + Frame { + msec: 6272 + hash: "73c06997014af4e008b546b53fe349fb" + } + Frame { + msec: 6288 + hash: "73c06997014af4e008b546b53fe349fb" + } + Frame { + msec: 6304 + hash: "73c06997014af4e008b546b53fe349fb" + } + Frame { + msec: 6320 + hash: "451a9408b04826ab35749d9120efd6bb" + } + Frame { + msec: 6336 + hash: "451a9408b04826ab35749d9120efd6bb" + } + Frame { + msec: 6352 + hash: "1c25b3d65e8590f8c213afa76b722e97" + } + Frame { + msec: 6368 + hash: "1c25b3d65e8590f8c213afa76b722e97" + } + Frame { + msec: 6384 + hash: "1c25b3d65e8590f8c213afa76b722e97" + } + Frame { + msec: 6400 + hash: "e64fa5eba05f81e6f263dc8543f21b1a" + } + Frame { + msec: 6416 + hash: "e64fa5eba05f81e6f263dc8543f21b1a" + } + Frame { + msec: 6432 + hash: "845581f8d03f4fe9323fc282e84f919b" + } +} diff --git a/tests/auto/declarative/visual/qmlgraphicsflipable/test-flipable.qml b/tests/auto/declarative/visual/qmlgraphicsflipable/test-flipable.qml new file mode 100644 index 0000000..ba2e93f --- /dev/null +++ b/tests/auto/declarative/visual/qmlgraphicsflipable/test-flipable.qml @@ -0,0 +1,83 @@ +import Qt 4.6 + +Rectangle { + width: 400; height: 240 + color: "white" + + Timer { + interval: 3000; running: true; repeat: true; triggeredOnStart: true + onTriggered: { + if (flipable.state == '') flipable.state = 'back'; else flipable.state = '' + if (flipable2.state == '') flipable2.state = 'back'; else flipable2.state = '' + } + } + + Flipable { + id: flipable + width: 200; height: 200 + + property int angle: 0 + + transform: Rotation { + origin.x: 100; origin.y: 100 + axis.x: 0; axis.y: 1; axis.z: 0 + angle: flipable.angle + } + + front: Rectangle { + color: "steelblue"; width: 200; height: 200 + } + + back: Rectangle { + color: "deeppink"; width: 200; height: 200 + } + + states: State { + name: "back" + PropertyChanges { target: flipable; angle: 180 } + } + + transitions: Transition { + NumberAnimation { easing: "easeInOutQuad"; matchProperties: "angle"; duration: 3000 } + } + } + + Flipable { + id: flipable2 + x: 200; width: 200; height: 200 + + property int angle: 0 + + transform: Rotation { + origin.x: 100; origin.y: 100 + axis.x: 1; axis.z: 0 + angle: flipable2.angle + } + + front: Rectangle { + color: "deeppink"; width: 200; height: 200 + } + + back: Rectangle { + color: "steelblue"; width: 200; height: 200 + } + + states: State { + name: "back" + PropertyChanges { target: flipable2; angle: 180 } + } + + transitions: Transition { + NumberAnimation { easing: "easeInOutQuad"; matchProperties: "angle"; duration: 3000 } + } + } + + Rectangle { + x: 25; width: 150; y: 210; height: 20; color: "black" + visible: flipable.side == Flipable.Front + } + Rectangle { + x: 225; width: 150; y: 210; height: 20; color: "black" + visible: flipable2.side == Flipable.Back + } +} -- cgit v0.12 From 11bbed0a7cfd4b5295109341c3dc6df339b4df05 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Mon, 9 Nov 2009 13:07:05 +1000 Subject: QmlContext objects shouldn't be added to object tree. --- src/declarative/qml/qmlenginedebug.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/declarative/qml/qmlenginedebug.cpp b/src/declarative/qml/qmlenginedebug.cpp index 52d54b9..20d6fc1 100644 --- a/src/declarative/qml/qmlenginedebug.cpp +++ b/src/declarative/qml/qmlenginedebug.cpp @@ -99,6 +99,7 @@ QmlEngineDebugServer::QmlObjectProperty QmlEngineDebugServer::propertyData(QObject *obj, int propIdx) { QmlObjectProperty rv; +; QMetaProperty prop = obj->metaObject()->property(propIdx); @@ -165,7 +166,7 @@ void QmlEngineDebugServer::buildObjectDump(QDataStream &message, int childrenCount = children.count(); for (int ii = 0; ii < children.count(); ++ii) { - if (QmlBoundSignal::cast(children[ii])) + if (qobject_cast(children[ii]) || QmlBoundSignal::cast(children[ii])) --childrenCount; } @@ -175,6 +176,8 @@ void QmlEngineDebugServer::buildObjectDump(QDataStream &message, for (int ii = 0; ii < children.count(); ++ii) { QObject *child = children.at(ii); + if (qobject_cast(child)) + continue; QmlBoundSignal *signal = QmlBoundSignal::cast(child); if (signal) { QmlObjectProperty prop; -- cgit v0.12 From d96ec3cff51b952a2db9dd016ca5b21d9bb21adf Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Mon, 9 Nov 2009 13:07:25 +1000 Subject: ListModel docs and tests --- src/declarative/util/qmllistmodel.cpp | 73 ++++++++--- src/declarative/util/qmllistmodel_p.h | 3 +- .../qmlgraphicswebview/data/javaScript.qml | 5 + .../auto/declarative/qmllistmodel/qmllistmodel.pro | 6 + .../declarative/qmllistmodel/tst_qmllistmodel.cpp | 138 +++++++++++++++++++++ .../declarative/visual/webview/embedding/egg.qml | 27 ++++ .../visual/webview/embedding/nesting.html | 9 ++ .../visual/webview/embedding/nesting.qml | 8 ++ 8 files changed, 253 insertions(+), 16 deletions(-) create mode 100644 tests/auto/declarative/qmlgraphicswebview/data/javaScript.qml create mode 100644 tests/auto/declarative/qmllistmodel/qmllistmodel.pro create mode 100644 tests/auto/declarative/qmllistmodel/tst_qmllistmodel.cpp create mode 100644 tests/auto/declarative/visual/webview/embedding/egg.qml create mode 100644 tests/auto/declarative/visual/webview/embedding/nesting.html create mode 100644 tests/auto/declarative/visual/webview/embedding/nesting.qml diff --git a/src/declarative/util/qmllistmodel.cpp b/src/declarative/util/qmllistmodel.cpp index afc6735..fbd957c 100644 --- a/src/declarative/util/qmllistmodel.cpp +++ b/src/declarative/util/qmllistmodel.cpp @@ -45,9 +45,11 @@ #include #include #include "qmlopenmetaobject_p.h" +#include #include #include "qmllistmodel_p.h" #include +#include "qmlinfo.h" Q_DECLARE_METATYPE(QListModelInterface *) @@ -264,6 +266,7 @@ QT_END_NAMESPACE Q_DECLARE_METATYPE(ModelNode *) QT_BEGIN_NAMESPACE + void ModelNode::setObjectValue(const QScriptValue& valuemap) { QScriptValueIterator it(valuemap); while (it.hasNext()) { @@ -451,14 +454,17 @@ void QmlListModel::clear() */ void QmlListModel::remove(int index) { - if (_root) { - ModelNode *node = qvariant_cast(_root->values.at(index)); - _root->values.removeAt(index); - if (node) - delete node; - emit itemsRemoved(index,1); - emit countChanged(_root->values.count()); + if (!_root || index < 0 || index >= _root->values.count()) { + qmlInfo(tr("remove: index %1 out of range").arg(index),this); + return; } + + ModelNode *node = qvariant_cast(_root->values.at(index)); + _root->values.removeAt(index); + if (node) + delete node; + emit itemsRemoved(index,1); + emit countChanged(_root->values.count()); } /*! @@ -480,9 +486,11 @@ void QmlListModel::insert(int index, const QScriptValue& valuemap) { if (!_root) _root = new ModelNode; - if (index >= _root->values.count()) { + if (index >= _root->values.count() || index<0) { if (index == _root->values.count()) append(valuemap); + else + qmlInfo(tr("insert: index %1 out of range").arg(index),this); return; } ModelNode *mn = new ModelNode; @@ -508,8 +516,10 @@ void QmlListModel::insert(int index, const QScriptValue& valuemap) */ void QmlListModel::move(int from, int to, int n) { - if (from+n > count() || to+n > count() || n==0 || from==to || from < 0 || to < 0) + if (n==0 || from==to) return; + if (from+n > count() || to+n > count() || from < 0 || to < 0) + qmlInfo(tr("move: out of range"),this); int origfrom=from; // preserve actual move, so any animations are correct int origto=to; int orign=n; @@ -556,7 +566,7 @@ void QmlListModel::move(int from, int to, int n) void QmlListModel::append(const QScriptValue& valuemap) { if (!valuemap.isObject()) { - qWarning("ListModel::append: value is not an object"); + qmlInfo(tr("append: value is not an object"),this); return; } if (!_root) @@ -569,10 +579,43 @@ void QmlListModel::append(const QScriptValue& valuemap) } /*! + \qmlmethod dict ListModel::get(index) + + Returns the item at \a index in the list model. + + \code + FruitModel.append({"cost": 5.95, "name":"Pizza"}) + FruitModel.get(0).cost + \endcode + + The \a index must be an element in the list. + + \sa append() +*/ +QScriptValue QmlListModel::get(int index) const +{ + if (index >= count()) { + qmlInfo(tr("get: index %1 out of range").arg(index),this); + return 0; + } + + ModelNode *node = qvariant_cast(_root->values.at(index)); + if (!node) + return 0; + QmlEngine *eng = qmlEngine(this); + if (!eng) { + qWarning("Cannot call QmlListModel::get() without a QmlEngine"); + return 0; + } + return QmlEnginePrivate::qmlScriptObject(node->object(), eng); +} + +/*! \qmlmethod ListModel::set(index,dict) - Changes the item at \a index in the list model to the - values in \a dict. + Changes the item at \a index in the list model with the + values in \a dict. Properties not appearing in \a valuemap + are left unchanged. \code FruitModel.set(3, {"cost": 5.95, "name":"Pizza"}) @@ -586,8 +629,8 @@ void QmlListModel::set(int index, const QScriptValue& valuemap) { if (!_root) _root = new ModelNode; - if ( index >= _root->values.count()) { - qWarning() << "ListModel::set index out of range:" << index; + if ( index > _root->values.count()) { + qmlInfo(tr("set: index %1 out of range").arg(index),this); return; } if (index == _root->values.count()) @@ -628,7 +671,7 @@ void QmlListModel::set(int index, const QString& property, const QVariant& value if (!_root) _root = new ModelNode; if ( index >= _root->values.count()) { - qWarning() << "ListModel::set index out of range:" << index; + qmlInfo(tr("set: index %1 out of range").arg(index),this); return; } ModelNode *node = qvariant_cast(_root->values.at(index)); diff --git a/src/declarative/util/qmllistmodel_p.h b/src/declarative/util/qmllistmodel_p.h index 31365d1..34b1562 100644 --- a/src/declarative/util/qmllistmodel_p.h +++ b/src/declarative/util/qmllistmodel_p.h @@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Declarative) struct ModelNode; -class QmlListModel : public QListModelInterface +class Q_DECLARATIVE_EXPORT QmlListModel : public QListModelInterface { Q_OBJECT Q_PROPERTY(int count READ count NOTIFY countChanged) @@ -77,6 +77,7 @@ public: Q_INVOKABLE void remove(int index); Q_INVOKABLE void append(const QScriptValue&); Q_INVOKABLE void insert(int index, const QScriptValue&); + Q_INVOKABLE QScriptValue get(int index) const; Q_INVOKABLE void set(int index, const QScriptValue&); Q_INVOKABLE void set(int index, const QString& property, const QVariant& value); Q_INVOKABLE void move(int from, int to, int count); diff --git a/tests/auto/declarative/qmlgraphicswebview/data/javaScript.qml b/tests/auto/declarative/qmlgraphicswebview/data/javaScript.qml new file mode 100644 index 0000000..75d0cea --- /dev/null +++ b/tests/auto/declarative/qmlgraphicswebview/data/javaScript.qml @@ -0,0 +1,5 @@ +import Qt 4.6 + +WebView { + url: "javaScript.html" +} diff --git a/tests/auto/declarative/qmllistmodel/qmllistmodel.pro b/tests/auto/declarative/qmllistmodel/qmllistmodel.pro new file mode 100644 index 0000000..60b0c4b --- /dev/null +++ b/tests/auto/declarative/qmllistmodel/qmllistmodel.pro @@ -0,0 +1,6 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += declarative +QT += script +macx:CONFIG -= app_bundle + +SOURCES += tst_qmllistmodel.cpp diff --git a/tests/auto/declarative/qmllistmodel/tst_qmllistmodel.cpp b/tests/auto/declarative/qmllistmodel/tst_qmllistmodel.cpp new file mode 100644 index 0000000..9ce1a7c --- /dev/null +++ b/tests/auto/declarative/qmllistmodel/tst_qmllistmodel.cpp @@ -0,0 +1,138 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include +#include +#include +#include + +class tst_QmlListModel : public QObject +{ + Q_OBJECT +public: + tst_QmlListModel() {} + +private slots: + void dynamic_data(); + void dynamic(); +}; + +void tst_QmlListModel::dynamic_data() +{ + QTest::addColumn("script"); + QTest::addColumn("result"); + QTest::addColumn("warning"); + + // Simple flat model + + QTest::newRow("count") << "count" << 0 << ""; + + QTest::newRow("append1") << "{append({'foo':123});count}" << 1 << ""; + QTest::newRow("append2") << "{append({'foo':123,'bar':456});count}" << 1 << ""; + QTest::newRow("append3a") << "{append({'foo':123});append({'foo':456});get(0).foo}" << 123 << ""; + QTest::newRow("append3b") << "{append({'foo':123});append({'foo':456});get(1).foo}" << 456 << ""; + + QTest::newRow("clear1") << "{append({'foo':456});clear();count}" << 0 << ""; + QTest::newRow("clear2") << "{append({'foo':123});append({'foo':456});clear();count}" << 0 << ""; + QTest::newRow("clear2") << "{append({'foo':123});clear();get(0).foo}" << 0 << "QML QmlListModel (unknown location) get: index 0 out of range"; + + QTest::newRow("remove1") << "{append({'foo':123});remove(0);count}" << 0 << ""; + QTest::newRow("remove2a") << "{append({'foo':123});append({'foo':456});remove(0);count}" << 1 << ""; + QTest::newRow("remove2b") << "{append({'foo':123});append({'foo':456});remove(0);get(0).foo}" << 456 << ""; + QTest::newRow("remove2c") << "{append({'foo':123});append({'foo':456});remove(1);get(0).foo}" << 123 << ""; + QTest::newRow("remove3") << "{append({'foo':123});remove(0);get(0).foo}" << 0 << "QML QmlListModel (unknown location) get: index 0 out of range"; + + QTest::newRow("insert1") << "{insert(0,{'foo':123});count}" << 1 << ""; + QTest::newRow("insert2") << "{insert(1,{'foo':123});count}" << 0 << "QML QmlListModel (unknown location) insert: index 1 out of range"; + QTest::newRow("insert3a") << "{append({'foo':123});insert(1,{'foo':456});count}" << 2 << ""; + QTest::newRow("insert3b") << "{append({'foo':123});insert(1,{'foo':456});get(0).foo}" << 123 << ""; + QTest::newRow("insert3c") << "{append({'foo':123});insert(1,{'foo':456});get(1).foo}" << 456 << ""; + QTest::newRow("insert3d") << "{append({'foo':123});insert(0,{'foo':456});get(0).foo}" << 456 << ""; + QTest::newRow("insert3e") << "{append({'foo':123});insert(0,{'foo':456});get(1).foo}" << 123 << ""; + QTest::newRow("insert4") << "{append({'foo':123});insert(-1,{'foo':456})}" << 0 << "QML QmlListModel (unknown location) insert: index -1 out of range"; + + QTest::newRow("set1") << "{append({'foo':123});set(0,{'foo':456});count}" << 1 << ""; + QTest::newRow("set2") << "{append({'foo':123});set(0,{'foo':456});get(0).foo}" << 456 << ""; + QTest::newRow("set3a") << "{append({'foo':123,'bar':456});set(0,{'foo':999});get(0).foo}" << 999 << ""; + QTest::newRow("set3b") << "{append({'foo':123,'bar':456});set(0,{'foo':999});get(0).bar}" << 456 << ""; + + QTest::newRow("setprop1") << "{append({'foo':123});set(0,'foo',456);count}" << 1 << ""; + QTest::newRow("setprop2") << "{append({'foo':123});set(0,'foo',456);get(0).foo}" << 456 << ""; + QTest::newRow("setprop3a") << "{append({'foo':123,'bar':456});set(0,'foo',999);get(0).foo}" << 999 << ""; + QTest::newRow("setprop3b") << "{append({'foo':123,'bar':456});set(0,'foo',999);get(0).bar}" << 456 << ""; + + QTest::newRow("move1a") << "{append({'foo':123});append({'foo':456});move(0,1,1);count}" << 2 << ""; + QTest::newRow("move1b") << "{append({'foo':123});append({'foo':456});move(0,1,1);get(0).foo}" << 456 << ""; + QTest::newRow("move1c") << "{append({'foo':123});append({'foo':456});move(0,1,1);get(1).foo}" << 123 << ""; + QTest::newRow("move1d") << "{append({'foo':123});append({'foo':456});move(1,0,1);get(0).foo}" << 456 << ""; + QTest::newRow("move1e") << "{append({'foo':123});append({'foo':456});move(1,0,1);get(1).foo}" << 123 << ""; + QTest::newRow("move2a") << "{append({'foo':123});append({'foo':456});append({'foo':789});move(0,1,2);count}" << 3 << ""; + QTest::newRow("move2b") << "{append({'foo':123});append({'foo':456});append({'foo':789});move(0,1,2);get(0).foo}" << 789 << ""; + QTest::newRow("move2c") << "{append({'foo':123});append({'foo':456});append({'foo':789});move(0,1,2);get(1).foo}" << 123 << ""; + QTest::newRow("move2d") << "{append({'foo':123});append({'foo':456});append({'foo':789});move(0,1,2);get(2).foo}" << 456 << ""; + + // Structured model + + // XXX todo +} + +void tst_QmlListModel::dynamic() +{ + QFETCH(QString, script); + QFETCH(int, result); + QFETCH(QString, warning); + + QmlEngine engine; + QmlListModel model; + QmlEngine::setContextForObject(&model,engine.rootContext()); + engine.rootContext()->addDefaultObject(&model); + QmlExpression e(engine.rootContext(), script, &model); + if (!warning.isEmpty()) + QTest::ignoreMessage(QtWarningMsg, warning.toLatin1()); + int actual = e.value().toInt(); + if (e.hasError()) + qDebug() << e.error(); // errors not expected + QVERIFY(!e.hasError()); + QCOMPARE(actual,result); +} + +QTEST_MAIN(tst_QmlListModel) + +#include "tst_qmllistmodel.moc" diff --git a/tests/auto/declarative/visual/webview/embedding/egg.qml b/tests/auto/declarative/visual/webview/embedding/egg.qml new file mode 100644 index 0000000..a9019d1 --- /dev/null +++ b/tests/auto/declarative/visual/webview/embedding/egg.qml @@ -0,0 +1,27 @@ +import Qt 4.6 + +Item { + property var period : 250 + property var color : "black" + id: root + + Item { + x: root.width/2 + y: root.height/2 + Rectangle { + radius: width/2 + color: root.color + x: -width/2 + y: -height/2 + width: root.width*1.5 + height: root.height*1.5 + } + rotation: NumberAnimation { + from: 0 + to: 360 + repeat: true + running: true + duration: root.period + } + } +} diff --git a/tests/auto/declarative/visual/webview/embedding/nesting.html b/tests/auto/declarative/visual/webview/embedding/nesting.html new file mode 100644 index 0000000..6e81689 --- /dev/null +++ b/tests/auto/declarative/visual/webview/embedding/nesting.html @@ -0,0 +1,9 @@ + +Nesting + + + +

Nesting

+This is a test... + +... with a spinning QML egg nested in it. diff --git a/tests/auto/declarative/visual/webview/embedding/nesting.qml b/tests/auto/declarative/visual/webview/embedding/nesting.qml new file mode 100644 index 0000000..0d76579 --- /dev/null +++ b/tests/auto/declarative/visual/webview/embedding/nesting.qml @@ -0,0 +1,8 @@ +import Qt 4.6 + +WebView { + width: 300 + height: 200 + url: "nesting.html" + settings.pluginsEnabled: true +} -- cgit v0.12 From 65ebb736e7d1f134b6d3dc5c620de43b9880d544 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Mon, 9 Nov 2009 13:08:26 +1000 Subject: webview JS test --- .../declarative/qmlgraphicswebview/data/javaScript.qml | 6 ++++++ .../qmlgraphicswebview/tst_qmlgraphicswebview.cpp | 14 +++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/tests/auto/declarative/qmlgraphicswebview/data/javaScript.qml b/tests/auto/declarative/qmlgraphicswebview/data/javaScript.qml index 75d0cea..28742f3 100644 --- a/tests/auto/declarative/qmlgraphicswebview/data/javaScript.qml +++ b/tests/auto/declarative/qmlgraphicswebview/data/javaScript.qml @@ -2,4 +2,10 @@ import Qt 4.6 WebView { url: "javaScript.html" + javaScriptWindowObjects: [ + Object { + property string qmlprop: "qmlvalue" + WebView.windowObjectName: "myjsname" + } + ] } diff --git a/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp b/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp index 6cf6741..c05f8a6 100644 --- a/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp +++ b/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp @@ -59,9 +59,9 @@ private slots: void historyNav(); void loadError(); void setHtml(); + void javaScript(); void cleanupTestCase(); - private: void checkNoErrors(const QmlComponent& component); QmlEngine engine; @@ -248,6 +248,18 @@ void tst_qmlgraphicswebview::setHtml() QCOMPARE(wv->html(),QString("

This is a string set on the WebView

")); } +void tst_qmlgraphicswebview::javaScript() +{ + QmlComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/javaScript.qml")); + checkNoErrors(component); + QmlGraphicsWebView *wv = qobject_cast(component.create()); + QVERIFY(wv != 0); + QTRY_COMPARE(wv->progress(), 1.0); + QCOMPARE(wv->evaluateJavaScript("123").toInt(), 123); + QCOMPARE(wv->evaluateJavaScript("window.status").toString(), QString("status here")); + QCOMPARE(wv->evaluateJavaScript("window.myjsname.qmlprop").toString(), QString("qmlvalue")); +} + QTEST_MAIN(tst_qmlgraphicswebview) #include "tst_qmlgraphicswebview.moc" -- cgit v0.12 From 034c9f1b81cfa2d854f87b08e945296d3c1fac85 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Mon, 9 Nov 2009 13:08:49 +1000 Subject: Initial qmldebug tests. --- tests/auto/declarative/declarative.pro | 1 + tests/auto/declarative/qmldebug/qmldebug.pro | 5 + tests/auto/declarative/qmldebug/tst_qmldebug.cpp | 594 +++++++++++++++++++++++ 3 files changed, 600 insertions(+) create mode 100644 tests/auto/declarative/qmldebug/qmldebug.pro create mode 100644 tests/auto/declarative/qmldebug/tst_qmldebug.cpp diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index b9f59d6..a31be0b 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -16,6 +16,7 @@ SUBDIRS += \ qfxwebview \ # Cover qmetaobjectbuilder \ # Cover qmlcontext \ # Cover + qmldebug \ # Cover qmldom \ # Cover qmlecmascript \ # Cover qmlfontloader \ # Cover diff --git a/tests/auto/declarative/qmldebug/qmldebug.pro b/tests/auto/declarative/qmldebug/qmldebug.pro new file mode 100644 index 0000000..61f821e --- /dev/null +++ b/tests/auto/declarative/qmldebug/qmldebug.pro @@ -0,0 +1,5 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += network declarative +macx:CONFIG -= app_bundle + +SOURCES += tst_qmldebug.cpp diff --git a/tests/auto/declarative/qmldebug/tst_qmldebug.cpp b/tests/auto/declarative/qmldebug/tst_qmldebug.cpp new file mode 100644 index 0000000..a7573da --- /dev/null +++ b/tests/auto/declarative/qmldebug/tst_qmldebug.cpp @@ -0,0 +1,594 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + + +class tst_QmlDebug : public QObject +{ + Q_OBJECT + +public: + tst_QmlDebug(QmlDebugConnection *conn, QmlEngine *engine, QmlGraphicsItem *rootItem) + : m_conn(conn), m_dbg(0), m_engine(engine), m_rootItem(rootItem) {} + +protected slots: + void saveValueChange(const QByteArray &ba, const QVariant &v) + { + m_savedValueChanges[ba] = v; + } + +private: + QmlDebugConnection *m_conn; + QmlEngineDebug *m_dbg; + QmlEngine *m_engine; + QmlGraphicsItem *m_rootItem; + + QHash m_savedValueChanges; + + void waitForQuery(QmlDebugQuery *query) + { + QCOMPARE(query->parent(), this); + QEventLoop loop; + QTimer timer; + QVERIFY(query->state() == QmlDebugQuery::Waiting); + connect(query, SIGNAL(stateChanged(State)), &loop, SLOT(quit())); + connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit())); + timer.start(5000); + loop.exec(); + if (!timer.isActive()) + QFAIL("query timed out"); + } + + void verifyRootObject(const QmlDebugObjectReference &obj) + { + // verifies object according to component definition in main() + + QCOMPARE(obj.debugId(), QmlDebugService::idForObject(m_rootItem)); + QCOMPARE(obj.className(), QLatin1String("Item")); + QCOMPARE(obj.name(), m_rootItem->objectName()); + QCOMPARE(obj.contextDebugId(), QmlDebugService::idForObject(qmlContext(m_rootItem))); + + QmlDebugFileReference source = obj.source(); + QCOMPARE(source.url(), QUrl("file://")); + QCOMPARE(source.lineNumber(), 3); + QCOMPARE(source.columnNumber(), 3); + + QList props = obj.properties(); + QHash expected; + + expected["width"] = 10; + expected["height"] = 20; + verifyProperties(props, expected); + } + + void verifyProperties(const QList &actual, const QHash &expected) + { + foreach(const QmlDebugPropertyReference &p, actual) { + if (expected.contains(p.name())) + QCOMPARE(p.value(), expected[p.name()]); + } + } + + QmlDebugObjectReference findRootObject() + { + QmlDebugEnginesQuery *q_engines = m_dbg->queryAvailableEngines(this); + waitForQuery(q_engines); + + if (q_engines->engines().count() == 0) + return QmlDebugObjectReference(); + QmlDebugRootContextQuery *q_context = m_dbg->queryRootContexts(q_engines->engines()[0].debugId(), this); + waitForQuery(q_context); + + if (q_context->rootContext().objects().count() == 0) + return QmlDebugObjectReference(); + QmlDebugObjectQuery *q_obj = m_dbg->queryObject(q_context->rootContext().objects()[0], this); + waitForQuery(q_obj); + + QmlDebugObjectReference result = q_obj->object(); + + delete q_engines; + delete q_context; + delete q_obj; + + return result; + } + + QmlDebugPropertyReference findProperty(const QList &props, const QString &name) + { + foreach(const QmlDebugPropertyReference &p, props) { + if (p.name() == name) + return p; + } + return QmlDebugPropertyReference(); + } + + int countNotifiableProperties(const QObject *obj) + { + int count = 0; + for (int i=0; imetaObject()->propertyCount(); i++) { + QMetaProperty p = obj->metaObject()->property(i); + if (p.hasNotifySignal()) + count++; + } + return count; + } + +private slots: + void initTestCase(); + + void watch_property(); + void watch_object(); + void watch_expression(); + void watch_expression_data(); + + void queryAvailableEngines(); + void queryRootContexts(); + void queryObject(); + void queryObjectRecursive(); + void queryExpressionResult(); + void queryExpressionResult_data(); +}; + +void tst_QmlDebug::initTestCase() +{ + m_dbg = new QmlEngineDebug(m_conn, this); +} + +void tst_QmlDebug::watch_property() +{ + QmlDebugObjectReference obj = findRootObject(); + QmlDebugPropertyReference prop = findProperty(obj.properties(), "width"); + + QmlDebugPropertyWatch *watch = m_dbg->addWatch(prop, this); + QCOMPARE(watch->state(), QmlDebugWatch::Waiting); + QCOMPARE(watch->objectDebugId(), obj.debugId()); + QCOMPARE(watch->name(), prop.name()); + + QSignalSpy spy(watch, SIGNAL(valueChanged(QByteArray,QVariant))); + QEventLoop loop; + QTimer timer; + connect(watch, SIGNAL(valueChanged(QByteArray,QVariant)), &loop, SLOT(quit())); + connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit())); + + int origWidth = m_rootItem->property("width").toInt(); + timer.start(5000); + m_rootItem->setProperty("width", origWidth*2); + loop.exec(); + + if (!timer.isActive()) + QFAIL("Did not receive valueChanged() for property"); + + m_dbg->removeWatch(watch); + delete watch; + + // restore original value and verify spy doesn't get a signal since watch has been removed + m_rootItem->setProperty("width", origWidth); + QTest::qWait(500); + QCOMPARE(spy.count(), 1); + + QCOMPARE(spy.at(0).at(0).value(), prop.name().toUtf8()); + QCOMPARE(spy.at(0).at(1).value(), qVariantFromValue(origWidth*2)); +} + +void tst_QmlDebug::watch_object() +{ + QmlDebugEnginesQuery *q_engines = m_dbg->queryAvailableEngines(this); + waitForQuery(q_engines); + + QmlDebugRootContextQuery *q_context = m_dbg->queryRootContexts(q_engines->engines()[0].debugId(), this); + waitForQuery(q_context); + + QmlDebugObjectQuery *q_obj = m_dbg->queryObject(q_context->rootContext().objects()[0], this); + waitForQuery(q_obj); + + QmlDebugObjectReference obj = q_obj->object(); + + delete q_engines; + delete q_context; + delete q_obj; + + QmlDebugWatch *watch = m_dbg->addWatch(obj, this); + QCOMPARE(watch->state(), QmlDebugWatch::Waiting); + QCOMPARE(watch->objectDebugId(), obj.debugId()); + + m_savedValueChanges.clear(); + connect(watch, SIGNAL(valueChanged(QByteArray,QVariant)), + SLOT(saveValueChange(QByteArray,QVariant))); + + int origWidth = m_rootItem->property("width").toInt(); + int origHeight = m_rootItem->property("height").toInt(); + m_rootItem->setProperty("width", origWidth*2); + m_rootItem->setProperty("height", origHeight*2); + + QEventLoop loop; + QTimer timer; + timer.start(5000); + while (timer.isActive() && + (!m_savedValueChanges.contains("width") || !m_savedValueChanges.contains("height"))) { + loop.processEvents(QEventLoop::AllEvents, 50); + } + + QVariant newWidth = m_savedValueChanges["width"]; + QVariant newHeight = m_savedValueChanges["height"]; + + m_dbg->removeWatch(watch); + delete watch; + + // since watch has been removed, restoring the original values should not trigger a valueChanged() + m_savedValueChanges.clear(); + m_rootItem->setProperty("width", origWidth); + m_rootItem->setProperty("height", origHeight); + QTest::qWait(500); + QCOMPARE(m_savedValueChanges.count(), 0); + + if (newWidth.isNull() || newHeight.isNull()) { + QString s = QString("Did not receive both width and height changes (width=%1, height=%2)") + .arg(newWidth.toString()).arg(newHeight.toString()); + QFAIL(qPrintable(s)); + } + + QCOMPARE(newWidth, qVariantFromValue(origWidth*2)); + QCOMPARE(newHeight, qVariantFromValue(origHeight*2)); +} + +void tst_QmlDebug::watch_expression() +{ + QFETCH(QString, expr); + QFETCH(int, increment); + QFETCH(int, incrementCount); + + int origWidth = m_rootItem->property("width").toInt(); + + QmlDebugObjectReference obj = findRootObject(); + QmlDebugPropertyReference prop; + + QmlDebugObjectExpressionWatch *watch = m_dbg->addWatch(obj, expr, this); + QCOMPARE(watch->state(), QmlDebugWatch::Waiting); + QCOMPARE(watch->objectDebugId(), obj.debugId()); + QCOMPARE(watch->expression(), expr); + + QSignalSpy spy(watch, SIGNAL(valueChanged(QByteArray,QVariant))); + int expectedSpyCount = incrementCount + 1; // should also get signal with expression's initial value + + int width = origWidth; + for (int i=0; i 0) { + width += increment; + m_rootItem->setProperty("width", width); + } + QEventLoop loop; + connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit())); + connect(watch, SIGNAL(valueChanged(QByteArray,QVariant)), &loop, SLOT(quit())); + loop.exec(); + if (!timer.isActive()) + QFAIL("Did not receive valueChanged() signal for expression"); + } + + m_dbg->removeWatch(watch); + delete watch; + + // restore original value and verify spy doesn't get a signal since watch has been removed + m_rootItem->setProperty("width", origWidth); // may increase spy count before QCOMPARE() + QTest::qWait(500); + QCOMPARE(spy.count(), expectedSpyCount); + + width = origWidth + increment; + for (int i=0; i().toInt(), width); + width += increment; + } +} + +void tst_QmlDebug::watch_expression_data() +{ + QTest::addColumn("expr"); + QTest::addColumn("increment"); + QTest::addColumn("incrementCount"); + + QTest::newRow("width") << "width" << 0 << 0; + QTest::newRow("width+10") << "width + 10" << 10 << 5; +} + +void tst_QmlDebug::queryAvailableEngines() +{ + QmlDebugEnginesQuery *q_engines = m_dbg->queryAvailableEngines(this); + waitForQuery(q_engines); + + // TODO have multiple engines + QList engines = q_engines->engines(); + QCOMPARE(engines.count(), 1); + + foreach(const QmlDebugEngineReference &e, engines) { + QCOMPARE(e.debugId(), QmlDebugService::idForObject(m_engine)); + QCOMPARE(e.name(), m_engine->objectName()); + } + + delete q_engines; +} + +void tst_QmlDebug::queryRootContexts() +{ + QmlDebugEnginesQuery *q_engines = m_dbg->queryAvailableEngines(this); + waitForQuery(q_engines); + + QmlDebugRootContextQuery *q_context = m_dbg->queryRootContexts(q_engines->engines()[0].debugId(), this); + waitForQuery(q_context); + + QmlContext *actualContext = m_engine->rootContext(); + QmlDebugContextReference context = q_context->rootContext(); + QCOMPARE(context.debugId(), QmlDebugService::idForObject(actualContext)); + QCOMPARE(context.name(), actualContext->objectName()); + + QCOMPARE(context.objects().count(), 1); + + // root context query sends only root object data - it doesn't fill in + // the children or property info + QCOMPARE(context.objects()[0].properties().count(), 0); + QCOMPARE(context.objects()[0].children().count(), 0); + + // TODO have multiple contexts + QCOMPARE(context.contexts().count(), 0); + + delete q_engines; + delete q_context; +} + +void tst_QmlDebug::queryObject() +{ + QmlDebugEnginesQuery *q_engines = m_dbg->queryAvailableEngines(this); + waitForQuery(q_engines); + + QmlDebugRootContextQuery *q_context = m_dbg->queryRootContexts(q_engines->engines()[0].debugId(), this); + waitForQuery(q_context); + + QmlDebugObjectQuery *q_obj = m_dbg->queryObject(q_context->rootContext().objects()[0], this); + waitForQuery(q_obj); + + QmlDebugObjectReference obj = q_obj->object(); + verifyRootObject(obj); + + QVERIFY(obj.children().count() >= 2); + + // non-recursive query, children data not available + foreach(const QmlDebugObjectReference &child, obj.children()) + QCOMPARE(child.properties().count(), 0); + + delete q_engines; + delete q_context; + delete q_obj; +} + +void tst_QmlDebug::queryObjectRecursive() +{ + QmlDebugEnginesQuery *q_engines = m_dbg->queryAvailableEngines(this); + waitForQuery(q_engines); + + QmlDebugRootContextQuery *q_context = m_dbg->queryRootContexts(q_engines->engines()[0].debugId(), this); + waitForQuery(q_context); + + QmlDebugObjectQuery *q_obj = m_dbg->queryObjectRecursive(q_context->rootContext().objects()[0], this); + waitForQuery(q_obj); + + QmlDebugObjectReference obj = q_obj->object(); + verifyRootObject(obj); + + delete q_engines; + delete q_context; + delete q_obj; + + QList children = obj.children(); + QVERIFY(children.count() >= 2); // there may be additional properties e.g. StateGroup + + QList props; + QHash expected; + + QmlDebugObjectReference rectRef; + QmlDebugObjectReference textRef; + foreach (const QmlDebugObjectReference &child, children) { + if (child.className() == "Rectangle") { + props = child.properties(); + QVERIFY(props.count() > 0); + expected.clear(); + expected["width"] = 500; + expected["height"] = 600; + expected["color"] = "blue"; + verifyProperties(props, expected); + rectRef = child; + } else if (child.className() == "Text") { + props = child.properties(); + QVERIFY(props.count() > 0); + expected.clear(); + expected["color"] = "red"; + verifyProperties(props, expected); + textRef = child; + } + } + + QVERIFY(!rectRef.className().isEmpty()); + QVERIFY(!textRef.className().isEmpty()); + + QObject *rectObj = 0; + QObject *textObj = 0; + foreach (QObject *o, m_rootItem->children()) { + if (o->metaObject()->className() == QmlGraphicsRectangle::staticMetaObject.className()) + rectObj = o; + else if (o->metaObject()->className() == QmlGraphicsText::staticMetaObject.className()) + textObj = o; + } + + QVERIFY(rectObj); + QVERIFY(textObj); + + for (int i=0; imetaObject()->propertyCount(); i++) { + QMetaProperty p = rectObj->metaObject()->property(i); + QmlDebugPropertyReference pd = findProperty(rectRef.properties(), p.name()); + if (!pd.name().isEmpty()) { + QCOMPARE(pd.name(), QString::fromUtf8(p.name())); + if (p.type() < QVariant::UserType) + QCOMPARE(pd.value(), p.read(rectObj)); + if (pd.name() != "parent") + QCOMPARE(pd.valueTypeName(), QString::fromUtf8(p.typeName())); + QCOMPARE(pd.hasNotifySignal(), p.hasNotifySignal()); + } + } +} + +void tst_QmlDebug::queryExpressionResult() +{ + QFETCH(QString, expr); + QFETCH(QVariant, result); + + QmlDebugEnginesQuery *q_engines = m_dbg->queryAvailableEngines(this); + waitForQuery(q_engines); + + QmlDebugRootContextQuery *q_context = m_dbg->queryRootContexts(q_engines->engines()[0].debugId(), this); + waitForQuery(q_context); + + QmlDebugExpressionQuery *q_expr = m_dbg->queryExpressionResult(q_context->rootContext().objects()[0].debugId(), expr, this); + QCOMPARE(q_expr->expression(), expr); + waitForQuery(q_expr); + + QCOMPARE(q_expr->result(), result); + + delete q_engines; + delete q_context; + delete q_expr; +} + +void tst_QmlDebug::queryExpressionResult_data() +{ + QTest::addColumn("expr"); + QTest::addColumn("result"); + + QTest::newRow("width + 50") << "width + 50" << qVariantFromValue(60); + QTest::newRow("blueRect.width") << "blueRect.width" << qVariantFromValue(500); + QTest::newRow("bad expr") << "aeaef" << qVariantFromValue(QString("")); +} + + +class TestRunnerThread : public QThread +{ + Q_OBJECT +public: + void run() { + QTest::qWait(1000); + connectToEngine(); + } + + QPointer m_engine; + QPointer m_item; + +signals: + void testsFinished(); + +public slots: + + void connectToEngine() + { + QmlDebugConnection conn; + conn.connectToHost("127.0.0.1", 3768); + bool ok = conn.waitForConnected(5000); + Q_ASSERT(ok); + while (!m_engine && !m_item) + QTest::qWait(50); + + tst_QmlDebug test(&conn, m_engine, m_item); + QTest::qExec(&test); + emit testsFinished(); + } +}; + + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + qputenv("QML_DEBUG_SERVER_PORT", "3768"); + + TestRunnerThread thread; + QObject::connect(&thread, SIGNAL(testsFinished()), qApp, SLOT(quit())); + thread.start(); + + QmlEngine engine; // blocks until client connects + + QmlComponent component(&engine, + "import Qt 4.6\n" + "\n" // don't remove, line number is tested + " Item {\n" // don't remove spaces, column number is tested + "width: 10; height: 20;\n" + "Rectangle { id: blueRect; width: 500; height: 600; color: \"blue\"; }" + "Text { color: \"red\"; }" + "}\n", + QUrl("file://")); + Q_ASSERT(component.isReady()); + QObject *o = component.create(); + QObject::connect(&thread, SIGNAL(testsFinished()), o, SLOT(deleteLater())); + + // start the test + thread.m_engine = &engine; + thread.m_item = qobject_cast(o); + + return app.exec(); + +} + +//QTEST_MAIN(tst_QmlDebug) + +#include "tst_qmldebug.moc" -- cgit v0.12