diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-27 05:11:09 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-27 05:11:09 (GMT) |
commit | db51f7d5452f645db252341d8a633a299b2ef2e1 (patch) | |
tree | 1be01d82f6ac68e159d3a9da9d86eac96835f82d /tools/qml | |
parent | 09293f1d07b019dc7bfe95afb93364cc87774e82 (diff) | |
parent | f0826662baaf7916f7b5f4fa9c8e9abab457731d (diff) | |
download | Qt-db51f7d5452f645db252341d8a633a299b2ef2e1.zip Qt-db51f7d5452f645db252341d8a633a299b2ef2e1.tar.gz Qt-db51f7d5452f645db252341d8a633a299b2ef2e1.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: (29 commits)
Plugins documentation.
Fix update issue when an item has an effect and child.
Fix QDeclarativeTextInput and QGraphicsView in regards of input methods hints.
Disallow "Qt" as namespace import
Don't "adjust" the z value of a delegate that has been cached.
Correctly inherit extension properties
Autotests
More QDeclarativeNetworkAccessManagerFactory doc clarification.
Fix QDeclarativeNetworkAccessManagerFactory docs.
Don't crash on invalid model remove signal.
Ensure scheduled layout can occur before testing.
Fix remaining 4.6 type registrations (to 4.7).
doc anchor margins vs. anchor (line) state/animation.
These examples should not be included in this test
Unify naming of settings / UI to be "Qt Qml Runtime"
Improved error messages for type resolving, new debug option
Link to example files from tutorial pages
Add tutorial for writing QML extensions
no export in plugin
Add doc pages for qml examples.
...
Diffstat (limited to 'tools/qml')
-rw-r--r-- | tools/qml/loggerwidget.cpp | 2 | ||||
-rw-r--r-- | tools/qml/main.cpp | 6 | ||||
-rw-r--r-- | tools/qml/qmlruntime.cpp | 32 | ||||
-rw-r--r-- | tools/qml/qmlruntime.h | 1 |
4 files changed, 25 insertions, 16 deletions
diff --git a/tools/qml/loggerwidget.cpp b/tools/qml/loggerwidget.cpp index 015d1b0..9eca4a6 100644 --- a/tools/qml/loggerwidget.cpp +++ b/tools/qml/loggerwidget.cpp @@ -50,7 +50,7 @@ LoggerWidget::LoggerWidget(QWidget *parent) : m_keepClosed(false) { setAttribute(Qt::WA_QuitOnClose, false); - setWindowTitle(tr("Qt Declarative UI Viewer - Logger")); + setWindowTitle(tr("Logger")); } void LoggerWidget::append(const QString &msg) diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index cba5650..9ccc3d2 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -198,7 +198,7 @@ int main(int argc, char ** argv) #endif QApplication app(argc, argv); - app.setApplicationName("viewer"); + app.setApplicationName("QtQmlRuntime"); app.setOrganizationName("Nokia"); app.setOrganizationDomain("nokia.com"); @@ -281,7 +281,7 @@ int main(int argc, char ** argv) if (lastArg) usage(); app.setStartDragDistance(QString(argv[++i]).toInt()); } else if (arg == QLatin1String("-v") || arg == QLatin1String("-version")) { - qWarning("Qt Declarative UI Viewer version %s", QT_VERSION_STR); + qWarning("Qt Qml Runtime version %s", QT_VERSION_STR); exit(0); } else if (arg == "-translation") { if (lastArg) usage(); @@ -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..008f163 100644 --- a/tools/qml/qmlruntime.cpp +++ b/tools/qml/qmlruntime.cpp @@ -341,14 +341,14 @@ private: data.append("\n"); } } - QSettings settings("Nokia", "QtQmlViewer"); + QSettings settings; settings.setValue("Cookies",data); } void load() { QMutexLocker lock(&mutex); - QSettings settings("Nokia", "QtQmlViewer"); + QSettings settings; QByteArray data = settings.value("Cookies").toByteArray(); setAllCookies(QNetworkCookie::parseCookies(data)); } @@ -466,6 +466,7 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags) , m_scriptOptions(0), tester(0), useQmlFileBrowser(true) { QDeclarativeViewer::registerTypes(); + setWindowTitle(tr("Qt Qml Runtime")); devicemode = false; skin = 0; @@ -537,6 +538,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 +925,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); } @@ -938,7 +947,7 @@ bool QDeclarativeViewer::open(const QString& file_or_url) url = QUrl::fromLocalFile(fi.absoluteFilePath()); else url = QUrl(file_or_url); - setWindowTitle(tr("%1 - Qt Declarative UI Viewer").arg(file_or_url)); + setWindowTitle(tr("%1 - Qt Qml Runtime").arg(file_or_url)); if (!m_script.isEmpty()) tester = new QDeclarativeTester(m_script, m_scriptOptions, canvas); @@ -1065,8 +1074,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 +1090,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 +1412,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); @@ -1430,7 +1440,7 @@ void QDeclarativeViewer::registerTypes() if (!registered) { // registering only for exposing the DeviceOrientation::Orientation enum - qmlRegisterUncreatableType<DeviceOrientation>("Qt",4,6,"Orientation",""); + qmlRegisterUncreatableType<DeviceOrientation>("Qt",4,7,"Orientation",""); registered = true; } } 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; |