diff options
47 files changed, 566 insertions, 327 deletions
diff --git a/config.tests/unix/fvisibility.test b/config.tests/unix/fvisibility.test index 99e6fbe..27c6841 100755 --- a/config.tests/unix/fvisibility.test +++ b/config.tests/unix/fvisibility.test @@ -34,7 +34,7 @@ EOF case "$COMPILER" in -gcc|g++) +*g++*|*c++*) CMDLINE="-fvisibility=hidden" RunCompileTest ;; diff --git a/configure.exe b/configure.exe Binary files differindex a19f515..1fddc81 100755 --- a/configure.exe +++ b/configure.exe diff --git a/demos/qtdemo/colors.cpp b/demos/qtdemo/colors.cpp index 07cf162..b352e3d 100644 --- a/demos/qtdemo/colors.cpp +++ b/demos/qtdemo/colors.cpp @@ -270,7 +270,7 @@ void Colors::parseArgs(int argc, char *argv[]) else if (s.startsWith("-h") || s.startsWith("-help")){ QMessageBox::warning(0, "Arguments", QString("Usage: qtdemo [-verbose] [-no-adapt] [-opengl] [-software] [-fullscreen] [-ticker[0|1]] ") - + "[-animations[0|1]] [-no-blending] [-no-sync] [-use-timer-update[0|1]] [-pause[0|1]] " + + "[-animations[0|1]] [-no-blending] [-use-blur] [-no-sync] [-use-timer-update[0|1]] [-pause[0|1]] " + "[-use-window-mask] [-no-rescale] " + "[-use-pixmaps] [-show-fps] [-show-br] [-8bit[0|1]] [-menu<int>] [-use-loop] [-use-balls] " + "[-animation-speed<float>] [-fps<int>] " diff --git a/demos/qtdemo/mainwindow.cpp b/demos/qtdemo/mainwindow.cpp index 45ec9a6..753014a 100644 --- a/demos/qtdemo/mainwindow.cpp +++ b/demos/qtdemo/mainwindow.cpp @@ -266,7 +266,7 @@ void MainWindow::setupSceneItems() { if (Colors::showFps){ this->fpsLabel = new DemoTextItem(QString("FPS: --"), Colors::buttonFont(), Qt::white, -1, this->scene, 0, DemoTextItem::DYNAMIC_TEXT); - this->fpsLabel->setZValue(100); + this->fpsLabel->setZValue(1000); this->fpsLabel->setPos(Colors::stageStartX, 600 - QFontMetricsF(Colors::buttonFont()).height() - 5); } @@ -311,15 +311,9 @@ void MainWindow::checkAdapt() } //Note: Because we don't adapt later in the program, if blur makes FPS plummet then we won't catch it - if (!Colors::noBlur && MenuManager::instance()->mainSceneBlur && this->mainSceneRoot){ + if (!Colors::noBlur && MenuManager::instance()->declarativeEngine && this->mainSceneRoot){ Colors::noBlur = true; - this->mainSceneRoot->setGraphicsEffect(0); - MenuManager::instance()->mainSceneBlur = 0; - if(MenuManager::instance()->qmlRoot){ - MenuManager::instance()->qmlRoot->setGraphicsEffect(0); - MenuManager::instance()->declarativeEngine->rootContext()->setContextProperty("realBlur", 0); - } - MenuManager::instance()->qmlShadow = 0; + MenuManager::instance()->declarativeEngine->rootContext()->setContextProperty("useBlur", false); if (Colors::verbose) qDebug() << "- benchmark adaption: removed blur (fps < 30)"; } diff --git a/demos/qtdemo/menumanager.cpp b/demos/qtdemo/menumanager.cpp index 9eb5664..9e2ba6b 100644 --- a/demos/qtdemo/menumanager.cpp +++ b/demos/qtdemo/menumanager.cpp @@ -59,8 +59,6 @@ MenuManager::MenuManager() this->tickerInAnim = 0; this->upButton = 0; this->downButton = 0; - this->mainSceneBlur = 0; - this->qmlShadow = 0; this->helpEngine = 0; this->score = new Score(); this->currentMenu = QLatin1String("[no menu visible]"); @@ -381,8 +379,14 @@ void MenuManager::launchQmlExample(const QString &name) } } + QPainter painter(qmlBgImage); + this->window->fpsLabel->setOpacity(0); + this->window->render(&painter); + this->window->fpsLabel->setOpacity(1.0); + Qt::ImageConversionFlags convFlags = Qt::AvoidDither | Qt::NoOpaqueDetection; + this->declarativeEngine->rootContext()->setContextProperty("bgAppPixmap", QVariant(QPixmap::fromImage(*qmlBgImage, convFlags))); qmlRoot->setProperty("show", QVariant(true)); - qmlRoot->setProperty("source", file.fileName()); + qmlRoot->setProperty("qmlFile", QUrl::fromLocalFile(file.fileName())); } void MenuManager::exampleFinished() @@ -401,15 +405,6 @@ void MenuManager::init(MainWindow *window) { this->window = window; - //Create blur for later use - // Note that blur is DISABLED by default because it's too slow, even on Desktop machines - if(!Colors::noBlur){ - this->mainSceneBlur = new QGraphicsBlurEffect(this); - this->mainSceneBlur->setEnabled(false); - this->mainSceneBlur->setBlurRadius(0); - this->window->mainSceneRoot->setGraphicsEffect(mainSceneBlur); - } - // Create div: this->createTicker(); this->createUpnDownButtons(); @@ -439,8 +434,15 @@ void MenuManager::init(MainWindow *window) // Create QML Loader qmlRegisterType<QGraphicsBlurEffect>("Effects", 1, 0, "Blur"); + qmlRegisterType<QGraphicsDropShadowEffect>("Effects", 1, 0, "DropShadow"); declarativeEngine = new QDeclarativeEngine(this); - MenuManager::instance()->declarativeEngine->rootContext()->setContextProperty("realBlur", this->mainSceneBlur); + + // Note that we paint the background into a static image for a theorized performance improvement when blurring + // It has not yet been determined what, if any, speed up this gives (but is left in 'cause the QML expects it now) + this->qmlBgImage = new QImage(window->sceneRect().size().toSize(), QImage::Format_ARGB32); + this->qmlBgImage->fill(0); + declarativeEngine->rootContext()->setContextProperty("useBlur", !Colors::noBlur); + declarativeEngine->rootContext()->setContextProperty("bgAppPixmap", QVariant(QPixmap::fromImage(*qmlBgImage))); QDeclarativeComponent component(declarativeEngine, QUrl("qrc:qml/qmlShell.qml"), this); qmlRoot = 0; if(component.isReady()) @@ -450,14 +452,9 @@ void MenuManager::init(MainWindow *window) if(qmlRoot){ qmlRoot->setHeight(this->window->scene->sceneRect().height()); qmlRoot->setWidth(this->window->scene->sceneRect().width()); - qmlRoot->setZValue(1000);//Above other items + qmlRoot->setZValue(101);//Above other items qmlRoot->setCursor(Qt::ArrowCursor); window->scene->addItem(qmlRoot); - if(!Colors::noBlur){ - qmlShadow = new QGraphicsDropShadowEffect(this); - qmlShadow->setOffset(4); - qmlRoot->setGraphicsEffect(qmlShadow); - } //Note that QML adds key handling to the app. window->viewport()->setFocusPolicy(Qt::NoFocus);//Correct keyboard focus handling diff --git a/demos/qtdemo/menumanager.h b/demos/qtdemo/menumanager.h index 3524081..e90e02c 100644 --- a/demos/qtdemo/menumanager.h +++ b/demos/qtdemo/menumanager.h @@ -85,8 +85,7 @@ public: QDeclarativeEngine* declarativeEngine; QDeclarativeItem *qmlRoot; - QGraphicsBlurEffect *mainSceneBlur; - QGraphicsDropShadowEffect *qmlShadow; + QImage *qmlBgImage; private slots: void exampleFinished(); diff --git a/demos/qtdemo/qmlShell.qml b/demos/qtdemo/qmlShell.qml index eb155c4..b9021e8 100644 --- a/demos/qtdemo/qmlShell.qml +++ b/demos/qtdemo/qmlShell.qml @@ -42,117 +42,132 @@ import Qt 4.7 import Effects 1.0 +/* Vars exposed from C++ + pixmap bgAppPixmap + bool useBlur (to turn on, pass -use-blur on the cmd line. Off by default 'cause it's too slow) +*/ Item { id: main - property alias source: loader.source + //height and width set by program to fill window + //below properties are sometimes set from C++ + property url qmlFile: '' property bool show: false - x: 0 - y: -500 //height and width set by program - opacity: 0 - property QtObject blurEffect: realBlur == null ? dummyBlur : realBlur //Is there a better way to lose those error messages? - Loader{//Automatic FocusScope - focus: true - clip: true - id: loader //source set by program - anchors.centerIn: parent - onStatusChanged: if(status == Loader.Ready) { + Image{ + id: bg + opacity: 0 + anchors.fill: parent + z: -1 + pixmap: bgAppPixmap + effect: Blur { id: blurEffect; enabled: useBlur; blurRadius: 8;} + } + + Item{ id:embeddedViewer + width: parent.width + height: parent.height + opacity: 0; + z: 10 + Loader{ + id: loader + z: 10 + focus: true //Automatic FocusScope + clip: true + source: qmlFile + anchors.centerIn: parent + onStatusChanged: if(status == Loader.Ready) { if(loader.item.width > 640) loader.item.width = 640; if(loader.item.height > 480) loader.item.height = 480; - } + } - } - Rectangle{ - z: -1 - anchors.fill: loader.status == Loader.Ready ? loader : errorTxt - anchors.margins: -10 - radius: 12 - smooth: true - gradient: Gradient{ - GradientStop{ position: 0.0; color: "#14FFFFFF" } - GradientStop{ position: 1.0; color: "#5AFFFFFF" } } - MouseArea{ - anchors.fill: parent - onClicked: loader.focus=true;/* and don't propogate to the 'exit' area*/ + Rectangle{ id: frame + z: 9 + anchors.fill: loader.status == Loader.Ready ? loader : errorTxt + anchors.margins: -8 + radius: 4 + smooth: true + border.color: "#88aaaaaa" + gradient: Gradient{ + GradientStop{ position: 0.0; color: "#14FFFFFF" } + GradientStop{ position: 1.0; color: "#5AFFFFFF" } + } + MouseArea{ + anchors.fill: parent + onClicked: loader.focus=true;/* and don't propogate to the 'exit' area*/ + } + + Rectangle{ id: innerFrame + anchors.margins: 7 + anchors.bottomMargin: 8 + anchors.rightMargin: 8 + color: "black" + border.color: "#44000000" + anchors.fill:parent + } + + effect: DropShadow { + enabled: useBlur; + blurRadius: 9; + color: "#88000000"; + xOffset:0 + yOffset:0 + } } + Text{ + id: errorTxt + z: 10 + anchors.centerIn: parent + color: 'white' + smooth: true + visible: loader.status == Loader.Error + textFormat: Text.RichText + //Note that if loader is Error, it is because the file was found but there was an error creating the component + //This means either we have a bug in our demos, or the required modules (which ship with Qt) did not deploy correctly + text: "The example has failed to load.<br />If you installed Qt's QML modules this is a bug!<br />" + + 'Report it at <a href="http://bugreports.qt.nokia.com">http://bugreports.qt.nokia.com</a>'; + onLinkActivated: Qt.openUrlExternally(link); + } + } + Rectangle{ id: blackout //Maybe use a colorize effect instead? + z: 8 + anchors.fill: parent + color: "#000000" + opacity: 0 } - MouseArea{ - z: -2 - hoverEnabled: true //To steal from the buttons + z: 8 + enabled: main.show + hoverEnabled: true //To steal focus from the buttons anchors.fill: parent onClicked: main.show=false; } - Text{ - id: errorTxt - anchors.centerIn: parent - color: 'white' - smooth: true - visible: loader.status == Loader.Error - textFormat: Text.RichText //includes link for bugreport - //Note that if loader is Error, it is because the file was found but there was an error creating the component - //This means either we have a bug in our demos, or the required modules (which ship with Qt) did not deploy correctly - text: 'The example has failed to load. This is a bug!<br />' - +'Report it at <a href="http://bugreports.qt.nokia.com">http://bugreports.qt.nokia.com</a>'; - onLinkActivated: Qt.openUrlExternally(link); - } - - states: [ State { name: "show" when: show == true PropertyChanges { - target: main + target: embeddedViewer + opacity: 1 + } + PropertyChanges { + target: bg opacity: 1 - y: 0 } PropertyChanges { - target: blurEffect - enabled: true - blurRadius: 8 - blurHints: Blur.AnimationHint | Blur.PerformanceHint + target: blackout + opacity: 0.5 } } ] - MagicAnim{ id: magicAnim; target: main; from: -500; to: 0 } - transitions: [ - Transition { from: ""; to: "show" - SequentialAnimation{ - ScriptAction{ script: magicAnim.start() } - NumberAnimation{ properties: "opacity,blurRadius"; easing.type: Easing.OutCubic; duration: 1000} - PropertyAnimation{ target: main; property: "y"} - } - - }, - Transition { from: "show"; to: "" //Addtionally, unload the item + transitions: [//Should not be too long, because the component has already started running + Transition { from: ''; to: "show"; reversible: true SequentialAnimation{ - NumberAnimation{ properties: "y,opacity,blurRadius";duration: 500 } - ScriptAction{ script: loader.source = ''; } + PropertyAction { target: bg; property: useBlur?"y":"opacity";}//fade in blurred background only if blurred + NumberAnimation{ properties: "opacity"; easing.type: Easing.InQuad; duration: 500} } - /*Attempt to copy the exeunt animation. Looks bad - SequentialAnimation{ - ParallelAnimation{ - NumberAnimation{ properties: "opacity,blurRadius"; easing.type: Easing.InCubic; duration: 1000 } - SequentialAnimation{ - NumberAnimation{ target: main; property: 'y'; to: 3.2*height/5; duration: 500} - ParallelAnimation{ - NumberAnimation{ target: main; property: 'y'; to: 3.0*height/5; duration: 100} - NumberAnimation{ target: main; property: 'x'; to: 3.0*width/5; duration: 100} - } - NumberAnimation{ target: main; property: 'x'; to: 700; duration: 400} - } - } - ScriptAction{ script: loader.source = ''; } - PropertyAction{ properties: "x,y";} - } - */ } ] - Item{ Blur{id: dummyBlur } } - } diff --git a/demos/qtdemo/qtdemo.pro b/demos/qtdemo/qtdemo.pro index 5e64e1c..4d4177e 100644 --- a/demos/qtdemo/qtdemo.pro +++ b/demos/qtdemo/qtdemo.pro @@ -75,5 +75,4 @@ sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES qtdemo.pro images xml *. sources.path = $$[QT_INSTALL_DEMOS]/qtdemo OTHER_FILES += \ - qmlShell.qml \ - MagicAnim.qml + qmlShell.qml diff --git a/demos/qtdemo/qtdemo.qrc b/demos/qtdemo/qtdemo.qrc index 7682ab5..c18420f 100644 --- a/demos/qtdemo/qtdemo.qrc +++ b/demos/qtdemo/qtdemo.qrc @@ -7,6 +7,5 @@ </qresource> <qresource prefix="/qml" lang="qml"> <file>qmlShell.qml</file> - <file>MagicAnim.qml</file> </qresource> </RCC> diff --git a/doc/src/declarative/extending-tutorial.qdoc b/doc/src/declarative/extending-tutorial.qdoc index f00b858..7ec9087 100644 --- a/doc/src/declarative/extending-tutorial.qdoc +++ b/doc/src/declarative/extending-tutorial.qdoc @@ -107,7 +107,7 @@ The class implementation in \c musician.cpp simply sets and returns the \c m_nam Our QML file, \c app.qml, creates a \c Musician item and display the musician's details using a standard QML \l Text item: -\quotefile declarative/tutorials/extending/chapter1-basics/app.qml +\snippet declarative/tutorials/extending/chapter1-basics/app.qml 0 We'll also create a C++ application that uses a QDeclarativeView to run and display \c app.qml. The application must register the \c Musician type @@ -147,7 +147,7 @@ to the console and then emits a "performanceEnded" signal. Other elements would be able to call \c perform() and receive \c performanceEnded() signals like this: -\quotefile declarative/tutorials/extending/chapter2-methods/app.qml +\snippet declarative/tutorials/extending/chapter2-methods/app.qml 0 To do this, we add a \c perform() method and a \c performanceEnded() signal to our C++ class: @@ -193,7 +193,7 @@ other elements' values when property values change. Let's enable property bindings for the \c instrument property. That means if we have code like this: -\quotefile declarative/tutorials/extending/chapter3-bindings/app.qml +\snippet declarative/tutorials/extending/chapter3-bindings/app.qml 0 The "instrument: reddy.instrument" statement binds the \c instrument value of \c craig to the \c instrument of \c reddy. @@ -275,7 +275,7 @@ For example, let's change the type of the \c instrument property from a string t new type called "Instrument". Instead of assigning a string value to \c instrument, we assign an \c Instrument value: -\quotefile declarative/tutorials/extending/chapter4-customPropertyTypes/app.qml +\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/app.qml 0 Like \c Musician, this new \c Instrument type has to inherit from QObject and declare its properties with Q_PROPERTY(): diff --git a/doc/src/declarative/globalobject.qdoc b/doc/src/declarative/globalobject.qdoc index 3a2ad81..7d4f9b9 100644 --- a/doc/src/declarative/globalobject.qdoc +++ b/doc/src/declarative/globalobject.qdoc @@ -141,7 +141,7 @@ of QDeclarativeEngine::offlineStoragePath(), currently as SQLite databases. The API can be used from JavaScript functions in your QML: -\quotefile declarative/sqllocalstorage/hello.qml +\snippet declarative/sqllocalstorage/hello.qml 0 The API conforms to the Synchronous API of the HTML5 Web Database API, \link http://www.w3.org/TR/2009/WD-webdatabase-20091029/ W3C Working Draft 29 October 2009\endlink. diff --git a/examples/declarative/sqllocalstorage/hello.qml b/examples/declarative/sqllocalstorage/hello.qml index 67f542e..0913d42 100644 --- a/examples/declarative/sqllocalstorage/hello.qml +++ b/examples/declarative/sqllocalstorage/hello.qml @@ -37,7 +37,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - +//![0] import Qt 4.7 Text { diff --git a/examples/declarative/tutorials/extending/chapter1-basics/app.qml b/examples/declarative/tutorials/extending/chapter1-basics/app.qml index 96c543e..7de32f2 100644 --- a/examples/declarative/tutorials/extending/chapter1-basics/app.qml +++ b/examples/declarative/tutorials/extending/chapter1-basics/app.qml @@ -37,7 +37,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - +//![0] import Music 1.0 import Qt 4.7 diff --git a/examples/declarative/tutorials/extending/chapter2-methods/app.qml b/examples/declarative/tutorials/extending/chapter2-methods/app.qml index 82740d2..495413f 100644 --- a/examples/declarative/tutorials/extending/chapter2-methods/app.qml +++ b/examples/declarative/tutorials/extending/chapter2-methods/app.qml @@ -37,7 +37,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - +//![0] import Music 1.0 import Qt 4.7 diff --git a/examples/declarative/tutorials/extending/chapter3-bindings/app.qml b/examples/declarative/tutorials/extending/chapter3-bindings/app.qml index 138d504..46408cb 100644 --- a/examples/declarative/tutorials/extending/chapter3-bindings/app.qml +++ b/examples/declarative/tutorials/extending/chapter3-bindings/app.qml @@ -37,7 +37,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - +//![0] import Music 1.0 import Qt 4.7 diff --git a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/app.qml b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/app.qml index e238ec4..09662d6 100644 --- a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/app.qml +++ b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/app.qml @@ -37,7 +37,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - +//![0] import Music 1.0 import Qt 4.7 diff --git a/mkspecs/features/incredibuild_xge.prf b/mkspecs/features/incredibuild_xge.prf index b8ca571..a81a0cc 100644 --- a/mkspecs/features/incredibuild_xge.prf +++ b/mkspecs/features/incredibuild_xge.prf @@ -1,11 +1,11 @@ contains(TEMPLATE, "vc.*")|contains(TEMPLATE_PREFIX, "vc") { - EOC = \$\$escape_expand(\\\\n\\\\t) + EOC = $$escape_expand(\\n\\t) # The VCPROJ generator will replace the \r\h with the coded \r\n: 
 # No other generator understands the \h - win32-msvc2*|wince*msvc*: EOC = \$\$escape_expand(\\\\r\\\\h) + win32-msvc2*|wince*msvc*: EOC = $$escape_expand(\\r\\h) for(xge, INCREDIBUILD_XGE) { - eval($${xge}.commands = Rem IncrediBuild_AllowRemote $$EOC Rem IncrediBuild_OutputFile $$replace($${xge}.output,/,\\) $$EOC $$eval($${xge}.commands)) + $${xge}.commands = Rem IncrediBuild_AllowRemote $$EOC Rem IncrediBuild_OutputFile $$replace($${xge}.output,/,\\) $$EOC $$eval($${xge}.commands) } } diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 4c4f5bc..d6b3e09 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -972,7 +972,7 @@ MakefileGenerator::writePrlFile(QTextStream &t) libs << "QMAKE_LIBS_PRIVATE"; t << "QMAKE_PRL_LIBS = "; for(QStringList::Iterator it = libs.begin(); it != libs.end(); ++it) - t << project->values((*it)).join(" ") << " "; + t << project->values((*it)).join(" ").replace('\\', "\\\\") << " "; t << endl; } } diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-hangul.c b/src/3rdparty/harfbuzz/src/harfbuzz-hangul.c index a819dac..6f89ed6 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-hangul.c +++ b/src/3rdparty/harfbuzz/src/harfbuzz-hangul.c @@ -130,7 +130,7 @@ static int hangul_nextSyllableBoundary(const HB_UChar16 *s, int start, int end) static const HB_OpenTypeFeature hangul_features [] = { { HB_MAKE_TAG('c', 'c', 'm', 'p'), CcmpProperty }, { HB_MAKE_TAG('l', 'j', 'm', 'o'), CcmpProperty }, - { HB_MAKE_TAG('j', 'j', 'm', 'o'), CcmpProperty }, + { HB_MAKE_TAG('v', 'j', 'm', 'o'), CcmpProperty }, { HB_MAKE_TAG('t', 'j', 'm', 'o'), CcmpProperty }, { 0, 0 } }; diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h index f7c7714..470e27b 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h +++ b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h @@ -34,6 +34,18 @@ HB_BEGIN_HEADER +/* + using anything else than signed or unsigned for bitfields in C is non standard, + but accepted by almost all compilers. And it gives a significant reduction in + memory consumption as HB_CharAttributes and HB_GlyphAttributes will not have + a 4 byte alignment +*/ +#ifdef __xlC__ +typedef unsigned hb_bitfield; +#else +typedef hb_uint8 hb_bitfield; +#endif + typedef enum { HB_Script_Common, HB_Script_Greek, @@ -123,12 +135,12 @@ typedef enum { typedef struct { - /*HB_LineBreakType*/ unsigned lineBreakType :2; - /*HB_Bool*/ unsigned whiteSpace :1; /* A unicode whitespace character, except NBSP, ZWNBSP */ - /*HB_Bool*/ unsigned charStop :1; /* Valid cursor position (for left/right arrow) */ - /*HB_Bool*/ unsigned wordBoundary :1; - /*HB_Bool*/ unsigned sentenceBoundary :1; - unsigned unused :2; + /*HB_LineBreakType*/ hb_bitfield lineBreakType :2; + /*HB_Bool*/ hb_bitfield whiteSpace :1; /* A unicode whitespace character, except NBSP, ZWNBSP */ + /*HB_Bool*/ hb_bitfield charStop :1; /* Valid cursor position (for left/right arrow) */ + /*HB_Bool*/ hb_bitfield wordBoundary :1; + /*HB_Bool*/ hb_bitfield sentenceBoundary :1; + hb_bitfield unused :2; } HB_CharAttributes; void HB_GetCharAttributes(const HB_UChar16 *string, hb_uint32 stringLength, @@ -181,12 +193,12 @@ typedef enum { * it like that. If this is a problem please tell Trolltech :) */ typedef struct { - unsigned justification :4; /* Justification class */ - unsigned clusterStart :1; /* First glyph of representation of cluster */ - unsigned mark :1; /* needs to be positioned around base char */ - unsigned zeroWidth :1; /* ZWJ, ZWNJ etc, with no width */ - unsigned dontPrint :1; - unsigned combiningClass :8; + hb_bitfield justification :4; /* Justification class */ + hb_bitfield clusterStart :1; /* First glyph of representation of cluster */ + hb_bitfield mark :1; /* needs to be positioned around base char */ + hb_bitfield zeroWidth :1; /* ZWJ, ZWNJ etc, with no width */ + hb_bitfield dontPrint :1; + hb_bitfield combiningClass :8; } HB_GlyphAttributes; typedef struct HB_FaceRec_ { diff --git a/src/corelib/tools/qlocale_symbian.cpp b/src/corelib/tools/qlocale_symbian.cpp index 1e674af..458bb2a 100644 --- a/src/corelib/tools/qlocale_symbian.cpp +++ b/src/corelib/tools/qlocale_symbian.cpp @@ -159,8 +159,9 @@ static const symbianToISO symbian_to_iso_list[] = { { ELangEnglish_Prc, "en_CN" }, // 159 ### Not supported by CLDR { ELangEnglish_Japan, "en_JP"}, // 160 ### Not supported by CLDR { ELangEnglish_Thailand, "en_TH" }, // 161 ### Not supported by CLDR - { ELangMalay_Apac, "ms" } // 326 + { ELangMalay_Apac, "ms" }, // 326 #endif + { 327/*ELangIndonesian_Apac*/,"id_ID" } // 327 - appeared in Symbian^3 }; /*! diff --git a/src/declarative/debugger/debugger.pri b/src/declarative/debugger/debugger.pri index dedea55..6777868 100644 --- a/src/declarative/debugger/debugger.pri +++ b/src/declarative/debugger/debugger.pri @@ -5,11 +5,13 @@ SOURCES += \ $$PWD/qpacketprotocol.cpp \ $$PWD/qdeclarativedebugservice.cpp \ $$PWD/qdeclarativedebugclient.cpp \ - $$PWD/qdeclarativedebug.cpp + $$PWD/qdeclarativedebug.cpp \ + $$PWD/qdeclarativedebugtiming.cpp HEADERS += \ $$PWD/qdeclarativedebuggerstatus_p.h \ $$PWD/qpacketprotocol_p.h \ $$PWD/qdeclarativedebugservice_p.h \ $$PWD/qdeclarativedebugclient_p.h \ - $$PWD/qdeclarativedebug_p.h + $$PWD/qdeclarativedebug_p.h \ + $$PWD/qdeclarativedebugtiming_p.h diff --git a/src/declarative/debugger/qdeclarativedebugservice.cpp b/src/declarative/debugger/qdeclarativedebugservice.cpp index 34e73fd..dca2695 100644 --- a/src/declarative/debugger/qdeclarativedebugservice.cpp +++ b/src/declarative/debugger/qdeclarativedebugservice.cpp @@ -61,6 +61,7 @@ class QDeclarativeDebugServer : public QObject public: static QDeclarativeDebugServer *instance(); void listen(); + void waitForConnection(); bool hasDebuggingClient() const; private Q_SLOTS: @@ -115,6 +116,12 @@ void QDeclarativeDebugServer::listen() qWarning("QDeclarativeDebugServer: Unable to listen on port %d", d->port); } +void QDeclarativeDebugServer::waitForConnection() +{ + Q_D(QDeclarativeDebugServer); + d->tcpServer->waitForNewConnection(-1); +} + void QDeclarativeDebugServer::newConnection() { Q_D(QDeclarativeDebugServer); @@ -144,6 +151,7 @@ QDeclarativeDebugServer *QDeclarativeDebugServer::instance() if (!envTested) { envTested = true; QByteArray env = qgetenv("QML_DEBUG_SERVER_PORT"); + QByteArray block = qgetenv("QML_DEBUG_SERVER_BLOCK"); bool ok = false; int port = env.toInt(&ok); @@ -151,6 +159,9 @@ QDeclarativeDebugServer *QDeclarativeDebugServer::instance() if (ok && port > 1024) { server = new QDeclarativeDebugServer(port); server->listen(); + if (!block.isEmpty()) { + server->waitForConnection(); + } } } diff --git a/src/declarative/debugger/qdeclarativedebugtiming.cpp b/src/declarative/debugger/qdeclarativedebugtiming.cpp new file mode 100644 index 0000000..5b93852 --- /dev/null +++ b/src/declarative/debugger/qdeclarativedebugtiming.cpp @@ -0,0 +1,95 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qdeclarativedebugtiming_p.h" + +#include <QtCore/qdatastream.h> + +Q_GLOBAL_STATIC(QDeclarativeDebugTiming, timerInstance); + +QDeclarativeDebugTiming::QDeclarativeDebugTiming() +: QDeclarativeDebugService(QLatin1String("CanvasFrameRate")) +{ + m_timer.start(); +} + +void QDeclarativeDebugTiming::addEvent(EventType t) +{ + if (QDeclarativeDebugService::isDebuggingEnabled()) + timerInstance()->addEventImpl(t); +} + +void QDeclarativeDebugTiming::startRange(RangeType t) +{ + if (QDeclarativeDebugService::isDebuggingEnabled()) + timerInstance()->startRangeImpl(t); +} + +void QDeclarativeDebugTiming::endRange(RangeType t) +{ + if (QDeclarativeDebugService::isDebuggingEnabled()) + timerInstance()->endRangeImpl(t); +} + +void QDeclarativeDebugTiming::addEventImpl(EventType event) +{ + QByteArray data; + QDataStream ds(&data, QIODevice::WriteOnly); + ds << m_timer.elapsed() << (int)Event << (int)event; + sendMessage(data); +} + +void QDeclarativeDebugTiming::startRangeImpl(RangeType range) +{ + QByteArray data; + QDataStream ds(&data, QIODevice::WriteOnly); + ds << m_timer.elapsed() << (int)RangeStart << (int)range; + sendMessage(data); +} + +void QDeclarativeDebugTiming::endRangeImpl(RangeType range) +{ + QByteArray data; + QDataStream ds(&data, QIODevice::WriteOnly); + ds << m_timer.elapsed() << (int)RangeEnd << (int)range; + sendMessage(data); +} + diff --git a/demos/qtdemo/MagicAnim.qml b/src/declarative/debugger/qdeclarativedebugtiming_p.h index 7ac3e1c..d9ed67c 100644 --- a/demos/qtdemo/MagicAnim.qml +++ b/src/declarative/debugger/qdeclarativedebugtiming_p.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the demonstration applications of the Qt Toolkit. +** This file is part of the QtDeclarative module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -39,22 +39,58 @@ ** ****************************************************************************/ -import Qt 4.7 - -//Emulates the in animation of the menu elements -SequentialAnimation{ - id: main; - property Item target - property int from: 0 - property int to: 100 - property int duration: 1000 - property string properties: "y" - PauseAnimation { duration: main.duration*0.20 } - NumberAnimation { target: main.target; properties: main.properties; from: main.from; to: main.to + 40; duration: main.duration*0.30 } - NumberAnimation { target: main.target; properties: main.properties; from: main.to + 40; to: main.to; duration: main.duration*0.10 } - NumberAnimation { target: main.target; properties: main.properties; from: main.to; to: main.to + 20; duration: main.duration*0.10 } - NumberAnimation { target: main.target; properties: main.properties; from: main.to + 20; to: main.to; duration: main.duration*0.10 } - NumberAnimation { target: main.target; properties: main.properties; from: main.to; to: main.to + 8; duration: main.duration*0.10 } - NumberAnimation { target: main.target; properties: main.properties; from: main.to + 8; to: main.to; duration: main.duration*0.10 } -} +#ifndef QDECLARATIVEDEBUGTIMING_P_H +#define QDECLARATIVEDEBUGTIMING_P_H + +#include <private/qdeclarativedebugservice_p.h> +#include <QtCore/qelapsedtimer.h> + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QDeclarativeDebugTiming : public QDeclarativeDebugService +{ +public: + enum EventType { + FramePaint, + Mouse, + Key, + + MaximumEventType + }; + + enum Message { + Event, + RangeStart, + RangeEnd, + + MaximumMessage + }; + + enum RangeType { + Painting, + Compiling, + Creating, + + MaximumRangeType + }; + + static void addEvent(EventType); + static void startRange(RangeType); + static void endRange(RangeType); + + QDeclarativeDebugTiming(); +private: + void addEventImpl(EventType); + void startRangeImpl(RangeType); + void endRangeImpl(RangeType); + QElapsedTimer m_timer; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QDECLARATIVEDEBUGTIMING_P_H diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index 560d586..1dde510 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -1026,24 +1026,6 @@ QDeclarativeListProperty<QGraphicsObject> QDeclarativeFlickable::flickableChildr return QGraphicsItemPrivate::get(d->viewport)->childrenList(); } -bool QDeclarativeFlickable::overShoot() const -{ - Q_D(const QDeclarativeFlickable); - return d->boundsBehavior == DragAndOvershootBounds; -} - -void QDeclarativeFlickable::setOverShoot(bool o) -{ - Q_D(QDeclarativeFlickable); - if ((o && d->boundsBehavior == DragAndOvershootBounds) - || (!o && d->boundsBehavior == StopAtBounds)) - return; - qmlInfo(this) << "overshoot is deprecated and will be removed imminently - use boundsBehavior."; - d->boundsBehavior = o ? DragAndOvershootBounds : StopAtBounds; - emit boundsBehaviorChanged(); - emit overShootChanged(); -} - /*! \qmlproperty enumeration Flickable::boundsBehavior This property holds whether the surface may be dragged @@ -1078,7 +1060,6 @@ void QDeclarativeFlickable::setBoundsBehavior(BoundsBehavior b) return; d->boundsBehavior = b; emit boundsBehaviorChanged(); - emit overShootChanged(); } /*! diff --git a/src/declarative/graphicsitems/qdeclarativeflickable_p.h b/src/declarative/graphicsitems/qdeclarativeflickable_p.h index 05887b8..d40a0dc 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable_p.h +++ b/src/declarative/graphicsitems/qdeclarativeflickable_p.h @@ -64,7 +64,6 @@ class Q_DECLARATIVE_EXPORT QDeclarativeFlickable : public QDeclarativeItem Q_PROPERTY(qreal horizontalVelocity READ horizontalVelocity NOTIFY horizontalVelocityChanged) Q_PROPERTY(qreal verticalVelocity READ verticalVelocity NOTIFY verticalVelocityChanged) - Q_PROPERTY(bool overShoot READ overShoot WRITE setOverShoot NOTIFY overShootChanged) // deprecated Q_PROPERTY(BoundsBehavior boundsBehavior READ boundsBehavior WRITE setBoundsBehavior NOTIFY boundsBehaviorChanged) Q_PROPERTY(qreal maximumFlickVelocity READ maximumFlickVelocity WRITE setMaximumFlickVelocity NOTIFY maximumFlickVelocityChanged) Q_PROPERTY(qreal flickDeceleration READ flickDeceleration WRITE setFlickDeceleration NOTIFY flickDecelerationChanged) @@ -101,9 +100,6 @@ public: QDeclarativeListProperty<QObject> flickableData(); QDeclarativeListProperty<QGraphicsObject> flickableChildren(); - bool overShoot() const; - void setOverShoot(bool); - enum BoundsBehavior { StopAtBounds, DragOverBounds, DragAndOvershootBounds }; BoundsBehavior boundsBehavior() const; void setBoundsBehavior(BoundsBehavior); @@ -172,7 +168,6 @@ Q_SIGNALS: void pageChanged(); void flickableDirectionChanged(); void interactiveChanged(); - void overShootChanged(); void boundsBehaviorChanged(); void maximumFlickVelocityChanged(); void flickDecelerationChanged(); diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp index 207cc25..3a69f44 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview.cpp +++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp @@ -110,6 +110,8 @@ QDeclarativeItem *QDeclarativePathViewPrivate::getItem(int modelIndex) att->setOnPath(true); } item->setParentItem(q); + QDeclarativeItemPrivate *itemPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(item)); + itemPrivate->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry); } requestedIndex = -1; return item; @@ -121,6 +123,8 @@ void QDeclarativePathViewPrivate::releaseItem(QDeclarativeItem *item) return; if (QDeclarativePathViewAttached *att = attached(item)) att->setOnPath(false); + QDeclarativeItemPrivate *itemPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(item)); + itemPrivate->removeItemChangeListener(this, QDeclarativeItemPrivate::Geometry); model->release(item); } @@ -1084,6 +1088,16 @@ bool QDeclarativePathView::sceneEventFilter(QGraphicsItem *i, QEvent *e) return QDeclarativeItem::sceneEventFilter(i, e); } +bool QDeclarativePathView::event(QEvent *event) +{ + if (event->type() == QEvent::User) { + refill(); + return true; + } + + return QDeclarativeItem::event(event); +} + void QDeclarativePathView::componentComplete() { Q_D(QDeclarativePathView); @@ -1103,6 +1117,7 @@ void QDeclarativePathView::refill() if (!d->isValid() || !isComponentComplete()) return; + d->layoutScheduled = false; bool currentVisible = false; // first move existing items and remove items off path diff --git a/src/declarative/graphicsitems/qdeclarativepathview_p.h b/src/declarative/graphicsitems/qdeclarativepathview_p.h index 349a01c..8a6f53f 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview_p.h +++ b/src/declarative/graphicsitems/qdeclarativepathview_p.h @@ -161,6 +161,7 @@ protected: void mouseReleaseEvent(QGraphicsSceneMouseEvent *); bool sendMouseEvent(QGraphicsSceneMouseEvent *event); bool sceneEventFilter(QGraphicsItem *, QEvent *); + bool event(QEvent *event); void componentComplete(); private Q_SLOTS: diff --git a/src/declarative/graphicsitems/qdeclarativepathview_p_p.h b/src/declarative/graphicsitems/qdeclarativepathview_p_p.h index 303486f..3abb2f4 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview_p_p.h +++ b/src/declarative/graphicsitems/qdeclarativepathview_p_p.h @@ -68,7 +68,7 @@ QT_BEGIN_NAMESPACE class QDeclarativeOpenMetaObjectType; class QDeclarativePathViewAttached; -class QDeclarativePathViewPrivate : public QDeclarativeItemPrivate +class QDeclarativePathViewPrivate : public QDeclarativeItemPrivate, public QDeclarativeItemChangeListener { Q_DECLARE_PUBLIC(QDeclarativePathView) @@ -77,7 +77,8 @@ public: : path(0), currentIndex(0), currentItemOffset(0.0), startPc(0), lastDist(0) , lastElapsed(0), mappedRange(1.0) , stealMouse(false), ownModel(false), interactive(true), haveHighlightRange(true) - , autoHighlight(true), highlightUp(false), dragMargin(0), deceleration(100) + , autoHighlight(true), highlightUp(false), layoutScheduled(false) + , dragMargin(0), deceleration(100) , moveOffset(this, &QDeclarativePathViewPrivate::setOffset) , firstIndex(-1), pathItems(-1), requestedIndex(-1) , moveReason(Other), attType(0), highlightComponent(0), highlightItem(0) @@ -89,8 +90,7 @@ public: { } - void init() - { + void init() { Q_Q(QDeclarativePathView); offset = 0; q->setAcceptedMouseButtons(Qt::LeftButton); @@ -99,6 +99,21 @@ public: q->connect(&tl, SIGNAL(updated()), q, SLOT(ticked())); } + void itemGeometryChanged(QDeclarativeItem *item, const QRectF &newGeometry, const QRectF &oldGeometry) { + if ((newGeometry.size() != oldGeometry.size()) + && (!highlightItem || item != highlightItem)) { + scheduleLayout(); + } + } + + void scheduleLayout() { + Q_Q(QDeclarativePathView); + if (!layoutScheduled) { + layoutScheduled = true; + QCoreApplication::postEvent(q, new QEvent(QEvent::User), Qt::HighEventPriority); + } + } + QDeclarativeItem *getItem(int modelIndex); void releaseItem(QDeclarativeItem *item); QDeclarativePathViewAttached *attached(QDeclarativeItem *item); @@ -138,6 +153,7 @@ public: bool haveHighlightRange : 1; bool autoHighlight : 1; bool highlightUp : 1; + bool layoutScheduled : 1; QTime lastPosTime; QPointF lastPos; qreal dragMargin; diff --git a/src/declarative/graphicsitems/qdeclarativerectangle.cpp b/src/declarative/graphicsitems/qdeclarativerectangle.cpp index 4f7a722..301ca00 100644 --- a/src/declarative/graphicsitems/qdeclarativerectangle.cpp +++ b/src/declarative/graphicsitems/qdeclarativerectangle.cpp @@ -116,6 +116,10 @@ void QDeclarativeGradientStop::updateGradient() \snippet doc/src/snippets/declarative/gradient.qml code + Note that this item is not a visual representation of a gradient. To display a + gradient use a visual item (like rectangle) which supports having a gradient set + on it for display. + \sa GradientStop */ diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp index 7aa17e8..2dc2d2d 100644 --- a/src/declarative/qml/qdeclarativecomponent.cpp +++ b/src/declarative/qml/qdeclarativecomponent.cpp @@ -53,6 +53,7 @@ #include "private/qdeclarativebinding_p_p.h" #include "private/qdeclarativeglobal_p.h" #include "private/qdeclarativescriptparser_p.h" +#include "private/qdeclarativedebugtiming_p.h" #include <QStack> #include <QStringList> @@ -693,6 +694,10 @@ QDeclarativeComponentPrivate::beginCreate(QDeclarativeContextData *context, cons QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine); + bool isRoot = !ep->inBeginCreate; + if (isRoot) + QDeclarativeDebugTiming::startRange(QDeclarativeDebugTiming::Creating); + QDeclarativeContextData *ctxt = new QDeclarativeContextData; ctxt->isInternal = true; ctxt->url = cc->url; @@ -839,6 +844,7 @@ void QDeclarativeComponentPrivate::complete(QDeclarativeEnginePrivate *enginePri enginePriv->erroredBindings->removeError(); } } + } } @@ -860,6 +866,8 @@ void QDeclarativeComponentPrivate::completeCreate() if (state.completePending) { QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine); complete(ep, &state); + + QDeclarativeDebugTiming::endRange(QDeclarativeDebugTiming::Creating); } } diff --git a/src/declarative/util/qdeclarativeview.cpp b/src/declarative/util/qdeclarativeview.cpp index b7ce9c9..d2dab76 100644 --- a/src/declarative/util/qdeclarativeview.cpp +++ b/src/declarative/util/qdeclarativeview.cpp @@ -45,11 +45,11 @@ #include <qdeclarativeitem.h> #include <qdeclarativeengine.h> #include <qdeclarativecontext.h> -#include <qdeclarativedebug_p.h> -#include <qdeclarativedebugservice_p.h> #include <qdeclarativeglobal_p.h> #include <qdeclarativeguard_p.h> +#include <private/qdeclarativedebugtiming_p.h> + #include <qscriptvalueiterator.h> #include <qdebug.h> #include <qtimer.h> @@ -66,66 +66,64 @@ #include <QtCore/qabstractanimation.h> #include <private/qgraphicsview_p.h> #include <private/qdeclarativeitem_p.h> +#include <private/qabstractanimation_p.h> #include <private/qdeclarativeitemchangelistener_p.h> QT_BEGIN_NAMESPACE DEFINE_BOOL_CONFIG_OPTION(frameRateDebug, QML_SHOW_FRAMERATE) -class QDeclarativeViewDebugServer; -class FrameBreakAnimation : public QAbstractAnimation +class QDeclarativeScene : public QGraphicsScene { public: - FrameBreakAnimation(QDeclarativeViewDebugServer *s) - : QAbstractAnimation((QObject*)s), server(s) - { - start(); - } + QDeclarativeScene(); - virtual int duration() const { return -1; } - virtual void updateCurrentTime(int msecs); +protected: + virtual void keyPressEvent(QKeyEvent *); + virtual void keyReleaseEvent(QKeyEvent *); -private: - QDeclarativeViewDebugServer *server; + virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *); + virtual void mousePressEvent(QGraphicsSceneMouseEvent *); + virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *); }; -class QDeclarativeViewDebugServer : public QDeclarativeDebugService +QDeclarativeScene::QDeclarativeScene() { -public: - QDeclarativeViewDebugServer(QObject *parent = 0) : QDeclarativeDebugService(QLatin1String("CanvasFrameRate"), parent), breaks(0) - { - timer.start(); - new FrameBreakAnimation(this); - } +} - void addTiming(int pe, int tbf) - { - if (!isEnabled()) - return; - - bool isFrameBreak = breaks > 1; - breaks = 0; - int e = timer.elapsed(); - QByteArray data; - QDataStream ds(&data, QIODevice::WriteOnly); - ds << (int)pe << (int)tbf << (int)e - << (bool)isFrameBreak; - sendMessage(data); - } +void QDeclarativeScene::keyPressEvent(QKeyEvent *e) +{ + QDeclarativeDebugTiming::addEvent(QDeclarativeDebugTiming::Key); - void frameBreak() { ++breaks; } + QGraphicsScene::keyPressEvent(e); +} -private: - QElapsedTimer timer; - int breaks; -}; +void QDeclarativeScene::keyReleaseEvent(QKeyEvent *e) +{ + QDeclarativeDebugTiming::addEvent(QDeclarativeDebugTiming::Key); -Q_GLOBAL_STATIC(QDeclarativeViewDebugServer, qfxViewDebugServer); + QGraphicsScene::keyReleaseEvent(e); +} -void FrameBreakAnimation::updateCurrentTime(int msecs) +void QDeclarativeScene::mouseMoveEvent(QGraphicsSceneMouseEvent *e) { - Q_UNUSED(msecs); - server->frameBreak(); + QDeclarativeDebugTiming::addEvent(QDeclarativeDebugTiming::Mouse); + + QGraphicsScene::mouseMoveEvent(e); +} + +void QDeclarativeScene::mousePressEvent(QGraphicsSceneMouseEvent *e) +{ + QDeclarativeDebugTiming::addEvent(QDeclarativeDebugTiming::Mouse); + + QGraphicsScene::mousePressEvent(e); +} + +void QDeclarativeScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *e) +{ + QDeclarativeDebugTiming::addEvent(QDeclarativeDebugTiming::Mouse); + + QGraphicsScene::mouseReleaseEvent(e); } class QDeclarativeViewPrivate : public QGraphicsViewPrivate, public QDeclarativeItemChangeListener @@ -156,7 +154,7 @@ public: void init(); - QGraphicsScene scene; + QDeclarativeScene scene; }; void QDeclarativeViewPrivate::execute() @@ -676,12 +674,18 @@ void QDeclarativeView::resizeEvent(QResizeEvent *e) void QDeclarativeView::paintEvent(QPaintEvent *event) { Q_D(QDeclarativeView); + + QDeclarativeDebugTiming::addEvent(QDeclarativeDebugTiming::FramePaint); + QDeclarativeDebugTiming::startRange(QDeclarativeDebugTiming::Painting); + int time = 0; - if (frameRateDebug() || QDeclarativeViewDebugServer::isDebuggingEnabled()) + if (frameRateDebug()) time = d->frameTimer.restart(); + QGraphicsView::paintEvent(event); - if (QDeclarativeViewDebugServer::isDebuggingEnabled()) - qfxViewDebugServer()->addTiming(d->frameTimer.elapsed(), time); + + QDeclarativeDebugTiming::endRange(QDeclarativeDebugTiming::Painting); + if (frameRateDebug()) qDebug() << "paintEvent:" << d->frameTimer.elapsed() << "time since last frame:" << time; } diff --git a/src/gui/itemviews/qitemdelegate.cpp b/src/gui/itemviews/qitemdelegate.cpp index d5f6fd2..9bbfc23 100644 --- a/src/gui/itemviews/qitemdelegate.cpp +++ b/src/gui/itemviews/qitemdelegate.cpp @@ -667,7 +667,6 @@ void QItemDelegate::drawDisplay(QPainter *painter, const QStyleOptionViewItem &o { Q_D(const QItemDelegate); - QPen pen = painter->pen(); QPalette::ColorGroup cg = option.state & QStyle::State_Enabled ? QPalette::Normal : QPalette::Disabled; if (cg == QPalette::Normal && !(option.state & QStyle::State_Active)) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 57c4c99..0d11b27 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -666,7 +666,8 @@ void QApplicationPrivate::process_cmdline() \o -geometry \e geometry, sets the client geometry of the first window that is shown. \o -fn or \c -font \e font, defines the application font. The font - should be specified using an X logical font description. + should be specified using an X logical font description. Note that + this option is ignored when Qt is built with fontconfig support enabled. \o -bg or \c -background \e color, sets the default background color and an application palette (light and dark shades are calculated). \o -fg or \c -foreground \e color, sets the default foreground color. diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index 6c8d561..9d6dc9a 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -325,6 +325,7 @@ void QGtkStyle::polish(QApplication *app) qt_filedialog_save_filename_hook = &QGtkStylePrivate::saveFilename; qt_filedialog_open_filenames_hook = &QGtkStylePrivate::openFilenames; qt_filedialog_existing_directory_hook = &QGtkStylePrivate::openDirectory; + qApp->installEventFilter(&d->filter); } } } @@ -345,6 +346,7 @@ void QGtkStyle::unpolish(QApplication *app) qt_filedialog_save_filename_hook = 0; qt_filedialog_open_filenames_hook = 0; qt_filedialog_existing_directory_hook = 0; + qApp->removeEventFilter(&d->filter); } } diff --git a/src/gui/styles/qgtkstyle_p.cpp b/src/gui/styles/qgtkstyle_p.cpp index 3c6a1ef..4ed0fab 100644 --- a/src/gui/styles/qgtkstyle_p.cpp +++ b/src/gui/styles/qgtkstyle_p.cpp @@ -285,8 +285,6 @@ void QGtkStylePrivate::init() { resolveGtk(); initGtkWidgets(); - if (isThemeAvailable()) - qApp->installEventFilter(&filter); } GtkWidget* QGtkStylePrivate::gtkWidget(const QHashableLatin1Literal &path) diff --git a/src/imports/webkit/qdeclarativewebview.cpp b/src/imports/webkit/qdeclarativewebview.cpp index 36a25f6..050e2b7 100644 --- a/src/imports/webkit/qdeclarativewebview.cpp +++ b/src/imports/webkit/qdeclarativewebview.cpp @@ -150,6 +150,9 @@ public: The item includes no scrolling, scaling, toolbars, etc., those must be implemented around WebView. See the WebBrowser example for a demonstration of this. + + When this item has keyboard focus, all keyboard input will be sent directly to the + web page within. */ /*! @@ -701,20 +704,12 @@ void QDeclarativeWebView::hoverMoveEvent (QGraphicsSceneHoverEvent * event) QDeclarativeItem::hoverMoveEvent(event); } -bool QDeclarativeWebView::sceneEvent(QEvent *event) -{ - if (event->type() == QEvent::KeyPress) { - QKeyEvent *k = static_cast<QKeyEvent *>(event); - if (k->key() == Qt::Key_Tab || k->key() == Qt::Key_Backtab) { - if (!(k->modifiers() & (Qt::ControlModifier | Qt::AltModifier))) { //### Add MetaModifier? - page()->event(event); - if (event->isAccepted()) - return true; - } - } - } +bool QDeclarativeWebView::sceneEvent(QEvent *event) +{ + if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease)//Key events go to the page + return page()->event(event); return QDeclarativeItem::sceneEvent(event); -} +} /*! diff --git a/src/script/api/qscriptcontext.cpp b/src/script/api/qscriptcontext.cpp index 639af80..3f08e74 100644 --- a/src/script/api/qscriptcontext.cpp +++ b/src/script/api/qscriptcontext.cpp @@ -742,6 +742,7 @@ void QScriptContext::pushScope(const QScriptValue &object) */ QScriptValue QScriptContext::popScope() { + activationObject(); //ensure the creation of the normal scope for native context JSC::CallFrame *frame = QScriptEnginePrivate::frameForContext(this); JSC::ScopeChainNode *scope = frame->scopeChain(); Q_ASSERT(scope != 0); diff --git a/src/src.pro b/src/src.pro index 7574796..5436c4a 100644 --- a/src/src.pro +++ b/src/src.pro @@ -157,24 +157,24 @@ for(subname, SRC_SUBDIRS) { SUB_TEMPLATE = $$list($$fromfile($$subpro, TEMPLATE)) !isEqual(subname, src_tools_bootstrap):if(isEqual($$SUB_TEMPLATE, lib) | isEqual($$SUB_TEMPLATE, subdirs) | isEqual(subname, src_tools_idc) | isEqual(subname, src_tools_uic3)):!separate_debug_info { #debug - eval(debug-$${subtarget}.depends = $${subdir}\$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_DEBUG_TARGETS) - eval(debug-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) debug)) + debug-$${subtarget}.depends = $${subdir}$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_DEBUG_TARGETS + debug-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) debug) EXTRA_DEBUG_TARGETS += debug-$${subtarget} QMAKE_EXTRA_TARGETS += debug-$${subtarget} #release - eval(release-$${subtarget}.depends = $${subdir}\$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_RELEASE_TARGETS) - eval(release-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) release)) + release-$${subtarget}.depends = $${subdir}$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_RELEASE_TARGETS + release-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) release) EXTRA_RELEASE_TARGETS += release-$${subtarget} QMAKE_EXTRA_TARGETS += release-$${subtarget} } else { #do not have a real debug target/release #debug - eval(debug-$${subtarget}.depends = $${subdir}\$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_DEBUG_TARGETS) - eval(debug-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) first)) + debug-$${subtarget}.depends = $${subdir}$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_DEBUG_TARGETS + debug-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) first) EXTRA_DEBUG_TARGETS += debug-$${subtarget} QMAKE_EXTRA_TARGETS += debug-$${subtarget} #release - eval(release-$${subtarget}.depends = $${subdir}\$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_RELEASE_TARGETS) - eval(release-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) first)) + release-$${subtarget}.depends = $${subdir}$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_RELEASE_TARGETS + release-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) first) EXTRA_RELEASE_TARGETS += release-$${subtarget} QMAKE_EXTRA_TARGETS += release-$${subtarget} } diff --git a/src/tools/tools.pro b/src/tools/tools.pro index 1ecb944..4736d09 100644 --- a/src/tools/tools.pro +++ b/src/tools/tools.pro @@ -45,24 +45,24 @@ EXTRA_RELEASE_TARGETS = SUB_TEMPLATE = $$list($$fromfile($$subpro, TEMPLATE)) !isEqual(subname, src_tools_bootstrap):if(isEqual($$SUB_TEMPLATE, lib) | isEqual($$SUB_TEMPLATE, subdirs) | isEqual(subname, src_tools_idc) | isEqual(subname, src_tools_uic3)):!separate_debug_info { #debug - eval(debug-$${subtarget}.depends = $${subdir}\$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_DEBUG_TARGETS) - eval(debug-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) debug)) + debug-$${subtarget}.depends = $${subdir}$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_DEBUG_TARGETS + debug-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) debug) EXTRA_DEBUG_TARGETS += debug-$${subtarget} QMAKE_EXTRA_TARGETS += debug-$${subtarget} #release - eval(release-$${subtarget}.depends = $${subdir}\$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_RELEASE_TARGETS) - eval(release-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) release)) + release-$${subtarget}.depends = $${subdir}$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_RELEASE_TARGETS + release-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) release) EXTRA_RELEASE_TARGETS += release-$${subtarget} QMAKE_EXTRA_TARGETS += release-$${subtarget} } else { #do not have a real debug target/release #debug - eval(debug-$${subtarget}.depends = $${subdir}\$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_DEBUG_TARGETS) - eval(debug-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) first)) + debug-$${subtarget}.depends = $${subdir}$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_DEBUG_TARGETS + debug-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) first) EXTRA_DEBUG_TARGETS += debug-$${subtarget} QMAKE_EXTRA_TARGETS += debug-$${subtarget} #release - eval(release-$${subtarget}.depends = $${subdir}\$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_RELEASE_TARGETS) - eval(release-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) first)) + release-$${subtarget}.depends = $${subdir}$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_RELEASE_TARGETS + release-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) first) EXTRA_RELEASE_TARGETS += release-$${subtarget} QMAKE_EXTRA_TARGETS += release-$${subtarget} } diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathview0.qml b/tests/auto/declarative/qdeclarativepathview/data/pathview0.qml index a3afd38..8956205 100644 --- a/tests/auto/declarative/qdeclarativepathview/data/pathview0.qml +++ b/tests/auto/declarative/qdeclarativepathview/data/pathview0.qml @@ -4,6 +4,8 @@ Rectangle { id: root property int currentA: -1 property int currentB: -1 + property real delegateWidth: 60 + property real delegateHeight: 20 width: 240 height: 320 color: "#ffffff" @@ -13,8 +15,8 @@ Rectangle { Rectangle { id: wrapper objectName: "wrapper" - height: 20 - width: 60 + height: root.delegateHeight + width: root.delegateWidth color: PathView.isCurrentItem ? "lightsteelblue" : "white" border.color: "black" Text { diff --git a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp index f32a6c7..dffc7ac 100644 --- a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp +++ b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp @@ -445,6 +445,12 @@ void tst_QDeclarativePathView::pathMoved() pathview->setOffset(0.0); QCOMPARE(firstItem->pos() + offset, start); + // Change delegate size + canvas->rootObject()->setProperty("delegateWidth", 30); + QCOMPARE(firstItem->width(), 30.0); + offset.setX(firstItem->width()/2); + QTRY_COMPARE(firstItem->pos() + offset, start); + delete canvas; } diff --git a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp index 100e195..617c183 100644 --- a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp +++ b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp @@ -84,6 +84,7 @@ private slots: void jsActivationObject(); void qobjectAsActivationObject(); void parentContextCallee_QT2270(); + void popNativeContextScope(); }; tst_QScriptContext::tst_QScriptContext() @@ -539,6 +540,50 @@ void tst_QScriptContext::pushAndPopContext() } } +void tst_QScriptContext::popNativeContextScope() +{ + QScriptEngine eng; + QScriptContext *ctx = eng.pushContext(); + QVERIFY(ctx->popScope().isObject()); // the activation object + + QCOMPARE(ctx->scopeChain().size(), 1); + QVERIFY(ctx->scopeChain().at(0).strictlyEquals(eng.globalObject())); + // This was different in 4.5: scope and activation were decoupled + QVERIFY(ctx->activationObject().strictlyEquals(eng.globalObject())); + + QVERIFY(!eng.evaluate("var foo = 123; function bar() {}").isError()); + QVERIFY(eng.globalObject().property("foo").isNumber()); + QVERIFY(eng.globalObject().property("bar").isFunction()); + + QScriptValue customScope = eng.newObject(); + ctx->pushScope(customScope); + QCOMPARE(ctx->scopeChain().size(), 2); + QVERIFY(ctx->scopeChain().at(0).strictlyEquals(customScope)); + QVERIFY(ctx->scopeChain().at(1).strictlyEquals(eng.globalObject())); + QVERIFY(ctx->activationObject().strictlyEquals(eng.globalObject())); + ctx->setActivationObject(customScope); + QVERIFY(ctx->activationObject().strictlyEquals(customScope)); + QCOMPARE(ctx->scopeChain().size(), 2); + QVERIFY(ctx->scopeChain().at(0).strictlyEquals(customScope)); + QEXPECT_FAIL("", "QTBUG-11012", Continue); + QVERIFY(ctx->scopeChain().at(1).strictlyEquals(eng.globalObject())); + + QVERIFY(!eng.evaluate("baz = 456; var foo = 789; function barbar() {}").isError()); + QEXPECT_FAIL("", "QTBUG-11012", Continue); + QVERIFY(eng.globalObject().property("baz").isNumber()); + QVERIFY(customScope.property("foo").isNumber()); + QVERIFY(customScope.property("barbar").isFunction()); + + QVERIFY(ctx->popScope().strictlyEquals(customScope)); + QCOMPARE(ctx->scopeChain().size(), 1); + QEXPECT_FAIL("", "QTBUG-11012", Continue); + QVERIFY(ctx->scopeChain().at(0).strictlyEquals(eng.globalObject())); + + // Need to push another object, otherwise we crash in popContext() (QTBUG-11012) + ctx->pushScope(customScope); + eng.popContext(); +} + void tst_QScriptContext::lineNumber() { QScriptEngine eng; diff --git a/tools/assistant/lib/qhelpsearchindexreader_default_p.h b/tools/assistant/lib/qhelpsearchindexreader_default_p.h index b30fa4b..27764db 100644 --- a/tools/assistant/lib/qhelpsearchindexreader_default_p.h +++ b/tools/assistant/lib/qhelpsearchindexreader_default_p.h @@ -61,9 +61,6 @@ QT_BEGIN_NAMESPACE -struct Entry; -struct PosEntry; - namespace fulltextsearch { namespace std { diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index ee49bbf..c2b3a57 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -392,11 +392,19 @@ Configure::~Configure() } } -QString Configure::fixSeparators(QString somePath) +QString Configure::fixSeparators(const QString &somePath, bool escape) { - return useUnixSeparators ? - QDir::fromNativeSeparators(somePath) : - QDir::toNativeSeparators(somePath); + if (useUnixSeparators) + return QDir::fromNativeSeparators(somePath); + QString ret = QDir::toNativeSeparators(somePath); + return escape ? escapeSeparators(ret) : ret; +} + +QString Configure::escapeSeparators(const QString &somePath) +{ + QString out = somePath; + out.replace(QLatin1Char('\\'), QLatin1String("\\\\")); + return out; } // We could use QDir::homePath() + "/.qt-license", but @@ -2573,10 +2581,10 @@ void Configure::generateOutputVars() qtConfig += "accessibility"; if( !qmakeLibs.isEmpty() ) - qmakeVars += "LIBS += " + qmakeLibs.join( " " ); + qmakeVars += "LIBS += " + escapeSeparators(qmakeLibs.join( " " )); if( !dictionary["QT_LFLAGS_SQLITE"].isEmpty() ) - qmakeVars += "QT_LFLAGS_SQLITE += " + dictionary["QT_LFLAGS_SQLITE"]; + qmakeVars += "QT_LFLAGS_SQLITE += " + escapeSeparators(dictionary["QT_LFLAGS_SQLITE"]); if (dictionary[ "QT3SUPPORT" ] == "yes") qtConfig += "qt3support"; @@ -2721,14 +2729,14 @@ void Configure::generateOutputVars() if(dictionary.contains("XQMAKESPEC") && dictionary[ "XQMAKESPEC" ].startsWith("linux")) dictionary[ "QMAKE_RPATHDIR" ] = dictionary[ "QT_INSTALL_LIBS" ]; - qmakeVars += QString("OBJECTS_DIR = ") + fixSeparators( "tmp/obj/" + dictionary[ "QMAKE_OUTDIR" ] ); - qmakeVars += QString("MOC_DIR = ") + fixSeparators( "tmp/moc/" + dictionary[ "QMAKE_OUTDIR" ] ); - qmakeVars += QString("RCC_DIR = ") + fixSeparators("tmp/rcc/" + dictionary["QMAKE_OUTDIR"]); + qmakeVars += QString("OBJECTS_DIR = ") + fixSeparators("tmp/obj/" + dictionary[ "QMAKE_OUTDIR" ], true); + qmakeVars += QString("MOC_DIR = ") + fixSeparators("tmp/moc/" + dictionary[ "QMAKE_OUTDIR" ], true); + qmakeVars += QString("RCC_DIR = ") + fixSeparators("tmp/rcc/" + dictionary["QMAKE_OUTDIR"], true); if (!qmakeDefines.isEmpty()) qmakeVars += QString("DEFINES += ") + qmakeDefines.join( " " ); if (!qmakeIncludes.isEmpty()) - qmakeVars += QString("INCLUDEPATH += ") + qmakeIncludes.join( " " ); + qmakeVars += QString("INCLUDEPATH += ") + escapeSeparators(qmakeIncludes.join( " " )); if (!opensslLibs.isEmpty()) qmakeVars += opensslLibs; else if (dictionary[ "OPENSSL" ] == "linked") { @@ -2800,27 +2808,27 @@ void Configure::generateCachefile() QString targetSpec = dictionary.contains("XQMAKESPEC") ? dictionary[ "XQMAKESPEC" ] : dictionary[ "QMAKESPEC" ]; QString mkspec_path = fixSeparators(sourcePath + "/mkspecs/" + targetSpec); if(QFile::exists(mkspec_path)) - cacheStream << "QMAKESPEC = " << mkspec_path << endl; + cacheStream << "QMAKESPEC = " << escapeSeparators(mkspec_path) << endl; else - cacheStream << "QMAKESPEC = " << fixSeparators(targetSpec) << endl; - cacheStream << "ARCH = " << fixSeparators(dictionary[ "ARCHITECTURE" ]) << endl; - cacheStream << "QT_BUILD_TREE = " << fixSeparators(dictionary[ "QT_BUILD_TREE" ]) << endl; - cacheStream << "QT_SOURCE_TREE = " << fixSeparators(dictionary[ "QT_SOURCE_TREE" ]) << endl; + cacheStream << "QMAKESPEC = " << fixSeparators(targetSpec, true) << endl; + cacheStream << "ARCH = " << dictionary[ "ARCHITECTURE" ] << endl; + cacheStream << "QT_BUILD_TREE = " << fixSeparators(dictionary[ "QT_BUILD_TREE" ], true) << endl; + cacheStream << "QT_SOURCE_TREE = " << fixSeparators(dictionary[ "QT_SOURCE_TREE" ], true) << endl; if (dictionary["QT_EDITION"] != "QT_EDITION_OPENSOURCE") cacheStream << "DEFINES *= QT_EDITION=QT_EDITION_DESKTOP" << endl; //so that we can build without an install first (which would be impossible) - cacheStream << "QMAKE_MOC = $$QT_BUILD_TREE" << fixSeparators("/bin/moc.exe") << endl; - cacheStream << "QMAKE_UIC = $$QT_BUILD_TREE" << fixSeparators("/bin/uic.exe") << endl; - cacheStream << "QMAKE_UIC3 = $$QT_BUILD_TREE" << fixSeparators("/bin/uic3.exe") << endl; - cacheStream << "QMAKE_RCC = $$QT_BUILD_TREE" << fixSeparators("/bin/rcc.exe") << endl; - cacheStream << "QMAKE_DUMPCPP = $$QT_BUILD_TREE" << fixSeparators("/bin/dumpcpp.exe") << endl; - cacheStream << "QMAKE_INCDIR_QT = $$QT_BUILD_TREE" << fixSeparators("/include") << endl; - cacheStream << "QMAKE_LIBDIR_QT = $$QT_BUILD_TREE" << fixSeparators("/lib") << endl; + cacheStream << "QMAKE_MOC = $$QT_BUILD_TREE" << fixSeparators("/bin/moc.exe", true) << endl; + cacheStream << "QMAKE_UIC = $$QT_BUILD_TREE" << fixSeparators("/bin/uic.exe", true) << endl; + cacheStream << "QMAKE_UIC3 = $$QT_BUILD_TREE" << fixSeparators("/bin/uic3.exe", true) << endl; + cacheStream << "QMAKE_RCC = $$QT_BUILD_TREE" << fixSeparators("/bin/rcc.exe", true) << endl; + cacheStream << "QMAKE_DUMPCPP = $$QT_BUILD_TREE" << fixSeparators("/bin/dumpcpp.exe", true) << endl; + cacheStream << "QMAKE_INCDIR_QT = $$QT_BUILD_TREE" << fixSeparators("/include", true) << endl; + cacheStream << "QMAKE_LIBDIR_QT = $$QT_BUILD_TREE" << fixSeparators("/lib", true) << endl; if (dictionary["CETEST"] == "yes") { - cacheStream << "QT_CE_RAPI_INC = " << fixSeparators(dictionary[ "QT_CE_RAPI_INC" ]) << endl; - cacheStream << "QT_CE_RAPI_LIB = " << fixSeparators(dictionary[ "QT_CE_RAPI_LIB" ]) << endl; + cacheStream << "QT_CE_RAPI_INC = " << fixSeparators(dictionary[ "QT_CE_RAPI_INC" ], true) << endl; + cacheStream << "QT_CE_RAPI_LIB = " << fixSeparators(dictionary[ "QT_CE_RAPI_LIB" ], true) << endl; } // embedded @@ -2896,7 +2904,7 @@ void Configure::generateCachefile() << "QT_PATCH_VERSION = " << dictionary["VERSION_PATCH"] << endl; configStream << "#Qt for Windows CE c-runtime deployment" << endl - << "QT_CE_C_RUNTIME = " << fixSeparators(dictionary[ "CE_CRT" ]) << endl; + << "QT_CE_C_RUNTIME = " << fixSeparators(dictionary[ "CE_CRT" ], true) << endl; if(dictionary["CE_SIGNATURE"] != QLatin1String("no")) configStream << "DEFAULT_SIGNATURE=" << dictionary["CE_SIGNATURE"] << endl; @@ -3213,32 +3221,32 @@ void Configure::generateConfigfiles() << endl; if(!dictionary[ "QT_HOST_PREFIX" ].isNull()) tmpStream << "#if !defined(QT_BOOTSTRAPPED) && !defined(QT_BUILD_QMAKE)" << endl; - tmpStream << "static const char qt_configure_prefix_path_str [512 + 12] = \"qt_prfxpath=" << QString(dictionary["QT_INSTALL_PREFIX"]).replace( "\\", "\\\\" ) << "\";" << endl - << "static const char qt_configure_documentation_path_str[512 + 12] = \"qt_docspath=" << QString(dictionary["QT_INSTALL_DOCS"]).replace( "\\", "\\\\" ) << "\";" << endl - << "static const char qt_configure_headers_path_str [512 + 12] = \"qt_hdrspath=" << QString(dictionary["QT_INSTALL_HEADERS"]).replace( "\\", "\\\\" ) << "\";" << endl - << "static const char qt_configure_libraries_path_str [512 + 12] = \"qt_libspath=" << QString(dictionary["QT_INSTALL_LIBS"]).replace( "\\", "\\\\" ) << "\";" << endl - << "static const char qt_configure_binaries_path_str [512 + 12] = \"qt_binspath=" << QString(dictionary["QT_INSTALL_BINS"]).replace( "\\", "\\\\" ) << "\";" << endl - << "static const char qt_configure_plugins_path_str [512 + 12] = \"qt_plugpath=" << QString(dictionary["QT_INSTALL_PLUGINS"]).replace( "\\", "\\\\" ) << "\";" << endl - << "static const char qt_configure_imports_path_str [512 + 12] = \"qt_impspath=" << QString(dictionary["QT_INSTALL_IMPORTS"]).replace( "\\", "\\\\" ) << "\";" << endl - << "static const char qt_configure_data_path_str [512 + 12] = \"qt_datapath=" << QString(dictionary["QT_INSTALL_DATA"]).replace( "\\", "\\\\" ) << "\";" << endl - << "static const char qt_configure_translations_path_str [512 + 12] = \"qt_trnspath=" << QString(dictionary["QT_INSTALL_TRANSLATIONS"]).replace( "\\", "\\\\" ) << "\";" << endl - << "static const char qt_configure_examples_path_str [512 + 12] = \"qt_xmplpath=" << QString(dictionary["QT_INSTALL_EXAMPLES"]).replace( "\\", "\\\\" ) << "\";" << endl - << "static const char qt_configure_demos_path_str [512 + 12] = \"qt_demopath=" << QString(dictionary["QT_INSTALL_DEMOS"]).replace( "\\", "\\\\" ) << "\";" << endl - //<< "static const char qt_configure_settings_path_str [256] = \"qt_stngpath=" << QString(dictionary["QT_INSTALL_SETTINGS"]).replace( "\\", "\\\\" ) << "\";" << endl + tmpStream << "static const char qt_configure_prefix_path_str [512 + 12] = \"qt_prfxpath=" << escapeSeparators(dictionary["QT_INSTALL_PREFIX"]) << "\";" << endl + << "static const char qt_configure_documentation_path_str[512 + 12] = \"qt_docspath=" << escapeSeparators(dictionary["QT_INSTALL_DOCS"]) << "\";" << endl + << "static const char qt_configure_headers_path_str [512 + 12] = \"qt_hdrspath=" << escapeSeparators(dictionary["QT_INSTALL_HEADERS"]) << "\";" << endl + << "static const char qt_configure_libraries_path_str [512 + 12] = \"qt_libspath=" << escapeSeparators(dictionary["QT_INSTALL_LIBS"]) << "\";" << endl + << "static const char qt_configure_binaries_path_str [512 + 12] = \"qt_binspath=" << escapeSeparators(dictionary["QT_INSTALL_BINS"]) << "\";" << endl + << "static const char qt_configure_plugins_path_str [512 + 12] = \"qt_plugpath=" << escapeSeparators(dictionary["QT_INSTALL_PLUGINS"]) << "\";" << endl + << "static const char qt_configure_imports_path_str [512 + 12] = \"qt_impspath=" << escapeSeparators(dictionary["QT_INSTALL_IMPORTS"]) << "\";" << endl + << "static const char qt_configure_data_path_str [512 + 12] = \"qt_datapath=" << escapeSeparators(dictionary["QT_INSTALL_DATA"]) << "\";" << endl + << "static const char qt_configure_translations_path_str [512 + 12] = \"qt_trnspath=" << escapeSeparators(dictionary["QT_INSTALL_TRANSLATIONS"]) << "\";" << endl + << "static const char qt_configure_examples_path_str [512 + 12] = \"qt_xmplpath=" << escapeSeparators(dictionary["QT_INSTALL_EXAMPLES"]) << "\";" << endl + << "static const char qt_configure_demos_path_str [512 + 12] = \"qt_demopath=" << escapeSeparators(dictionary["QT_INSTALL_DEMOS"]) << "\";" << endl + //<< "static const char qt_configure_settings_path_str [256] = \"qt_stngpath=" << escapeSeparators(dictionary["QT_INSTALL_SETTINGS"]) << "\";" << endl ; if(!dictionary[ "QT_HOST_PREFIX" ].isNull()) { tmpStream << "#else" << endl - << "static const char qt_configure_prefix_path_str [512 + 12] = \"qt_prfxpath=" << QString(dictionary[ "QT_HOST_PREFIX" ]).replace( "\\", "\\\\" ) << "\";" << endl - << "static const char qt_configure_documentation_path_str[512 + 12] = \"qt_docspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/doc").replace( "\\", "\\\\" ) <<"\";" << endl - << "static const char qt_configure_headers_path_str [512 + 12] = \"qt_hdrspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/include").replace( "\\", "\\\\" ) <<"\";" << endl - << "static const char qt_configure_libraries_path_str [512 + 12] = \"qt_libspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/lib").replace( "\\", "\\\\" ) <<"\";" << endl - << "static const char qt_configure_binaries_path_str [512 + 12] = \"qt_binspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/bin").replace( "\\", "\\\\" ) <<"\";" << endl - << "static const char qt_configure_plugins_path_str [512 + 12] = \"qt_plugpath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/plugins").replace( "\\", "\\\\" ) <<"\";" << endl - << "static const char qt_configure_imports_path_str [512 + 12] = \"qt_impspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/imports").replace( "\\", "\\\\" ) <<"\";" << endl - << "static const char qt_configure_data_path_str [512 + 12] = \"qt_datapath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ]).replace( "\\", "\\\\" ) <<"\";" << endl - << "static const char qt_configure_translations_path_str [512 + 12] = \"qt_trnspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/translations").replace( "\\", "\\\\" ) <<"\";" << endl - << "static const char qt_configure_examples_path_str [512 + 12] = \"qt_xmplpath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/example").replace( "\\", "\\\\" ) <<"\";" << endl - << "static const char qt_configure_demos_path_str [512 + 12] = \"qt_demopath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/demos").replace( "\\", "\\\\" ) <<"\";" << endl + << "static const char qt_configure_prefix_path_str [512 + 12] = \"qt_prfxpath=" << escapeSeparators(dictionary[ "QT_HOST_PREFIX" ]) << "\";" << endl + << "static const char qt_configure_documentation_path_str[512 + 12] = \"qt_docspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/doc", true) <<"\";" << endl + << "static const char qt_configure_headers_path_str [512 + 12] = \"qt_hdrspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/include", true) <<"\";" << endl + << "static const char qt_configure_libraries_path_str [512 + 12] = \"qt_libspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/lib", true) <<"\";" << endl + << "static const char qt_configure_binaries_path_str [512 + 12] = \"qt_binspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/bin", true) <<"\";" << endl + << "static const char qt_configure_plugins_path_str [512 + 12] = \"qt_plugpath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/plugins", true) <<"\";" << endl + << "static const char qt_configure_imports_path_str [512 + 12] = \"qt_impspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/imports", true) <<"\";" << endl + << "static const char qt_configure_data_path_str [512 + 12] = \"qt_datapath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ], true) <<"\";" << endl + << "static const char qt_configure_translations_path_str [512 + 12] = \"qt_trnspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/translations", true) <<"\";" << endl + << "static const char qt_configure_examples_path_str [512 + 12] = \"qt_xmplpath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/example", true) <<"\";" << endl + << "static const char qt_configure_demos_path_str [512 + 12] = \"qt_demopath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/demos", true) <<"\";" << endl << "#endif //QT_BOOTSTRAPPED" << endl; } tmpStream << "/* strlen( \"qt_lcnsxxxx\" ) == 12 */" << endl diff --git a/tools/configure/configureapp.h b/tools/configure/configureapp.h index c441129..6c10dd8 100644 --- a/tools/configure/configureapp.h +++ b/tools/configure/configureapp.h @@ -147,7 +147,8 @@ private: int outputWidth; bool useUnixSeparators; - QString fixSeparators(QString somePath); + QString fixSeparators(const QString &somePath, bool escape = false); + QString escapeSeparators(const QString &somePath); bool filesDiffer(const QString &file1, const QString &file2); bool findFile(const QString &fileName); |