summaryrefslogtreecommitdiffstats
path: root/tools/qml
diff options
context:
space:
mode:
authorRobert Griebl <robert.griebl@nokia.com>2010-06-28 22:31:37 (GMT)
committerRobert Griebl <robert.griebl@nokia.com>2010-06-28 22:32:26 (GMT)
commit5b0de255d1facfe89efed393447a1c914ffdf414 (patch)
tree0c4a628c2058a1f54eb8ca56d04748d084ea87b0 /tools/qml
parent9149efe500f91c08867d3658ac1064c7f226841e (diff)
downloadQt-5b0de255d1facfe89efed393447a1c914ffdf414.zip
Qt-5b0de255d1facfe89efed393447a1c914ffdf414.tar.gz
Qt-5b0de255d1facfe89efed393447a1c914ffdf414.tar.bz2
Adapt all qmlviewer testcases to the code changes in the actual viewer.
(currently tested on Linux only)
Diffstat (limited to 'tools/qml')
-rw-r--r--tools/qml/main.cpp2
-rw-r--r--tools/qml/qmlruntime.cpp12
-rw-r--r--tools/qml/qmlruntime.h5
3 files changed, 4 insertions, 15 deletions
diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp
index de5bca2..a75023b 100644
--- a/tools/qml/main.cpp
+++ b/tools/qml/main.cpp
@@ -346,7 +346,7 @@ int main(int argc, char ** argv)
if (stayOnTop)
wflags |= Qt::WindowStaysOnTopHint;
- QDeclarativeViewer *viewer = QDeclarativeViewer::instance(0, wflags);
+ QDeclarativeViewer *viewer = new QDeclarativeViewer(0, wflags);
viewer->setAttribute(Qt::WA_DeleteOnClose, true);
if (!scriptopts.isEmpty()) {
QStringList options =
diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp
index e0482cf..2cca262 100644
--- a/tools/qml/qmlruntime.cpp
+++ b/tools/qml/qmlruntime.cpp
@@ -534,17 +534,6 @@ QString QDeclarativeViewer::getVideoFileName()
return QFileDialog::getSaveFileName(this, title, "", types.join(";; "));
}
-QDeclarativeViewer *QDeclarativeViewer::inst = 0;
-
-QDeclarativeViewer *QDeclarativeViewer::instance(QWidget *parent, Qt::WindowFlags flags)
-{
- if (!inst) {
- inst = new QDeclarativeViewer(parent, flags);
- inst->setAttribute(Qt::WA_DeleteOnClose);
- }
- return inst;
-}
-
QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags)
: QMainWindow(parent, flags)
, loggerWindow(new LoggerWidget(this))
@@ -1400,6 +1389,7 @@ void QDeclarativeViewer::updateSizeHints()
canvas->setMinimumSize(newWindowSize);
canvas->resize(newWindowSize);
resize(1, 1); // workaround for QMainWindowLayout NOT shrinking the window if the centralWidget() shrinks
+ canvas->setMinimumSize(QSize(0, 0));
}
} else { // QDeclarativeView::SizeRootObjectToView
canvas->setMinimumSize(QSize(0,0));
diff --git a/tools/qml/qmlruntime.h b/tools/qml/qmlruntime.h
index 92c2969..a3a9fb3 100644
--- a/tools/qml/qmlruntime.h
+++ b/tools/qml/qmlruntime.h
@@ -62,16 +62,15 @@ class QNetworkCookieJar;
class NetworkAccessManagerFactory;
class QTranslator;
class QActionGroup;
+class QMenuBar;
class QDeclarativeViewer
: public QMainWindow
{
Q_OBJECT
- QDeclarativeViewer(QWidget *parent = 0, Qt::WindowFlags flags = 0);
- static QDeclarativeViewer *inst;
public:
- static QDeclarativeViewer *instance(QWidget *parent = 0, Qt::WindowFlags flags = 0);
+ QDeclarativeViewer(QWidget *parent = 0, Qt::WindowFlags flags = 0);
~QDeclarativeViewer();
static void registerTypes();