diff options
author | Martin Smith <msmith@trolltech.com> | 2010-04-13 08:20:16 (GMT) |
---|---|---|
committer | Martin Smith <msmith@trolltech.com> | 2010-04-13 08:20:16 (GMT) |
commit | add41080b9a4e2319007063bd73447f336933e9e (patch) | |
tree | 2b5bcbf18d4a0b3dc96043a430830c8212e85749 /tools | |
parent | 1055099e331af3b10d0b81b1a965e7d3db5f272d (diff) | |
parent | fbacd0fb2eb41470b090a3cbca7535f78689a382 (diff) | |
download | Qt-add41080b9a4e2319007063bd73447f336933e9e.zip Qt-add41080b9a4e2319007063bd73447f336933e9e.tar.gz Qt-add41080b9a4e2319007063bd73447f336933e9e.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/qml/Info_mac.plist | 16 | ||||
-rw-r--r-- | tools/qml/content/Browser.qml | 4 | ||||
-rw-r--r-- | tools/qml/deviceorientation_maemo.cpp | 13 | ||||
-rw-r--r-- | tools/qml/main.cpp | 35 | ||||
-rw-r--r-- | tools/qml/qml.pro | 4 | ||||
-rw-r--r-- | tools/qml/qmlruntime.cpp | 5 | ||||
-rw-r--r-- | tools/qml/qmlruntime.h | 1 | ||||
-rw-r--r-- | tools/tools.pro | 34 |
8 files changed, 82 insertions, 30 deletions
diff --git a/tools/qml/Info_mac.plist b/tools/qml/Info_mac.plist new file mode 100644 index 0000000..ce4ebe3 --- /dev/null +++ b/tools/qml/Info_mac.plist @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd"> +<plist version="0.1"> +<dict> + <key>CFBundleIdentifier</key> + <string>com.nokia.qt.qml</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleGetInfoString</key> + <string>Created by Qt/QMake</string> + <key>CFBundleSignature</key> + <string>@TYPEINFO@</string> + <key>CFBundleExecutable</key> + <string>@EXECUTABLE@</string> +</dict> +</plist> diff --git a/tools/qml/content/Browser.qml b/tools/qml/content/Browser.qml index 391ded8..8882d5a 100644 --- a/tools/qml/content/Browser.qml +++ b/tools/qml/content/Browser.qml @@ -3,8 +3,8 @@ import Qt 4.6 Rectangle { id: root property bool keyPressed: false - property var folders: folders1 - property var view: view1 + property variant folders: folders1 + property variant view: view1 width: 320 height: 480 color: palette.window diff --git a/tools/qml/deviceorientation_maemo.cpp b/tools/qml/deviceorientation_maemo.cpp index fa2c6e5..9f12f3d 100644 --- a/tools/qml/deviceorientation_maemo.cpp +++ b/tools/qml/deviceorientation_maemo.cpp @@ -50,6 +50,10 @@ public: MaemoOrientation() : DeviceOrientation(),m_current(Portrait), m_lastSeen(Portrait), m_lastSeenCount(0) { + m_current = get(); + if (m_current == UnknownOrientation) + m_current = Portrait; + startTimer(100); } @@ -57,14 +61,7 @@ public: return m_current; } - void setOrientation(Orientation orient) { - //XXX maybe better to just ignore - if (orient != m_current) { - m_current = orient; - emit orientationChanged(); - } - } - + void setOrientation(Orientation) { } protected: virtual void timerEvent(QTimerEvent *) diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index 5099e49..01b3912 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -101,8 +101,9 @@ void usage() qWarning(" -dragthreshold <size> .................... set mouse drag threshold size"); qWarning(" -netcache <size> ......................... set disk cache to size bytes"); qWarning(" -translation <translationfile> ........... set the language to run in"); - qWarning(" -L <directory> ........................... prepend to the library search path,"); + qWarning(" -I <directory> ........................... prepend to the module import search path,"); qWarning(" display path if <directory> is empty"); + qWarning(" -P <directory> ........................... prepend to the plugin search path"); qWarning(" -opengl .................................. use a QGLWidget for the viewport"); qWarning(" -script <path> ........................... set the script to use"); qWarning(" -scriptopts <options>|help ............... set the script options to use"); @@ -167,7 +168,8 @@ int main(int argc, char ** argv) QString dither = "none"; QString recordfile; QStringList recordargs; - QStringList libraries; + QStringList imports; + QStringList plugins; QString skin; QString script; QString scriptopts; @@ -239,14 +241,19 @@ int main(int argc, char ** argv) useGL = true; } else if (arg == "-qmlbrowser") { useNativeFileBrowser = false; - } else if (arg == "-L") { + } else if (arg == "-I" || arg == "-L") { + if (arg == "-L") + fprintf(stderr, "-L option provided for compatibility only, use -I instead"); if (lastArg) { QDeclarativeEngine tmpEngine; QString paths = tmpEngine.importPathList().join(QLatin1String(":")); fprintf(stderr, "Current search path: %s\n", paths.toLocal8Bit().constData()); return 0; } - libraries << QString(argv[++i]); + imports << QString(argv[++i]); + } else if (arg == "-P") { + if (lastArg) usage(); + plugins << QString(argv[++i]); } else if (arg == "-script") { if (lastArg) usage(); script = QString(argv[++i]); @@ -320,9 +327,12 @@ int main(int argc, char ** argv) viewer.addLibraryPath(QCoreApplication::applicationDirPath()); - foreach (QString lib, libraries) + foreach (QString lib, imports) viewer.addLibraryPath(lib); + foreach (QString plugin, plugins) + viewer.addPluginPath(plugin); + viewer.setNetworkCacheSize(cache); viewer.setRecordFile(recordfile); if (resizeview) @@ -349,6 +359,21 @@ int main(int argc, char ** argv) viewer.setUseNativeFileBrowser(useNativeFileBrowser); if (fullScreen && maximized) qWarning() << "Both -fullscreen and -maximized specified. Using -fullscreen."; + + if (fileName.isEmpty()) { + QFile qmlapp(QLatin1String("qmlapp")); + if (qmlapp.exists() && qmlapp.open(QFile::ReadOnly)) { + QString content = QString::fromUtf8(qmlapp.readAll()); + qmlapp.close(); + + int newline = content.indexOf(QLatin1Char('\n')); + if (newline >= 0) + fileName = content.left(newline); + else + fileName = content; + } + } + if (!fileName.isEmpty()) { viewer.open(fileName); fullScreen ? viewer.showFullScreen() : maximized ? viewer.showMaximized() : viewer.show(); diff --git a/tools/qml/qml.pro b/tools/qml/qml.pro index ba283b6..13b01f2 100644 --- a/tools/qml/qml.pro +++ b/tools/qml/qml.pro @@ -58,3 +58,7 @@ symbian { LIBS += -lesock -lcommdb -lconnmon -linsock TARGET.CAPABILITY = "All -TCB" } +mac { + QMAKE_INFO_PLIST=Info_mac.plist + TARGET=Qml +} diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp index 1ab528e..c4ebd80 100644 --- a/tools/qml/qmlruntime.cpp +++ b/tools/qml/qmlruntime.cpp @@ -870,6 +870,11 @@ void QDeclarativeViewer::addLibraryPath(const QString& lib) canvas->engine()->addImportPath(lib); } +void QDeclarativeViewer::addPluginPath(const QString& plugin) +{ + canvas->engine()->addPluginPath(plugin); +} + void QDeclarativeViewer::reload() { openQml(currentFileOrUrl); diff --git a/tools/qml/qmlruntime.h b/tools/qml/qmlruntime.h index 01777bd..6f1e425 100644 --- a/tools/qml/qmlruntime.h +++ b/tools/qml/qmlruntime.h @@ -96,6 +96,7 @@ public: void setDeviceKeys(bool); void setNetworkCacheSize(int size); void addLibraryPath(const QString& lib); + void addPluginPath(const QString& plugin); void setUseGL(bool use); void setUseNativeFileBrowser(bool); diff --git a/tools/tools.pro b/tools/tools.pro index 99a965d..7598962 100644 --- a/tools/tools.pro +++ b/tools/tools.pro @@ -4,25 +4,29 @@ TEMPLATE = subdirs no-png { message("Some graphics-related tools are unavailable without PNG support") } else { - SUBDIRS += assistant \ - pixeltool \ - porting \ - qtestlib \ - qttracereplay - contains(QT_EDITION, Console) { - SUBDIRS += designer/src/uitools # Linguist depends on this - } else { - SUBDIRS += designer - } - symbian: SUBDIRS = designer - wince*: SUBDIRS = qtestlib designer - unix:!mac:!embedded:contains(QT_CONFIG, qt3support):SUBDIRS += qtconfig - win32:!wince*:SUBDIRS += activeqt + symbian { + SUBDIRS = designer + } else:wince* { + SUBDIRS = qtestlib designer + } else { + SUBDIRS = assistant \ + pixeltool \ + porting \ + qtestlib \ + qttracereplay + contains(QT_EDITION, Console) { + SUBDIRS += designer/src/uitools # Linguist depends on this + } else { + SUBDIRS += designer + } + } + unix:!mac:!embedded:contains(QT_CONFIG, qt3support):SUBDIRS += qtconfig + win32:!wince*:SUBDIRS += activeqt } contains(QT_CONFIG, declarative):SUBDIRS += qml } -SUBDIRS += linguist +!wince*:!symbian:SUBDIRS += linguist mac { SUBDIRS += macdeployqt |