summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-04-26 17:51:07 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-04-26 17:51:07 (GMT)
commitbb9de7e6ebf7b465fb3982c1af8185096fa6193f (patch)
tree72ef4bbff1922789e2a460063c45214012878f9a /tools
parent2648d5a2dc6ad4dee9ac685330b000a34339a758 (diff)
parentb9380e8b93d4e4d2135c918cdb77ab8dc2bf9000 (diff)
downloadQt-bb9de7e6ebf7b465fb3982c1af8185096fa6193f.zip
Qt-bb9de7e6ebf7b465fb3982c1af8185096fa6193f.tar.gz
Qt-bb9de7e6ebf7b465fb3982c1af8185096fa6193f.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: 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. 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/loggerwidget.cpp2
-rw-r--r--tools/qml/main.cpp6
-rw-r--r--tools/qml/qmlruntime.cpp30
-rw-r--r--tools/qml/qmlruntime.h1
4 files changed, 24 insertions, 15 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..9b9e4fe 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);
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;