summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-04-24 21:55:42 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-04-24 21:55:42 (GMT)
commitb64226e7b8cb1c9922b5419b27e0888c3215aae3 (patch)
tree6da0551e70ad499eff60a90786a0f9b14b76426a /tools
parent69b88e97a02b41f3ffb88cbac09a5096da6c520d (diff)
parent89d1b595af59d099ecbe535564ddd406a089a405 (diff)
downloadQt-b64226e7b8cb1c9922b5419b27e0888c3215aae3.zip
Qt-b64226e7b8cb1c9922b5419b27e0888c3215aae3.tar.gz
Qt-b64226e7b8cb1c9922b5419b27e0888c3215aae3.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: Link to example files from tutorial pages Add tutorial for writing QML extensions no export in plugin Add doc pages for qml examples. Replace usage of print() with console.log(). Remove out-of-date performance doc. Fix hidden menu on embedded. Location of binary is not on installed-content import path. Doc fixes. Return null if creation fails. Basic Component doc. Collection of small doc improvements compile
Diffstat (limited to 'tools')
-rw-r--r--tools/qml/main.cpp2
-rw-r--r--tools/qml/qmlruntime.cpp23
-rw-r--r--tools/qml/qmlruntime.h1
3 files changed, 17 insertions, 9 deletions
diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp
index cba5650..e484f77 100644
--- a/tools/qml/main.cpp
+++ b/tools/qml/main.cpp
@@ -389,8 +389,6 @@ int main(int argc, char ** argv)
usage();
}
- viewer->addLibraryPath(QCoreApplication::applicationDirPath());
-
foreach (QString lib, imports)
viewer->addLibraryPath(lib);
diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp
index 87a4d21..a715de9 100644
--- a/tools/qml/qmlruntime.cpp
+++ b/tools/qml/qmlruntime.cpp
@@ -537,6 +537,14 @@ QDeclarativeViewer::~QDeclarativeViewer()
delete namFactory;
}
+int QDeclarativeViewer::menuBarHeight() const
+{
+ if (!(windowFlags() & Qt::FramelessWindowHint))
+ return menuBar()->height();
+ else
+ return 0; // don't create menu
+}
+
QMenuBar *QDeclarativeViewer::menuBar() const
{
#if !defined(Q_OS_SYMBIAN)
@@ -916,7 +924,7 @@ void QDeclarativeViewer::statusChanged()
initialSize = canvas->sizeHint();
if (canvas->resizeMode() == QDeclarativeView::SizeRootObjectToView) {
QSize newWindowSize = initialSize;
- newWindowSize.setHeight(newWindowSize.height()+menuBar()->height());
+ newWindowSize.setHeight(newWindowSize.height()+menuBarHeight());
updateSizeHints();
resize(newWindowSize);
}
@@ -1065,8 +1073,10 @@ void QDeclarativeViewer::setSkin(const QString& skinDirOrName)
} else if (skin) {
skin = 0;
clearMask();
- menuBar()->clear();
- createMenu(menuBar(),0);
+ if ((windowFlags() & Qt::FramelessWindowHint)) {
+ menuBar()->clear();
+ createMenu(menuBar(),0);
+ }
canvas->setParent(this, Qt::SubWindow);
setParent(0,windowFlags()); // recreate
mb->show();
@@ -1079,7 +1089,7 @@ void QDeclarativeViewer::setSkin(const QString& skinDirOrName)
canvas->setFixedSize(initialSize);
}
QSize newWindowSize = canvas->size();
- newWindowSize.setHeight(newWindowSize.height()+menuBar()->height());
+ newWindowSize.setHeight(newWindowSize.height()+menuBarHeight());
resize(newWindowSize);
show();
}
@@ -1401,9 +1411,8 @@ void QDeclarativeViewer::updateSizeHints()
{
if (canvas->resizeMode() == QDeclarativeView::SizeViewToRootObject) {
QSize newWindowSize = canvas->sizeHint();
- if (!skin) {
- newWindowSize.setHeight(newWindowSize.height()+menuBar()->height());
- }
+ if (!skin)
+ newWindowSize.setHeight(newWindowSize.height()+menuBarHeight());
if (!isFullScreen() && !isMaximized()) {
resize(newWindowSize);
setFixedSize(newWindowSize);
diff --git a/tools/qml/qmlruntime.h b/tools/qml/qmlruntime.h
index a00a703..2a0a07d 100644
--- a/tools/qml/qmlruntime.h
+++ b/tools/qml/qmlruntime.h
@@ -146,6 +146,7 @@ private slots:
private:
QString getVideoFileName();
+ int menuBarHeight() const;
PreviewDeviceSkin *skin;
QSize skinscreensize;