summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-09-22 07:27:19 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-09-22 07:27:19 (GMT)
commit52920c5a1cabddb9d0e31a8ef91b741a8c38c69b (patch)
tree761f47fc8bba32b96913ff9734ac97fc6d6e1b10
parent6b2e0b4c5851a156c1f5fa0f73e9b1266ddc6930 (diff)
parent83fa27d3fc692e06e10cb0dd57b8f59b38d24637 (diff)
downloadQt-52920c5a1cabddb9d0e31a8ef91b741a8c38c69b.zip
Qt-52920c5a1cabddb9d0e31a8ef91b741a8c38c69b.tar.gz
Qt-52920c5a1cabddb9d0e31a8ef91b741a8c38c69b.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
-rw-r--r--demos/declarative/minehunt/main.cpp6
-rwxr-xr-xdemos/declarative/samegame/content/samegame.js49
-rw-r--r--doc/src/declarative/binding.qdoc2
-rw-r--r--doc/src/declarative/focus.qdoc2
-rw-r--r--doc/src/declarative/qtprogrammers.qdoc2
-rw-r--r--examples/declarative/loader/main.cpp6
-rw-r--r--src/declarative/extra/qfxparticles.cpp2
-rw-r--r--src/declarative/fx/qfxborderimage.cpp2
-rw-r--r--src/declarative/fx/qfximage.cpp2
-rw-r--r--src/declarative/fx/qfxitem.cpp4
-rw-r--r--src/declarative/fx/qfxpainteditem.cpp2
-rw-r--r--src/declarative/fx/qfxrect.cpp4
-rw-r--r--src/declarative/fx/qfxtext.cpp2
-rw-r--r--src/declarative/fx/qfxtextedit.cpp2
-rw-r--r--src/declarative/fx/qfxwebview.cpp2
-rw-r--r--src/declarative/util/qmlview.cpp (renamed from src/declarative/util/qfxview.cpp)96
-rw-r--r--src/declarative/util/qmlview.h (renamed from src/declarative/util/qfxview.h)12
-rw-r--r--src/declarative/util/util.pri4
-rw-r--r--tests/auto/declarative/anchors/tst_anchors.cpp14
-rw-r--r--tests/auto/declarative/animations/tst_animations.cpp4
-rw-r--r--tests/auto/declarative/layouts/tst_layouts.cpp20
-rw-r--r--tests/auto/declarative/listview/tst_listview.cpp16
-rw-r--r--tests/auto/declarative/pathview/tst_pathview.cpp14
-rw-r--r--tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp4
-rw-r--r--tests/auto/declarative/qfxtextinput/tst_qfxtextinput.cpp20
-rw-r--r--tests/auto/declarative/repeater/tst_repeater.cpp10
-rw-r--r--tests/auto/declarative/visual/tst_visual.cpp2
-rw-r--r--tools/qmldebugger/canvasframerate.cpp23
-rw-r--r--tools/qmldebugger/canvasframerate.h2
-rw-r--r--tools/qmldebugger/engine.cpp2
-rw-r--r--tools/qmldebugger/engine.h4
-rw-r--r--tools/qmlviewer/qfxtester.cpp4
-rw-r--r--tools/qmlviewer/qfxtester.h4
-rw-r--r--tools/qmlviewer/qmlviewer.cpp4
-rw-r--r--tools/qmlviewer/qmlviewer.h4
35 files changed, 174 insertions, 178 deletions
diff --git a/demos/declarative/minehunt/main.cpp b/demos/declarative/minehunt/main.cpp
index 20f7492..a9b8828 100644
--- a/demos/declarative/minehunt/main.cpp
+++ b/demos/declarative/minehunt/main.cpp
@@ -2,7 +2,7 @@
#include "qmlcontext.h"
#include "qml.h"
#include <qfxitem.h>
-#include <qfxview.h>
+#include <qmlview.h>
#include <QWidget>
#include <QApplication>
@@ -94,7 +94,7 @@ private:
int getHint(int row, int col);
void setPlaying(bool b){if(b==playing) return; playing=b; emit isPlayingChanged();}
- QFxView *canvas;
+ QmlView *canvas;
QList<Tile *> _tiles;
int numCols;
@@ -123,7 +123,7 @@ MyWidget::MyWidget(int width, int height, QWidget *parent, Qt::WindowFlags flags
vbox->setMargin(0);
setLayout(vbox);
- canvas = new QFxView(this);
+ canvas = new QmlView(this);
canvas->setFixedSize(width, height);
vbox->addWidget(canvas);
diff --git a/demos/declarative/samegame/content/samegame.js b/demos/declarative/samegame/content/samegame.js
index 0a3a4db..e42b7cc 100755
--- a/demos/declarative/samegame/content/samegame.js
+++ b/demos/declarative/samegame/content/samegame.js
@@ -44,7 +44,7 @@ function initBoard()
for(xIdx=0; xIdx<maxX; xIdx++){
for(yIdx=0; yIdx<maxY; yIdx++){
board[index(xIdx,yIdx)] = null;
- startCreatingBlock(xIdx,yIdx);
+ createBlock(xIdx,yIdx);
}
}
timer = new Date();
@@ -170,22 +170,15 @@ function floodMoveCheck(xIdx, yIdx, type)
floodMoveCheck(xIdx, yIdx - 1, board[index(xIdx,yIdx)].type);
}
-//If the component isn't ready, then the signal doesn't include the game x,y
-//So we store any x,y sent that we couldn't create at the time, and use those
-//if we are triggered by the signal.
-var waitStack = new Array(maxIndex);
-var waitTop = -1;
+function createBlock(xIdx,yIdx){
+ if(component==null)
+ component = createComponent(tileSrc);
-function finishCreatingBlock(xIdx,yIdx){
+ // Note that we don't wait for the component to become ready. This will
+ // only work if the block QML is a local file. Otherwise the component will
+ // not be ready immediately. There is a statusChanged signal on the
+ // component you could use if you want to wait to load remote files.
if(component.isReady){
- if(xIdx == undefined){
- //Called without arguments, create a previously stored (xIdx,yIdx)
- if(waitTop == -1)
- return;//Don't have a previously stored (xIdx,yIdx)
- xIdx = waitStack[waitTop] % maxX;
- yIdx = Math.floor(waitStack[waitTop] / maxX);
- waitTop -= 1;
- }
dynamicObject = component.createObject();
if(dynamicObject == null){
print("error creating block");
@@ -201,30 +194,12 @@ function finishCreatingBlock(xIdx,yIdx){
dynamicObject.height = tileSize;
dynamicObject.spawned = true;
board[index(xIdx,yIdx)] = dynamicObject;
- return true;
- }else if(component.isError){
- print("error creating block");
+ }else{//isError or isLoading
+ print("error loading block component");
print(component.errorsString());
- }else{
- //It isn't ready, but we'll be called again when it is.
- //So store the requested (xIdx,yIdx) for later use
- waitTop += 1;
- waitStack[waitTop] = index(xIdx,yIdx);
- }
- return false;
-}
-
-function startCreatingBlock(xIdx,yIdx){
- if(component!=null){
- finishCreatingBlock(xIdx,yIdx);
- return;
+ return false;
}
-
- component = createComponent(tileSrc);
- if(finishCreatingBlock(xIdx,yIdx))
- return;
- component.statusChanged.connect(finishCreatingBlock());
- return;
+ return true;
}
function sendHighScore(name) {
diff --git a/doc/src/declarative/binding.qdoc b/doc/src/declarative/binding.qdoc
index 7e8933f..37b4c97 100644
--- a/doc/src/declarative/binding.qdoc
+++ b/doc/src/declarative/binding.qdoc
@@ -86,7 +86,7 @@ void setBrightness(int b)
Next, make an instance of this class visible to the QML bind engine:
\code
-QFxView *view = new QFxView;
+QmlView *view = new QmlView;
view->setUrl("MyUI.qml");
MyScreen *screen = new MyScreen;
diff --git a/doc/src/declarative/focus.qdoc b/doc/src/declarative/focus.qdoc
index 7c293ee..028b5f0 100644
--- a/doc/src/declarative/focus.qdoc
+++ b/doc/src/declarative/focus.qdoc
@@ -13,7 +13,7 @@ and to address some of the cases unique to fluid user interfaces, the QML items
When the user presses or releases a key, the following occurs:
\list 1
\o Qt receives the key action and generates a key event.
-\o If the Qt widget containing the \l QFxView has focus, the key event is delivered to it. Otherwise, regular Qt key handling continues.
+\o If the Qt widget containing the \l QmlView has focus, the key event is delivered to it. Otherwise, regular Qt key handling continues.
\o The key event is delivered by the scene to the QML \l Item with \e {active focus}. If no \l Item has \e {active focus}, the key event is \l {QEvent::ignore()}{ignored} and regular Qt key handling continues.
\o If the QML \l Item with \e {active focus} accepts the key event, propagation stops. Otherwise the event is "bubbled up", by recursively passing it to each \l Item's parent until either the event is accepted, or the root \l Item is reached.
diff --git a/doc/src/declarative/qtprogrammers.qdoc b/doc/src/declarative/qtprogrammers.qdoc
index 742fc07..3b20539 100644
--- a/doc/src/declarative/qtprogrammers.qdoc
+++ b/doc/src/declarative/qtprogrammers.qdoc
@@ -20,7 +20,7 @@ QML provides direct access to the following concepts from Qt:
\o QAction - the \l {basicqmlaction}{action} type
\o QObject signals and slots - available as functions to call in JavaScript
\o QObject properties - available as variables in JavaScript
- \o QWidget - QFxView is a QML-displaying widget
+ \o QWidget - QmlView is a QML-displaying widget
\o Qt models - used directly in data binding (QAbstractItemModel and next generation QListModelInterface)
\endlist
diff --git a/examples/declarative/loader/main.cpp b/examples/declarative/loader/main.cpp
index 68f20d4..fbae5f1 100644
--- a/examples/declarative/loader/main.cpp
+++ b/examples/declarative/loader/main.cpp
@@ -11,12 +11,12 @@
#include <QmlContext>
#include <QmlComponent>
#include <QmlEngine>
-#include <qfxview.h>
+#include <qmlview.h>
#include <QDebug>
#include <QNetworkDiskCache>
#include <QNetworkAccessManager>
-QFxView *canvas = 0;
+QmlView *canvas = 0;
class Logger : public QWidget
{
@@ -181,7 +181,7 @@ int main(int argc, char *argv[])
QObject::connect(Logger::instance(), SIGNAL(textChanged()), launcher, SIGNAL(logUpdated()));
- canvas = new QFxView;
+ canvas = new QmlView;
canvas->setFocusPolicy(Qt::StrongFocus);
canvas->engine()->setNetworkAccessManager(new ConfiguredNetworkAccessManager);
diff --git a/src/declarative/extra/qfxparticles.cpp b/src/declarative/extra/qfxparticles.cpp
index 7855f3e..15e257e 100644
--- a/src/declarative/extra/qfxparticles.cpp
+++ b/src/declarative/extra/qfxparticles.cpp
@@ -603,7 +603,6 @@ QFxParticles::QFxParticles(QFxItem *parent)
{
Q_D(QFxParticles);
d->init();
- setFlag(QGraphicsItem::ItemHasNoContents, false);
}
QFxParticles::QFxParticles(QFxParticlesPrivate &dd, QFxItem *parent)
@@ -611,7 +610,6 @@ QFxParticles::QFxParticles(QFxParticlesPrivate &dd, QFxItem *parent)
{
Q_D(QFxParticles);
d->init();
- setFlag(QGraphicsItem::ItemHasNoContents, false);
}
QFxParticles::~QFxParticles()
diff --git a/src/declarative/fx/qfxborderimage.cpp b/src/declarative/fx/qfxborderimage.cpp
index ee505f2..3bc76da 100644
--- a/src/declarative/fx/qfxborderimage.cpp
+++ b/src/declarative/fx/qfxborderimage.cpp
@@ -65,7 +65,7 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,BorderImage,QFxBorderImage)
/*!
\internal
\class QFxBorderImage BorderImage
- \brief The QFxBorderImage class provides an image item that you can add to a QFxView.
+ \brief The QFxBorderImage class provides an image item that you can add to a QmlView.
*/
QFxBorderImage::QFxBorderImage(QFxItem *parent)
diff --git a/src/declarative/fx/qfximage.cpp b/src/declarative/fx/qfximage.cpp
index 3ac3f3c..860af66 100644
--- a/src/declarative/fx/qfximage.cpp
+++ b/src/declarative/fx/qfximage.cpp
@@ -113,7 +113,7 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Image,QFxImage)
/*!
\internal
\class QFxImage Image
- \brief The QFxImage class provides an image item that you can add to a QFxView.
+ \brief The QFxImage class provides an image item that you can add to a QmlView.
\ingroup group_coreitems
diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp
index 1ca5254..7f4e6b1 100644
--- a/src/declarative/fx/qfxitem.cpp
+++ b/src/declarative/fx/qfxitem.cpp
@@ -56,7 +56,7 @@
#include "qmlstate.h"
#include "qlistmodelinterface.h"
-#include "qfxview.h"
+#include "qmlview.h"
#include "qmlstategroup.h"
#include "qfxitem_p.h"
@@ -1216,7 +1216,7 @@ QFxKeysAttached *QFxKeysAttached::qmlAttachedProperties(QObject *obj)
/*!
\class QFxItem Item
- \brief The QFxItem class is a generic QFxView item. It is the base class for all other view items.
+ \brief The QFxItem class is a generic QmlView item. It is the base class for all other view items.
\qmltext
All visual items in Qt Declarative inherit from QFxItem. Although QFxItem
diff --git a/src/declarative/fx/qfxpainteditem.cpp b/src/declarative/fx/qfxpainteditem.cpp
index 5471e1b..1ed44a9 100644
--- a/src/declarative/fx/qfxpainteditem.cpp
+++ b/src/declarative/fx/qfxpainteditem.cpp
@@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QFxPaintedItem
- \brief The QFxPaintedItem class is an abstract base class for QFxView items that want cached painting.
+ \brief The QFxPaintedItem class is an abstract base class for QmlView items that want cached painting.
\ingroup group_coreitems
This is a convenience class for implementing items that paint their contents
diff --git a/src/declarative/fx/qfxrect.cpp b/src/declarative/fx/qfxrect.cpp
index 7d6340f..1a41b5d 100644
--- a/src/declarative/fx/qfxrect.cpp
+++ b/src/declarative/fx/qfxrect.cpp
@@ -52,7 +52,7 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Gradient,QFxGradient)
/*!
\internal
\class QFxPen
- \brief The QFxPen class provides a pen used for drawing rectangle borders on a QFxView.
+ \brief The QFxPen class provides a pen used for drawing rectangle borders on a QmlView.
By default, the pen is invalid and nothing is drawn. You must either set a color (then the default
width is 1) or a width (then the default color is black).
@@ -175,7 +175,7 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Rectangle,QFxRect)
/*!
\internal
\class QFxRect
- \brief The QFxRect class provides a rectangle item that you can add to a QFxView.
+ \brief The QFxRect class provides a rectangle item that you can add to a QmlView.
*/
QFxRect::QFxRect(QFxItem *parent)
: QFxItem(*(new QFxRectPrivate), parent)
diff --git a/src/declarative/fx/qfxtext.cpp b/src/declarative/fx/qfxtext.cpp
index a76b8e6..7c7b3b0 100644
--- a/src/declarative/fx/qfxtext.cpp
+++ b/src/declarative/fx/qfxtext.cpp
@@ -84,7 +84,7 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Text,QFxText)
\qmlclass Text
\ingroup group_coreitems
- \brief The QFxText class provides a formatted text item that you can add to a QFxView.
+ \brief The QFxText class provides a formatted text item that you can add to a QmlView.
Text was designed for read-only text; it does not allow for any text editing.
It can display both plain and rich text. For example:
diff --git a/src/declarative/fx/qfxtextedit.cpp b/src/declarative/fx/qfxtextedit.cpp
index d1bafd6..8094d32 100644
--- a/src/declarative/fx/qfxtextedit.cpp
+++ b/src/declarative/fx/qfxtextedit.cpp
@@ -84,7 +84,7 @@ TextEdit {
\qmlclass TextEdit
\ingroup group_coreitems
- \brief The QFxTextEdit class provides an editable formatted text item that you can add to a QFxView.
+ \brief The QFxTextEdit class provides an editable formatted text item that you can add to a QmlView.
It can display both plain and rich text.
diff --git a/src/declarative/fx/qfxwebview.cpp b/src/declarative/fx/qfxwebview.cpp
index bcbedfb..a06e294 100644
--- a/src/declarative/fx/qfxwebview.cpp
+++ b/src/declarative/fx/qfxwebview.cpp
@@ -241,7 +241,7 @@ public:
/*!
\internal
\class QFxWebView
- \brief The QFxWebView class allows you to add web content to a QFxView.
+ \brief The QFxWebView class allows you to add web content to a QmlView.
A WebView renders web content base on a URL.
diff --git a/src/declarative/util/qfxview.cpp b/src/declarative/util/qmlview.cpp
index f67dc75..7cce2da 100644
--- a/src/declarative/util/qfxview.cpp
+++ b/src/declarative/util/qmlview.cpp
@@ -56,7 +56,7 @@
#include "private/qperformancelog_p.h"
#include "private/qfxperf_p.h"
-#include "qfxview.h"
+#include "qmlview.h"
#include <QtDeclarative/qmlengine.h>
#include <QtDeclarative/qmlcontext.h>
#include <QtDeclarative/qmldebug.h>
@@ -67,11 +67,11 @@ QT_BEGIN_NAMESPACE
DEFINE_BOOL_CONFIG_OPTION(frameRateDebug, QML_SHOW_FRAMERATE)
-class QFxViewDebugServer;
+class QmlViewDebugServer;
class FrameBreakAnimation : public QAbstractAnimation
{
public:
- FrameBreakAnimation(QFxViewDebugServer *s)
+ FrameBreakAnimation(QmlViewDebugServer *s)
: QAbstractAnimation((QObject*)s), server(s)
{
start();
@@ -81,13 +81,13 @@ public:
virtual void updateCurrentTime(int msecs);
private:
- QFxViewDebugServer *server;
+ QmlViewDebugServer *server;
};
-class QFxViewDebugServer : public QmlDebugService
+class QmlViewDebugServer : public QmlDebugService
{
public:
- QFxViewDebugServer(QObject *parent = 0) : QmlDebugService(QLatin1String("CanvasFrameRate"), parent), breaks(0)
+ QmlViewDebugServer(QObject *parent = 0) : QmlDebugService(QLatin1String("CanvasFrameRate"), parent), breaks(0)
{
timer.start();
new FrameBreakAnimation(this);
@@ -103,7 +103,7 @@ public:
int e = timer.elapsed();
QByteArray data;
QDataStream ds(&data, QIODevice::WriteOnly);
- ds << (int)pe << (int)pe << (int)tbf << (int)e
+ ds << (int)pe << (int)tbf << (int)e
<< (bool)isFrameBreak;
sendMessage(data);
}
@@ -115,7 +115,7 @@ private:
int breaks;
};
-Q_GLOBAL_STATIC(QFxViewDebugServer, qfxViewDebugServer);
+Q_GLOBAL_STATIC(QmlViewDebugServer, qfxViewDebugServer);
void FrameBreakAnimation::updateCurrentTime(int msecs)
{
@@ -129,13 +129,13 @@ static QVariant stringToKeySequence(const QString &str)
return QVariant::fromValue(QKeySequence(str));
}
-class QFxViewPrivate
+class QmlViewPrivate
{
public:
- QFxViewPrivate(QFxView *w)
+ QmlViewPrivate(QmlView *w)
: q(w), root(0), component(0), resizable(false) {}
- QFxView *q;
+ QmlView *q;
QFxItem *root;
QUrl source;
@@ -155,16 +155,16 @@ public:
};
/*!
- \class QFxView
- \brief The QFxView class provides a widget for displaying a Qt Declarative user interface.
+ \class QmlView
+ \brief The QmlView class provides a widget for displaying a Qt Declarative user interface.
- QFxView currently provides a minimal interface for displaying QML
+ QmlView currently provides a minimal interface for displaying QML
files, and connecting between QML and C++ Qt objects.
Typical usage:
\code
...
- QFxView *view = new QFxView(this);
+ QmlView *view = new QmlView(this);
vbox->addWidget(view);
QUrl url(fileName);
@@ -176,18 +176,18 @@ public:
*/
/*!
- \fn QFxView::QFxView(QWidget *parent)
+ \fn QmlView::QmlView(QWidget *parent)
- Constructs a QFxView with the given \a parent.
+ Constructs a QmlView with the given \a parent.
*/
-QFxView::QFxView(QWidget *parent)
-: QGraphicsView(parent), d(new QFxViewPrivate(this))
+QmlView::QmlView(QWidget *parent)
+: QGraphicsView(parent), d(new QmlViewPrivate(this))
{
setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
d->init();
}
-void QFxViewPrivate::init()
+void QmlViewPrivate::init()
{
// XXX: These need to be put in a central location for this kind of thing
QmlMetaType::registerCustomStringConverter(QVariant::KeySequence, &stringToKeySequence);
@@ -218,7 +218,7 @@ void QFxViewPrivate::init()
\sa clearItems()
*/
-QFxView::~QFxView()
+QmlView::~QmlView()
{
clearItems();
delete d; d = 0;
@@ -228,7 +228,7 @@ QFxView::~QFxView()
Sets the source to the \a url. The QML string is set to
empty.
*/
-void QFxView::setUrl(const QUrl& url)
+void QmlView::setUrl(const QUrl& url)
{
d->source = url;
d->qml = QString();
@@ -238,7 +238,7 @@ void QFxView::setUrl(const QUrl& url)
Sets the source to the URL from the \a filename, and sets
the QML string to \a qml.
*/
-void QFxView::setQml(const QString &qml, const QString &filename)
+void QmlView::setQml(const QString &qml, const QString &filename)
{
d->source = QUrl::fromLocalFile(filename);
d->qml = qml;
@@ -247,7 +247,7 @@ void QFxView::setQml(const QString &qml, const QString &filename)
/*!
Returns the QML string.
*/
-QString QFxView::qml() const
+QString QmlView::qml() const
{
return d->qml;
}
@@ -256,7 +256,7 @@ QString QFxView::qml() const
Returns a pointer to the QmlEngine used for instantiating
QML Components.
*/
-QmlEngine* QFxView::engine()
+QmlEngine* QmlView::engine()
{
return &d->engine;
}
@@ -268,7 +268,7 @@ QmlEngine* QFxView::engine()
arranged hierarchically and this hierarchy is managed by the
QmlEngine.
*/
-QmlContext* QFxView::rootContext()
+QmlContext* QmlView::rootContext()
{
return d->engine.rootContext();
}
@@ -276,7 +276,7 @@ QmlContext* QFxView::rootContext()
/*!
Displays the Qt Declarative user interface.
*/
-void QFxView::execute()
+void QmlView::execute()
{
if (d->qml.isEmpty()) {
d->component = new QmlComponent(&d->engine, d->source, this);
@@ -295,7 +295,7 @@ void QFxView::execute()
/*!
\internal
*/
-void QFxView::continueExecute()
+void QmlView::continueExecute()
{
disconnect(d->component, SIGNAL(statusChanged(QmlComponent::Status)), this, SLOT(continueExecute()));
@@ -366,18 +366,18 @@ void QFxView::continueExecute()
}
}
-/*! \fn void QFxView::sceneResized(QSize size)
+/*! \fn void QmlView::sceneResized(QSize size)
This signal is emitted when the view is resized to \a size.
*/
-/*! \fn void QFxView::errors(const QList<QmlError> &errors)
+/*! \fn void QmlView::errors(const QList<QmlError> &errors)
This signal is emitted when the qml loaded contains \a errors.
*/
/*!
\internal
*/
-void QFxView::sizeChanged()
+void QmlView::sizeChanged()
{
// delay, so we catch both width and height changing.
d->resizetimer.start(0,this);
@@ -387,7 +387,7 @@ void QFxView::sizeChanged()
If the \l {QTimerEvent} {timer event} \a e is this
view's resize timer, sceneResized() is emitted.
*/
-void QFxView::timerEvent(QTimerEvent* e)
+void QmlView::timerEvent(QTimerEvent* e)
{
if (!e || e->timerId() == d->resizetimer.timerId()) {
if (d->root) {
@@ -403,7 +403,7 @@ void QFxView::timerEvent(QTimerEvent* e)
// modelled on QScrollArea::widgetResizable
/*!
- \property QFxView::contentResizable
+ \property QmlView::contentResizable
\brief whether the view should resize the canvas contents
If this property is set to false (the default), the view
@@ -416,7 +416,7 @@ void QFxView::timerEvent(QTimerEvent* e)
is the initial size of the root item.
*/
-void QFxView::setContentResizable(bool on)
+void QmlView::setContentResizable(bool on)
{
if (d->resizable != on) {
d->resizable = on;
@@ -432,7 +432,7 @@ void QFxView::setContentResizable(bool on)
}
}
-bool QFxView::contentResizable() const
+bool QmlView::contentResizable() const
{
return d->resizable;
}
@@ -441,7 +441,7 @@ bool QFxView::contentResizable() const
/*!
The size hint is the size of the root item.
*/
-QSize QFxView::sizeHint() const
+QSize QmlView::sizeHint() const
{
if (d->root) {
if (d->initialSize.width() <= 0)
@@ -458,7 +458,7 @@ QSize QFxView::sizeHint() const
\a parent item is provided, it becomes the new item's
parent. \a parent should be in this view's item hierarchy.
*/
-QFxItem* QFxView::addItem(const QString &qml, QFxItem* parent)
+QFxItem* QmlView::addItem(const QString &qml, QFxItem* parent)
{
if (!d->root)
return 0;
@@ -500,7 +500,7 @@ QFxItem* QFxView::addItem(const QString &qml, QFxItem* parent)
Deletes the view's \l {QFxItem} {items} and the \l {QmlEngine}
{QML engine's} Component cache.
*/
-void QFxView::reset()
+void QmlView::reset()
{
clearItems();
d->engine.clearComponentCache();
@@ -510,7 +510,7 @@ void QFxView::reset()
/*!
Deletes the view's \l {QFxItem} {items}.
*/
-void QFxView::clearItems()
+void QmlView::clearItems()
{
if (!d->root)
return;
@@ -521,7 +521,7 @@ void QFxView::clearItems()
/*!
Returns the view's root \l {QFxItem} {item}.
*/
-QFxItem *QFxView::root() const
+QFxItem *QmlView::root() const
{
return d->root;
}
@@ -530,7 +530,7 @@ QFxItem *QFxView::root() const
This function handles the \l {QResizeEvent} {resize event}
\a e.
*/
-void QFxView::resizeEvent(QResizeEvent *e)
+void QmlView::resizeEvent(QResizeEvent *e)
{
if (d->resizable && d->root) {
d->root->setWidth(width());
@@ -543,34 +543,34 @@ void QFxView::resizeEvent(QResizeEvent *e)
/*!
\reimp
*/
-void QFxView::paintEvent(QPaintEvent *event)
+void QmlView::paintEvent(QPaintEvent *event)
{
int time = 0;
- if (frameRateDebug() || QFxViewDebugServer::isDebuggingEnabled())
+ if (frameRateDebug() || QmlViewDebugServer::isDebuggingEnabled())
time = d->frameTimer.restart();
QGraphicsView::paintEvent(event);
- if (QFxViewDebugServer::isDebuggingEnabled())
+ if (QmlViewDebugServer::isDebuggingEnabled())
qfxViewDebugServer()->addTiming(d->frameTimer.elapsed(), time);
if (frameRateDebug())
qDebug() << "paintEvent:" << d->frameTimer.elapsed() << "time since last frame:" << time;
}
-/*! \fn void QFxView::focusInEvent(QFocusEvent *e)
+/*! \fn void QmlView::focusInEvent(QFocusEvent *e)
This virtual function does nothing with the event \a e
in this class.
*/
-void QFxView::focusInEvent(QFocusEvent *e)
+void QmlView::focusInEvent(QFocusEvent *e)
{
// Do nothing (do not call QWidget::update())
QGraphicsView::focusInEvent(e);
}
-/*! \fn void QFxView::focusOutEvent(QFocusEvent *e)
+/*! \fn void QmlView::focusOutEvent(QFocusEvent *e)
This virtual function does nothing with the event \a e
in this class.
*/
-void QFxView::focusOutEvent(QFocusEvent *e)
+void QmlView::focusOutEvent(QFocusEvent *e)
{
// Do nothing (do not call QWidget::update())
QGraphicsView::focusOutEvent(e);
diff --git a/src/declarative/util/qfxview.h b/src/declarative/util/qmlview.h
index 25e2997..b54101f 100644
--- a/src/declarative/util/qfxview.h
+++ b/src/declarative/util/qmlview.h
@@ -59,15 +59,15 @@ class QmlEngine;
class QmlContext;
class QmlError;
-class QFxViewPrivate;
-class Q_DECLARATIVE_EXPORT QFxView : public QGraphicsView
+class QmlViewPrivate;
+class Q_DECLARATIVE_EXPORT QmlView : public QGraphicsView
{
Q_OBJECT
Q_PROPERTY(bool contentResizable READ contentResizable WRITE setContentResizable)
public:
- explicit QFxView(QWidget *parent = 0);
+ explicit QmlView(QWidget *parent = 0);
- virtual ~QFxView();
+ virtual ~QmlView();
void setUrl(const QUrl&);
void setQml(const QString &qml, const QString &filename=QString());
@@ -102,8 +102,8 @@ protected:
void timerEvent(QTimerEvent*);
private:
- friend class QFxViewPrivate;
- QFxViewPrivate *d;
+ friend class QmlViewPrivate;
+ QmlViewPrivate *d;
};
QT_END_NAMESPACE
diff --git a/src/declarative/util/util.pri b/src/declarative/util/util.pri
index 442380a..41c9019 100644
--- a/src/declarative/util/util.pri
+++ b/src/declarative/util/util.pri
@@ -1,5 +1,5 @@
SOURCES += \
- util/qfxview.cpp \
+ util/qmlview.cpp \
util/qfxperf.cpp \
util/qperformancelog.cpp \
util/qmlconnection.cpp \
@@ -23,7 +23,7 @@ SOURCES += \
util/qmlbind.cpp
HEADERS += \
- util/qfxview.h \
+ util/qmlview.h \
util/qfxperf_p.h \
util/qfxglobal.h \
util/qperformancelog_p.h \
diff --git a/tests/auto/declarative/anchors/tst_anchors.cpp b/tests/auto/declarative/anchors/tst_anchors.cpp
index 98ede65..a8b119c 100644
--- a/tests/auto/declarative/anchors/tst_anchors.cpp
+++ b/tests/auto/declarative/anchors/tst_anchors.cpp
@@ -1,7 +1,7 @@
#include <qtest.h>
#include <QtDeclarative/qmlengine.h>
#include <QtDeclarative/qmlcomponent.h>
-#include <QtDeclarative/qfxview.h>
+#include <QtDeclarative/qmlview.h>
#include <QtDeclarative/qfxrect.h>
class tst_anchors : public QObject
@@ -43,7 +43,7 @@ T *tst_anchors::findItem(QFxItem *parent, const QString &objectName)
void tst_anchors::basicAnchors()
{
- QFxView *view = new QFxView;
+ QmlView *view = new QmlView;
view->setUrl(QUrl("file://" SRCDIR "/data/anchors.qml"));
view->execute();
@@ -93,7 +93,7 @@ void tst_anchors::basicAnchors()
void tst_anchors::loops()
{
{
- QFxView *view = new QFxView;
+ QmlView *view = new QmlView;
view->setUrl(QUrl("file://" SRCDIR "/data/loop1.qml"));
@@ -105,7 +105,7 @@ void tst_anchors::loops()
}
{
- QFxView *view = new QFxView;
+ QmlView *view = new QmlView;
view->setUrl(QUrl("file://" SRCDIR "/data/loop2.qml"));
@@ -120,7 +120,7 @@ void tst_anchors::loops()
void tst_anchors::illegalSets()
{
{
- QFxView *view = new QFxView;
+ QmlView *view = new QmlView;
view->setUrl(QUrl("file://" SRCDIR "/data/illegal1.qml"));
@@ -132,7 +132,7 @@ void tst_anchors::illegalSets()
}
{
- QFxView *view = new QFxView;
+ QmlView *view = new QmlView;
view->setUrl(QUrl("file://" SRCDIR "/data/illegal2.qml"));
@@ -144,7 +144,7 @@ void tst_anchors::illegalSets()
}
{
- QFxView *view = new QFxView;
+ QmlView *view = new QmlView;
view->setUrl(QUrl("file://" SRCDIR "/data/illegal3.qml"));
diff --git a/tests/auto/declarative/animations/tst_animations.cpp b/tests/auto/declarative/animations/tst_animations.cpp
index 8e1abc6..f627527 100644
--- a/tests/auto/declarative/animations/tst_animations.cpp
+++ b/tests/auto/declarative/animations/tst_animations.cpp
@@ -1,7 +1,7 @@
#include <qtest.h>
#include <QtDeclarative/qmlengine.h>
#include <QtDeclarative/qmlcomponent.h>
-#include <QtDeclarative/qfxview.h>
+#include <QtDeclarative/qmlview.h>
#include <QtDeclarative/qfxrect.h>
#include <QtDeclarative/QmlNumberAnimation>
@@ -97,7 +97,7 @@ void tst_animations::badTypes()
{
//don't crash
{
- QFxView *view = new QFxView;
+ QmlView *view = new QmlView;
view->setUrl(QUrl("file://" SRCDIR "/data/badtype1.qml"));
view->execute();
diff --git a/tests/auto/declarative/layouts/tst_layouts.cpp b/tests/auto/declarative/layouts/tst_layouts.cpp
index 3416b2e..d1e6aab 100644
--- a/tests/auto/declarative/layouts/tst_layouts.cpp
+++ b/tests/auto/declarative/layouts/tst_layouts.cpp
@@ -1,6 +1,6 @@
#include <QtTest/QtTest>
#include <qlistmodelinterface.h>
-#include <qfxview.h>
+#include <qmlview.h>
#include <qfxrect.h>
#include <qmlexpression.h>
@@ -19,7 +19,7 @@ private slots:
void test_grid_spacing();
private:
- QFxView *createView(const QString &filename);
+ QmlView *createView(const QString &filename);
};
tst_QFxLayouts::tst_QFxLayouts()
@@ -28,7 +28,7 @@ tst_QFxLayouts::tst_QFxLayouts()
void tst_QFxLayouts::test_horizontal()
{
- QFxView *canvas = createView(SRCDIR "/data/horizontal.qml");
+ QmlView *canvas = createView(SRCDIR "/data/horizontal.qml");
canvas->execute();
qApp->processEvents();
@@ -52,7 +52,7 @@ void tst_QFxLayouts::test_horizontal()
void tst_QFxLayouts::test_horizontal_spacing()
{
- QFxView *canvas = createView(SRCDIR "/data/horizontal-spacing.qml");
+ QmlView *canvas = createView(SRCDIR "/data/horizontal-spacing.qml");
canvas->execute();
qApp->processEvents();
@@ -76,7 +76,7 @@ void tst_QFxLayouts::test_horizontal_spacing()
void tst_QFxLayouts::test_vertical()
{
- QFxView *canvas = createView(SRCDIR "/data/vertical.qml");
+ QmlView *canvas = createView(SRCDIR "/data/vertical.qml");
canvas->execute();
qApp->processEvents();
@@ -100,7 +100,7 @@ void tst_QFxLayouts::test_vertical()
void tst_QFxLayouts::test_vertical_spacing()
{
- QFxView *canvas = createView(SRCDIR "/data/vertical-spacing.qml");
+ QmlView *canvas = createView(SRCDIR "/data/vertical-spacing.qml");
canvas->execute();
qApp->processEvents();
@@ -124,7 +124,7 @@ void tst_QFxLayouts::test_vertical_spacing()
void tst_QFxLayouts::test_grid()
{
- QFxView *canvas = createView("data/grid.qml");
+ QmlView *canvas = createView("data/grid.qml");
canvas->execute();
qApp->processEvents();
@@ -154,7 +154,7 @@ void tst_QFxLayouts::test_grid()
void tst_QFxLayouts::test_grid_spacing()
{
- QFxView *canvas = createView("data/grid-spacing.qml");
+ QmlView *canvas = createView("data/grid-spacing.qml");
canvas->execute();
qApp->processEvents();
@@ -182,9 +182,9 @@ void tst_QFxLayouts::test_grid_spacing()
QCOMPARE(five->y(), 54.0);
}
-QFxView *tst_QFxLayouts::createView(const QString &filename)
+QmlView *tst_QFxLayouts::createView(const QString &filename)
{
- QFxView *canvas = new QFxView(0);
+ QmlView *canvas = new QmlView(0);
QFile file(filename);
file.open(QFile::ReadOnly);
diff --git a/tests/auto/declarative/listview/tst_listview.cpp b/tests/auto/declarative/listview/tst_listview.cpp
index ebc3053..19d324d 100644
--- a/tests/auto/declarative/listview/tst_listview.cpp
+++ b/tests/auto/declarative/listview/tst_listview.cpp
@@ -1,6 +1,6 @@
#include <QtTest/QtTest>
#include <qlistmodelinterface.h>
-#include <qfxview.h>
+#include <qmlview.h>
#include <qfxlistview.h>
#include <qfxtext.h>
#include <qmlcontext.h>
@@ -31,7 +31,7 @@ private:
template <class T> void changed();
template <class T> void inserted();
template <class T> void removed();
- QFxView *createView(const QString &filename);
+ QmlView *createView(const QString &filename);
template<typename T>
T *findItem(QFxItem *parent, const QString &id, int index=0);
};
@@ -169,7 +169,7 @@ tst_QFxListView::tst_QFxListView()
template <class T>
void tst_QFxListView::items()
{
- QFxView *canvas = createView(SRCDIR "/data/listview.qml");
+ QmlView *canvas = createView(SRCDIR "/data/listview.qml");
T model;
model.addItem("Fred", "12345");
@@ -205,7 +205,7 @@ void tst_QFxListView::items()
template <class T>
void tst_QFxListView::changed()
{
- QFxView *canvas = createView(SRCDIR "/data/listview.qml");
+ QmlView *canvas = createView(SRCDIR "/data/listview.qml");
T model;
model.addItem("Fred", "12345");
@@ -238,7 +238,7 @@ void tst_QFxListView::changed()
template <class T>
void tst_QFxListView::inserted()
{
- QFxView *canvas = createView(SRCDIR "/data/listview.qml");
+ QmlView *canvas = createView(SRCDIR "/data/listview.qml");
T model;
model.addItem("Fred", "12345");
@@ -305,7 +305,7 @@ void tst_QFxListView::inserted()
template <class T>
void tst_QFxListView::removed()
{
- QFxView *canvas = createView(SRCDIR "/data/listview.qml");
+ QmlView *canvas = createView(SRCDIR "/data/listview.qml");
T model;
for (int i = 0; i < 30; i++)
@@ -438,9 +438,9 @@ void tst_QFxListView::qAbstractItemModel_removed()
removed<TestModel2>();
}
-QFxView *tst_QFxListView::createView(const QString &filename)
+QmlView *tst_QFxListView::createView(const QString &filename)
{
- QFxView *canvas = new QFxView(0);
+ QmlView *canvas = new QmlView(0);
canvas->setFixedSize(240,320);
QFile file(filename);
diff --git a/tests/auto/declarative/pathview/tst_pathview.cpp b/tests/auto/declarative/pathview/tst_pathview.cpp
index 2933323..e2da191 100644
--- a/tests/auto/declarative/pathview/tst_pathview.cpp
+++ b/tests/auto/declarative/pathview/tst_pathview.cpp
@@ -1,6 +1,6 @@
#include <QtTest/QtTest>
#include <qlistmodelinterface.h>
-#include <qfxview.h>
+#include <qmlview.h>
#include <qfxpathview.h>
#include <qfxtext.h>
#include <qfxrect.h>
@@ -19,7 +19,7 @@ private slots:
void limitedItems();
private:
- QFxView *createView(const QString &filename);
+ QmlView *createView(const QString &filename);
template<typename T>
T *findItem(QFxItem *parent, const QString &id, int index=0);
};
@@ -101,7 +101,7 @@ tst_QFxPathView::tst_QFxPathView()
void tst_QFxPathView::items()
{
- QFxView *canvas = createView(SRCDIR "/data/pathview.qml");
+ QmlView *canvas = createView(SRCDIR "/data/pathview.qml");
TestModel model;
model.addItem("Fred", "12345");
@@ -133,7 +133,7 @@ void tst_QFxPathView::items()
void tst_QFxPathView::pathMoved()
{
- QFxView *canvas = createView(SRCDIR "/data/pathview.qml");
+ QmlView *canvas = createView(SRCDIR "/data/pathview.qml");
TestModel model;
model.addItem("Ben", "12345");
@@ -176,7 +176,7 @@ void tst_QFxPathView::pathMoved()
void tst_QFxPathView::limitedItems()
{
- QFxView *canvas = createView(SRCDIR "/data/pathview.qml");
+ QmlView *canvas = createView(SRCDIR "/data/pathview.qml");
TestModel model;
for(int i=0; i<100; i++)
@@ -213,9 +213,9 @@ void tst_QFxPathView::limitedItems()
QVERIFY(testItem != 0);
}
-QFxView *tst_QFxPathView::createView(const QString &filename)
+QmlView *tst_QFxPathView::createView(const QString &filename)
{
- QFxView *canvas = new QFxView(0);
+ QmlView *canvas = new QmlView(0);
canvas->setFixedSize(240,320);
QFile file(filename);
diff --git a/tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp b/tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp
index c4fc506..ffbb09b 100644
--- a/tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp
+++ b/tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp
@@ -424,10 +424,10 @@ void tst_qfxtextedit::selection()
QVERIFY(textEditObject->selectedText().size() == 10);
}
-#include <QFxView>
+#include <QmlView>
void tst_qfxtextedit::cursorDelegate()
{
- QFxView* view = new QFxView(0);
+ QmlView* view = new QmlView(0);
view->show();
view->setUrl(QUrl("data/cursorTest.qml"));
view->execute();
diff --git a/tests/auto/declarative/qfxtextinput/tst_qfxtextinput.cpp b/tests/auto/declarative/qfxtextinput/tst_qfxtextinput.cpp
index c883aa3..13a301d 100644
--- a/tests/auto/declarative/qfxtextinput/tst_qfxtextinput.cpp
+++ b/tests/auto/declarative/qfxtextinput/tst_qfxtextinput.cpp
@@ -2,7 +2,7 @@
#include "../../../shared/util.h"
#include <QtDeclarative/qmlengine.h>
#include <QFile>
-#include <QtDeclarative/qfxview.h>
+#include <QtDeclarative/qmlview.h>
#include <QFxTextInput>
#include <QDebug>
@@ -28,8 +28,8 @@ private slots:
void navigation();
private:
- void simulateKey(QFxView *, int key);
- QFxView *createView(const QString &filename);
+ void simulateKey(QmlView *, int key);
+ QmlView *createView(const QString &filename);
QmlEngine engine;
QStringList standard;
@@ -268,7 +268,7 @@ void tst_qfxtextinput::selection()
void tst_qfxtextinput::maxLength()
{
- QFxView *canvas = createView(SRCDIR "/data/navigation.qml");
+ QmlView *canvas = createView(SRCDIR "/data/navigation.qml");
canvas->execute();
canvas->show();
@@ -282,7 +282,7 @@ void tst_qfxtextinput::maxLength()
void tst_qfxtextinput::masks()
{
- QFxView *canvas = createView(SRCDIR "/data/navigation.qml");
+ QmlView *canvas = createView(SRCDIR "/data/navigation.qml");
canvas->execute();
canvas->show();
@@ -296,7 +296,7 @@ void tst_qfxtextinput::masks()
void tst_qfxtextinput::validators()
{
- QFxView *canvas = createView(SRCDIR "/data/navigation.qml");
+ QmlView *canvas = createView(SRCDIR "/data/navigation.qml");
canvas->execute();
canvas->show();
@@ -314,7 +314,7 @@ the extent of the text, then they should ignore the keys.
*/
void tst_qfxtextinput::navigation()
{
- QFxView *canvas = createView(SRCDIR "/data/navigation.qml");
+ QmlView *canvas = createView(SRCDIR "/data/navigation.qml");
canvas->execute();
canvas->show();
@@ -339,7 +339,7 @@ void tst_qfxtextinput::cursorDelegate()
//TODO:Get the QFxTextInput test passing first
}
-void tst_qfxtextinput::simulateKey(QFxView *view, int key)
+void tst_qfxtextinput::simulateKey(QmlView *view, int key)
{
QKeyEvent press(QKeyEvent::KeyPress, key, 0);
QKeyEvent release(QKeyEvent::KeyRelease, key, 0);
@@ -348,9 +348,9 @@ void tst_qfxtextinput::simulateKey(QFxView *view, int key)
QApplication::sendEvent(view, &release);
}
-QFxView *tst_qfxtextinput::createView(const QString &filename)
+QmlView *tst_qfxtextinput::createView(const QString &filename)
{
- QFxView *canvas = new QFxView(0);
+ QmlView *canvas = new QmlView(0);
QFile file(filename);
file.open(QFile::ReadOnly);
diff --git a/tests/auto/declarative/repeater/tst_repeater.cpp b/tests/auto/declarative/repeater/tst_repeater.cpp
index 08f9154..5fce70e 100644
--- a/tests/auto/declarative/repeater/tst_repeater.cpp
+++ b/tests/auto/declarative/repeater/tst_repeater.cpp
@@ -1,6 +1,6 @@
#include <QtTest/QtTest>
#include <qlistmodelinterface.h>
-#include <qfxview.h>
+#include <qmlview.h>
#include <qfxrepeater.h>
#include <qfxtext.h>
#include <qmlcontext.h>
@@ -15,7 +15,7 @@ private slots:
void stringList();
private:
- QFxView *createView(const QString &filename);
+ QmlView *createView(const QString &filename);
template<typename T>
T *findItem(QObject *parent, const QString &id);
};
@@ -26,7 +26,7 @@ tst_QFxRepeater::tst_QFxRepeater()
void tst_QFxRepeater::stringList()
{
- QFxView *canvas = createView(SRCDIR "/data/repeater.qml");
+ QmlView *canvas = createView(SRCDIR "/data/repeater.qml");
QStringList data;
data << "One";
@@ -58,9 +58,9 @@ void tst_QFxRepeater::stringList()
}
-QFxView *tst_QFxRepeater::createView(const QString &filename)
+QmlView *tst_QFxRepeater::createView(const QString &filename)
{
- QFxView *canvas = new QFxView(0);
+ QmlView *canvas = new QmlView(0);
canvas->setFixedSize(240,320);
QFile file(filename);
diff --git a/tests/auto/declarative/visual/tst_visual.cpp b/tests/auto/declarative/visual/tst_visual.cpp
index f540e62..10823e8 100644
--- a/tests/auto/declarative/visual/tst_visual.cpp
+++ b/tests/auto/declarative/visual/tst_visual.cpp
@@ -1,5 +1,5 @@
#include <qtest.h>
-#include <QFxView>
+#include <QmlView>
#include <QApplication>
#include <QFxTestView>
#include <QFile>
diff --git a/tools/qmldebugger/canvasframerate.cpp b/tools/qmldebugger/canvasframerate.cpp
index ae514a5..0d23050 100644
--- a/tools/qmldebugger/canvasframerate.cpp
+++ b/tools/qmldebugger/canvasframerate.cpp
@@ -13,6 +13,8 @@
#include <QPushButton>
#include <QLineEdit>
#include <QCheckBox>
+#include <QSpinBox>
+#include <QLabel>
QT_BEGIN_NAMESPACE
@@ -26,6 +28,7 @@ public:
public slots:
void addSample(int, int, int, bool);
+ void setResolutionForHeight(int);
protected:
virtual void paintEvent(QPaintEvent *);
@@ -153,7 +156,7 @@ void QLineGraph::drawSample(QPainter *p, int s, const QRect &rect)
first = qMax(0, _samples.count() - samplesPerWidth - 1);
int last = qMin(_samples.count() - 1, first + samplesPerWidth);
- qreal scaleY = rect.height() / resolutionForHeight;
+ qreal scaleY = qreal(rect.height()) / resolutionForHeight;
qreal scaleX = qreal(rect.width()) / qreal(samplesPerWidth);
int xEnd;
@@ -205,6 +208,12 @@ void QLineGraph::paintEvent(QPaintEvent *)
drawTime(&p, r);
}
+void QLineGraph::setResolutionForHeight(int resolution)
+{
+ resolutionForHeight = resolution;
+ update();
+}
+
class CanvasFrameRatePlugin : public QmlDebugClient
{
Q_OBJECT
@@ -256,7 +265,18 @@ CanvasFrameRate::CanvasFrameRate(QmlDebugConnection *client, QWidget *parent)
layout->addWidget(m_tabs);
QHBoxLayout *bottom = new QHBoxLayout;
+ bottom->setSpacing(5);
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);
+
bottom->addStretch(2);
QCheckBox *check = new QCheckBox("Enable", this);
@@ -284,6 +304,7 @@ void CanvasFrameRate::newTab()
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)));
QString name = QLatin1String("Graph ") + QString::number(id);
m_tabs->addTab(graph, name);
diff --git a/tools/qmldebugger/canvasframerate.h b/tools/qmldebugger/canvasframerate.h
index 912412b..cef267d 100644
--- a/tools/qmldebugger/canvasframerate.h
+++ b/tools/qmldebugger/canvasframerate.h
@@ -7,6 +7,7 @@ QT_BEGIN_NAMESPACE
class QmlDebugConnection;
class QTabWidget;
+class QSpinBox;
class CanvasFrameRate : public QWidget
{
Q_OBJECT
@@ -19,6 +20,7 @@ private slots:
private:
QTabWidget *m_tabs;
+ QSpinBox *m_spin;
QObject *m_plugin;
};
diff --git a/tools/qmldebugger/engine.cpp b/tools/qmldebugger/engine.cpp
index 1f4bcc2..6e163e6 100644
--- a/tools/qmldebugger/engine.cpp
+++ b/tools/qmldebugger/engine.cpp
@@ -43,7 +43,7 @@ EnginePane::EnginePane(QmlDebugConnection *client, QWidget *parent)
enginesFile.open(QFile::ReadOnly);
Q_ASSERT(enginesFile.isOpen());
- m_engineView = new QFxView(this);
+ m_engineView = new QmlView(this);
m_engineView->rootContext()->setContextProperty("engines", qVariantFromValue(&m_engineItems));
m_engineView->setContentResizable(true);
m_engineView->setQml(enginesFile.readAll());
diff --git a/tools/qmldebugger/engine.h b/tools/qmldebugger/engine.h
index 52f0608..5ef28ae 100644
--- a/tools/qmldebugger/engine.h
+++ b/tools/qmldebugger/engine.h
@@ -4,7 +4,7 @@
#include <QWidget>
#include <QtDeclarative/qmlengine.h>
#include <QtDeclarative/qmlcontext.h>
-#include <QtDeclarative/qfxview.h>
+#include <QtDeclarative/qmlview.h>
#include <QtDeclarative/qmldebug.h>
QT_BEGIN_NAMESPACE
@@ -51,7 +51,7 @@ private:
QTreeWidget *m_objTree;
QTableWidget *m_propTable;
- QFxView *m_engineView;
+ QmlView *m_engineView;
QList<QObject *> m_engineItems;
};
diff --git a/tools/qmlviewer/qfxtester.cpp b/tools/qmlviewer/qfxtester.cpp
index 3732aaf..d4802f6 100644
--- a/tools/qmlviewer/qfxtester.cpp
+++ b/tools/qmlviewer/qfxtester.cpp
@@ -14,7 +14,7 @@
#include <qfxtester.h>
#include <QDebug>
#include <QApplication>
-#include <QFxView>
+#include <qmlview.h>
#include <QFile>
#include <QmlComponent>
#include <QCryptographicHash>
@@ -29,7 +29,7 @@ QML_DEFINE_TYPE(Qt.VisualTest, 4, 6, (QT_VERSION&0x00ff00)>>8, Mouse, QFxVisualT
QML_DEFINE_TYPE(Qt.VisualTest, 4, 6, (QT_VERSION&0x00ff00)>>8, Key, QFxVisualTestKey);
QFxTester::QFxTester(const QString &script, QmlViewer::ScriptOptions opts,
- QFxView *parent)
+ QmlView *parent)
: QAbstractAnimation(parent), m_view(parent), filterEvents(true), options(opts),
testscript(0), hasFailed(false)
{
diff --git a/tools/qmlviewer/qfxtester.h b/tools/qmlviewer/qfxtester.h
index e37d6aa..4ace2d1 100644
--- a/tools/qmlviewer/qfxtester.h
+++ b/tools/qmlviewer/qfxtester.h
@@ -155,7 +155,7 @@ QML_DECLARE_TYPE(QFxVisualTestKey)
class QFxTester : public QAbstractAnimation
{
public:
- QFxTester(const QString &script, QmlViewer::ScriptOptions options, QFxView *parent);
+ QFxTester(const QString &script, QmlViewer::ScriptOptions options, QmlView *parent);
virtual int duration() const;
@@ -174,7 +174,7 @@ private:
enum Destination { View, ViewPort };
void addKeyEvent(Destination, QKeyEvent *);
void addMouseEvent(Destination, QMouseEvent *);
- QFxView *m_view;
+ QmlView *m_view;
struct MouseEvent {
MouseEvent(QMouseEvent *e)
diff --git a/tools/qmlviewer/qmlviewer.cpp b/tools/qmlviewer/qmlviewer.cpp
index 2894f1d..2ac13cc 100644
--- a/tools/qmlviewer/qmlviewer.cpp
+++ b/tools/qmlviewer/qmlviewer.cpp
@@ -11,7 +11,7 @@
**
****************************************************************************/
-#include <qfxview.h>
+#include <qmlview.h>
#include "ui_recopts.h"
#include "qmlviewer.h"
@@ -286,7 +286,7 @@ QmlViewer::QmlViewer(QWidget *parent, Qt::WindowFlags flags)
if (!(flags & Qt::FramelessWindowHint))
createMenu(menuBar(),0);
- canvas = new QFxView(this);
+ canvas = new QmlView(this);
canvas->setAttribute(Qt::WA_OpaquePaintEvent);
canvas->setAttribute(Qt::WA_NoSystemBackground);
canvas->setContentResizable(!skin || !scaleSkin);
diff --git a/tools/qmlviewer/qmlviewer.h b/tools/qmlviewer/qmlviewer.h
index f0e997c..c785e89 100644
--- a/tools/qmlviewer/qmlviewer.h
+++ b/tools/qmlviewer/qmlviewer.h
@@ -21,7 +21,7 @@
QT_BEGIN_NAMESPACE
-class QFxView;
+class QmlView;
class PreviewDeviceSkin;
class QFxTestEngine;
class QProcess;
@@ -95,7 +95,7 @@ private:
QString currentFileName;
PreviewDeviceSkin *skin;
QSize skinscreensize;
- QFxView *canvas;
+ QmlView *canvas;
QmlTimer recordTimer;
QString frame_fmt;
QImage frame;