diff options
author | Martin Smith <msmith@trolltech.com> | 2010-04-15 10:23:57 (GMT) |
---|---|---|
committer | Martin Smith <msmith@trolltech.com> | 2010-04-15 10:23:57 (GMT) |
commit | e4282111378ce67a1ae9c235efbd89b327f1bb91 (patch) | |
tree | 175fca0d6b40940f8bcba61e4b6563145f5dde70 /tools | |
parent | 114cb018c088570ff0640eeb0d57594905ff9fcf (diff) | |
parent | b1c8bdc899cd276fcb90ad424b128bd7d8a21e21 (diff) | |
download | Qt-e4282111378ce67a1ae9c235efbd89b327f1bb91.zip Qt-e4282111378ce67a1ae9c235efbd89b327f1bb91.tar.gz Qt-e4282111378ce67a1ae9c235efbd89b327f1bb91.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/assistant/lib/fulltextsearch/qclucene-config_p.h | 14 | ||||
-rw-r--r-- | tools/assistant/lib/fulltextsearch/qclucene_global_p.h | 2 | ||||
-rw-r--r-- | tools/assistant/tools/assistant/helpviewer_qtb.cpp | 2 | ||||
-rw-r--r-- | tools/configure/environment.cpp | 2 | ||||
-rw-r--r-- | tools/qml/deviceorientation.h | 1 | ||||
-rw-r--r-- | tools/qml/main.cpp | 6 | ||||
-rw-r--r-- | tools/qml/qdeclarativetester.cpp | 11 | ||||
-rw-r--r-- | tools/qml/qml.pro | 2 | ||||
-rw-r--r-- | tools/qml/qmlruntime.cpp | 61 | ||||
-rw-r--r-- | tools/qml/qmlruntime.h | 4 | ||||
-rw-r--r-- | tools/qtestlib/wince/cetest/cetest.pro | 3 | ||||
-rw-r--r-- | tools/qtestlib/wince/cetest/qmake_include.pri | 2 |
12 files changed, 76 insertions, 34 deletions
diff --git a/tools/assistant/lib/fulltextsearch/qclucene-config_p.h b/tools/assistant/lib/fulltextsearch/qclucene-config_p.h index 0c70718..387d64d 100644 --- a/tools/assistant/lib/fulltextsearch/qclucene-config_p.h +++ b/tools/assistant/lib/fulltextsearch/qclucene-config_p.h @@ -314,14 +314,12 @@ configure. #define _CL_HAVE_SYS_TYPES_H 1 #endif -// Do not use the tchar.h that ships with mingw, this causes the qt build to -// fail (211547, 211401, etc...), reuse the replacement as with any other compiler -// #if defined(__MINGW32__) -// /* Define to 1 if you have the <tchar.h> header file. */ -// # ifndef _CL_HAVE_TCHAR_H -// # define _CL_HAVE_TCHAR_H 1 -// # endif -// #endif +#if defined(__MINGW32__) + /* Define to 1 if you have the <tchar.h> header file. */ + # ifndef _CL_HAVE_TCHAR_H + # define _CL_HAVE_TCHAR_H 1 + # endif +#endif #if defined(__MINGW32__) || defined(__SUNPRO_CC) || defined(__SUNPRO_C) /* Define to 1 if you have the `tell' function. */ diff --git a/tools/assistant/lib/fulltextsearch/qclucene_global_p.h b/tools/assistant/lib/fulltextsearch/qclucene_global_p.h index f4b744d..206725b 100644 --- a/tools/assistant/lib/fulltextsearch/qclucene_global_p.h +++ b/tools/assistant/lib/fulltextsearch/qclucene_global_p.h @@ -36,7 +36,7 @@ #include <QtCore/QChar> #include <QtCore/QString> -#if !defined(_MSC_VER) && defined(_CL_HAVE_WCHAR_H) && defined(_CL_HAVE_WCHAR_T) +#if !defined(_MSC_VER) && !defined(__MINGW32__) && defined(_CL_HAVE_WCHAR_H) && defined(_CL_HAVE_WCHAR_T) # if !defined(TCHAR) # define TCHAR wchar_t # endif diff --git a/tools/assistant/tools/assistant/helpviewer_qtb.cpp b/tools/assistant/tools/assistant/helpviewer_qtb.cpp index 3ff64e8..7f82b56 100644 --- a/tools/assistant/tools/assistant/helpviewer_qtb.cpp +++ b/tools/assistant/tools/assistant/helpviewer_qtb.cpp @@ -303,3 +303,5 @@ bool HelpViewer::eventFilter(QObject *obj, QEvent *event) return true; return QTextBrowser::eventFilter(obj, event); } + +QT_END_NAMESPACE diff --git a/tools/configure/environment.cpp b/tools/configure/environment.cpp index 74bebb2..60b8dcc 100644 --- a/tools/configure/environment.cpp +++ b/tools/configure/environment.cpp @@ -73,7 +73,7 @@ struct CompilerInfo{ } compiler_info[] = { // The compilers here are sorted in a reversed-preferred order {CC_BORLAND, "Borland C++", 0, "bcc32.exe"}, - {CC_MINGW, "MinGW (Minimalist GNU for Windows)", 0, "mingw32-gcc.exe"}, + {CC_MINGW, "MinGW (Minimalist GNU for Windows)", 0, "g++.exe"}, {CC_INTEL, "Intel(R) C++ Compiler for 32-bit applications", 0, "icl.exe"}, // xilink.exe, xilink5.exe, xilink6.exe, xilib.exe {CC_MSVC6, "Microsoft (R) 32-bit C/C++ Optimizing Compiler (6.x)", "Software\\Microsoft\\VisualStudio\\6.0\\Setup\\Microsoft Visual C++\\ProductDir", "cl.exe"}, // link.exe, lib.exe {CC_NET2002, "Microsoft (R) 32-bit C/C++ Optimizing Compiler.NET 2002 (7.0)", "Software\\Microsoft\\VisualStudio\\7.0\\Setup\\VC\\ProductDir", "cl.exe"}, // link.exe, lib.exe diff --git a/tools/qml/deviceorientation.h b/tools/qml/deviceorientation.h index c8125cd..d209005 100644 --- a/tools/qml/deviceorientation.h +++ b/tools/qml/deviceorientation.h @@ -50,6 +50,7 @@ class DeviceOrientationPrivate; class DeviceOrientation : public QObject { Q_OBJECT + Q_ENUMS(Orientation) public: enum Orientation { UnknownOrientation, Portrait, Landscape }; virtual Orientation orientation() const = 0; diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index 01b3912..45c2b85 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -121,6 +121,8 @@ void scriptOptsUsage() qWarning(" play ..................................... playback an existing script"); qWarning(" testimages ............................... record images or compare images on playback"); qWarning(" testerror ................................ test 'error' property of root item on playback"); + qWarning(" snapshot ................................. file being recorded is static,"); + qWarning(" only one frame will be recorded or tested"); qWarning(" exitoncomplete ........................... cleanly exit the viewer on script completion"); qWarning(" exitonfailure ............................ immediately exit the viewer on script failure"); qWarning(" saveonexit ............................... save recording on viewer exit"); @@ -243,7 +245,7 @@ int main(int argc, char ** argv) useNativeFileBrowser = false; } else if (arg == "-I" || arg == "-L") { if (arg == "-L") - fprintf(stderr, "-L option provided for compatibility only, use -I instead"); + fprintf(stderr, "-L option provided for compatibility only, use -I instead\n"); if (lastArg) { QDeclarativeEngine tmpEngine; QString paths = tmpEngine.importPathList().join(QLatin1String(":")); @@ -309,6 +311,8 @@ int main(int argc, char ** argv) scriptOptions |= QDeclarativeViewer::ExitOnFailure; } else if (option == QLatin1String("saveonexit")) { scriptOptions |= QDeclarativeViewer::SaveOnExit; + } else if (option == QLatin1String("snapshot")) { + scriptOptions |= QDeclarativeViewer::Snapshot; } else { scriptOptsUsage(); } diff --git a/tools/qml/qdeclarativetester.cpp b/tools/qml/qdeclarativetester.cpp index 6245124..cf537ee 100644 --- a/tools/qml/qdeclarativetester.cpp +++ b/tools/qml/qdeclarativetester.cpp @@ -240,6 +240,8 @@ void QDeclarativeTester::save() void QDeclarativeTester::updateCurrentTime(int msec) { QDeclarativeItemPrivate::setConsistentTime(msec); + if (!testscript && msec > 16 && options & QDeclarativeViewer::Snapshot) + return; QImage img(m_view->width(), m_view->height(), QImage::Format_RGB32); @@ -249,11 +251,13 @@ void QDeclarativeTester::updateCurrentTime(int msec) m_view->render(&p); } + bool snapshot = msec == 16 && options & QDeclarativeViewer::Snapshot; + FrameEvent fe; fe.msec = msec; if (msec == 0 || !(options & QDeclarativeViewer::TestImages)) { // Skip first frame, skip if not doing images - } else if (0 == (m_savedFrameEvents.count() % 60)) { + } else if (0 == (m_savedFrameEvents.count() % 60) || snapshot) { fe.image = img; } else { QCryptographicHash hash(QCryptographicHash::Md5); @@ -366,8 +370,11 @@ void QDeclarativeTester::updateCurrentTime(int msec) filterEvents = true; - if (testscript && testscript->count() <= testscriptidx) + if (testscript && testscript->count() <= testscriptidx) { + //if (msec == 16) //for a snapshot, leave it up long enough to see + // (void)::sleep(1); complete(); + } } void QDeclarativeTester::registerTypes() diff --git a/tools/qml/qml.pro b/tools/qml/qml.pro index bc6d032..1ed8b2c 100644 --- a/tools/qml/qml.pro +++ b/tools/qml/qml.pro @@ -56,7 +56,7 @@ symbian { INCLUDEPATH += $$QT_SOURCE_TREE/examples/network/qftp/ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 LIBS += -lesock -lcommdb -lconnmon -linsock - TARGET.CAPABILITY = "All -TCB" + TARGET.CAPABILITY = NetworkServices ReadUserData } mac { QMAKE_INFO_PLIST=Info_mac.plist diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp index c4ebd80..df29294 100644 --- a/tools/qml/qmlruntime.cpp +++ b/tools/qml/qmlruntime.cpp @@ -112,33 +112,47 @@ QT_BEGIN_NAMESPACE -class Screen : public QObject +class Runtime : public QObject { Q_OBJECT - Q_PROPERTY(Orientation orientation READ orientation NOTIFY orientationChanged) - Q_ENUMS(Orientation) + Q_PROPERTY(bool isActiveWindow READ isActiveWindow NOTIFY isActiveWindowChanged) + Q_PROPERTY(DeviceOrientation::Orientation orientation READ orientation NOTIFY orientationChanged) public: - Screen(QObject *parent=0) : QObject(parent) { - connect(DeviceOrientation::instance(), SIGNAL(orientationChanged()), - this, SIGNAL(orientationChanged())); + static Runtime* instance() + { + static Runtime *instance = 0; + if (!instance) + instance = new Runtime; + return instance; } - enum Orientation { UnknownOrientation = DeviceOrientation::UnknownOrientation, - Portrait = DeviceOrientation::Portrait, - Landscape = DeviceOrientation::Landscape }; - Orientation orientation() const { return Orientation(DeviceOrientation::instance()->orientation()); } + bool isActiveWindow() const { return activeWindow; } + void setActiveWindow(bool active) + { + if (active == activeWindow) + return; + activeWindow = active; + emit isActiveWindowChanged(); + } -signals: + DeviceOrientation::Orientation orientation() const { return DeviceOrientation::instance()->orientation(); } + +Q_SIGNALS: + void isActiveWindowChanged(); void orientationChanged(); -}; -QT_END_NAMESPACE +private: + Runtime(QObject *parent=0) : QObject(parent), activeWindow(false) + { + connect(DeviceOrientation::instance(), SIGNAL(orientationChanged()), + this, SIGNAL(orientationChanged())); + } -QML_DECLARE_TYPE(Screen) + bool activeWindow; +}; -QT_BEGIN_NAMESPACE class SizedMenuBar : public QMenuBar { @@ -1035,7 +1049,7 @@ void QDeclarativeViewer::openQml(const QString& file_or_url) url = QUrl(file_or_url); setWindowTitle(tr("%1 - Qt Declarative UI Viewer").arg(file_or_url)); - if (!m_script.isEmpty()) + if (!m_script.isEmpty()) tester = new QDeclarativeTester(m_script, m_scriptOptions, canvas); delete canvas->rootObject(); @@ -1048,6 +1062,8 @@ void QDeclarativeViewer::openQml(const QString& file_or_url) ctxt->setContextProperty("qmlViewerFolder", QDir::currentPath()); #endif + ctxt->setContextProperty("runtime", Runtime::instance()); + QString fileName = url.toLocalFile(); if (!fileName.isEmpty()) { QFileInfo fi(fileName); @@ -1249,6 +1265,16 @@ void QDeclarativeViewer::keyPressEvent(QKeyEvent *event) QWidget::keyPressEvent(event); } +bool QDeclarativeViewer::event(QEvent *event) +{ + if (event->type() == QEvent::WindowActivate) { + Runtime::instance()->setActiveWindow(true); + } else if (event->type() == QEvent::WindowDeactivate) { + Runtime::instance()->setActiveWindow(false); + } + return QWidget::event(event); +} + void QDeclarativeViewer::senseImageMagick() { QProcess proc; @@ -1474,7 +1500,8 @@ void QDeclarativeViewer::setUseNativeFileBrowser(bool use) void QDeclarativeViewer::registerTypes() { - qmlRegisterType<Screen>("QDeclarativeViewer", 1, 0, "Screen"); + // registering only for exposing the DeviceOrientation::Orientation enum + qmlRegisterUncreatableType<DeviceOrientation>("Qt",4,6,"Orientation"); } QT_END_NAMESPACE diff --git a/tools/qml/qmlruntime.h b/tools/qml/qmlruntime.h index 6f1e425..1ae771a 100644 --- a/tools/qml/qmlruntime.h +++ b/tools/qml/qmlruntime.h @@ -81,7 +81,8 @@ public: TestErrorProperty = 0x00000008, SaveOnExit = 0x00000010, ExitOnComplete = 0x00000020, - ExitOnFailure = 0x00000040 + ExitOnFailure = 0x00000040, + Snapshot = 0x00000080 }; Q_DECLARE_FLAGS(ScriptOptions, ScriptOption) void setScript(const QString &s) { m_script = s; } @@ -125,6 +126,7 @@ public slots: protected: virtual void keyPressEvent(QKeyEvent *); + virtual bool event(QEvent *); void createMenu(QMenuBar *menu, QMenu *flatmenu); diff --git a/tools/qtestlib/wince/cetest/cetest.pro b/tools/qtestlib/wince/cetest/cetest.pro index 43ed18e..82747da 100644 --- a/tools/qtestlib/wince/cetest/cetest.pro +++ b/tools/qtestlib/wince/cetest/cetest.pro @@ -13,8 +13,7 @@ DEFINES += QT_BUILD_QMAKE QT_BOOTSTRAPPED QT_NO_CODECS QT_LITE_UNICODE QT QT_NO_STL QT_NO_COMPRESS QT_NO_DATASTREAM \ QT_NO_TEXTCODEC QT_NO_UNICODETABLES QT_NO_THREAD \ QT_NO_SYSTEMLOCALE QT_NO_GEOM_VARIANT \ - QT_NODLL QT_NO_QOBJECT \ - QT_BUILD_QMAKE_NO_GENERATORS + QT_NODLL QT_NO_QOBJECT INCLUDEPATH = \ $$QT_SOURCE_TREE/tools/qtestlib/ce/cetest \ diff --git a/tools/qtestlib/wince/cetest/qmake_include.pri b/tools/qtestlib/wince/cetest/qmake_include.pri index 8b415b0..35fbc64 100644 --- a/tools/qtestlib/wince/cetest/qmake_include.pri +++ b/tools/qtestlib/wince/cetest/qmake_include.pri @@ -5,7 +5,9 @@ SOURCES += \ $$QT_SOURCE_TREE/qmake/option.cpp \ $$QT_SOURCE_TREE/qmake/project.cpp \ $$QT_SOURCE_TREE/qmake/property.cpp \ + $$QT_SOURCE_TREE/qmake/generators/metamakefile.cpp \ $$QT_SOURCE_TREE/qmake/generators/symbian/initprojectdeploy_symbian.cpp \ $$QT_SOURCE_TREE/tools/shared/symbian/epocroot.cpp \ $$QT_SOURCE_TREE/tools/shared/windows/registry.cpp +DEFINES += QT_QMAKE_PARSER_ONLY |