aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-06-24 11:26:22 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2013-06-24 11:48:46 +0200
commit1a9759855639b9e2b3cdc0687d3381dcbf6c9815 (patch)
treeb2da51f6eddddb83c2d97cdcfac24d38d2e67a4e /tools
parent8217ec1b888f3ff93f004801b018c5f85362c484 (diff)
parente1fc2793aef53b84a3f1e19b6d6bdf1141340074 (diff)
Merge branch 'dev' of ssh://codereview.qt-project.org/qt/qtdeclarative into wip/v4
Conflicts: src/imports/qtquick2/plugins.qmltypes src/qml/debugger/qv8debugservice.cpp src/qml/qml/qml.pri src/qml/qml/qqmlcompiler.cpp src/qml/qml/qqmlcomponent.cpp src/qml/qml/qqmlcontext.cpp src/qml/qml/qqmldata_p.h src/qml/qml/qqmlengine_p.h src/qml/qml/qqmljavascriptexpression.cpp src/qml/qml/qqmlxmlhttprequest.cpp src/qml/qml/v4/qv4bindings.cpp src/qml/qml/v4/qv4irbuilder.cpp src/qml/qml/v4/qv4jsonobject_p.h src/qml/qml/v8/qqmlbuiltinfunctions.cpp src/qml/qml/v8/qv8bindings.cpp src/qml/qml/v8/qv8contextwrapper.cpp src/qml/qml/v8/qv8listwrapper.cpp src/qml/qml/v8/qv8qobjectwrapper.cpp src/qml/qml/v8/qv8qobjectwrapper_p.h src/qml/qml/v8/qv8sequencewrapper_p_p.h src/qml/qml/v8/qv8typewrapper.cpp src/qml/qml/v8/qv8valuetypewrapper.cpp src/qml/types/qqmldelegatemodel.cpp src/quick/items/context2d/qquickcanvasitem.cpp src/quick/items/context2d/qquickcontext2d.cpp sync.profile tests/auto/qml/qjsengine/tst_qjsengine.cpp tests/benchmarks/qml/animation/animation.pro tools/qmlprofiler/qmlprofiler.pro Change-Id: I18a76b8a81d87523247fa03a44ca334b1a2360c9
Diffstat (limited to 'tools')
-rw-r--r--tools/qmlplugindump/main.cpp99
-rw-r--r--tools/qmlplugindump/qmlplugindump.pro9
-rw-r--r--tools/qmlprofiler/qmlprofiler.pro2
-rw-r--r--tools/qmlprofiler/qqmldebugclient.cpp2
-rw-r--r--tools/qmlscene/main.cpp10
-rw-r--r--tools/tools.pro11
6 files changed, 81 insertions, 52 deletions
diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp
index e05c77cbfa..4337db1689 100644
--- a/tools/qmlplugindump/main.cpp
+++ b/tools/qmlplugindump/main.cpp
@@ -71,6 +71,7 @@
QString pluginImportPath;
bool verbose = false;
+bool creatable = true;
QString currentProperty;
QString inObjectInstantiation;
@@ -225,46 +226,48 @@ QSet<const QMetaObject *> collectReachableMetaObjects(QQmlEngine *engine, const
qmlTypesByCppName[baseCpp] = baseExports;
}
- // find even more QMetaObjects by instantiating QML types and running
- // over the instances
- foreach (QQmlType *ty, QQmlMetaType::qmlTypes()) {
- if (skip.contains(ty))
- continue;
- if (ty->isExtendedType())
- continue;
- if (!ty->isCreatable())
- continue;
- if (ty->typeName() == "QQmlComponent")
- continue;
-
- QString tyName = ty->qmlTypeName();
- tyName = tyName.mid(tyName.lastIndexOf(QLatin1Char('/')) + 1);
- if (tyName.isEmpty())
- continue;
-
- inObjectInstantiation = tyName;
- QObject *object = 0;
-
- if (ty->isSingleton()) {
- QQmlType::SingletonInstanceInfo *siinfo = ty->singletonInstanceInfo();
- if (siinfo->qobjectCallback) {
- siinfo->init(engine);
- collectReachableMetaObjects(object, &metas);
- object = siinfo->qobjectApi(engine);
+ if (creatable) {
+ // find even more QMetaObjects by instantiating QML types and running
+ // over the instances
+ foreach (QQmlType *ty, QQmlMetaType::qmlTypes()) {
+ if (skip.contains(ty))
+ continue;
+ if (ty->isExtendedType())
+ continue;
+ if (!ty->isCreatable())
+ continue;
+ if (ty->typeName() == "QQmlComponent")
+ continue;
+
+ QString tyName = ty->qmlTypeName();
+ tyName = tyName.mid(tyName.lastIndexOf(QLatin1Char('/')) + 1);
+ if (tyName.isEmpty())
+ continue;
+
+ inObjectInstantiation = tyName;
+ QObject *object = 0;
+
+ if (ty->isSingleton()) {
+ QQmlType::SingletonInstanceInfo *siinfo = ty->singletonInstanceInfo();
+ if (siinfo->qobjectCallback) {
+ siinfo->init(engine);
+ collectReachableMetaObjects(object, &metas);
+ object = siinfo->qobjectApi(engine);
+ } else {
+ inObjectInstantiation.clear();
+ continue; // we don't handle QJSValue singleton types.
+ }
} else {
- inObjectInstantiation.clear();
- continue; // we don't handle QJSValue singleton types.
+ object = ty->create();
}
- } else {
- object = ty->create();
- }
- inObjectInstantiation.clear();
+ inObjectInstantiation.clear();
- if (object)
- collectReachableMetaObjects(object, &metas);
- else
- qWarning() << "Could not create" << tyName;
+ if (object)
+ collectReachableMetaObjects(object, &metas);
+ else
+ qWarning() << "Could not create" << tyName;
+ }
}
return metas;
@@ -330,17 +333,13 @@ public:
qSort(exportStrings);
qml->writeArrayBinding(QLatin1String("exports"), exportStrings);
- // write meta object revisions unless they're all zero
+ // write meta object revisions
QStringList metaObjectRevisions;
- bool shouldWriteMetaObjectRevisions = false;
foreach (const QString &exportString, exportStrings) {
int metaObjectRevision = exports[exportString]->metaObjectRevision();
- if (metaObjectRevision != 0)
- shouldWriteMetaObjectRevisions = true;
metaObjectRevisions += QString::number(metaObjectRevision);
}
- if (shouldWriteMetaObjectRevisions)
- qml->writeArrayBinding(QLatin1String("exportMetaObjectRevisions"), metaObjectRevisions);
+ qml->writeArrayBinding(QLatin1String("exportMetaObjectRevisions"), metaObjectRevisions);
if (const QMetaObject *attachedType = (*qmlTypes.begin())->attachedPropertiesType()) {
// Can happen when a type is registered that returns itself as attachedPropertiesType()
@@ -544,8 +543,8 @@ void sigSegvHandler(int) {
void printUsage(const QString &appName)
{
qWarning() << qPrintable(QString(
- "Usage: %1 [-v] [-notrelocatable] module.uri version [module/import/path]\n"
- " %1 [-v] -path path/to/qmldir/directory [version]\n"
+ "Usage: %1 [-v] [-noinstantiate] [-[non]relocatable] module.uri version [module/import/path]\n"
+ " %1 [-v] [-noinstantiate] -path path/to/qmldir/directory [version]\n"
" %1 [-v] -builtins\n"
"Example: %1 Qt.labs.folderlistmodel 2.0 /home/user/dev/qt-install/imports").arg(
appName));
@@ -566,7 +565,7 @@ int main(int argc, char *argv[])
#endif
#ifdef QT_SIMULATOR
- // Running this application would bring up the Qt Simulator (since it links QtGui), avoid that!
+ // Running this application would bring up the Qt Simulator (since it links Qt GUI), avoid that!
QtSimulatorPrivate::SimulatorConnection::createStubInstance();
#endif
@@ -595,8 +594,16 @@ int main(int argc, char *argv[])
}
if (arg == QLatin1String("--notrelocatable")
- || arg == QLatin1String("-notrelocatable")) {
+ || arg == QLatin1String("-notrelocatable")
+ || arg == QLatin1String("--nonrelocatable")
+ || arg == QLatin1String("-nonrelocatable")) {
relocatable = false;
+ } else if (arg == QLatin1String("--relocatable")
+ || arg == QLatin1String("-relocatable")) {
+ relocatable = true;
+ } else if (arg == QLatin1String("--noinstantiate")
+ || arg == QLatin1String("-noinstantiate")) {
+ creatable = false;
} else if (arg == QLatin1String("--path")
|| arg == QLatin1String("-path")) {
action = Path;
diff --git a/tools/qmlplugindump/qmlplugindump.pro b/tools/qmlplugindump/qmlplugindump.pro
index b777e0da75..0829173abe 100644
--- a/tools/qmlplugindump/qmlplugindump.pro
+++ b/tools/qmlplugindump/qmlplugindump.pro
@@ -9,7 +9,12 @@ SOURCES += \
HEADERS += \
qmlstreamwriter.h
-OTHER_FILES += Info.plist
-macx: QMAKE_INFO_PLIST = Info.plist
+mac {
+ # Prevent qmlplugindump from popping up in the dock when launched.
+ # We embed the Info.plist file, so the application doesn't need to
+ # be a bundle.
+ QMAKE_LFLAGS += -sectcreate __TEXT __info_plist $$shell_quote($$PWD/Info.plist)
+ CONFIG -= app_bundle
+}
load(qt_tool)
diff --git a/tools/qmlprofiler/qmlprofiler.pro b/tools/qmlprofiler/qmlprofiler.pro
index b29768f10e..a939612c67 100644
--- a/tools/qmlprofiler/qmlprofiler.pro
+++ b/tools/qmlprofiler/qmlprofiler.pro
@@ -1,4 +1,4 @@
-QT += qml qml-private network core-private
+QT = qml qml-private network core-private
SOURCES += main.cpp \
qmlprofilerapplication.cpp \
diff --git a/tools/qmlprofiler/qqmldebugclient.cpp b/tools/qmlprofiler/qqmldebugclient.cpp
index bb57594a3b..3ba8b334ff 100644
--- a/tools/qmlprofiler/qqmldebugclient.cpp
+++ b/tools/qmlprofiler/qqmldebugclient.cpp
@@ -308,7 +308,9 @@ void QQmlDebugConnection::flush()
void QQmlDebugConnection::connectToHost(const QString &hostName, quint16 port)
{
QTcpSocket *socket = new QTcpSocket(d);
+#ifndef QT_NO_NETWORKPROXY
socket->setProxy(QNetworkProxy::NoProxy);
+#endif
d->device = socket;
d->connectDeviceSignals();
d->gotHello = false;
diff --git a/tools/qmlscene/main.cpp b/tools/qmlscene/main.cpp
index afc4be875c..8a48445d63 100644
--- a/tools/qmlscene/main.cpp
+++ b/tools/qmlscene/main.cpp
@@ -483,7 +483,9 @@ int main(int argc, char ** argv)
QObject *topLevel = component->create();
QQuickWindow *window = qobject_cast<QQuickWindow *>(topLevel);
QQuickView* qxView = 0;
- if (!window) {
+ if (window) {
+ engine.setIncubationController(window->incubationController());
+ } else {
QQuickItem *contentItem = qobject_cast<QQuickItem *>(topLevel);
if (contentItem) {
qxView = new QQuickView(&engine, NULL);
@@ -491,7 +493,6 @@ int main(int argc, char ** argv)
// Set window default properties; the qml can still override them
QString oname = contentItem->objectName();
window->setTitle(oname.isEmpty() ? QString::fromLatin1("qmlscene") : QString::fromLatin1("qmlscene: ") + oname);
- window->setFlags(Qt::Window | Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint | Qt::WindowFullscreenButtonHint);
if (options.resizeViewToRootItem)
qxView->setResizeMode(QQuickView::SizeViewToRootObject);
else
@@ -512,11 +513,14 @@ int main(int argc, char ** argv)
}
window->setFormat(surfaceFormat);
+ if (window->flags() == Qt::Window) // Fix window flags unless set by QML.
+ window->setFlags(Qt::Window | Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint | Qt::WindowFullscreenButtonHint);
+
if (options.fullscreen)
window->showFullScreen();
else if (options.maximized)
window->showMaximized();
- else
+ else if (!window->isVisible())
window->show();
}
diff --git a/tools/tools.pro b/tools/tools.pro
index ab2d2e93df..43b6c14022 100644
--- a/tools/tools.pro
+++ b/tools/tools.pro
@@ -7,3 +7,14 @@ SUBDIRS += \
qmlbundle \
v4
qtHaveModule(quick):qtHaveModule(widgets): SUBDIRS += qmleasing
+
+# qmlmin & qmlbundle are build tools.
+# qmlscene is needed by the autotests.
+# qmltestrunner may be useful for manual testing.
+# qmlplugindump cannot be a build tool, because it loads target plugins.
+# The other apps are mostly "desktop" tools and are thus excluded.
+qtNomakeTools( \
+ qmlprofiler \
+ qmlplugindump \
+ qmleasing \
+)