summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-04-24 01:08:10 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-04-24 01:08:10 (GMT)
commit66ba1f88eeda3c26431faad2a0b550ce72f61b6a (patch)
tree332329c2b0ebd19bf8c0b839f7e9120bcc8781fe /tools
parent9ea81cbc63db063cd30797fd265a9002430ebd2f (diff)
parentfae6f6401f25a743516e726dede6534dc4c6b0e0 (diff)
downloadQt-66ba1f88eeda3c26431faad2a0b550ce72f61b6a.zip
Qt-66ba1f88eeda3c26431faad2a0b550ce72f61b6a.tar.gz
Qt-66ba1f88eeda3c26431faad2a0b550ce72f61b6a.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;