summaryrefslogtreecommitdiffstats
path: root/tools
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 /tools
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
Diffstat (limited to 'tools')
-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
8 files changed, 35 insertions, 12 deletions
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;