diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qml/main.cpp | 2 | ||||
-rw-r--r-- | tools/qml/qmlruntime.cpp | 12 | ||||
-rw-r--r-- | tools/qml/qmlruntime.h | 5 |
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(); |