summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-04-30 02:48:07 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-04-30 02:48:07 (GMT)
commitd7fe5cb94577c56a9fb656f6e61ec0b13f6f0a8f (patch)
treeec250745f96b2d38b5059faf92f8bc55e26c377b /tools
parentbab72866f444443632528fadd240eea6f79d66e2 (diff)
downloadQt-d7fe5cb94577c56a9fb656f6e61ec0b13f6f0a8f.zip
Qt-d7fe5cb94577c56a9fb656f6e61ec0b13f6f0a8f.tar.gz
Qt-d7fe5cb94577c56a9fb656f6e61ec0b13f6f0a8f.tar.bz2
Resizable.
Resizing is not propagated to canvas view and root item. Examples may or may not resize meaningfully. Skins are device-oriented and so do not resize.
Diffstat (limited to 'tools')
-rw-r--r--tools/duiviewer/qfxviewer.cpp12
-rw-r--r--tools/duiviewer/qfxviewer.h1
2 files changed, 10 insertions, 3 deletions
diff --git a/tools/duiviewer/qfxviewer.cpp b/tools/duiviewer/qfxviewer.cpp
index 7b39f53..b15a8bf 100644
--- a/tools/duiviewer/qfxviewer.cpp
+++ b/tools/duiviewer/qfxviewer.cpp
@@ -55,7 +55,7 @@ QFxViewer::QFxViewer(QFxTestEngine::TestMode testMode, const QString &testDir, Q
QObject::connect(canvas, SIGNAL(sceneResized(QSize)), this, SLOT(sceneResized(QSize)));
canvas->setFixedSize(width, height);
- setFixedSize(width, height);
+ resize(width, height);
}
void QFxViewer::reload()
@@ -217,15 +217,21 @@ void QFxViewer::setRecordPeriod(int ms)
void QFxViewer::sceneResized(QSize size)
{
- if(size.width() > 0 && size.height() > 0) {
+ if (size.width() > 0 && size.height() > 0) {
canvas->setFixedSize(size.width(), size.height());
if (skin)
skin->setScreenSize(size);
else
- setFixedSize(size);
+ resize(size);
}
}
+void QFxViewer::resizeEvent(QResizeEvent *)
+{
+ if (!skin)
+ canvas->setFixedSize(width(),height());
+}
+
void QFxViewer::keyPressEvent(QKeyEvent *event)
{
if (event->key() == Qt::Key_0 && devicemode)
diff --git a/tools/duiviewer/qfxviewer.h b/tools/duiviewer/qfxviewer.h
index 5733591..7a190c5 100644
--- a/tools/duiviewer/qfxviewer.h
+++ b/tools/duiviewer/qfxviewer.h
@@ -49,6 +49,7 @@ public slots:
protected:
virtual void keyPressEvent(QKeyEvent *);
virtual void timerEvent(QTimerEvent *);
+ virtual void resizeEvent(QResizeEvent *);
private:
QString currentFileName;