summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/qml/loggerwidget.cpp2
-rw-r--r--tools/qml/main.cpp6
-rw-r--r--tools/qml/qmlruntime.cpp32
-rw-r--r--tools/qml/qmlruntime.h1
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;