diff options
author | Morten Engvoldsen <morten.engvoldsen@nokia.com> | 2010-04-28 08:16:23 (GMT) |
---|---|---|
committer | Morten Engvoldsen <morten.engvoldsen@nokia.com> | 2010-04-28 08:16:23 (GMT) |
commit | 57a60d49a5d9d031144388b0fdf4d92e5e6c8571 (patch) | |
tree | 7d892183926eba5a84b07a005523bd2508887077 /tools | |
parent | 4922d8d4a88b5e061c36eebbaa2c7678bea47dd5 (diff) | |
parent | 36bd47429312f6d78d620c04bb7e62d34273d310 (diff) | |
download | Qt-57a60d49a5d9d031144388b0fdf4d92e5e6c8571.zip Qt-57a60d49a5d9d031144388b0fdf4d92e5e6c8571.tar.gz Qt-57a60d49a5d9d031144388b0fdf4d92e5e6c8571.tar.bz2 |
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 2 | ||||
-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 |
5 files changed, 26 insertions, 17 deletions
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 7e7cafd..4b3c6e2 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -1680,7 +1680,7 @@ void HtmlGenerator::generateBreadCrumbs(const QString& title, { Text breadcrumb; if (node->type() == Node::Class) { - ClassNode* cn = static_cast<const ClassNode*>(node); + const ClassNode* cn = static_cast<const ClassNode*>(node); QString name = node->moduleName(); if (!name.isEmpty()) { out() << " <li>"; 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; |