From 5467c3f8eb6f7d2b5c5a72b9c2e0fd94ae325c24 Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Thu, 20 May 2010 14:28:36 +1000 Subject: Fix crash on exit in native wifi plugin on Vista+ when run in debugger. Close the wlanapi handle before main function returns. --- .../bearer/nativewifi/qnativewifiengine.cpp | 91 +++++++++++++++++----- src/plugins/bearer/nativewifi/qnativewifiengine.h | 5 +- 2 files changed, 73 insertions(+), 23 deletions(-) diff --git a/src/plugins/bearer/nativewifi/qnativewifiengine.cpp b/src/plugins/bearer/nativewifi/qnativewifiengine.cpp index 9b6ffa0..1a55402 100644 --- a/src/plugins/bearer/nativewifi/qnativewifiengine.cpp +++ b/src/plugins/bearer/nativewifi/qnativewifiengine.cpp @@ -46,6 +46,7 @@ #include #include +#include #include @@ -79,38 +80,26 @@ void qNotificationCallback(WLAN_NOTIFICATION_DATA *data, QNativeWifiEngine *d) } QNativeWifiEngine::QNativeWifiEngine(QObject *parent) -: QBearerEngineImpl(parent), handle(0) +: QBearerEngineImpl(parent), handle(INVALID_HANDLE_VALUE) { - DWORD clientVersion; - - DWORD result = local_WlanOpenHandle(1, 0, &clientVersion, &handle); - if (result != ERROR_SUCCESS) { -#ifdef BEARER_MANAGEMENT_DEBUG - if (result != ERROR_SERVICE_NOT_ACTIVE) - qDebug("%s: WlanOpenHandle failed with error %ld\n", __FUNCTION__, result); -#endif - - return; - } - - result = local_WlanRegisterNotification(handle, WLAN_NOTIFICATION_SOURCE_ALL, true, - WLAN_NOTIFICATION_CALLBACK(qNotificationCallback), - this, 0, 0); -#ifdef BEARER_MANAGEMENT_DEBUG - if (result != ERROR_SUCCESS) - qDebug("%s: WlanRegisterNotification failed with error %ld\n", __FUNCTION__, result); -#endif + connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), this, SLOT(closeHandle())); } QNativeWifiEngine::~QNativeWifiEngine() { - local_WlanCloseHandle(handle, 0); + closeHandle(); } void QNativeWifiEngine::scanComplete() { QMutexLocker locker(&mutex); + if (!available()) { + locker.unlock(); + emit updateCompleted(); + return; + } + // enumerate interfaces WLAN_INTERFACE_INFO_LIST *interfaceList; DWORD result = local_WlanEnumInterfaces(handle, 0, &interfaceList); @@ -249,6 +238,9 @@ QString QNativeWifiEngine::getInterfaceFromId(const QString &id) { QMutexLocker locker(&mutex); + if (!available()) + return QString(); + // enumerate interfaces WLAN_INTERFACE_INFO_LIST *interfaceList; DWORD result = local_WlanEnumInterfaces(handle, 0, &interfaceList); @@ -304,6 +296,9 @@ bool QNativeWifiEngine::hasIdentifier(const QString &id) { QMutexLocker locker(&mutex); + if (!available()) + return false; + // enumerate interfaces WLAN_INTERFACE_INFO_LIST *interfaceList; DWORD result = local_WlanEnumInterfaces(handle, 0, &interfaceList); @@ -364,6 +359,12 @@ void QNativeWifiEngine::connectToId(const QString &id) { QMutexLocker locker(&mutex); + if (!available()) { + locker.unlock(); + emit connectionError(id, InterfaceLookupError); + return; + } + WLAN_INTERFACE_INFO_LIST *interfaceList; DWORD result = local_WlanEnumInterfaces(handle, 0, &interfaceList); if (result != ERROR_SUCCESS) { @@ -440,6 +441,12 @@ void QNativeWifiEngine::disconnectFromId(const QString &id) { QMutexLocker locker(&mutex); + if (!available()) { + locker.unlock(); + emit connectionError(id, InterfaceLookupError); + return; + } + QString interface = getInterfaceFromId(id); if (interface.isEmpty()) { @@ -479,6 +486,12 @@ void QNativeWifiEngine::requestUpdate() { QMutexLocker locker(&mutex); + if (!available()) { + locker.unlock(); + emit updateCompleted(); + return; + } + // enumerate interfaces WLAN_INTERFACE_INFO_LIST *interfaceList; DWORD result = local_WlanEnumInterfaces(handle, 0, &interfaceList); @@ -555,6 +568,42 @@ QNetworkConfigurationPrivatePointer QNativeWifiEngine::defaultConfiguration() return QNetworkConfigurationPrivatePointer(); } +bool QNativeWifiEngine::available() +{ + if (handle != INVALID_HANDLE_VALUE) + return true; + + DWORD clientVersion; + + DWORD result = local_WlanOpenHandle(1, 0, &clientVersion, &handle); + if (result != ERROR_SUCCESS) { +#ifdef BEARER_MANAGEMENT_DEBUG + if (result != ERROR_SERVICE_NOT_ACTIVE) + qDebug("%s: WlanOpenHandle failed with error %ld\n", __FUNCTION__, result); +#endif + + return false; + } + + result = local_WlanRegisterNotification(handle, WLAN_NOTIFICATION_SOURCE_ALL, true, + WLAN_NOTIFICATION_CALLBACK(qNotificationCallback), + this, 0, 0); +#ifdef BEARER_MANAGEMENT_DEBUG + if (result != ERROR_SUCCESS) + qDebug("%s: WlanRegisterNotification failed with error %ld\n", __FUNCTION__, result); +#endif + + return handle != INVALID_HANDLE_VALUE; +} + +void QNativeWifiEngine::closeHandle() +{ + if (handle != INVALID_HANDLE_VALUE) { + local_WlanCloseHandle(handle, 0); + handle = INVALID_HANDLE_VALUE; + } +} + bool QNativeWifiEngine::requiresPolling() const { // On Windows XP SP2 and SP3 only connection and disconnection notifications are available. diff --git a/src/plugins/bearer/nativewifi/qnativewifiengine.h b/src/plugins/bearer/nativewifi/qnativewifiengine.h index 3b21985..0e9576b 100644 --- a/src/plugins/bearer/nativewifi/qnativewifiengine.h +++ b/src/plugins/bearer/nativewifi/qnativewifiengine.h @@ -91,12 +91,13 @@ public: QNetworkConfigurationPrivatePointer defaultConfiguration(); - inline bool available() const { return handle != 0; } + bool available(); bool requiresPolling() const; -public Q_SLOTS: +private Q_SLOTS: void scanComplete(); + void closeHandle(); private: Qt::HANDLE handle; -- cgit v0.12 From 2eed3e243d6db81433bfdc2dee76edee1d53ceb9 Mon Sep 17 00:00:00 2001 From: Peter Yard Date: Thu, 20 May 2010 14:51:55 +1000 Subject: Docs: added an intro for qml, Quick for Beginners. --- doc/src/declarative/qml-intro.qdoc | 969 ++++++++++++++++++++++++++++++++++ doc/src/images/qml-dial.png | Bin 0 -> 43754 bytes doc/src/images/qml-intro-anchors1.png | Bin 0 -> 15198 bytes doc/src/images/qml-intro-anchors2.png | Bin 0 -> 15343 bytes doc/src/images/qml-intro-anchors3.png | Bin 0 -> 16745 bytes doc/src/images/qml-intro-helloa.png | Bin 0 -> 18246 bytes 6 files changed, 969 insertions(+) create mode 100644 doc/src/declarative/qml-intro.qdoc create mode 100644 doc/src/images/qml-dial.png create mode 100644 doc/src/images/qml-intro-anchors1.png create mode 100644 doc/src/images/qml-intro-anchors2.png create mode 100644 doc/src/images/qml-intro-anchors3.png create mode 100644 doc/src/images/qml-intro-helloa.png diff --git a/doc/src/declarative/qml-intro.qdoc b/doc/src/declarative/qml-intro.qdoc new file mode 100644 index 0000000..457efa8 --- /dev/null +++ b/doc/src/declarative/qml-intro.qdoc @@ -0,0 +1,969 @@ +/************************************************************************** +** +** +** 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 documentation 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$ +** +*************************************************************************** +*/ + + + +/*! + +\page qml-intro.html +\title Beginning Qt Quick + + +\section1 Overview + + +QML is a high level, scripted language. Its commands, more correctly \e elements, +leverage the power and efficiency of the Qt libraries to make easy to use +commands that perform intuitive functions. Draw a rectangle, display an image at +a position and so on. Behind these elements are complex C++ libraries that +efficiently perform the action. As with any graphical application, always +consider that this ability to easily build graphically rich applications means +that some care may be needed to prevent performance problems. + +The language also allows more flexibility of these commands by using +Javascript rather than C++ to add new layers of logic to your application. +Javascript is easier to learn than C++ and can be embedded into the QML +files or imported from a separate file. + +\bold{In QML the types of various 'objects' are referred to as \l {QML +Elements}{ elements}}. + +An element usually has various \e properties that help define the element. For +example, if we created an element called Circle then the radius of the circle +would be a property. + + +\section1 A First Look + +The basic syntax of an \l {QML Elements}{element} is + + \code + SomeElement { + id: myObject + ... some other things here ... + } + \endcode + +Here we are defining a new object. We specify its 'type' first as SomeElement. +Then within matching braces { ... } we specify the various parts of our +element. + +The \c id is a unique identifier for the element, it must start with a lower +case letter and only contain letters, numbers and underscores. It is this +particular object's name. If this SomeElement \l {QML Elements}{element} was +a Rectangle instead and it was one of many then the \e optional unique id +would allow us to manipulate each element individually. + +Each visual element is ultimately based on, or inherits from, an element +called \l Item. \l Item has certain properties and actions that may be +useful. The properties have default values so you need only specify the +ones you will need. + +Take a simple element such as a \l Rectangle. It has an \c id, we will call +it \e myRectangle, it has a \c width and a \c height. Imagine that we +want a rectangle that is 500 pixels by 400 pixels in the x and y directions +(horizontal by vertical). + +We can implement this \l Rectangle with these properties this way + + \code + import Qt 4.7 + + // This is a comment. And below myRectangle is defined. + Rectangle { + id: myRectangle + width: 500 + height: 400 + } + \endcode + +This is a valid QML script. To run it, copy it and save it to a file, say +myexample.qml, and on the command line run the command + + \code + qml myexample.qml + \endcode + +It will create a very boring rectangle in its own window. + + + +\section1 Hello World! + +We can now add some color and text to make a Hello World QML program. + +\l Rectangle has the property \l {Rectangle::color}{color} to produce a +background color. + +Text is handled by a different element called \l Text. We need to create a +\l Text object inside the \l Rectangle and set its \l {Text::text}{text} +property to "Hello World!". So to set the text to 'Hello world' and the +background colour to light gray, + + \code + import Qt 4.7 + + Rectangle { + id: myRectangle + width: 500 + height: 400 + + Text { text: "Hello World!" } + + color: "lightgray" + } + \endcode + + +\section1 Hello World Again + +From now on we will not always show the import statement for Qt but it +should still be there when you create your QML scripts. + +To make our Hello World example a little nicer set the position of the text +to be at pixel position x = 100, y = 100 within the displayed window. This +position belongs to the \l Text element so we set the position inside its +definition. Note that we separate different QML statements on the same line +with a semi-colon, or we could have simply put each statement on a new line + + \code + Text { + text: "

Hello World

"; color: "darkgreen" + x: 100; y:100 + } + \endcode + +Not only did we reposition the text, but the text was altered by adding +HTML tags to change the font size. The text color was also changed from the +default black to dark green by using a standard string for the color's SVG +name. + +We could also have used a hexadecimal string for the RGB (red-green-blue, as +#rrggbb) values of the color similar to the method used in HTML. For +example, mostly blue with a green tint, + + \code + Text { + text: "

Hello world again

" + color: "#002288" + x: 100; y: 100 + } + \endcode + +All of these changes occurred within the \l Text object which is the scope +of these property changes. + +Other objects may use the information but it belongs to the element where +the property has been defined. + + +\section1 Images + +To add an image to our little application we use the \l Image element. An +\l Image uses a path to an image file, and has properties to control +the aspect ratio, the image size, to tile the area amongst others. The +source of the image, the path to the file, is a URL. Therefore the file can +be local: \e {mydir/myimage1.png}. Or it can be remote: +\e {"http://www.example.com/images/myimage1.png"}. + + \code + Image { + source: "images/qt-logo.png" + } + \endcode + +This displays the image, as we would expect, at the top left of the window. +The position of the default x = 0, y = 0 coordinate. The example here uses +a PNG file, but it could have been one of various supported formats, +including JPG and GIF. + +Let us reposition the image and enlarge it. Place it at the same 'x' offset +as the "Hello world again" text, but put it another 50 pixels below the +text, also make it 150 by 150 pixels in size, + + \code + Image { + source: "images/qt-logo.png" + x: 100; y: 150 + width: 150; height: 150 + } + \endcode + +Adding the Hello World example, with the text and the image example we can +write a simple piece of QML that starts to look a bit better. + + \code + import Qt 4.7 + + Rectangle { + id: myRectangle + width: 500 + height: 400 + + // A light gray background + color: "lightgray" + + // Position and color some text + Text { + text: "

Hello world again

" + color: "darkgreen" + x: 100; y: 100 + } + + // Using the opportunity to resize the image. + Image { + source: "images/qt-logo.png" + x: 100; y: 150 + width: 150; height: 150 + } + + } + \endcode + +The result is still quite simple + +\image qml-intro-helloa.png + + +\section1 Anchors: Aligning Elements + +Using absolute positioning, such as saying x = 100 and y = 150, works well +until the user or developer stretches or increases the size of the window. +Then the positions need to be recalculated. What would be nice would be a +relative means of positioning of objects in a window or rectangle. For +example, we want to place an image at the bottom of a rectangle, we would +like to specify the image's location as the 'bottom of the window', not a +specific coordinate. We can do this with the anchors property, which +objects inherit from Item. + +The anchors property is really a property group. It is a collection of +related properties. It has properties within it which can be used by means +of the dot notation. + +The dot notation uses object \c{id}s and property names to use a particular +object or property. Say I have a rectangle r1, which contains a rectangle +r2, which contains an Item item1, which has an 'x' property I want to +change. I just use the dot notation to identify it: r1.r2.item1.x + +If we want to position an image at the bottom of the rectangle it is +inside. I have to specify that the bottom of the image is also at the +bottom of the rectangle + + \code + import Qt 4.7 + + Rectangle { + id: myWin + width: 500 + height: 400 + + Image { + id: image1 + source: "images/qt-logo.png" + width: 150; height: 150 + anchors.bottom: myWin.bottom + } + } + \endcode + +This places the logo at the bottom left of the window. + +\image qml-intro-anchors1.png "A simple anchor" + +We would like it centered and not touching the bottom of the window, for +aesthetic reasons. For the centering we use the horizontalCenter property, +and to prevent the touching of the image to the bottom of the rectangle, +the bottomMargin property is used. So the new actions for the script are + + \list + \o set the bottom of the image (anchors.bottom) to be the bottom of the window + \o move the image to be in the horizontal center of the window + \o set a margin of 10 pixels so that the image does not touch the bottom window border + \endlist + +Encoded into QML the script becomes + + \code + import Qt 4.7 + + Rectangle { + id: myWin + width: 500 + height: 400 + + Image { + id: image1 + source: "images/qt-logo.png" + width: 150; height: 150 + anchors.bottom: myWin.bottom + anchors.horizontalCenter: myWin.horizontalCenter + anchors.bottomMargin: 10 + } + } + \endcode + + +Run this and resize the window. You will see that now the position of the +image adjusts during the resize. + +\image qml-intro-anchors2.png "Image Centered at the Bottom" + +You can also add another object say a block of descriptive text and place +it above or below the image or to the side. This code places some text just +above the image + + \code + Text { + text: "

The Qt Logo

" + anchors.bottom: image1.top + anchors.horizontalCenter: myWin.horizontalCenter + anchors.bottomMargin: 15 + } + \endcode + +\image qml-intro-anchors3.png + +\note \e anchors is a property group, to be used within the object. When +referencing these properties from another object we use the property +directly, instead of saying: + + \code + myRectangle.anchors.top // Wrong + \endcode + +we use + + \code + myRectangle.top // Correct + \endcode + + + + +\section1 Transformations + +We can transform a graphical object to get additional effects. Rotate a +piece of text by 180 degrees to display upside-down text. Rotate an image +by 90 degrees to lay it on its side. These transformations require +additonal information. + +For rotation, the additional information includes: the origin relative to +the object being rotated, the axis of rotation, and the angle in degrees to +rotate the image through in a clockwise direction. The axis does not have +to be the z-axis, the line between your eyes and the image, it could be +along the vertical y-axis or the horizontal x-axis. We have three +dimensions to play with. For simplicity in this example we will rotate +about the z-axis by 90 degrees in a negative direction, anti-clockwise. + +Rotation of text was also suggested. It could also be useful to scale the +text. We can do both. The \l {Item::transform}{transform} property is a +\e list of \l Transform elements, so using the list syntax + + \code + myList: [ listElement1, listElement2, ... } ] + \endcode + +we can produce a list of transformations. + +The text will be rotated by 45 degrees anti-clockwise and scaled +vertically by a factor of 1.5 and by 1.2 horizontally. + +Using the example above as the basis for this we have, + + \code + import Qt 4.7 + + Rectangle { + id: myWin + width: 500 + height: 400 + + Image { + id: image1 + source: "images/qt-logo.png" + width: 150; height: 150 + anchors.bottom: myWin.bottom + anchors.horizontalCenter: myWin.horizontalCenter + anchors.bottomMargin: 10 + + transform: Rotation { + origin.x: 75; origin.y: 75 + axis{ x: 0; y: 0; z:1 } angle: -90 + } + + } + + Text { + text: "

The Qt Logo -- taking it easy

" + anchors.bottom: image1.top + anchors.horizontalCenter: myWin.horizontalCenter + anchors.bottomMargin: 15 + + transform: [ + Scale { xScale: 1.5; yScale: 1.2 } , + + Rotation { + origin.x: 75; origin.y: 75 + axis{ x: 0; y: 0; z:1 } angle: -45 + } + ] + } + } + \endcode + +The code block in \c image1 starting with \c transform specifies that the +\l {Item::transform}{transform} property will be a Rotation through -90 +degrees, which is anti-clockwise, about the z-axis running through the +center of the image at (75,75), since the image is 150 x 150 pixels. + +The other transformation available is \l Translate. This produces a change +in position of the item. + +\note In a list of transformations the order of the transformations is +important. In the above example try swapping around the Scale transform with +the Rotation transform, remember to remove or add the comma. The results are +acceptable for our little test but not the same. + + +\section1 Animations + +Animation in QML is done by animating properties of objects. Properties +that are numbers, colors, Rectangles, points and directions. In QML these +are \l {QML Basic Types} named as real, int, color, rect, point, size, and +vector3d. There are a number of different ways to do animation. Here we +will look at a few of them. + +\section2 Number Animation + +Previously we have used a rotation transformation to change the orientation +of an image. We could easily animate this rotation so that instead of a +straight rotation counter-clockwise of 90 degrees we could rotate the image +through a full 360 degrees in an animation. The axis of rotation wont +change, the position of the center of the image will not change, only the +angle will change. Therefore, a NumberAnimation of a rotation's angle should +be enough for the task. If we wish for a simple rotation about the center +of the image then we can use the \c rotation property that is inherited +from \l Item. The rotation property is a real number that specifies the +angle in a clockwise direction for the rotation of the object. Here is the +code for our animated rotating image. + + \code + import Qt 4.7 + + Rectangle { + id: mainRec + width: 600 + height: 400 + + Image { + id: image1 + source: "images/qt-logo.png" + x: 200; y: 100 + width: 100; height: 100 + + // Animate a rotation + transformOrigin: Item.Center + NumberAnimation on rotation { + from: 0; to: 360 + duration: 2000 + loops: Animation.Infinite + } + } + } + \endcode + +The \c {transformOrigin: Item.Center} is redundant since this is the default +axis of rotation anyway. But if you change \c Center to \c BottomRight you +will see an interesting variation. + +Also if instead the \l Rotation transformation had been used then we would have +more control over the various parameters. We could vary the axis, to be not +just a different offset from the z-axis but along the y-axis, x-axis or +combination. For example, if the task had been to animate the rotation +about the y-axis passing through the center of the image then the following +code would do it. + + \code + import Qt 4.7 + + Rectangle { + id: mainRec + width: 600 + height: 400 + + Image { + id: image1 + source: "images/qt-logo.png" + x: 200; y: 100 + width: 100; height: 100 + + // Animate a rotation + transform: Rotation { + origin.x: 50; origin.y: 50; axis {x:0; y:1; z:0} angle:0 + NumberAnimation on angle { + from: 0; to: 360; + duration: 3000; + loops: Animation.Infinite + } + } + } + } + \endcode + +Here there is a rectangle 600 by 400 pixels. Placed within that rectangle +is an image 100 by 100 pixels. It is rotated about the center of the image +about the y-axis so that it looks as if it is rotating about an invisible +vertical string holding it up. The time it takes to complete the rotation is 3 +seconds (3,000 milliseconds). The NumberAnimation is applied to the angle +taking it from 0 (no change) to 360 degrees, back where it started. +Strictly speaking it isn't necessary to go from 0 to 360 since the same +location is duplicated, but it makes it easier to read in this example and +it has no visible effect on the animation. The number of loops that the +animation will execute is set to \c {Animation.Infinite} which means that the +animation is in an endless loop. + +To see an interesting variation. Change the axis to \c {axis { x:1; y:1; z:1 +}}. This is a line coming from the center of the image downwards to the +right and out of the screen. Although the change is simple the rotation +seems complex. + +\section2 Sequential Animation + +For a more complex animation we will need two images. The first image will +be placed at the center of a window (Rectangle) and the second image will +be at the upper left of the window. The animation will move the second +image from the top left of the window to the bottom right. In doing so we +will be animating the position and the size of the image. + +First create two images + + \code + import Qt 4.7 + + Rectangle { + id: mainRec + width: 600 + height: 400 + z: 0 + + Image { + id: image1 + source: "images/qt-logo.png" + x: 20; y: 20 ; z: 1 + width: 100; height: 100 + } + + Image { + id: image2 + source: "images/qt-logo.png" + width: 100; height: 100 + x: (mainRec.width - 100)/2; y: (mainRec.height - 100)/2 + z: 2 + } + } + \endcode + +We will add to 'image1' a SequentialAnimation from x = 20 to the target of +x = 450. The 'from' values will be used because we will be repeating the +animation, so the object needs to know where the original position is, both +x and y. The SequentialAnimation of x will set it to repeat by indicating +that the number of animation loops is infinite, meaning that the 'loop' +counter will be set to a value Animation.Infinite that indicates an endless +cycle. Also there will be a NumberAnimation to vary the numeric property +between the x values and over a given duration. After the NumberAnimation +there will be a PauseAnimation that will pause the animation for 500 +milliseconds (half a second) simply for the visual effect. + + \code + SequentialAnimation on x { + loops: Animation.Infinite + NumberAnimation { from: 20; to: 450; easing.type: "InOutQuad"; +duration: 2000 } + PauseAnimation { duration: 500 } + } + \endcode + +A similar block of code is written for the animation of the 'y' value of +the position. + +We will also animate the scale of the object, so as it goes from top left +to bottom right of the window it will become smaller until about midway, +and then become larger. To complete the animation we will set the 'z' +values of the images. 'z' is the stacking order, the z-axis effectively +points out from the screen to your eyes with the default value of 'z' being +0. So if we set the Rectangle to have z with value zero, just to be sure, +and image1 to 1 and image2 to 2 then image2 will be in the foreground and +image1 in the background. When image1 passes image2 it will pass behind it. +The completed code looks like + + \code + Rectangle { + id: mainRec + width: 600 + height: 400 + z: 0 + + Image { + id: image2 + source: "images/qt-logo.png" + width: 100; height: 100 + x: (mainRec.width - 100)/2; y: (mainRec.height - 100)/2 + z: 2 + } + + Image { + id: image1 + source: "images/qt-logo.png" + x: 20; y: 20 ; z: 1 + width: 100; height: 100 + + SequentialAnimation on x { + loops: Animation.Infinite + NumberAnimation { + from: 20; to: 450 + easing.type: "InOutQuad"; duration: 2000 + } + PauseAnimation { duration: 500 } + } + + SequentialAnimation on y { + loops: Animation.Infinite + NumberAnimation { + from: 20; to: 250 + easing.type: "InOutQuad"; duration: 2000 + } + PauseAnimation { duration: 500 } + } + + SequentialAnimation on scale { + loops: Animation.Infinite + NumberAnimation { from: 1; to: 0.5; duration: 1000 } + NumberAnimation { from: 0.5; to: 1; duration: 1000 } + PauseAnimation { duration: 500 } + } + } + } + \endcode + +The \c {easing.type} has many options, expressed as a string. It specifies the +kind of equation that describes the acceleration of the property value, not +necessarily position, over time. + +For example, \e InOutQuad means that at the start and the end of the animation the +'velocity' is low but the acceleration or deceleration is high. Much like a car +accelerating from stop, and decelerating to stop at the end of a journey, +with the maximum speed being in the middle. Examine the \l {PropertyAnimation::easing.type} +{easing} documentation and the various graphs that show the effect. The horizontal +axis, 'progress', can be thought of as time. The vertical axis is the value +of the particular property. + +In discussing animation we need to describe three objects: State, MouseArea +and Signals. Although independent of the animation elements, animation +delivers some of the best examples that illustrate these new elements. + + + +\section2 Animation Summary + +\table + \header + \o Name + \o Description + \row + \o PropertyAnimation + \o a property value on a target object is varied to a specified value over a given time. + + \row + \o NumberAnimation + \o animate a numeric property from one value to another over a given time. + + \row + \o PauseAnimation + \o results in the task waiting for the specified duration, in milliseconds. + + \row + \o SequentialAnimation + \o allows us to list in order the animation events we want to occur, first A then B then C and so on. + + \row + \o ParallelAnimation + \o enables us to run different animations at the same time instead of sequentially. + +\endtable + + + + + +\section1 Using States + +A state is a defined set of values in the configuration of an object and +often depends on the previous state. For example, a glass could be in a +state we call 'HalfFull' if it is being filled with a liquid and has +reached half of its total capacity. We could also have a state called +HalfEmpty which is the state that occurs when the amount of liquid drops to +half of the glass's capacity. Both states represent the same amount of +liquid, but we consider them different. Likewise, states in a program +represent not just values but may include how the current values were +reached. + +When a state changes a \e transition occurs. This is an opportunity to make +changes or take actions that depend on the movement to the new state. For +example, if we had a scene in the country where the state variable has two +states "daylight" and "night". Then when the state changes to "night" at +this transition the sky would be made dark, stars would be shown, the +countryside would be darkened. And when the state changes to "daylight" the +opposite changes would be made: the sky is now blue, the scenery is green, +there is a sun in the sky. + +Here is a simple QML program that shows the change of state in the above +example. We have two rectangles, the top one is the 'sky' and the bottom +one is the 'ground'. We will animate the change from daylight to night. +There will be two states, but we only need to define one since 'daylight' +will be the default state. We will just go to 'night' by clicking and +holding the left mouse button down, releasing the mouse button will reverse +the process + + \code + import Qt 4.7 + + Rectangle { + id: mainRectangle + width: 600 + height: 400 + color: "black" + + Rectangle { + id: sky + width: 600 + height: 200 + y: 0 + color: "lightblue" + } + + Rectangle { + id: ground + width: 600; height: 200 + y: 200 + color: "green" + } + + MouseArea { + id: mousearea + anchors.fill: mainRectangle + } + + states: [ State { + name: "night" + when: mousearea.pressed == true + PropertyChanges { target: sky; color: "darkblue" } + PropertyChanges { target: ground; color: "black" } + }, + State { + name: "daylight" + when: mousearea.pressed == false + PropertyChanges { target: sky; color: "lightblue" } + PropertyChanges { target: ground; color: "green" } + } + ] + + transitions: [ Transition { + from: "daylight"; to: "night" + ColorAnimation { duration: 1000 } + }, + Transition { + from: "night"; to: "daylight" + ColorAnimation { duration: 500 } + } + ] + } + \endcode + +Several new things appear in this sample. Firstly, we use a \l MouseArea +element to detect mouse clicks in the \e mainRectangle. Secondly, we use +the list notation [ thing1 , thing2, ... ] to build a list of states and a +list of transitions. + +\l MouseArea defines a region that will respond to mouse clicks. In this case +we are only concerned with when the mouse is pressed or not pressed, not +the particular button or other details. The area of the MouseArea is the +entire main window, mainRectangle, so that clicking anywhere in this region +will start the animation. Since we are using the 'pressed' mouse state, +then the animation will move from 'daylight' to 'night' only while the mouse +button remains pressed. + +When the button is released the 'daylight' state is entered and the +transition from 'night' to 'daylight' is triggered causing the animation to +run. The transition specifies the duration in milliseconds of the +ColorAnimation, while the state specifies the color of the new state. + +The PropertyChanges command is the way that we nominate which properties +will change in a change of state, and what new value the property will +take. Since, for example, we want the 'sky' region to turn to dark blue and +the 'ground' region to turn to black for the 'night' state, then the +rectangles for those regions are the 'target' and the property in the target +is 'color'. + + +\section1 Signals + +Signals are simply events that can be hooked up to actions we want performed. +In QML they are usually preceded by the word 'on', for example in the animation +using a MouseArea the signal was \l {MouseArea::onPressed}{onPressed}. If +you look at the C++ documentation you will see a lot of talk about +\l {Signals & Slots}{Signals and Slots}. Signals are connected to Slots. The +signal represents an event and the Slot is the function that does something +based on that event. You can also have Signals connected to other Signals, so +that one Signal (event) triggers another Signal (event), and so forth. It is +nice to know this is what happens beneath the QML layer but not essential for +using QML. + +Most elements do not have Signals associated with them. However, a few like +the \l Audio element have many signals. Some of the \l Audio signals are +used to represent events such as when the audio is stopped, play is pressed, +paused, and reaching the end of the media. They allow the developer to connect, + for example, the press of a user interface button (perhaps a MouseArea) to + some QML that will handle this event. + + +\section1 Analyzing An Example: Dial + +In the Qt \e {examples/declarative/toys} folder you will find a folder +\e {dial} which contains the \e dial example. + +\image qml-dial.png "QML Dial example with Slider" + +In essence this small application has a sliding bar that you can slide using +a mouse, and a graphical dial that responds to the position of the slider. + +The code for the example is in two parts: Dial.qml and dial-example.qml. + +\e {Dial.qml} can be found in the \e content sub-directory. It defines a Dial +component similar to an odometer. Eventually, the example will hook up a slider +component so that moving the slider will change the position of a needle on the +dial. + +The code for the Dial, identified by the name of the file, contains four images +in overlapping order: the background (numbers and divisions), the shadow of the +needle, the needle itself, and finally the 'glass' overlay (containing +transparent layers). + +The needle_shadow.png image has a Rotation assigned to the \e transform +attribute of the \l Image. The rotation is set to match the angle of the needle +image angle value \e {needleRotation.angle}. Both the needle and the +needle_shadow have the same default \e x and \e y values but the rotation origin +for the needle is slightly different so that a shadow will be evident as the +needle moves. + +\snippet ../../examples/declarative/toys/dial/content/Dial.qml needle_shadow + +And the needle + +\snippet ../../examples/declarative/toys/dial/content/Dial.qml needle + +The final image is the overlay which simply has a position defined. + +\snippet ../../examples/declarative/toys/dial/content/Dial.qml overlay + +\e {dial-example.qml} in the \e {examples/declarative/toys/dial} directory is the +main file of the example. It defines the visual environment that the Dial +will fit into. Because the \e Dial component and the images live in the \e +content sub-directory we will have to import this into \e dial-example. So the +start of the file looks like + + \code + import Qt 4.7 + import "content" + \endcode + +The visual space is bound by a 300 by 300 pixel \l Rectangle which is given +a gray color. Inside this rectangle is our component \e Dial and a \l Rectangle. +Inside the rectangle called 'container' is another rectangle with the +interesting name 'slider'. + +\snippet ../../examples/declarative/toys/dial/dial-example.qml 0 + +The Dial component, named 'dial, is \e anchored to the center of the main +rectangle. The \c value attribute of 'dial' is set to a value based on the +'slider' horizontal position and the 'container' width. So changes to the +'slider' position will change the Dial \c value which is used in Dial to compute +the rotation of the needle image. Notice this piece of code in Dial where +the change in \c value modifies the position of the needle. + + \code + SpringFollow on angle { + spring: 1.4 + damping: .15 + to: Math.min(Math.max(-130, root.value*2.6 - 130), 133) + } + \endcode + +This is part of the \c needleRotation that rotates the needle and causes the +rotation of its shadow. \l SpringFollow is an element that modifies the value +of that rotation angle \e to and mimics the oscillatory behavior of a spring, +with the appropriate \e spring constant to control the acceleration and the \e +damping to control how quickly the effect dies away. + +The 'container' is light gray with a color gradient defined using +\l GradientStop. The gradient is applied vertically. If you need a horizontal +gradient then you could apply the vertical gradient and then rotate the item +by 90 degrees. + +The 'slider' is dark gray and also has a vertical color gradient. The most +important thing about the 'slider' is that it has a MouseArea defined, which +specifies a \c {drag.target} on itself along the X-axis. With minimum +and maximum values on the X-axis defined. So we can click on the 'slider' and +drag it left and right within the confines of the 'container'. The motion of +the 'slider' will then change the \c value attribute in \e Dial as discussed +already. + +Also notice the use of a \c radius value for a rectangle. This produces rounded +corners. That is how the 'container' and 'slider' are displayed with a +pleasant rounded look. + + + +*/ + + + diff --git a/doc/src/images/qml-dial.png b/doc/src/images/qml-dial.png new file mode 100644 index 0000000..da5c031 Binary files /dev/null and b/doc/src/images/qml-dial.png differ diff --git a/doc/src/images/qml-intro-anchors1.png b/doc/src/images/qml-intro-anchors1.png new file mode 100644 index 0000000..fdb301e Binary files /dev/null and b/doc/src/images/qml-intro-anchors1.png differ diff --git a/doc/src/images/qml-intro-anchors2.png b/doc/src/images/qml-intro-anchors2.png new file mode 100644 index 0000000..84f43bd Binary files /dev/null and b/doc/src/images/qml-intro-anchors2.png differ diff --git a/doc/src/images/qml-intro-anchors3.png b/doc/src/images/qml-intro-anchors3.png new file mode 100644 index 0000000..21ae97b Binary files /dev/null and b/doc/src/images/qml-intro-anchors3.png differ diff --git a/doc/src/images/qml-intro-helloa.png b/doc/src/images/qml-intro-helloa.png new file mode 100644 index 0000000..00b34b0 Binary files /dev/null and b/doc/src/images/qml-intro-helloa.png differ -- cgit v0.12 From c152b5dc859a47c45c7be70b7869e747ec58d8a9 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Thu, 20 May 2010 10:04:58 +0200 Subject: Doc: Updating CSS and JS Fixed bugs on index page, moved JS from template to script file. --- doc/src/template/scripts/functions.js | 17 +++++++++++++++++ doc/src/template/style/style.css | 2 ++ tools/qdoc3/test/qt-html-templates.qdocconf | 14 ++++++-------- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/doc/src/template/scripts/functions.js b/doc/src/template/scripts/functions.js index 7d93486..afd1ec3 100755 --- a/doc/src/template/scripts/functions.js +++ b/doc/src/template/scripts/functions.js @@ -33,7 +33,21 @@ $('#bigA').click(function() { $(this).addClass('active') }); +$('.feedclose').click(function() { + $('.bd').show(); + $('.hd').show(); + $('.footer').show(); + $('#feedbackBox').hide(); + $('#blurpage').hide(); +}); +$('.feedback').click(function() { + $('.bd').hide(); + $('.hd').hide(); + $('.footer').hide(); + $('#feedbackBox').show(); + $('#blurpage').show(); +}); var lookupCount = 0; var articleCount = 0; var exampleCount = 0; @@ -131,6 +145,9 @@ else */ // Loads on doc ready $(document).ready(function () { + var pageUrl = window.location.href; + //alert(pageUrl); + $('#pageUrl').attr('foo',pageUrl); var pageTitle = $('title').html(); $('#feedform').append(''); var currentString = $('#pageType').val() ; diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css index 5ad90e3..3f35642 100755 --- a/doc/src/template/style/style.css +++ b/doc/src/template/style/style.css @@ -456,6 +456,7 @@ .wrap .content { padding: 30px; + word-wrap:break-word; } .wrap .content li @@ -1067,6 +1068,7 @@ .indexboxcont .sectionlist { display: inline-block; + vertical-align:top; width: 32.5%; padding: 0; } diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index e83e666..50bf0c3 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -109,7 +109,7 @@ HTML.postpostheader = " \n" \ "
\n" HTML.footer = " \n" \ - "
\n" \ + "
\n" \ " [+] Documentation Feedback
\n" \ "
\n" \ "
\n" \ @@ -127,14 +127,12 @@ HTML.footer = " \n" \ " href=\"http://qt.nokia.com/about/privacy-policy\">Privacy Policy

\n" \ " \n" \ "
\n" \ - "
\n" \ - " X\n" \ - "
\n" \ - "
\n" \ + "
X
\n" \ + " \n" \ "

\n" \ - " \n" \ - "

\n" \ + " \n" \ + " \n" \ + "

\n" \ "
\n" \ "
\n" \ "
\n" \ -- cgit v0.12 From e61b3eb9903e9a63f107074c0e8d60e3ee689a52 Mon Sep 17 00:00:00 2001 From: Martin Petersson Date: Thu, 20 May 2010 10:12:52 +0200 Subject: Added support for .rc files on VS2010. Reviewed-by: Thierry --- qmake/generators/win32/msbuild_objectmodel.cpp | 39 ++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp index 99cdd11..75fc910 100644 --- a/qmake/generators/win32/msbuild_objectmodel.cpp +++ b/qmake/generators/win32/msbuild_objectmodel.cpp @@ -2656,6 +2656,14 @@ bool VCXFilter::outputFileConfig(XmlOutput &xml, XmlOutput &xmlFilter, const QSt xml << tag("ClCompile") << attrTag("Include",Option::fixPathToLocalOS(filename)); + } else if(filename.endsWith(".res")) { + + xmlFilter << tag("CustomBuild") + << attrTag("Include",Option::fixPathToLocalOS(filename)) + << attrTagS("Filter", filtername); + + xml << tag("CustomBuild") + << attrTag("Include",Option::fixPathToLocalOS(filename)); } else { xmlFilter << tag("CustomBuild") @@ -2665,6 +2673,16 @@ bool VCXFilter::outputFileConfig(XmlOutput &xml, XmlOutput &xmlFilter, const QSt xml << tag("CustomBuild") << attrTag("Include",Option::fixPathToLocalOS(filename)); } + } else if(filtername == "Root Files") { + + if (filename.endsWith(".rc")) { + + xmlFilter << tag("ResourceCompile") + << attrTag("Include",Option::fixPathToLocalOS(filename)); + + xml << tag("ResourceCompile") + << attrTag("Include",Option::fixPathToLocalOS(filename)); + } } } @@ -2696,8 +2714,6 @@ bool VCXFilter::outputFileConfig(XmlOutput &xml, XmlOutput &xmlFilter, const QSt << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg((*Config).Name)) << valueTag(CompilerTool.PrecompiledHeader); } - - //xml << CompilerTool; } } @@ -3023,6 +3039,14 @@ void VCXProject::outputFileConfigs(XmlOutput &xml, xml << tag("ClCompile") << attrTag("Include",Option::fixPathToLocalOS(info.file)); + } else if(info.file.endsWith(".res")) { + + xmlFilter << tag("CustomBuild") + << attrTag("Include",Option::fixPathToLocalOS(info.file)) + << attrTagS("Filter", filtername); + + xml << tag("CustomBuild") + << attrTag("Include",Option::fixPathToLocalOS(info.file)); } else { xmlFilter << tag("CustomBuild") @@ -3033,6 +3057,16 @@ void VCXProject::outputFileConfigs(XmlOutput &xml, << attrTag("Include",Option::fixPathToLocalOS(info.file)); } + } else if(filtername == "Root Files") { + + if (info.file.endsWith(".rc")) { + + xmlFilter << tag("ResourceCompile") + << attrTag("Include",Option::fixPathToLocalOS(info.file)); + + xml << tag("ResourceCompile") + << attrTag("Include",Option::fixPathToLocalOS(info.file)); + } } else { xmlFilter << tag("None") @@ -3329,6 +3363,7 @@ XmlOutput &operator<<(XmlOutput &xml, VCXProject &tool) for (int x = 0; x < tool.ExtraCompilers.count(); ++x) { tool.outputFilter(xml, xmlFilter, tool.ExtraCompilers.at(x)); } + tool.outputFilter(xml, xmlFilter, "Root Files"); xml << import("Project", "$(VCTargetsPath)\\Microsoft.Cpp.targets"); -- cgit v0.12 From a72c6f403435e5cc7aff501b1e1ee990dfb24969 Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Thu, 20 May 2010 11:03:12 +0200 Subject: Use QApplication::arguments() to check for command line args Use the Qt way to look up command line args, remove 5 lines of code per example. Also clean up badly indented code. --- demos/deform/main.cpp | 5 +---- demos/pathstroke/main.cpp | 5 +---- examples/draganddrop/fridgemagnets/main.cpp | 6 ++---- examples/script/context2d/main.cpp | 6 +----- examples/widgets/wiggly/main.cpp | 15 ++++++--------- 5 files changed, 11 insertions(+), 26 deletions(-) diff --git a/demos/deform/main.cpp b/demos/deform/main.cpp index 4539973..bef075a 100644 --- a/demos/deform/main.cpp +++ b/demos/deform/main.cpp @@ -50,10 +50,7 @@ int main(int argc, char **argv) QApplication app(argc, argv); - bool smallScreen = false; - for (int i=0; i Date: Thu, 20 May 2010 11:29:20 +0200 Subject: Examples: Fix compilation with namespace. --- demos/spectrum/app/engine.h | 5 ++++- demos/spectrum/app/mainwidget.h | 3 +++ demos/spectrum/app/settingsdialog.h | 2 ++ demos/spectrum/app/spectrograph.h | 2 ++ demos/spectrum/app/spectrumanalyser.h | 3 +++ demos/spectrum/app/tonegenerator.h | 2 ++ demos/spectrum/app/tonegeneratordialog.h | 2 ++ demos/spectrum/app/utils.h | 2 ++ demos/spectrum/app/waveform.h | 2 ++ 9 files changed, 22 insertions(+), 1 deletion(-) diff --git a/demos/spectrum/app/engine.h b/demos/spectrum/app/engine.h index 16088b2..93733fe 100644 --- a/demos/spectrum/app/engine.h +++ b/demos/spectrum/app/engine.h @@ -61,10 +61,13 @@ #include #endif +QT_BEGIN_NAMESPACE class QAudioInput; class QAudioOutput; -class FrequencySpectrum; class QFile; +QT_END_NAMESPACE + +class FrequencySpectrum; /** * This class interfaces with the QtMultimedia audio classes, and also with diff --git a/demos/spectrum/app/mainwidget.h b/demos/spectrum/app/mainwidget.h index 846b97a..c59dbd6 100644 --- a/demos/spectrum/app/mainwidget.h +++ b/demos/spectrum/app/mainwidget.h @@ -50,11 +50,14 @@ class Waveform; class LevelMeter; class SettingsDialog; class ToneGeneratorDialog; + +QT_BEGIN_NAMESPACE class QAudioFormat; class QLabel; class QPushButton; class QMenu; class QAction; +QT_END_NAMESPACE /** * Main application widget, responsible for connecting the various UI diff --git a/demos/spectrum/app/settingsdialog.h b/demos/spectrum/app/settingsdialog.h index 7215a50..fda518b 100644 --- a/demos/spectrum/app/settingsdialog.h +++ b/demos/spectrum/app/settingsdialog.h @@ -42,11 +42,13 @@ #include #include +QT_BEGIN_NAMESPACE class QComboBox; class QCheckBox; class QSlider; class QSpinBox; class QGridLayout; +QT_END_NAMESPACE /** * Dialog used to control settings such as the audio input / output device diff --git a/demos/spectrum/app/spectrograph.h b/demos/spectrum/app/spectrograph.h index 6bfef33..a7790ff 100644 --- a/demos/spectrum/app/spectrograph.h +++ b/demos/spectrum/app/spectrograph.h @@ -41,7 +41,9 @@ #include #include "frequencyspectrum.h" +QT_BEGIN_NAMESPACE class QMouseEvent; +QT_END_NAMESPACE /** * Widget which displays a spectrograph showing the frequency spectrum diff --git a/demos/spectrum/app/spectrumanalyser.h b/demos/spectrum/app/spectrumanalyser.h index caeb1c1..f10da63 100644 --- a/demos/spectrum/app/spectrumanalyser.h +++ b/demos/spectrum/app/spectrumanalyser.h @@ -55,8 +55,11 @@ #include "FFTRealFixLenParam.h" #endif +QT_BEGIN_NAMESPACE class QAudioFormat; class QThread; +QT_END_NAMESPACE + class FFTRealWrapper; class SpectrumAnalyserThreadPrivate; diff --git a/demos/spectrum/app/tonegenerator.h b/demos/spectrum/app/tonegenerator.h index 419f7e4..d387768 100644 --- a/demos/spectrum/app/tonegenerator.h +++ b/demos/spectrum/app/tonegenerator.h @@ -41,8 +41,10 @@ #include #include "spectrum.h" +QT_BEGIN_NAMESPACE class QAudioFormat; class QByteArray; +QT_END_NAMESPACE /** * Generate a sine wave diff --git a/demos/spectrum/app/tonegeneratordialog.h b/demos/spectrum/app/tonegeneratordialog.h index 35d69c2..d6fcffa 100644 --- a/demos/spectrum/app/tonegeneratordialog.h +++ b/demos/spectrum/app/tonegeneratordialog.h @@ -42,10 +42,12 @@ #include #include +QT_BEGIN_NAMESPACE class QCheckBox; class QSlider; class QSpinBox; class QGridLayout; +QT_END_NAMESPACE /** * Dialog which controls the parameters of the tone generator. diff --git a/demos/spectrum/app/utils.h b/demos/spectrum/app/utils.h index 83467cd..548f884 100644 --- a/demos/spectrum/app/utils.h +++ b/demos/spectrum/app/utils.h @@ -41,7 +41,9 @@ #include #include +QT_BEGIN_NAMESPACE class QAudioFormat; +QT_END_NAMESPACE //----------------------------------------------------------------------------- // Miscellaneous utility functions diff --git a/demos/spectrum/app/waveform.h b/demos/spectrum/app/waveform.h index 4de527f..909e5ee 100644 --- a/demos/spectrum/app/waveform.h +++ b/demos/spectrum/app/waveform.h @@ -43,7 +43,9 @@ #include #include +QT_BEGIN_NAMESPACE class QByteArray; +QT_END_NAMESPACE /** * Widget which displays a section of the audio waveform. -- cgit v0.12 From 16f44ee07db46ad362a464afc2c6e6567c933870 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Thu, 20 May 2010 10:52:16 +0200 Subject: QApplication::closeAllWindows() should ignore windows being closed It is very common to display a dialog in response to a close event. Closing the window again will result in QWidget::close() returning true. This confuses QApplication::closeAllWindows(), since the window is still visible even though it was closed (or is closing). Solve this by ignoring windows that have the is_closing flag set in their widget data. Task-number: QTBUG-7635 Reviewed-by: Denis Dzyubenko --- src/gui/kernel/qapplication.cpp | 8 +-- tests/auto/qapplication/tst_qapplication.cpp | 78 ++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 7b62de1..b805a72 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -2218,15 +2218,17 @@ void QApplication::closeAllWindows() { bool did_close = true; QWidget *w; - while((w = activeModalWidget()) && did_close) { - if(!w->isVisible()) + while ((w = activeModalWidget()) && did_close) { + if (!w->isVisible() || w->data->is_closing) break; did_close = w->close(); } QWidgetList list = QApplication::topLevelWidgets(); for (int i = 0; did_close && i < list.size(); ++i) { w = list.at(i); - if (w->isVisible() && w->windowType() != Qt::Desktop) { + if (w->isVisible() + && w->windowType() != Qt::Desktop + && !w->data->is_closing) { did_close = w->close(); list = QApplication::topLevelWidgets(); i = -1; diff --git a/tests/auto/qapplication/tst_qapplication.cpp b/tests/auto/qapplication/tst_qapplication.cpp index 459ac2b..43fbba1 100644 --- a/tests/auto/qapplication/tst_qapplication.cpp +++ b/tests/auto/qapplication/tst_qapplication.cpp @@ -106,6 +106,7 @@ private slots: void lastWindowClosed(); void quitOnLastWindowClosed(); + void closeAllWindows(); void testDeleteLater(); void testDeleteLaterProcessEvents(); @@ -745,6 +746,83 @@ void tst_QApplication::quitOnLastWindowClosed() } } +class PromptOnCloseWidget : public QWidget +{ +public: + void closeEvent(QCloseEvent *event) + { + QMessageBox *messageBox = new QMessageBox(this); + messageBox->setWindowTitle("Unsaved data"); + messageBox->setText("Would you like to save or discard your current data?"); + messageBox->setStandardButtons(QMessageBox::Save|QMessageBox::Discard|QMessageBox::Cancel); + messageBox->setDefaultButton(QMessageBox::Save); + + messageBox->show(); + QTest::qWaitForWindowShown(messageBox); + + // verify that all windows are visible + foreach (QWidget *w, qApp->topLevelWidgets()) + QVERIFY(w->isVisible()); + // flush event queue + qApp->processEvents(); + // close all windows + qApp->closeAllWindows(); + + if (messageBox->standardButton(messageBox->clickedButton()) == QMessageBox::Cancel) + event->ignore(); + else + event->accept(); + + delete messageBox; + } +}; + +void tst_QApplication::closeAllWindows() +{ + int argc = 0; + QApplication app(argc, 0, QApplication::GuiServer); + + // create some windows + new QWidget; + new QWidget; + new QWidget; + + // show all windows + foreach (QWidget *w, app.topLevelWidgets()) { + w->show(); + QTest::qWaitForWindowShown(w); + } + // verify that they are visible + foreach (QWidget *w, app.topLevelWidgets()) + QVERIFY(w->isVisible()); + // empty event queue + app.processEvents(); + // close all windows + app.closeAllWindows(); + // all windows should no longer be visible + foreach (QWidget *w, app.topLevelWidgets()) + QVERIFY(!w->isVisible()); + + // add a window that prompts the user when closed + PromptOnCloseWidget *promptOnCloseWidget = new PromptOnCloseWidget; + // show all windows + foreach (QWidget *w, app.topLevelWidgets()) { + w->show(); + QTest::qWaitForWindowShown(w); + } + // close the last window to open the prompt (eventloop recurses) + promptOnCloseWidget->close(); + // all windows should not be visible, except the one that opened the prompt + foreach (QWidget *w, app.topLevelWidgets()) { + if (w == promptOnCloseWidget) + QVERIFY(w->isVisible()); + else + QVERIFY(!w->isVisible()); + } + + qDeleteAll(app.topLevelWidgets()); +} + bool isPathListIncluded(const QStringList &l, const QStringList &r) { int size = r.count(); -- cgit v0.12 From 65a673f7ab1955e277246e4c88bec46493265cf3 Mon Sep 17 00:00:00 2001 From: Carlos Manuel Duclos Vergara Date: Thu, 20 May 2010 12:17:58 +0200 Subject: QPushButton's click area exceeds the button area by far on Mac OS X The problem is the "rounding" of buttons in OSX. To achieve this we add some padding to the buttons, therefore creating an inner rect for the widget. The common hitButton(...) method found in QAbstractButton just checks the normal rect of the widget. What this patch does is to reimplement hitButton(...) in QPushButton, but only for the Mac case. In this reimplemented method I calculate the inner rect and check if the hit point is inside that rect or not. Task-number: QTBUG-10401 Reviewed-by: Richard Moe Gustavsen --- src/gui/styles/qmacstyle_mac.h | 11 +++++++++++ src/gui/styles/qmacstyle_mac.mm | 33 +++++++++++++++++---------------- src/gui/widgets/qpushbutton.cpp | 34 ++++++++++++++++++++++++++++++++++ src/gui/widgets/qpushbutton.h | 3 +++ src/gui/widgets/qpushbutton_p.h | 3 +++ 5 files changed, 68 insertions(+), 16 deletions(-) diff --git a/src/gui/styles/qmacstyle_mac.h b/src/gui/styles/qmacstyle_mac.h index bcebb1d..e594793 100644 --- a/src/gui/styles/qmacstyle_mac.h +++ b/src/gui/styles/qmacstyle_mac.h @@ -120,6 +120,17 @@ public: bool event(QEvent *e); + // Ideally these wouldn't exist, but since they already exist we need some accessors. + static const int PushButtonLeftOffset; + static const int PushButtonTopOffset; + static const int PushButtonRightOffset; + static const int PushButtonBottomOffset; + static const int MiniButtonH; + static const int SmallButtonH; + static const int BevelButtonW; + static const int BevelButtonH; + static const int PushButtonContentPadding; + protected Q_SLOTS: QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *opt = 0, const QWidget *widget = 0) const; diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index e065bcc..0f01bd5 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -108,15 +108,15 @@ extern QRegion qt_mac_convert_mac_region(RgnHandle); //qregion_mac.cpp // The following constants are used for adjusting the size // of push buttons so that they are drawn inside their bounds. -static const int PushButtonLeftOffset = 6; -static const int PushButtonTopOffset = 4; -static const int PushButtonRightOffset = 12; -static const int PushButtonBottomOffset = 12; -static const int MiniButtonH = 26; -static const int SmallButtonH = 30; -static const int BevelButtonW = 50; -static const int BevelButtonH = 22; -static const int PushButtonContentPadding = 6; +const int QMacStyle::PushButtonLeftOffset = 6; +const int QMacStyle::PushButtonTopOffset = 4; +const int QMacStyle::PushButtonRightOffset = 12; +const int QMacStyle::PushButtonBottomOffset = 12; +const int QMacStyle::MiniButtonH = 26; +const int QMacStyle::SmallButtonH = 30; +const int QMacStyle::BevelButtonW = 50; +const int QMacStyle::BevelButtonH = 22; +const int QMacStyle::PushButtonContentPadding = 6; // These colors specify the titlebar gradient colors on // Leopard. Ideally we should get them from the system. @@ -1055,10 +1055,10 @@ HIRect QMacStylePrivate::pushButtonContentBounds(const QStyleOptionButton *btn, // Adjust the bounds to correct for // carbon not calculating the content bounds fully correct if (bdi->kind == kThemePushButton || bdi->kind == kThemePushButtonSmall){ - outerBounds.origin.y += PushButtonTopOffset; - outerBounds.size.height -= PushButtonBottomOffset; + outerBounds.origin.y += QMacStyle::PushButtonTopOffset; + outerBounds.size.height -= QMacStyle::PushButtonBottomOffset; } else if (bdi->kind == kThemePushButtonMini) { - outerBounds.origin.y += PushButtonTopOffset; + outerBounds.origin.y += QMacStyle::PushButtonTopOffset; } HIRect contentBounds; @@ -1074,7 +1074,7 @@ QSize QMacStylePrivate::pushButtonSizeFromContents(const QStyleOptionButton *btn { QSize csz(0, 0); QSize iconSize = btn->icon.isNull() ? QSize(0, 0) - : (btn->iconSize + QSize(PushButtonContentPadding, 0)); + : (btn->iconSize + QSize(QMacStyle::PushButtonContentPadding, 0)); QRect textRect = btn->text.isEmpty() ? QRect(0, 0, 1, 1) : btn->fontMetrics.boundingRect(QRect(), Qt::AlignCenter, btn->text); csz.setWidth(iconSize.width() + textRect.width() @@ -1149,12 +1149,12 @@ void QMacStylePrivate::initHIThemePushButton(const QStyleOptionButton *btn, // Choose the button kind that closest match the button rect, but at the // same time displays the button contents without clipping. bdi->kind = kThemeBevelButton; - if (btn->rect.width() >= BevelButtonW && btn->rect.height() >= BevelButtonH){ + if (btn->rect.width() >= QMacStyle::BevelButtonW && btn->rect.height() >= QMacStyle::BevelButtonH){ if (widget && widget->testAttribute(Qt::WA_MacVariableSize)) { - if (btn->rect.height() <= MiniButtonH){ + if (btn->rect.height() <= QMacStyle::MiniButtonH){ if (contentFitsInPushButton(btn, bdi, kThemePushButtonMini)) bdi->kind = kThemePushButtonMini; - } else if (btn->rect.height() <= SmallButtonH){ + } else if (btn->rect.height() <= QMacStyle::SmallButtonH){ if (contentFitsInPushButton(btn, bdi, kThemePushButtonSmall)) bdi->kind = kThemePushButtonSmall; } else if (contentFitsInPushButton(btn, bdi, kThemePushButton)) { @@ -3470,6 +3470,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter QCommonStyle::drawControl(ce, opt, p, w); break; case CE_PushButtonBevel: + qDebug() << "here"; if (const QStyleOptionButton *btn = ::qstyleoption_cast(opt)) { if (!(btn->state & (State_Raised | State_Sunken | State_On))) break; diff --git a/src/gui/widgets/qpushbutton.cpp b/src/gui/widgets/qpushbutton.cpp index 1a9adcc..7b8c0db 100644 --- a/src/gui/widgets/qpushbutton.cpp +++ b/src/gui/widgets/qpushbutton.cpp @@ -58,6 +58,9 @@ #include "qdebug.h" #include "qlayoutitem.h" #include "qdialogbuttonbox.h" +#ifdef Q_WS_MAC +#include "qmacstyle_mac.h" +#endif // Q_WS_MAC #ifndef QT_NO_ACCESSIBILITY #include "qaccessible.h" @@ -679,6 +682,37 @@ bool QPushButton::event(QEvent *e) return QAbstractButton::event(e); } +#ifdef Q_WS_MAC +/*! \reimp */ +bool QPushButton::hitButton(const QPoint &pos) const +{ + // This is only required if we are using the native style, so check that first. + QMacStyle *macStyle = qobject_cast(style()); + // If this is a flat button we just bail out. + if(isFlat() || (0 == macStyle)) + return QAbstractButton::hitButton(pos); + // Now that we know we are using the native style, let's proceed. + Q_D(const QPushButton); + QPushButtonPrivate *nonConst = const_cast(d); + // In OSX buttons are round, which causes the hit method to be special. + // We cannot simply relay on detecting if something is inside the rect or not, + // we need to check if it is inside the "rounded area" or not. A point might + // be inside the rect but not inside the rounded area. + // Notice this method is only reimplemented for OSX. + return nonConst->hitButton(pos); +} + +bool QPushButtonPrivate::hitButton(const QPoint &pos) +{ + Q_Q(QPushButton); + QRect roundedRect(q->rect().left() + QMacStyle::PushButtonLeftOffset, + q->rect().top() + QMacStyle::PushButtonContentPadding, + q->rect().width() - QMacStyle::PushButtonRightOffset, + q->rect().height() - QMacStyle::PushButtonBottomOffset); + return roundedRect.contains(pos); +} +#endif // Q_WS_MAC + #ifdef QT3_SUPPORT /*! Use one of the constructors that doesn't take the \a name diff --git a/src/gui/widgets/qpushbutton.h b/src/gui/widgets/qpushbutton.h index 2a4823d..cf28753 100644 --- a/src/gui/widgets/qpushbutton.h +++ b/src/gui/widgets/qpushbutton.h @@ -91,6 +91,9 @@ public Q_SLOTS: protected: bool event(QEvent *e); +#ifdef Q_WS_MAC + bool hitButton(const QPoint &pos) const; +#endif // Q_WS_MAC void paintEvent(QPaintEvent *); void keyPressEvent(QKeyEvent *); void focusInEvent(QFocusEvent *); diff --git a/src/gui/widgets/qpushbutton_p.h b/src/gui/widgets/qpushbutton_p.h index f2ee09d..6feb726 100644 --- a/src/gui/widgets/qpushbutton_p.h +++ b/src/gui/widgets/qpushbutton_p.h @@ -69,6 +69,9 @@ public: inline void init() { resetLayoutItemMargins(); } static QPushButtonPrivate* get(QPushButton *b) { return b->d_func(); } +#ifdef Q_WS_MAC + bool hitButton(const QPoint &pos); +#endif #ifndef QT_NO_MENU QPoint adjustedMenuPosition(); #endif -- cgit v0.12 From d88905544477283a17580b210e46c93635cf9920 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Thu, 20 May 2010 12:22:29 +0200 Subject: update 4.7.0 changes Mistakenly added something that was fixed for 4.6.3 (it's been moved to changes-4.6.3 in a different branch). --- dist/changes-4.7.0 | 2 -- 1 file changed, 2 deletions(-) diff --git a/dist/changes-4.7.0 b/dist/changes-4.7.0 index a57575e..d6209f4 100644 --- a/dist/changes-4.7.0 +++ b/dist/changes-4.7.0 @@ -54,8 +54,6 @@ QtCore * Significantly improved performance of the type() function - QState * [QTBUG-7741] Added a function to get the out-going transitions - - QStateMachine - * [QTBUG-8842] Reset history states when (re)starting machine - QXmlStreamReader * [QTBUG-9196] fixed crash when parsing - QTimer -- cgit v0.12 From 1dc2235ac930c5444aa83a25432d1bf8b78b18db Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 20 May 2010 13:49:18 +0200 Subject: doc: Fixed many broken links. --- doc/src/declarative/advtutorial.qdoc | 2 +- doc/src/declarative/integrating.qdoc | 2 +- doc/src/examples/diagramscene.qdoc | 12 ++++++------ doc/src/examples/undoframework.qdoc | 2 +- doc/src/frameworks-technologies/activeqt.qdoc | 6 +++--- doc/src/getting-started/installation.qdoc | 12 ++++++------ doc/src/getting-started/known-issues.qdoc | 2 +- doc/src/porting/porting4.qdoc | 4 ++-- doc/src/widgets-and-layouts/focus.qdoc | 2 +- doc/src/widgets-and-layouts/styles.qdoc | 2 +- src/gui/graphicsview/qgraphicsview.cpp | 2 +- src/gui/image/qimage.cpp | 4 ++-- src/gui/image/qpixmap.cpp | 4 ++-- src/gui/itemviews/qlistwidget.cpp | 4 ++-- src/gui/itemviews/qstandarditemmodel.cpp | 4 ++-- src/gui/itemviews/qtablewidget.cpp | 4 ++-- src/gui/itemviews/qtreewidget.cpp | 4 ++-- src/gui/kernel/qwidget.cpp | 4 ++-- src/gui/math3d/qgenericmatrix.cpp | 4 ++-- src/gui/math3d/qmatrix4x4.cpp | 4 ++-- src/gui/math3d/qquaternion.cpp | 4 ++-- src/gui/math3d/qvector2d.cpp | 4 ++-- src/gui/math3d/qvector3d.cpp | 4 ++-- src/gui/math3d/qvector4d.cpp | 4 ++-- src/gui/painting/qbrush.cpp | 8 ++++---- src/gui/painting/qpaintdevice.qdoc | 3 +-- src/gui/painting/qpaintengine.cpp | 2 +- src/gui/painting/qpen.cpp | 6 +++--- src/gui/painting/qtransform.cpp | 10 +++++----- src/gui/styles/qstyle.cpp | 2 +- 30 files changed, 65 insertions(+), 66 deletions(-) diff --git a/doc/src/declarative/advtutorial.qdoc b/doc/src/declarative/advtutorial.qdoc index 47504ae..62536c6 100644 --- a/doc/src/declarative/advtutorial.qdoc +++ b/doc/src/declarative/advtutorial.qdoc @@ -468,6 +468,6 @@ By following this tutorial you've seen how you can write a fully functional appl \endlist There is so much more to learn about QML that we haven't been able to cover in this tutorial. Check out all the -demos and examples and the \l {Declarative UI Using QML}{documentation} to find out all the things you can do with QML! +demos and examples and the \l {Qt Quick} documentation to see all the things you can do with QML! */ diff --git a/doc/src/declarative/integrating.qdoc b/doc/src/declarative/integrating.qdoc index c6f754b..728eb13 100644 --- a/doc/src/declarative/integrating.qdoc +++ b/doc/src/declarative/integrating.qdoc @@ -81,7 +81,7 @@ of simple and dynamic elements. \section2 Adding QML widgets to a QGraphicsScene -If you have an existing UI based on the \l{The Graphics View Framework}{Graphics View Framework}, +If you have an existing UI based on the \l{Graphics View Framework}, you can integrate QML widgets directly into your QGraphicsScene. Use QDeclarativeComponent to create a QGraphicsObject from a QML file, and place the graphics object into your scene using \l{QGraphicsScene::addItem()}, or diff --git a/doc/src/examples/diagramscene.qdoc b/doc/src/examples/diagramscene.qdoc index 87c973a..a39f89a7 100644 --- a/doc/src/examples/diagramscene.qdoc +++ b/doc/src/examples/diagramscene.qdoc @@ -54,13 +54,13 @@ colors, and it is possible to change the font, style, and underline of the text. - The Qt graphics view framework is designed to manage and - display custom 2D graphics items. The main classes of the - framework are QGraphicsItem, QGraphicsScene and QGraphicsView. The - graphics scene manages the items and provides a surface for them. + The Qt graphics view framework is designed to manage and display + custom 2D graphics items. The main classes of the framework are + QGraphicsItem, QGraphicsScene and QGraphicsView. The graphics + scene manages the items and provides a surface for them. QGraphicsView is a widget that is used to render a scene on the - screen. See the \l{The Graphics View Framework}{overview document} - for a more detailed description of the framework. + screen. See the \l{Graphics View Framework} for a more detailed + description of the framework. In this example we show how to create such custom graphics scenes and items by implementing classes that inherit diff --git a/doc/src/examples/undoframework.qdoc b/doc/src/examples/undoframework.qdoc index adb38b6..aab25fa 100644 --- a/doc/src/examples/undoframework.qdoc +++ b/doc/src/examples/undoframework.qdoc @@ -67,7 +67,7 @@ available through the edit menu. The user can also select a command from the undo view. - We use the \l{The Graphics View Framework}{graphics view + We use the \l{Graphics View Framework}{graphics view framework} to implement the diagram. We only treat the related code briefly as the framework has examples of its own (e.g., the \l{Diagram Scene Example}). diff --git a/doc/src/frameworks-technologies/activeqt.qdoc b/doc/src/frameworks-technologies/activeqt.qdoc index 979d885..5a3b23e 100644 --- a/doc/src/frameworks-technologies/activeqt.qdoc +++ b/doc/src/frameworks-technologies/activeqt.qdoc @@ -71,16 +71,16 @@ \endlist For more information about using ActiveX with Qt, see - \l{Building ActiveX servers and controls with Qt}. + \l{Building ActiveX servers in Qt}. The ActiveQt framework consists of two modules: \list - \o The \l{Using ActiveX controls and COM objects in Qt}{QAxContainer} + \o The \l{Using ActiveX controls and COM in Qt}{QAxContainer} module is a static library implementing QObject and QWidget subclasses, QAxObject and QAxWidget, that act as containers for COM objects and ActiveX controls. - \o The \l{Building ActiveX servers and controls with Qt}{QAxServer} + \o The \l{Building ActiveX servers in Qt}{QAxServer} module is a static library that implements functionality for in-process and executable COM servers. This module provides the QAxAggregated, QAxBindable and QAxFactory diff --git a/doc/src/getting-started/installation.qdoc b/doc/src/getting-started/installation.qdoc index 36abc10..4a96a39 100644 --- a/doc/src/getting-started/installation.qdoc +++ b/doc/src/getting-started/installation.qdoc @@ -959,7 +959,7 @@ applications using Qt for Symbian can start right away.} \l{http://www.microsoft.com/downloads/details.aspx?FamilyID=0baf2b35-c656-4969-ace8-e4c0c0716adb&DisplayLang=en}{here}. \endlist - \sa {Known Issues in %VERSION%} + \sa {Known Issues} */ /*! @@ -969,7 +969,7 @@ applications using Qt for Symbian can start right away.} \brief Setting up the Mac OS X environment for Qt. \previouspage General Qt Requirements - \sa {Known Issues in %VERSION%} + \sa {Known Issues} */ /*! @@ -1108,7 +1108,7 @@ applications using Qt for Symbian can start right away.} distributions; try searching for \c gstreamer or \c libgstreamer in your distribution's package repository to find suitable packages. - \sa {Known Issues in %VERSION%} + \sa {Known Issues} */ /*! @@ -1162,7 +1162,7 @@ applications using Qt for Symbian can start right away.} information on Windows CE Customization can be found \l{Windows CE - Working with Custom SDKs}{here}. - \sa {Known Issues in %VERSION%} + \sa {Known Issues} */ /*! @@ -1172,7 +1172,7 @@ applications using Qt for Symbian can start right away.} \brief Setting up the Embedded Linux environment for Qt. \previouspage General Qt Requirements - \sa {Known Issues in %VERSION%} + \sa {Known Issues} \section1 Building Qt for Embedded Linux with uclibc @@ -1272,5 +1272,5 @@ applications using Qt for Symbian can start right away.} We recommend you to take a look at \l{http://developer.symbian.org/wiki/index.php/Qt_Quick_Start}{Symbian Foundation - Qt Quick Start} to get more information about how to setup the development environment. - \sa {Known Issues in %VERSION%} + \sa {Known Issues} */ diff --git a/doc/src/getting-started/known-issues.qdoc b/doc/src/getting-started/known-issues.qdoc index cedebf9..5b6b2fc 100644 --- a/doc/src/getting-started/known-issues.qdoc +++ b/doc/src/getting-started/known-issues.qdoc @@ -41,7 +41,7 @@ /*! \page known-issues.html - \title Known Issues in this Qt Version + \title Known Issues \ingroup platform-specific \brief A summary of known issues in this Qt version at the time of release. diff --git a/doc/src/porting/porting4.qdoc b/doc/src/porting/porting4.qdoc index 1b6eeb7..75fe844 100644 --- a/doc/src/porting/porting4.qdoc +++ b/doc/src/porting/porting4.qdoc @@ -1000,8 +1000,8 @@ \row \o \c QCanvasView \o Q3CanvasView \endtable - \l{The Graphics View Framework} replaces QCanvas. For more on porting to - Graphics View, see \l{Porting to Graphics View}. + The \l{Graphics View Framework} replaces QCanvas. For more on + porting to Graphics View, see \l{Porting to Graphics View}. \section1 QColor diff --git a/doc/src/widgets-and-layouts/focus.qdoc b/doc/src/widgets-and-layouts/focus.qdoc index 71f41d5..5ccfb63 100644 --- a/doc/src/widgets-and-layouts/focus.qdoc +++ b/doc/src/widgets-and-layouts/focus.qdoc @@ -82,7 +82,7 @@ Pressing \key Tab is by far the most common way to move focus using the keyboard. (Sometimes in data-entry applications Enter does the same as \key{Tab}; this can easily be achieved in Qt by - implementing an \l{Events and Event Filters}{event filter}.) + implementing an \l{The Event System}{event filter}.) Pressing \key Tab, in all window systems in common use today, moves the keyboard focus to the next widget in a circular diff --git a/doc/src/widgets-and-layouts/styles.qdoc b/doc/src/widgets-and-layouts/styles.qdoc index 31dfe40..b031dec 100644 --- a/doc/src/widgets-and-layouts/styles.qdoc +++ b/doc/src/widgets-and-layouts/styles.qdoc @@ -47,7 +47,7 @@ /*! \page style-reference.html - \title Styles and Style Aware Widgets + \title Styles & Style Aware Widgets \ingroup qt-gui-concepts \brief Styles and the styling of widgets. diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 9dfcd2c..a83b528 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -53,7 +53,7 @@ static const int QGRAPHICSVIEW_PREALLOC_STYLE_OPTIONS = 503; // largest prime < QGraphicsView visualizes the contents of a QGraphicsScene in a scrollable viewport. To create a scene with geometrical items, see QGraphicsScene's - documentation. QGraphicsView is part of \l{The Graphics View Framework}. + documentation. QGraphicsView is part of the \l{Graphics View Framework}. To visualize a scene, you start by constructing a QGraphicsView object, passing the address of the scene you want to visualize to QGraphicsView's diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 85be5b1..98f235e 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -4812,7 +4812,7 @@ bool QImageData::doImageIO(const QImage *image, QImageWriter *writer, int qualit or as a BMP image if the stream's version is 1. Note that writing the stream to a file will not produce a valid image file. - \sa QImage::save(), {Format of the QDataStream Operators} + \sa QImage::save(), {Serializing Qt Data Types} */ QDataStream &operator<<(QDataStream &s, const QImage &image) @@ -4838,7 +4838,7 @@ QDataStream &operator<<(QDataStream &s, const QImage &image) Reads an image from the given \a stream and stores it in the given \a image. - \sa QImage::load(), {Format of the QDataStream Operators} + \sa QImage::load(), {Serializing Qt Data Types} */ QDataStream &operator>>(QDataStream &s, QImage &image) diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 474cd2e..48c5d3f 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -1281,7 +1281,7 @@ bool QPixmap::convertFromImage(const QImage &image, ColorMode mode) image. Note that writing the stream to a file will not produce a valid image file. - \sa QPixmap::save(), {Format of the QDataStream Operators} + \sa QPixmap::save(), {Serializing Qt Data Types} */ QDataStream &operator<<(QDataStream &stream, const QPixmap &pixmap) @@ -1294,7 +1294,7 @@ QDataStream &operator<<(QDataStream &stream, const QPixmap &pixmap) Reads an image from the given \a stream into the given \a pixmap. - \sa QPixmap::load(), {Format of the QDataStream Operators} + \sa QPixmap::load(), {Serializing Qt Data Types} */ QDataStream &operator>>(QDataStream &stream, QPixmap &pixmap) diff --git a/src/gui/itemviews/qlistwidget.cpp b/src/gui/itemviews/qlistwidget.cpp index 125f0c4..da1d5db 100644 --- a/src/gui/itemviews/qlistwidget.cpp +++ b/src/gui/itemviews/qlistwidget.cpp @@ -791,7 +791,7 @@ QListWidgetItem &QListWidgetItem::operator=(const QListWidgetItem &other) This operator uses QListWidgetItem::write(). - \sa {Format of the QDataStream Operators} + \sa {Serializing Qt Data Types} */ QDataStream &operator<<(QDataStream &out, const QListWidgetItem &item) { @@ -806,7 +806,7 @@ QDataStream &operator<<(QDataStream &out, const QListWidgetItem &item) This operator uses QListWidgetItem::read(). - \sa {Format of the QDataStream Operators} + \sa {Serializing Qt Data Types} */ QDataStream &operator>>(QDataStream &in, QListWidgetItem &item) { diff --git a/src/gui/itemviews/qstandarditemmodel.cpp b/src/gui/itemviews/qstandarditemmodel.cpp index 9d52c78..767b5a9 100644 --- a/src/gui/itemviews/qstandarditemmodel.cpp +++ b/src/gui/itemviews/qstandarditemmodel.cpp @@ -1921,7 +1921,7 @@ void QStandardItem::write(QDataStream &out) const This operator uses QStandardItem::read(). - \sa {Format of the QDataStream Operators} + \sa {Serializing Qt Data Types} */ QDataStream &operator>>(QDataStream &in, QStandardItem &item) { @@ -1937,7 +1937,7 @@ QDataStream &operator>>(QDataStream &in, QStandardItem &item) This operator uses QStandardItem::write(). - \sa {Format of the QDataStream Operators} + \sa {Serializing Qt Data Types} */ QDataStream &operator<<(QDataStream &out, const QStandardItem &item) { diff --git a/src/gui/itemviews/qtablewidget.cpp b/src/gui/itemviews/qtablewidget.cpp index f653a41..5bb242e 100644 --- a/src/gui/itemviews/qtablewidget.cpp +++ b/src/gui/itemviews/qtablewidget.cpp @@ -1428,7 +1428,7 @@ void QTableWidgetItem::write(QDataStream &out) const This operator uses QTableWidgetItem::read(). - \sa {Format of the QDataStream Operators} + \sa {Serializing Qt Data Types} */ QDataStream &operator>>(QDataStream &in, QTableWidgetItem &item) { @@ -1443,7 +1443,7 @@ QDataStream &operator>>(QDataStream &in, QTableWidgetItem &item) This operator uses QTableWidgetItem::write(). - \sa {Format of the QDataStream Operators} + \sa {Serializing Qt Data Types} */ QDataStream &operator<<(QDataStream &out, const QTableWidgetItem &item) { diff --git a/src/gui/itemviews/qtreewidget.cpp b/src/gui/itemviews/qtreewidget.cpp index 4c80325..0e06f34 100644 --- a/src/gui/itemviews/qtreewidget.cpp +++ b/src/gui/itemviews/qtreewidget.cpp @@ -2199,7 +2199,7 @@ void QTreeWidgetItem::executePendingSort() const This operator uses QTreeWidgetItem::write(). - \sa {Format of the QDataStream Operators} + \sa {Serializing Qt Data Types} */ QDataStream &operator<<(QDataStream &out, const QTreeWidgetItem &item) { @@ -2214,7 +2214,7 @@ QDataStream &operator<<(QDataStream &out, const QTreeWidgetItem &item) This operator uses QTreeWidgetItem::read(). - \sa {Format of the QDataStream Operators} + \sa {Serializing Qt Data Types} */ QDataStream &operator>>(QDataStream &in, QTreeWidgetItem &item) { diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 1f2cd8c..1c7f6ac 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -670,8 +670,8 @@ void QWidget::setAutoFillBackground(bool enabled) (to move the keyboard focus), and passes on most of the other events to one of the more specialized handlers above. - Events and the mechanism used to deliver them are covered in the - \l{Events and Event Filters} document. + Events and the mechanism used to deliver them are covered in + \l{The Event System}. \section1 Groups of Functions and Properties diff --git a/src/gui/math3d/qgenericmatrix.cpp b/src/gui/math3d/qgenericmatrix.cpp index 96405a8b..be30cb6 100644 --- a/src/gui/math3d/qgenericmatrix.cpp +++ b/src/gui/math3d/qgenericmatrix.cpp @@ -252,7 +252,7 @@ QT_BEGIN_NAMESPACE Writes the given \a matrix to the given \a stream and returns a reference to the stream. - \sa {Format of the QDataStream Operators} + \sa {Serializing Qt Data Types} */ /*! @@ -262,7 +262,7 @@ QT_BEGIN_NAMESPACE Reads a NxM matrix from the given \a stream into the given \a matrix and returns a reference to the stream. - \sa {Format of the QDataStream Operators} + \sa {Serializing Qt Data Types} */ #endif diff --git a/src/gui/math3d/qmatrix4x4.cpp b/src/gui/math3d/qmatrix4x4.cpp index 62d740c..16c7f97 100644 --- a/src/gui/math3d/qmatrix4x4.cpp +++ b/src/gui/math3d/qmatrix4x4.cpp @@ -1878,7 +1878,7 @@ QDebug operator<<(QDebug dbg, const QMatrix4x4 &m) Writes the given \a matrix to the given \a stream and returns a reference to the stream. - \sa {Format of the QDataStream Operators} + \sa {Serializing Qt Data Types} */ QDataStream &operator<<(QDataStream &stream, const QMatrix4x4 &matrix) @@ -1896,7 +1896,7 @@ QDataStream &operator<<(QDataStream &stream, const QMatrix4x4 &matrix) Reads a 4x4 matrix from the given \a stream into the given \a matrix and returns a reference to the stream. - \sa {Format of the QDataStream Operators} + \sa {Serializing Qt Data Types} */ QDataStream &operator>>(QDataStream &stream, QMatrix4x4 &matrix) diff --git a/src/gui/math3d/qquaternion.cpp b/src/gui/math3d/qquaternion.cpp index ad71836..2fd66eb 100644 --- a/src/gui/math3d/qquaternion.cpp +++ b/src/gui/math3d/qquaternion.cpp @@ -595,7 +595,7 @@ QDebug operator<<(QDebug dbg, const QQuaternion &q) Writes the given \a quaternion to the given \a stream and returns a reference to the stream. - \sa {Format of the QDataStream Operators} + \sa {Serializing Qt Data Types} */ QDataStream &operator<<(QDataStream &stream, const QQuaternion &quaternion) @@ -612,7 +612,7 @@ QDataStream &operator<<(QDataStream &stream, const QQuaternion &quaternion) Reads a quaternion from the given \a stream into the given \a quaternion and returns a reference to the stream. - \sa {Format of the QDataStream Operators} + \sa {Serializing Qt Data Types} */ QDataStream &operator>>(QDataStream &stream, QQuaternion &quaternion) diff --git a/src/gui/math3d/qvector2d.cpp b/src/gui/math3d/qvector2d.cpp index b67e8a1..6a5cfc8 100644 --- a/src/gui/math3d/qvector2d.cpp +++ b/src/gui/math3d/qvector2d.cpp @@ -434,7 +434,7 @@ QDebug operator<<(QDebug dbg, const QVector2D &vector) Writes the given \a vector to the given \a stream and returns a reference to the stream. - \sa {Format of the QDataStream Operators} + \sa {Serializing Qt Data Types} */ QDataStream &operator<<(QDataStream &stream, const QVector2D &vector) @@ -450,7 +450,7 @@ QDataStream &operator<<(QDataStream &stream, const QVector2D &vector) Reads a 2D vector from the given \a stream into the given \a vector and returns a reference to the stream. - \sa {Format of the QDataStream Operators} + \sa {Serializing Qt Data Types} */ QDataStream &operator>>(QDataStream &stream, QVector2D &vector) diff --git a/src/gui/math3d/qvector3d.cpp b/src/gui/math3d/qvector3d.cpp index 6a592b2..dfcce0e 100644 --- a/src/gui/math3d/qvector3d.cpp +++ b/src/gui/math3d/qvector3d.cpp @@ -585,7 +585,7 @@ QDebug operator<<(QDebug dbg, const QVector3D &vector) Writes the given \a vector to the given \a stream and returns a reference to the stream. - \sa {Format of the QDataStream Operators} + \sa {Serializing Qt Data Types} */ QDataStream &operator<<(QDataStream &stream, const QVector3D &vector) @@ -602,7 +602,7 @@ QDataStream &operator<<(QDataStream &stream, const QVector3D &vector) Reads a 3D vector from the given \a stream into the given \a vector and returns a reference to the stream. - \sa {Format of the QDataStream Operators} + \sa {Serializing Qt Data Types} */ QDataStream &operator>>(QDataStream &stream, QVector3D &vector) diff --git a/src/gui/math3d/qvector4d.cpp b/src/gui/math3d/qvector4d.cpp index f2f3cc6..abff1ba 100644 --- a/src/gui/math3d/qvector4d.cpp +++ b/src/gui/math3d/qvector4d.cpp @@ -538,7 +538,7 @@ QDebug operator<<(QDebug dbg, const QVector4D &vector) Writes the given \a vector to the given \a stream and returns a reference to the stream. - \sa {Format of the QDataStream Operators} + \sa {Serializing Qt Data Types} */ QDataStream &operator<<(QDataStream &stream, const QVector4D &vector) @@ -555,7 +555,7 @@ QDataStream &operator<<(QDataStream &stream, const QVector4D &vector) Reads a 4D vector from the given \a stream into the given \a vector and returns a reference to the stream. - \sa {Format of the QDataStream Operators} + \sa {Serializing Qt Data Types} */ QDataStream &operator>>(QDataStream &stream, QVector4D &vector) diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp index 96d547b..b468b11 100644 --- a/src/gui/painting/qbrush.cpp +++ b/src/gui/painting/qbrush.cpp @@ -329,8 +329,8 @@ struct QBrushDataPointerDeleter \endtable - For more information about painting in general, see \l{The Paint - System} documentation. + For more information about painting in general, see the \l{Paint + System}. \sa Qt::BrushStyle, QPainter, QColor */ @@ -1013,7 +1013,7 @@ QDebug operator<<(QDebug dbg, const QBrush &b) Writes the given \a brush to the given \a stream and returns a reference to the \a stream. - \sa {Format of the QDataStream Operators} + \sa {Serializing Qt Data Types} */ QDataStream &operator<<(QDataStream &s, const QBrush &b) @@ -1081,7 +1081,7 @@ QDataStream &operator<<(QDataStream &s, const QBrush &b) Reads the given \a brush from the given \a stream and returns a reference to the \a stream. - \sa {Format of the QDataStream Operators} + \sa {Serializing Qt Data Types} */ QDataStream &operator>>(QDataStream &s, QBrush &b) diff --git a/src/gui/painting/qpaintdevice.qdoc b/src/gui/painting/qpaintdevice.qdoc index 8c73cc0..340db39 100644 --- a/src/gui/painting/qpaintdevice.qdoc +++ b/src/gui/painting/qpaintdevice.qdoc @@ -87,8 +87,7 @@ function returns the number of different colors available for the paint device. - \sa QPaintEngine, QPainter, {The Coordinate System}, {The Paint - System} + \sa QPaintEngine, QPainter, {Coordinate System}, {Paint System} */ /*! diff --git a/src/gui/painting/qpaintengine.cpp b/src/gui/painting/qpaintengine.cpp index 6aabde8..a2d0337 100644 --- a/src/gui/painting/qpaintengine.cpp +++ b/src/gui/painting/qpaintengine.cpp @@ -172,7 +172,7 @@ QFont QTextItem::font() const possible to adapt to multiple technologies on each platform and take advantage of each to the fullest. - \sa QPainter, QPaintDevice::paintEngine(), {The Paint System} + \sa QPainter, QPaintDevice::paintEngine(), {Paint System} */ /*! diff --git a/src/gui/painting/qpen.cpp b/src/gui/painting/qpen.cpp index e290cbe..2e43984 100644 --- a/src/gui/painting/qpen.cpp +++ b/src/gui/painting/qpen.cpp @@ -92,7 +92,7 @@ typedef QPenPrivate QPenData; convenience functions to extract and set the color of the pen's brush, respectively. Pens may also be compared and streamed. - For more information about painting in general, see \l{The Paint + For more information about painting in general, see the \l{Paint System} documentation. \tableofcontents @@ -872,7 +872,7 @@ bool QPen::isDetached() Writes the given \a pen to the given \a stream and returns a reference to the \a stream. - \sa {Format of the QDataStream Operators} + \sa {Serializing Qt Data Types} */ QDataStream &operator<<(QDataStream &s, const QPen &p) @@ -918,7 +918,7 @@ QDataStream &operator<<(QDataStream &s, const QPen &p) Reads a pen from the given \a stream into the given \a pen and returns a reference to the \a stream. - \sa {Format of the QDataStream Operators} + \sa {Serializing Qt Data Types} */ QDataStream &operator>>(QDataStream &s, QPen &p) diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp index aaa241f..423cce9 100644 --- a/src/gui/painting/qtransform.cpp +++ b/src/gui/painting/qtransform.cpp @@ -148,8 +148,8 @@ QT_BEGIN_NAMESPACE coordinate system. The standard coordinate system of a QPaintDevice has its origin located at the top-left position. The \e x values increase to the right; \e y values increase - downward. For a complete description, see the \l {The Coordinate - System}{coordinate system} documentation. + downward. For a complete description, see the \l {Coordinate + System} {coordinate system} documentation. QPainter has functions to translate, scale, shear and rotate the coordinate system without using a QTransform. For example: @@ -223,7 +223,7 @@ QT_BEGIN_NAMESPACE \snippet doc/src/snippets/transform/main.cpp 2 \endtable - \sa QPainter, {The Coordinate System}, {demos/affine}{Affine + \sa QPainter, {Coordinate System}, {demos/affine}{Affine Transformations Demo}, {Transformations Example} */ @@ -1028,7 +1028,7 @@ void QTransform::reset() Writes the given \a matrix to the given \a stream and returns a reference to the stream. - \sa {Format of the QDataStream Operators} + \sa {Serializing Qt Data Types} */ QDataStream & operator<<(QDataStream &s, const QTransform &m) { @@ -1052,7 +1052,7 @@ QDataStream & operator<<(QDataStream &s, const QTransform &m) Reads the given \a matrix from the given \a stream and returns a reference to the stream. - \sa {Format of the QDataStream Operators} + \sa {Serializing Qt Data Types} */ QDataStream & operator>>(QDataStream &s, QTransform &t) { diff --git a/src/gui/styles/qstyle.cpp b/src/gui/styles/qstyle.cpp index 429dafe..4cfa93f 100644 --- a/src/gui/styles/qstyle.cpp +++ b/src/gui/styles/qstyle.cpp @@ -325,7 +325,7 @@ static int unpackControlTypes(QSizePolicy::ControlTypes controls, QSizePolicy::C control over size of header items and row and column sizes. \sa QStyleOption, QStylePainter, {Styles Example}, - {Implementing Styles and Style Aware Widgets}, QStyledItemDelegate + {Styles & Style Aware Widgets}, QStyledItemDelegate */ /*! -- cgit v0.12 From d987e048f542a4c85c640b36d116bb408dd029fd Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 20 May 2010 15:05:08 +0200 Subject: doc: Fixed many broken links. --- doc/src/demos/boxes.qdoc | 2 +- doc/src/examples/drilldown.qdoc | 12 ++++++------ doc/src/examples/mandelbrot.qdoc | 2 +- doc/src/examples/transformations.qdoc | 4 ++-- doc/src/frameworks-technologies/dnd.qdoc | 6 +++--- doc/src/frameworks-technologies/graphicsview.qdoc | 18 ++++++++++-------- doc/src/getting-started/demos.qdoc | 19 +++++++++---------- doc/src/getting-started/how-to-learn-qt.qdoc | 10 +++++----- doc/src/objectmodel/object.qdoc | 6 +++--- doc/src/painting-and-printing/paintsystem.qdoc | 12 ++++++------ doc/src/porting/porting4-canvas.qdoc | 2 +- doc/src/scripting/scripting.qdoc | 8 ++++---- doc/src/sql-programming/qsqldatatype-table.qdoc | 2 +- doc/src/sql-programming/sql-programming.qdoc | 7 ++++--- doc/src/widgets-and-layouts/widgets.qdoc | 14 ++++++-------- doc/src/windows-and-dialogs/mainwindow.qdoc | 3 +-- 16 files changed, 63 insertions(+), 64 deletions(-) diff --git a/doc/src/demos/boxes.qdoc b/doc/src/demos/boxes.qdoc index aeb2513..367eb52 100644 --- a/doc/src/demos/boxes.qdoc +++ b/doc/src/demos/boxes.qdoc @@ -44,7 +44,7 @@ \title Boxes This demo shows Qt's ability to combine advanced OpenGL rendering with the - the \l{The Graphics View Framework}{Graphics View} framework. + the \l{Graphics View Framework}. \image boxes-demo.png diff --git a/doc/src/examples/drilldown.qdoc b/doc/src/examples/drilldown.qdoc index ca994e8..2b87840 100644 --- a/doc/src/examples/drilldown.qdoc +++ b/doc/src/examples/drilldown.qdoc @@ -292,7 +292,7 @@ \codeline \snippet examples/sql/drilldown/view.h 1 - The QGraphicsView class is part of the \l {The Graphics View + The QGraphicsView class is part of the \l {Graphics View Framework} which we will use to display the images of Nokia's Qt offices. To be able to respond to user interaction; i.e., showing the @@ -388,8 +388,8 @@ reason we must create a custom item class is that we want to catch the item's hover events, animating the item when the mouse cursor is hovering over the image (by default, no items accept hover - events). Please see the \l{The Graphics View Framework} - documentation and the \l{Graphics View Examples} for more details. + events). Please see the \l{Graphics View Framework} documentation + and the \l{Graphics View Examples} for more details. \snippet examples/sql/drilldown/view.cpp 5 @@ -399,7 +399,7 @@ function calls the private \c showInformation() function to pop up the associated information window. - \l {The Graphics View Framework} provides the qgraphicsitem_cast() + The \l {Graphics View Framework} provides the qgraphicsitem_cast() function to determine whether the given QGraphicsItem instance is of a given type. Note that if the event is not related to any of our image items, we pass it on to the base class implementation. @@ -456,7 +456,7 @@ borders. Finally, we store the location ID that this particular record is - associated with as well as a z-value. In the \l {The Graphics View + associated with as well as a z-value. In the \l {Graphics View Framework}, an item's z-value determines its position in the item stack. An item of high Z-value will be drawn on top of an item with a lower z-value if they share the same parent item. We also @@ -477,7 +477,7 @@ there is no current mouse grabber item. They are sent when the mouse cursor enters an item, when it moves around inside the item, and when the cursor leaves an item. As we mentioned earlier, none - of the \l {The Graphics View Framework}'s items accept hover + of the \l {Graphics View Framework}'s items accept hover event's by default. The QTimeLine class provides a timeline for controlling diff --git a/doc/src/examples/mandelbrot.qdoc b/doc/src/examples/mandelbrot.qdoc index 7a3c1cd..11173a8 100644 --- a/doc/src/examples/mandelbrot.qdoc +++ b/doc/src/examples/mandelbrot.qdoc @@ -285,7 +285,7 @@ \snippet examples/threads/mandelbrot/mandelbrotwidget.cpp 8 If the pixmap has the right scale factor, we draw the pixmap directly onto - the widget. Otherwise, we scale and translate the \l{The Coordinate + the widget. Otherwise, we scale and translate the \l{Coordinate System}{coordinate system} before we draw the pixmap. By reverse mapping the widget's rectangle using the scaled painter matrix, we also make sure that only the exposed areas of the pixmap are drawn. The calls to diff --git a/doc/src/examples/transformations.qdoc b/doc/src/examples/transformations.qdoc index 0d8de1d..0c246cb 100644 --- a/doc/src/examples/transformations.qdoc +++ b/doc/src/examples/transformations.qdoc @@ -87,7 +87,7 @@ tranformation matrix that you can retrieve using the QPainter::worldTransform() function. A matrix transforms a point in the plane to another point. For more information about the - transformation matrix, see the \l {The Coordinate System} and + transformation matrix, see the \l {Coordinate System} and QTransform documentation. \snippet examples/painting/transformations/renderarea.h 0 @@ -374,7 +374,7 @@ All the tranformation operations operate on QPainter's tranformation matrix. For more information about the - transformation matrix, see the \l {The Coordinate System} and + transformation matrix, see the \l {Coordinate System} and QTransform documentation. The Qt reference documentation provides several painting diff --git a/doc/src/frameworks-technologies/dnd.qdoc b/doc/src/frameworks-technologies/dnd.qdoc index 0e952ad..f728972 100644 --- a/doc/src/frameworks-technologies/dnd.qdoc +++ b/doc/src/frameworks-technologies/dnd.qdoc @@ -58,9 +58,9 @@ This document describes the basic drag and drop mechanism and outlines the approach used to enable it in custom widgets. Drag and drop operations are also supported by Qt's item views and by - the graphics view framework; more information is available in the - \l{Using Drag and Drop with Item Views} and \l{The Graphics View - Framework} documents. + the graphics view framework. More information is available in + \l{Using Drag and Drop with Item Views} and \l{Graphics View + Framework}. \section1 Drag and Drop Classes diff --git a/doc/src/frameworks-technologies/graphicsview.qdoc b/doc/src/frameworks-technologies/graphicsview.qdoc index 681568e..b13f98e 100644 --- a/doc/src/frameworks-technologies/graphicsview.qdoc +++ b/doc/src/frameworks-technologies/graphicsview.qdoc @@ -220,9 +220,10 @@ allow you to map between the three coordinate systems. When rendering, Graphics View's scene coordinates correspond to - QPainter's \e logical coordinates, and view coordinates are the same as - \e device coordinates. In \l{The Coordinate System}, you can read about - the relationship between logical coordinates and device coordinates. + QPainter's \e logical coordinates, and view coordinates are the + same as \e device coordinates. In the \l{Coordinate System} + documentation, you can read about the relationship between + logical coordinates and device coordinates. \img graphicsview-parentchild.png @@ -435,11 +436,12 @@ \section2 Animation - Graphics View supports animation at several levels. You can easily - assemble animation by using the Animation Framework. For that you'll - need your items to inherit from QGraphicsObject and associate - QPropertyAnimation with them. QPropertyAnimation allows to animate any - QObject property. + Graphics View supports animation at several levels. You can + easily assemble animation by using the Animation Framework. + For that you'll need your items to inherit from + QGraphicsObject and associate QPropertyAnimation with + them. QPropertyAnimation allows to animate any QObject + property. Another option is to create a custom item that inherits from QObject and QGraphicsItem. The item can the set up its own timers, and control diff --git a/doc/src/getting-started/demos.qdoc b/doc/src/getting-started/demos.qdoc index f8c70fe..9d39e08 100644 --- a/doc/src/getting-started/demos.qdoc +++ b/doc/src/getting-started/demos.qdoc @@ -126,16 +126,15 @@ \section1 Graphics View \list - \o \l{demos/chip}{40000 Chips} uses the - \l{The Graphics View Framework}{Graphics View} framework to efficiently - display a large number of individual graphical items on a scrolling canvas, - highlighting features such as rotation, zooming, level of detail control, - and item selection. - \o \l{demos/embeddeddialogs}{Embedded Dialogs} showcases Qt 4.4's \e{Widgets on - the Canvas} feature by embedding a multitude of fully-working dialogs into a - scene. + \o \l{demos/chip}{40000 Chips} uses the \l{Graphics View Framework} to + efficiently display a large number of individual graphical items on + a scrolling canvas and highlighting features including rotation, + zooming, level of detail control, and item selection. + \o \l{demos/embeddeddialogs}{Embedded Dialogs} showcases Qt 4.4's + \e{Widgets on the Canvas} feature by embedding several + fully-functional dialogs in a scene. \o \l{demos/boxes}{Boxes} showcases Qt's OpenGL support and the - integration with the Graphics View framework. + integration with the \l{Graphics View Framework}. \endlist \section1 Tools @@ -185,7 +184,7 @@ \o \l{demos/embedded/fluidlauncher}{Fluid Launcher} demo application launcher for embedded screens \o \l{demos/embedded/lightmaps}{Light Maps} demonstrates OpenStreetMap integration with WebKit. \o \l{demos/embedded/raycasting}{Ray Casting} demonstrates the use of ray casting with the - \l{The Graphics View Framework}{Graphics View} framework. + \l{Graphics View Framework}. \o \l{demos/embedded/styledemo}{Embedded Styles} demonstrates the use of styles. \o \l{demos/embedded/weatherinfo}{Weather Info} fetches weather information from the Web. \endlist diff --git a/doc/src/getting-started/how-to-learn-qt.qdoc b/doc/src/getting-started/how-to-learn-qt.qdoc index ce8f521..642421b 100644 --- a/doc/src/getting-started/how-to-learn-qt.qdoc +++ b/doc/src/getting-started/how-to-learn-qt.qdoc @@ -59,11 +59,11 @@ If you want to design your user interfaces using a design tool, then read at least the first few chapters of the \l{Qt Designer manual}. - By now you'll have produced some small working applications and have a - broad feel for Qt programming. You could start work on your own - projects straight away, but we recommend reading a couple of key - overviews to deepen your understanding of Qt: \l{Qt Object Model} - and \l{Signals and Slots}. + By now you'll have produced some small working applications and + have a broad feel for Qt programming. You could start work on your + own projects straight away, but we recommend reading a couple of + key overviews to deepen your understanding of Qt: The Qt \l{Object + Model} and \l{Signals and Slots}. \beginfloatleft \inlineimage qtdemo-small.png diff --git a/doc/src/objectmodel/object.qdoc b/doc/src/objectmodel/object.qdoc index f81577d..8ae91ec 100644 --- a/doc/src/objectmodel/object.qdoc +++ b/doc/src/objectmodel/object.qdoc @@ -59,11 +59,11 @@ communication called \l{signals and slots} \o queryable and designable \l{Qt's Property System}{object properties} - \o powerful \l{events and event filters} + \o powerful \l{The Event System}{events and event filters} \o contextual \l{i18n}{string translation for internationalization} \o sophisticated interval driven \l timers that make it possible to elegantly integrate many tasks in an event-driven GUI - \o hierarchical and queryable \l{Object Trees and Object Ownership}{object + \o hierarchical and queryable \l{Object Trees & Ownership}{object trees} that organize object ownership in a natural way \o guarded pointers (QPointer) that are automatically set to 0 when the referenced object is destroyed, unlike normal C++ @@ -113,7 +113,7 @@ \o might have a unique \l{QObject::objectName()}. If we copy a Qt Object, what name should we give the copy? - \o has a location in an \l{Object Trees and Object Ownership} + \o has a location in an \l{Object Trees & Ownership} {object hierarchy}. If we copy a Qt Object, where should the copy be located? diff --git a/doc/src/painting-and-printing/paintsystem.qdoc b/doc/src/painting-and-printing/paintsystem.qdoc index 44c84a2..c106f35 100644 --- a/doc/src/painting-and-printing/paintsystem.qdoc +++ b/doc/src/painting-and-printing/paintsystem.qdoc @@ -89,7 +89,7 @@ \o \l{Classes for Painting} \o \l{Paint Devices and Backends} \o \l{Drawing and Filling} - \o \l{The Coordinate System} + \o \l{Coordinate System} \o \l{Reading and Writing Image Files} \o \l{Styling} \o \l{Printing with Qt} @@ -339,10 +339,10 @@ Normally, QPainter draws in a "natural" coordinate system, but it is able to perform view and world transformations using the - QTransform class. For more information, see \l {The Coordinate - System} documentation which also describes the rendering process, - i.e. the relation between the logical representation and the - rendered pixels, and the benefits of anti-aliased painting. + QTransform class. For more information, see \l {Coordinate + System}, which also describes the rendering process, i.e. the + relation between the logical representation and the rendered + pixels, and the benefits of anti-aliased painting. \table 100% \row \o @@ -568,5 +568,5 @@ \endtable For more information about widget styling and appearance, see the - documentation about \l{Implementing Styles and Style Aware Widgets}. + \l{Styles & Style Aware Widgets}. */ diff --git a/doc/src/porting/porting4-canvas.qdoc b/doc/src/porting/porting4-canvas.qdoc index b69f53b..592f430 100644 --- a/doc/src/porting/porting4-canvas.qdoc +++ b/doc/src/porting/porting4-canvas.qdoc @@ -56,7 +56,7 @@ number of custom-made 2D graphical items, and a view widget for visualizing the items, with support for zooming and rotation. Graphics View was introduced in Qt 4.2, replacing its predecessor, QCanvas. For - more on Graphics View, see \l{The Graphics View Framework}. + more on Graphics View, see \l{Graphics View Framework}. This document walks through the steps needed, class by class and function by function, to port a QCanvas application to Graphics View. diff --git a/doc/src/scripting/scripting.qdoc b/doc/src/scripting/scripting.qdoc index 2c22989..1f203a6 100644 --- a/doc/src/scripting/scripting.qdoc +++ b/doc/src/scripting/scripting.qdoc @@ -362,7 +362,7 @@ By default, the script engine does not take ownership of the QObject that is passed to QScriptEngine::newQObject(); the object is managed according to Qt's object ownership (see - \l{Object Trees and Object Ownership}). This mode is appropriate + \l{Object Trees & Ownership}). This mode is appropriate when, for example, you are wrapping C++ objects that are part of your application's core; that is, they should persist regardless of what happens in the scripting environment. Another way of stating @@ -627,9 +627,9 @@ To completely understand how to make C++ objects available to Qt Script, some basic knowledge of the Qt meta-object system is very - helpful. We recommend that you read the \l{Qt Object Model}. The - information in this document and the documents it links to are very - useful for understanding how to implement application objects. + helpful. We recommend that you read about the Qt \l{Object Model} + and \l{The Meta-Object System}, which are useful for understanding + how to implement application objects. However, this knowledge is not essential in the simplest cases. To make an object available in QtScript, it must derive from diff --git a/doc/src/sql-programming/qsqldatatype-table.qdoc b/doc/src/sql-programming/qsqldatatype-table.qdoc index fb5fb49..329222b 100644 --- a/doc/src/sql-programming/qsqldatatype-table.qdoc +++ b/doc/src/sql-programming/qsqldatatype-table.qdoc @@ -46,7 +46,7 @@ \ingroup qt-sql - \section1 Data Types for Qt Supported Database Systems + \section1 Recommended Data Types for Qt-Supported Database Systems This table shows the recommended data types for extracting data from the databases supported in Qt. Note that types used in Qt are not diff --git a/doc/src/sql-programming/sql-programming.qdoc b/doc/src/sql-programming/sql-programming.qdoc index b34810c..936e555 100644 --- a/doc/src/sql-programming/sql-programming.qdoc +++ b/doc/src/sql-programming/sql-programming.qdoc @@ -73,7 +73,7 @@ \endlist \o \l{Executing SQL Statements} \list - \o \l{Recommended Use of Data Types in Databases} + \o \l{Data Types for Qt-supported Database Systems} \endlist \o \l{Using the SQL Model Classes} \o \l{Presenting Data in a Table View} @@ -240,8 +240,9 @@ QVariant::toString() and QVariant::toInt() to convert variants to QString and \c int. - For an overview of the recommended types used with Qt supported - Databases, please refer to \l{Recommended Use of Data Types in Databases}{this table}. + For an overview of the recommended types for use with Qt-supported + Databases, please refer to \l{Data Types for Qt-supported Database + Systems} {this table}. You can iterate back and forth using QSqlQuery::next(), QSqlQuery::previous(), QSqlQuery::first(), QSqlQuery::last(), and diff --git a/doc/src/widgets-and-layouts/widgets.qdoc b/doc/src/widgets-and-layouts/widgets.qdoc index 9fe2d69..c93a380 100644 --- a/doc/src/widgets-and-layouts/widgets.qdoc +++ b/doc/src/widgets-and-layouts/widgets.qdoc @@ -48,11 +48,10 @@ \section1 Widgets Widgets are the primary elements for creating user interfaces in Qt. - \l{Widget Classes}{Widgets} can display data and status information, + \l{The Widget Classes}{Widgets} can display data and status information, receive user input, and provide a container for other widgets that should be grouped together. A widget that is not embedded in a - parent widget is called a \l{Application Windows and - Dialogs}{window}. + parent widget is called a \l{Window and Dialog Widgets} {window}. \image parent-child-widgets.png A parent widget containing various child widgets. @@ -82,11 +81,10 @@ \section1 Widget Styles - \l{Implementing Styles and Style Aware Widgets}{Styles} draw on - behalf of widgets and encapsulate the look and feel of a GUI. Qt's - built-in widgets use the QStyle class to perform nearly all of their - drawing, ensuring that they look exactly like the equivalent native - widgets. + \l{Styles & Style Aware Widgets}{Styles} draw on behalf of + widgets and encapsulate the look and feel of a GUI. Qt's built-in + widgets use the QStyle class to perform nearly all of their drawing, + ensuring that they look exactly like the equivalent native widgets. \table \row diff --git a/doc/src/windows-and-dialogs/mainwindow.qdoc b/doc/src/windows-and-dialogs/mainwindow.qdoc index c1e66d9..db9a636 100644 --- a/doc/src/windows-and-dialogs/mainwindow.qdoc +++ b/doc/src/windows-and-dialogs/mainwindow.qdoc @@ -49,7 +49,6 @@ \title Window and Dialog Widgets \brief Windows and Dialogs in Qt. \ingroup qt-gui-concepts - \ingroup frameworks-technologies A \l{Widgets Tutorial}{widget} that is not embedded in a parent widget is called a window. Usually, windows have a frame and a title bar, although it is also possible to create @@ -81,7 +80,7 @@ \section1 Main Windows and Dialogs - \l{The Application Main Window} provides the framework for building the + The \l{Application Main Window} provides the framework for building the application's main user interface, and are created by subclassing QMainWindow. QMainWindow has its own layout to which you can add a \l{QMenuBar}{menu bar}, \l{QToolBar}{tool bars}, \l{QDockWidget}{dockable widgets} and a -- cgit v0.12 From 8846348738a3cab1a4b59b27f81e27bc17da02ff Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Thu, 20 May 2010 16:45:53 +0200 Subject: Improve look and feel of itemviews on mac These fixes are neccessary and requested by Qt Creator and should go into 4.7.0. The fixes involved is: - positioning of disclosure arrow in treeviews - spacing between icon and text label - added 2 pixel spacing between item view items Note that native cocoa views tend to use 3 pixel spacing. We considered this and decided on leaving it at 2 which is what you see in finder list views, XCode among other places. It also makes the change a bit less radical. Reviewed-by:cduclos Task-number:QTBUG-10190 --- src/gui/styles/qmacstyle_mac.mm | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index 0f01bd5..e82e638 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -132,6 +132,8 @@ static const QColor titlebarSeparatorLineInactive(131, 131, 131); static const QColor mainWindowGradientBegin(240, 240, 240); static const QColor mainWindowGradientEnd(200, 200, 200); +static const int DisclosureOffset = 4; + #if (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5) enum { kThemePushButtonTextured = 31, @@ -3100,7 +3102,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai else bi.value = opt->direction == Qt::LeftToRight ? kThemeDisclosureRight : kThemeDisclosureLeft; bi.adornment = kThemeAdornmentNone; - HIRect hirect = qt_hirectForQRect(opt->rect); + HIRect hirect = qt_hirectForQRect(opt->rect.adjusted(DisclosureOffset,0,-DisclosureOffset,0)); HIThemeDrawButton(&hirect, &bi, cg, kHIThemeOrientationNormal, 0); break; } @@ -4353,6 +4355,15 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt, int controlSize = getControlSize(opt, widget); switch (sr) { + case SE_ItemViewItemText: + if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast(opt)) { + int fw = proxy()->pixelMetric(PM_FocusFrameHMargin, opt, widget); + // We add the focusframeargin between icon and text in commonstyle + rect = QCommonStyle::subElementRect(sr, opt, widget); + if (vopt->features & QStyleOptionViewItemV2::HasDecoration) + rect.adjust(-fw, 0, 0, 0); + } + break; case SE_ToolBoxTabContents: rect = QCommonStyle::subElementRect(sr, opt, widget); break; @@ -4370,9 +4381,9 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt, case SE_HeaderLabel: if (qstyleoption_cast(opt)) { rect = QWindowsStyle::subElementRect(sr, opt, widget); - if (widget && widget->height() <= qt_mac_aqua_get_metric(kThemeMetricListHeaderHeight)){ - // We need to allow the text a bit more space when the header is as - // small as kThemeMetricListHeaderHeight, otherwise it gets clipped: + if (widget && widget->height() <= 22){ + // We need to allow the text a bit more space when the header is + // small, otherwise it gets clipped: rect.setY(0); rect.setHeight(widget->height()); } @@ -4399,8 +4410,9 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt, HIRect outRect; HIThemeGetButtonShape(&inRect, &bdi, &shape); ptrHIShapeGetBounds(shape, &outRect); - rect = QRect(int(outRect.origin.x), int(outRect.origin.y), - int(contentRect.origin.x - outRect.origin.x), int(outRect.size.height)); + rect = QRect(int(outRect.origin.x + DisclosureOffset), int(outRect.origin.y), + int(contentRect.origin.x - outRect.origin.x + DisclosureOffset), + int(outRect.size.height)); break; } case SE_TabWidgetLeftCorner: @@ -5789,6 +5801,13 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, sz = sz.expandedTo(QSize(sz.width(), minimumSize)); } break; + case CT_ItemViewItem: + if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast(opt)) { + sz = QCommonStyle::sizeFromContents(ct, vopt, csz, widget); + sz.setHeight(sz.height() + 2); + } + break; + default: sz = QWindowsStyle::sizeFromContents(ct, opt, csz, widget); } -- cgit v0.12 From 83245ed872b6265d872a8ab0235c9dbd1f2daf4b Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Thu, 20 May 2010 17:32:12 +0200 Subject: Removed a change from the 4.7.0 change log. The change belongs in the 4.6.3 change log. --- dist/changes-4.7.0 | 6 ------ 1 file changed, 6 deletions(-) diff --git a/dist/changes-4.7.0 b/dist/changes-4.7.0 index d6209f4..34d002c 100644 --- a/dist/changes-4.7.0 +++ b/dist/changes-4.7.0 @@ -164,12 +164,6 @@ QtNetwork * [QTBUG-2515] Do not make OpenSSL prompt for a password * [QTBUG-6504, QTBUG-8924, QTBUG-5645] Fix memleak -QtOpenGL --------- - - QGLWidget - * [QTBUG-7865] Fixed bug where GL widgets were not fully updated on - Windows Vista/7 with Aero disabled. - QtScript -------- - Updated src/3rdparty/javascriptcore to a more recent version -- cgit v0.12 From be9d25dc7f06ce8d7a9bb7524bb9b11609c9ec90 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 20 May 2010 18:46:39 +0200 Subject: qdoc: Propagate the language information into the XML as before. Reviewed-by: Trust Me --- tools/qdoc3/htmlgenerator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index e352364..2774833 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -1781,7 +1781,7 @@ void HtmlGenerator::generateHeader(const QString& title, { out() << QString("\n").arg(outputEncoding); out() << "\n"; - out() << "\n"; + out() << QString("\n").arg(naturalLanguage); out() << "\n"; out() << " \n"; QString shortVersion; -- cgit v0.12 From bb0048d2e8536f1db5144ee99d122e2b3b102e04 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 6 May 2010 21:54:07 +0200 Subject: simplify arcane conditional, once again Reviewed-by: joerg --- qmake/generators/metamakefile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp index 9c64544..ad8750b 100644 --- a/qmake/generators/metamakefile.cpp +++ b/qmake/generators/metamakefile.cpp @@ -476,7 +476,7 @@ MetaMakefileGenerator::createMakefileGenerator(QMakeProject *proj, bool noIO) mkfile = new NmakeMakefileGenerator; } else if(gen == "MSBUILD") { // Visual Studio >= v11.0 - if(proj->first("TEMPLATE").indexOf(QRegExp("^vc.*")) != -1 || proj->first("TEMPLATE").indexOf(QRegExp("^ce.*")) != -1) + if (proj->first("TEMPLATE").startsWith("vc")) mkfile = new VcxprojGenerator; else mkfile = new NmakeMakefileGenerator; -- cgit v0.12 From 3201b70f0364911382cf3657141be95e34f1d61c Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 6 May 2010 15:15:13 +0200 Subject: unify QMAKE_QMAKE path separator fixing the value of the variable in Option is only ever accessed via the project variable, so there is no point in early fixing. as it happens, this fixes mingw+sh generating makefiles with the wrong separator, as the fixing is delayed to a point where QMAKE_DIR_SEP was read back into Option. Reviewed-by: joerg --- qmake/option.cpp | 1 - qmake/project.cpp | 13 ++++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/qmake/option.cpp b/qmake/option.cpp index 13e855c..d63158c 100644 --- a/qmake/option.cpp +++ b/qmake/option.cpp @@ -558,7 +558,6 @@ void Option::applyHostMode() Option::dir_sep = "/"; Option::obj_ext = ".o"; } - Option::qmake_abslocation = Option::fixPathToTargetOS(Option::qmake_abslocation); } bool Option::postProcessProject(QMakeProject *project) diff --git a/qmake/project.cpp b/qmake/project.cpp index 998d173..c3595fe 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -3099,13 +3099,12 @@ QStringList &QMakeProject::values(const QString &_var, QMap Date: Thu, 20 May 2010 11:52:59 +0200 Subject: use qtPrepareTool for qdoc Reviewed-by: joerg --- tools/qdoc3/qdoc3.pro | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/tools/qdoc3/qdoc3.pro b/tools/qdoc3/qdoc3.pro index e394799..81ff93a 100644 --- a/tools/qdoc3/qdoc3.pro +++ b/tools/qdoc3/qdoc3.pro @@ -115,20 +115,7 @@ SOURCES += apigenerator.cpp \ ### Documentation for qdoc3 ### -win32:!win32-g++ { - unixstyle = false -} else :win32-g++:isEmpty(QMAKE_SH) { - unixstyle = false -} else { - unixstyle = true -} - -$$unixstyle { - QDOC = cd $$PWD/doc && $$[QT_INSTALL_BINS]/qdoc3 -} else { - QDOC = cd $$PWD/doc && $$[QT_INSTALL_BINS]/qdoc3.exe - QDOC = $$replace(QDOC, "/", "\\") -} +qtPrepareTool(QDOC, qdoc3) docs.commands = $$QDOC qdoc-manual.qdocconf -- cgit v0.12 From 79893e1f90b04317fde14069684534ba29d74f5b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 14 May 2010 20:04:45 +0200 Subject: deprecate undocumented -E option Reviewed-by: joerg --- qmake/option.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/qmake/option.cpp b/qmake/option.cpp index d63158c..8db3797 100644 --- a/qmake/option.cpp +++ b/qmake/option.cpp @@ -304,6 +304,7 @@ Option::parseCommandLine(int argc, char **argv, int skip) } else if(opt == "nodependheuristics") { Option::mkfile::do_dep_heuristics = false; } else if(opt == "E") { + fprintf(stderr, "-E is deprecated. Use -d instead.\n"); Option::mkfile::do_preprocess = true; } else if(opt == "cache") { Option::mkfile::cachefile = argv[++x]; -- cgit v0.12 From f8efbfb774679aa81648974e049605981532ec17 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 14 May 2010 20:06:30 +0200 Subject: close scope while inside assignment only if the last char is a closing brace the code assumed it anyway and would make a mess if it was wrong Reviewed-by: joerg --- qmake/project.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/project.cpp b/qmake/project.cpp index c3595fe..214b013 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -1046,7 +1046,7 @@ QMakeProject::parse(const QString &t, QMap &place, int num SKIP_WS(d, d_off, s.length()); QString vals = s.mid(d_off); // vals now contains the space separated list of values int rbraces = vals.count('}'), lbraces = vals.count('{'); - if(scope_blocks.count() > 1 && rbraces - lbraces == 1) { + if(scope_blocks.count() > 1 && rbraces - lbraces == 1 && vals.endsWith('}')) { debug_msg(1, "Project Parser: %s:%d : Leaving block %d", parser.file.toLatin1().constData(), parser.line_no, scope_blocks.count()); ScopeBlock sb = scope_blocks.pop(); -- cgit v0.12 From 044eb6966ade14a7367bb687cfac976007ad820c Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 14 May 2010 20:07:05 +0200 Subject: clarify wording of warning message Reviewed-by: joerg --- qmake/project.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/project.cpp b/qmake/project.cpp index 214b013..2be68be 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -1073,7 +1073,7 @@ QMakeProject::parse(const QString &t, QMap &place, int num } if(vals.contains('=') && numLines > 1) - warn_msg(WarnParser, "Detected possible line continuation: {%s} %s:%d", + warn_msg(WarnParser, "Possible accidental line continuation: {%s} at %s:%d", var.toLatin1().constData(), parser.file.toLatin1().constData(), parser.line_no); QStringList &varlist = place[var]; // varlist is the list in the symbol table -- cgit v0.12 From d56e75982111a2c1caf0271eafd4d41ba9f9aefd Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 18 May 2010 12:21:06 +0200 Subject: fix irix build Task-number: QTBUG-10611 Reviewed-by: joerg --- src/corelib/corelib.pro | 1 + src/gui/gui.pro | 1 + src/opengl/opengl.pro | 1 + 3 files changed, 3 insertions(+) diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro index 83fa044..e39d326 100644 --- a/src/corelib/corelib.pro +++ b/src/corelib/corelib.pro @@ -3,6 +3,7 @@ QPRO_PWD = $$PWD QT = DEFINES += QT_BUILD_CORE_LIB QT_NO_USING_NAMESPACE win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x67000000 +irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused include(../qbase.pri) include(animation/animation.pri) diff --git a/src/gui/gui.pro b/src/gui/gui.pro index a6370b2..7f1cb78 100644 --- a/src/gui/gui.pro +++ b/src/gui/gui.pro @@ -3,6 +3,7 @@ QPRO_PWD = $$PWD QT = core DEFINES += QT_BUILD_GUI_LIB QT_NO_USING_NAMESPACE win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x65000000 +irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused !win32:!embedded:!mac:!symbian:CONFIG += x11 diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro index 15795d2..d6011cf 100644 --- a/src/opengl/opengl.pro +++ b/src/opengl/opengl.pro @@ -5,6 +5,7 @@ DEFINES += QT_BUILD_OPENGL_LIB DEFINES += QT_NO_USING_NAMESPACE win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x63000000 solaris-cc*:QMAKE_CXXFLAGS_RELEASE -= -O2 +irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused unix:QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui -- cgit v0.12 From af2df9e88705eeda2df5cdd46c5f7ec195facb8a Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Fri, 21 May 2010 08:34:00 +1000 Subject: Fix formating of license header. --- doc/src/declarative/qml-intro.qdoc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/doc/src/declarative/qml-intro.qdoc b/doc/src/declarative/qml-intro.qdoc index 457efa8..64a4949 100644 --- a/doc/src/declarative/qml-intro.qdoc +++ b/doc/src/declarative/qml-intro.qdoc @@ -1,5 +1,4 @@ -/************************************************************************** -** +/**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. @@ -38,8 +37,7 @@ ** ** $QT_END_LICENSE$ ** -*************************************************************************** -*/ +****************************************************************************/ -- cgit v0.12 From 4ada24963ccd8a5a1d57a90739b627f6684693e9 Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Fri, 21 May 2010 14:20:55 +1000 Subject: add bytes and activeTime to corelwan. Task-number: QTBUG-10875 --- src/plugins/bearer/corewlan/qcorewlanengine.h | 6 ++ src/plugins/bearer/corewlan/qcorewlanengine.mm | 104 +++++++++++++++++++++++-- 2 files changed, 102 insertions(+), 8 deletions(-) diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.h b/src/plugins/bearer/corewlan/qcorewlanengine.h index 3c24c54..4d90648 100644 --- a/src/plugins/bearer/corewlan/qcorewlanengine.h +++ b/src/plugins/bearer/corewlan/qcorewlanengine.h @@ -78,6 +78,10 @@ public: QNetworkSession::State sessionStateForId(const QString &id); + quint64 bytesWritten(const QString &id); + quint64 bytesReceived(const QString &id); + quint64 startTime(const QString &id); + QNetworkConfigurationManager::Capabilities capabilities() const; QNetworkSessionPrivate *createSessionBackend(); @@ -100,6 +104,8 @@ private: bool scanning; QScanThread *scanThread; + quint64 getBytes(const QString &interfaceName,bool b); + protected: void startNetworkChangeLoop(); diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm index 3206833..90d093a 100644 --- a/src/plugins/bearer/corewlan/qcorewlanengine.mm +++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm @@ -67,6 +67,9 @@ #include #include "private/qcore_mac_p.h" +#include +#include + @interface QNSListener : NSObject { NSNotificationCenter *center; @@ -157,7 +160,7 @@ void QScanThread::quit() void QScanThread::run() { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + QMacCocoaAutoReleasePool pool; QStringList found; mutex.lock(); CWInterface *currentInterface = [CWInterface interfaceWithName:qt_mac_QStringToNSString(interfaceName)]; @@ -167,6 +170,7 @@ void QScanThread::run() NSError *err = nil; NSDictionary *parametersDict = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:YES], kCWScanKeyMerge, + [NSNumber numberWithInt:kCWScanTypeFast], kCWScanKeyScanType, [NSNumber numberWithInteger:100], kCWScanKeyRestTime, nil]; NSArray* apArray = [currentInterface scanForNetworksWithParameters:parametersDict error:&err]; @@ -204,11 +208,9 @@ void QScanThread::run() found.append(foundNetwork(id, networkSsid, state, interfaceName, purpose)); - } //end row -// [parametersDict release]; - - } //end error - } // endwifi power + } + } + } // add known configurations that are not around. QMapIterator > i(userProfiles); while (i.hasNext()) { @@ -248,7 +250,6 @@ void QScanThread::run() } } emit networksChanged(); - [pool release]; } QStringList QScanThread::foundNetwork(const QString &id, const QString &name, const QNetworkConfiguration::StateFlags state, const QString &interfaceName, const QNetworkConfiguration::Purpose purpose) @@ -426,6 +427,7 @@ QCoreWlanEngine::~QCoreWlanEngine() void QCoreWlanEngine::initialize() { QMutexLocker locker(&mutex); + QMacCocoaAutoReleasePool pool; if([[CWInterface supportedInterfaces] count] > 0 && !listener) { listener = [[QNSListener alloc] init]; @@ -659,7 +661,6 @@ bool QCoreWlanEngine::isWifiReady(const QString &wifiDeviceName) QNetworkSession::State QCoreWlanEngine::sessionStateForId(const QString &id) { QMutexLocker locker(&mutex); - QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(id); if (!ptr) @@ -823,5 +824,92 @@ void QCoreWlanEngine::networksChanged() } +quint64 QCoreWlanEngine::bytesWritten(const QString &id) +{ + QMutexLocker locker(&mutex); + const QString interfaceStr = getInterfaceFromId(id); + return getBytes(interfaceStr,false); + return Q_UINT64_C(0); +} + +quint64 QCoreWlanEngine::bytesReceived(const QString &id) +{ + QMutexLocker locker(&mutex); + const QString interfaceStr = getInterfaceFromId(id); + return getBytes(interfaceStr,true); + return Q_UINT64_C(0); +} + +quint64 QCoreWlanEngine::startTime(const QString &id) +{ + QMutexLocker locker(&mutex); + QMacCocoaAutoReleasePool pool; + quint64 timestamp = 0; + + NSString *filePath = @"/Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist"; + NSDictionary* plistDict = [[[NSDictionary alloc] initWithContentsOfFile:filePath] autorelease]; + NSString *input = @"KnownNetworks"; + NSString *timeStampStr = @"_timeStamp"; + + NSString *ssidStr = @"SSID_STR"; + + for (id key in plistDict) { + if ([input isEqualToString:key]) { + + NSDictionary *knownNetworksDict = [plistDict objectForKey:key]; + for (id networkKey in knownNetworksDict) { + bool isFound = false; + NSDictionary *itemDict = [knownNetworksDict objectForKey:networkKey]; + NSInteger dictSize = [itemDict count]; + id objects[dictSize]; + id keys[dictSize]; + + [itemDict getObjects:objects andKeys:keys]; + bool ok = false; + for(int i = 0; i < dictSize; i++) { + if([ssidStr isEqualToString:keys[i]]) { + const QString ident = QString::number(qHash(QLatin1String("corewlan:") + qt_mac_NSStringToQString(objects[i]))); + if(ident == id) { + ok = true; + } + } + if(ok && [timeStampStr isEqualToString:keys[i]]) { + timestamp = (quint64)[objects[i] timeIntervalSince1970]; + isFound = true; + break; + } + } + if(isFound) + break; + } + } + } + return timestamp; +} + +quint64 QCoreWlanEngine::getBytes(const QString &interfaceName, bool b) +{ + struct ifaddrs *ifAddressList, *ifAddress; + struct if_data *if_data; + + quint64 bytes = 0; + ifAddressList = nil; + if(getifaddrs(&ifAddressList) == 0) { + for(ifAddress = ifAddressList; ifAddress; ifAddress = ifAddress->ifa_next) { + if(interfaceName == ifAddress->ifa_name) { + if_data = (struct if_data*)ifAddress->ifa_data; + if(b) { + bytes = if_data->ifi_ibytes; + break; + } else { + bytes = if_data->ifi_obytes; + break; + } + } + } + freeifaddrs(ifAddressList); + } + return bytes; +} QT_END_NAMESPACE -- cgit v0.12 From 7fc31eb7c73968c4bafda3dba143c9b1e369ab69 Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Fri, 21 May 2010 14:24:51 +1000 Subject: remove dead code that will never get called. --- src/plugins/bearer/corewlan/qcorewlanengine.mm | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm index 90d093a..a9cb65b 100644 --- a/src/plugins/bearer/corewlan/qcorewlanengine.mm +++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm @@ -829,7 +829,6 @@ quint64 QCoreWlanEngine::bytesWritten(const QString &id) QMutexLocker locker(&mutex); const QString interfaceStr = getInterfaceFromId(id); return getBytes(interfaceStr,false); - return Q_UINT64_C(0); } quint64 QCoreWlanEngine::bytesReceived(const QString &id) @@ -837,7 +836,6 @@ quint64 QCoreWlanEngine::bytesReceived(const QString &id) QMutexLocker locker(&mutex); const QString interfaceStr = getInterfaceFromId(id); return getBytes(interfaceStr,true); - return Q_UINT64_C(0); } quint64 QCoreWlanEngine::startTime(const QString &id) -- cgit v0.12 From d53b25d397e54551aff15b79e3807e7ce4612886 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Fri, 21 May 2010 09:55:14 +0200 Subject: Doc: Changes to the HTMLGenerator, style and js Replacing tables with lists in the HTML generator Adding img to search box Moving JS from template to script files --- doc/src/template/scripts/functions.js | 17 ++++++++--------- doc/src/template/style/style.css | 17 +++++++++++++---- tools/qdoc3/htmlgenerator.cpp | 20 ++++++++++---------- tools/qdoc3/test/assistant.qdocconf | 1 + tools/qdoc3/test/designer.qdocconf | 1 + tools/qdoc3/test/linguist.qdocconf | 1 + tools/qdoc3/test/qdeclarative.qdocconf | 1 + tools/qdoc3/test/qmake.qdocconf | 1 + tools/qdoc3/test/qt-build-docs.qdocconf | 1 + tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf | 1 + tools/qdoc3/test/qt-defines.qdocconf | 1 + tools/qdoc3/test/qt-html-templates.qdocconf | 1 - tools/qdoc3/test/qt.qdocconf | 1 + tools/qdoc3/test/qt_zh_CN.qdocconf | 1 + 14 files changed, 41 insertions(+), 24 deletions(-) diff --git a/doc/src/template/scripts/functions.js b/doc/src/template/scripts/functions.js index afd1ec3..7ae2421 100755 --- a/doc/src/template/scripts/functions.js +++ b/doc/src/template/scripts/functions.js @@ -54,8 +54,6 @@ var exampleCount = 0; var qturl = ""; // change from "http://doc.qt.nokia.com/4.6/" to 0 so we can have relative links function processNokiaData(response){ -$('.sidebar .search form input').addClass('loading'); - // debug $('.content').prepend('
  • handling search results
  • '); // debuging var propertyTags = response.getElementsByTagName('page'); for (var i=0; i< propertyTags.length; i++) { @@ -64,7 +62,6 @@ $('.sidebar .search form input').addClass('loading'); if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'APIPage'){ lookupCount++; - //$('.live001').css('display','block'); for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){ @@ -79,7 +76,6 @@ $('.sidebar .search form input').addClass('loading'); if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Article'){ articleCount++; - //$('.live002').css('display','block'); for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){ @@ -93,7 +89,6 @@ $('.sidebar .search form input').addClass('loading'); } if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Example'){ exampleCount++; - //$('.live003').css('display','block'); for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){ @@ -105,10 +100,11 @@ $('.sidebar .search form input').addClass('loading'); } } + if(i==propertyTags.length){$('#pageType').removeClass('loading');} + } - if(lookupCount == 0){$('#ul001').prepend('
  • Found no result
  • ');$('#ul001 li').css('display','block');$('.sidebar .search form input').removeClass('loading'); -} + if(lookupCount == 0){$('#ul001').prepend('
  • Found no result
  • ');$('#ul001 li').css('display','block');$('.sidebar .search form input').removeClass('loading');} if(articleCount == 0){$('#ul002').prepend('
  • Found no result
  • ');$('#ul002 li').css('display','block');} if(exampleCount == 0){$('#ul003').prepend('
  • Found no result
  • ');$('#ul003 li').css('display','block');} // reset count variables; @@ -117,7 +113,6 @@ $('.sidebar .search form input').addClass('loading'); exampleCount = 0; } - //build regular expression object to find empty string or any number of blank var blankRE=/^\s*$/; function CheckEmptyAndLoadList() @@ -147,7 +142,7 @@ else $(document).ready(function () { var pageUrl = window.location.href; //alert(pageUrl); - $('#pageUrl').attr('foo',pageUrl); + //$('#pageUrl').attr('foo',pageUrl); var pageTitle = $('title').html(); $('#feedform').append(''); var currentString = $('#pageType').val() ; @@ -159,6 +154,7 @@ else $('#pageType').keyup(function () { var searchString = $('#pageType').val() ; if ((searchString == null) || (searchString.length < 3)) { + $('#pageType').removeClass('loading'); $('.liveResult').remove(); // replaces removeResults(); CheckEmptyAndLoadList(); $('.report').remove(); @@ -167,6 +163,7 @@ else } if (this.timer) clearTimeout(this.timer); this.timer = setTimeout(function () { + $('#pageType').addClass('loading'); // debug$('.content').prepend('
  • new search started
  • ');// debug // debug$('.content').prepend('

    Search string ' +searchString +'

    '); // debug @@ -179,6 +176,8 @@ else success: function (response, textStatus) { $('.liveResult').remove(); // replaces removeResults(); + $('#pageType').removeClass('loading'); + processNokiaData(response); } diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css index 3f35642..82acd3e 100755 --- a/doc/src/template/style/style.css +++ b/doc/src/template/style/style.css @@ -998,17 +998,17 @@ .rightAlign { - text-align:right; + /*text-align:right; */ } .leftAlign { - text-align:left; + /*text-align:left; */ } .topAlign{ - vertical-align:top + /*vertical-align:top*/ } .functionIndex a{ @@ -1140,7 +1140,16 @@ /* end of screen media */ - +.flowList{ +display:inline-block; +width:260px; +} +.flowList dl{ +padding:0px; +} +.wrap .content .flowList p{ +padding:0px; +} } /* end of screen media */ diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 6394b6e..0e8d021 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -2479,19 +2479,19 @@ void HtmlGenerator::generateCompactList(const Node *relative, out() << "

    \n"; } - out() << "\n"; + out() << "
    \n"; for (k = 0; k < numRows; k++) { if (++numTableRows % 2 == 1) - out() << "
    "; + out() << "
    "; + out() << "
    "; //break; // out() << "
    \n"; for (i = 0; i < NumColumns; i++) { if (currentOffset[i] >= firstOffset[i + 1]) { // this column is finished - out() << "\n"; // check why? + out() << "
    \n
    \n"; // check why? } else { while ((currentParagraphNo[i] < NumParagraphs) && @@ -2506,7 +2506,7 @@ void HtmlGenerator::generateCompactList(const Node *relative, currentParagraphNo[i] = NumParagraphs - 1; } #endif - out() << "\n"; + out() << "

    \n"; - out() << "\n"; + out() << "

    \n"; currentOffset[i]++; currentOffsetInParagraph[i]++; } } - out() << "\n"; + out() << "\n"; } - out() << "
    \n

    "; + out() << "

    "; if (currentOffsetInParagraph[i] == 0) { // start a new paragraph if (includeAlphabet) { @@ -2517,9 +2517,9 @@ void HtmlGenerator::generateCompactList(const Node *relative, << paragraphName[currentParagraphNo[i]] << ""; } - out() << "

    "; + out() << "

    "; if ((currentParagraphNo[i] < NumParagraphs) && !paragraphName[currentParagraphNo[i]].isEmpty()) { NodeMap::Iterator it; @@ -2545,15 +2545,15 @@ void HtmlGenerator::generateCompactList(const Node *relative, out() << ")"; } } - out() << "

    \n"; + out() << "
    \n"; } void HtmlGenerator::generateFunctionIndex(const Node *relative, diff --git a/tools/qdoc3/test/assistant.qdocconf b/tools/qdoc3/test/assistant.qdocconf index 3711ec4..167bb19 100644 --- a/tools/qdoc3/test/assistant.qdocconf +++ b/tools/qdoc3/test/assistant.qdocconf @@ -30,6 +30,7 @@ qhp.Assistant.extraFiles = images/bg_l.png \ images/page.png \ images/page_bg.png \ images/sprites-combined.png \ + images/spinner.gif \ images/stylesheet-coffee-plastique.png \ images/taskmenuextension-example.png \ images/coloreditorfactoryimage.png \ diff --git a/tools/qdoc3/test/designer.qdocconf b/tools/qdoc3/test/designer.qdocconf index 39da68b..48e3ea1 100644 --- a/tools/qdoc3/test/designer.qdocconf +++ b/tools/qdoc3/test/designer.qdocconf @@ -30,6 +30,7 @@ qhp.Designer.extraFiles = images/bg_l.png \ images/page.png \ images/page_bg.png \ images/sprites-combined.png \ + images/spinner.gif \ images/stylesheet-coffee-plastique.png \ images/taskmenuextension-example.png \ images/coloreditorfactoryimage.png \ diff --git a/tools/qdoc3/test/linguist.qdocconf b/tools/qdoc3/test/linguist.qdocconf index dba4fb5..8974bd7 100644 --- a/tools/qdoc3/test/linguist.qdocconf +++ b/tools/qdoc3/test/linguist.qdocconf @@ -30,6 +30,7 @@ qhp.Linguist.extraFiles = images/bg_l.png \ images/page.png \ images/page_bg.png \ images/sprites-combined.png \ + images/spinner.gif \ images/stylesheet-coffee-plastique.png \ images/taskmenuextension-example.png \ images/coloreditorfactoryimage.png \ diff --git a/tools/qdoc3/test/qdeclarative.qdocconf b/tools/qdoc3/test/qdeclarative.qdocconf index f744879..0f2e381 100644 --- a/tools/qdoc3/test/qdeclarative.qdocconf +++ b/tools/qdoc3/test/qdeclarative.qdocconf @@ -41,6 +41,7 @@ qhp.Qml.extraFiles = images/bg_l.png \ images/page.png \ images/page_bg.png \ images/sprites-combined.png \ + images/spinner.png \ images/stylesheet-coffee-plastique.png \ images/taskmenuextension-example.png \ images/coloreditorfactoryimage.png \ diff --git a/tools/qdoc3/test/qmake.qdocconf b/tools/qdoc3/test/qmake.qdocconf index b7f4115..ea58059 100644 --- a/tools/qdoc3/test/qmake.qdocconf +++ b/tools/qdoc3/test/qmake.qdocconf @@ -30,6 +30,7 @@ qhp.qmake.extraFiles = images/bg_l.png \ images/page.png \ images/page_bg.png \ images/sprites-combined.png \ + images/spinner.gif \ images/stylesheet-coffee-plastique.png \ images/taskmenuextension-example.png \ images/coloreditorfactoryimage.png \ diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf index d3c855f..bd363a6 100644 --- a/tools/qdoc3/test/qt-build-docs.qdocconf +++ b/tools/qdoc3/test/qt-build-docs.qdocconf @@ -36,6 +36,7 @@ qhp.Qt.extraFiles = index.html \ images/page.png \ images/page_bg.png \ images/sprites-combined.png \ + images/spinner.gif \ images/stylesheet-coffee-plastique.png \ images/taskmenuextension-example.png \ images/coloreditorfactoryimage.png \ diff --git a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf index e9bc00c..caf5f73 100644 --- a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf +++ b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf @@ -44,6 +44,7 @@ qhp.Qt.extraFiles = index.html \ images/page.png \ images/page_bg.png \ images/sprites-combined.png \ + images/spinner.gif \ images/stylesheet-coffee-plastique.png \ images/taskmenuextension-example.png \ images/coloreditorfactoryimage.png \ diff --git a/tools/qdoc3/test/qt-defines.qdocconf b/tools/qdoc3/test/qt-defines.qdocconf index f3291df..3e71d07 100644 --- a/tools/qdoc3/test/qt-defines.qdocconf +++ b/tools/qdoc3/test/qt-defines.qdocconf @@ -34,6 +34,7 @@ extraimages.HTML = qt-logo \ page.png \ page_bg.png \ sprites-combined.png \ + spinner.gif \ taskmenuextension-example.png \ coloreditorfactoryimage.png \ dynamiclayouts-example.png \ diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index 50bf0c3..09f0c96 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -130,7 +130,6 @@ HTML.footer = " \n" \ "
    X
    \n" \ "
    \n" \ "

    \n" \ - " \n" \ " \n" \ "

    \n" \ "
    \n" \ diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf index 83a35a9..267d536 100644 --- a/tools/qdoc3/test/qt.qdocconf +++ b/tools/qdoc3/test/qt.qdocconf @@ -40,6 +40,7 @@ qhp.Qt.extraFiles = index.html \ images/page.png \ images/page_bg.png \ images/sprites-combined.png \ + images/spinner.gif \ images/stylesheet-coffee-plastique.png \ images/taskmenuextension-example.png \ images/coloreditorfactoryimage.png \ diff --git a/tools/qdoc3/test/qt_zh_CN.qdocconf b/tools/qdoc3/test/qt_zh_CN.qdocconf index 9275b5c..db02478 100644 --- a/tools/qdoc3/test/qt_zh_CN.qdocconf +++ b/tools/qdoc3/test/qt_zh_CN.qdocconf @@ -46,6 +46,7 @@ qhp.Qt.extraFiles = index.html \ images/page.png \ images/page_bg.png \ images/sprites-combined.png \ + images/spinner.gif \ images/stylesheet-coffee-plastique.png \ images/taskmenuextension-example.png \ images/coloreditorfactoryimage.png \ -- cgit v0.12 From 9ad82755f62b7fb5e303bf5f8ee2bb8e4afb7f8d Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 21 May 2010 10:34:42 +0200 Subject: qdoc: Changed number of columns to 1. Oila! --- tools/qdoc3/htmlgenerator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 0e8d021..1872d87 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -2332,7 +2332,7 @@ void HtmlGenerator::generateCompactList(const Node *relative, QString commonPrefix) { const int NumParagraphs = 37; // '0' to '9', 'A' to 'Z', '_' - const int NumColumns = 3; // number of columns in the result + const int NumColumns = 1; // number of columns in the result if (classMap.isEmpty()) return; -- cgit v0.12 From 04ad0950378fb4255064c10d5a4d64c1074035ed Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 21 May 2010 10:53:55 +0200 Subject: qdoc: Fixed html error, but the problem is still there. --- tools/qdoc3/htmlgenerator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 1872d87..cf8ea7c 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -2482,7 +2482,7 @@ void HtmlGenerator::generateCompactList(const Node *relative, out() << "
    \n"; for (k = 0; k < numRows; k++) { if (++numTableRows % 2 == 1) - out() << "
    "; else out() << "
    "; //break; -- cgit v0.12 From 6b52b41c71300ea3424385986391485058fc1fa5 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Fri, 21 May 2010 13:29:58 +0200 Subject: Doc: design changes Fixing menus and js --- doc/src/template/scripts/functions.js | 9 +++++++-- doc/src/template/style/style.css | 13 +++++++++---- tools/qdoc3/test/qt-html-templates.qdocconf | 7 ------- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/doc/src/template/scripts/functions.js b/doc/src/template/scripts/functions.js index 7ae2421..58a0248 100755 --- a/doc/src/template/scripts/functions.js +++ b/doc/src/template/scripts/functions.js @@ -117,7 +117,14 @@ function processNokiaData(response){ var blankRE=/^\s*$/; function CheckEmptyAndLoadList() { + var pageUrl = window.location.href; + var pageVal = $('title').html(); + $('#feedUrl').remove(); + $('#pageVal').remove(); + $('#feedform').append(''); + $('#feedform').append(''); $('.liveResult').remove(); + $('.defaultLink').css('display','block'); var value = document.getElementById('pageType').value; if((blankRE.test(value)) || (value.length < 3)) { @@ -140,11 +147,9 @@ else */ // Loads on doc ready $(document).ready(function () { - var pageUrl = window.location.href; //alert(pageUrl); //$('#pageUrl').attr('foo',pageUrl); var pageTitle = $('title').html(); - $('#feedform').append(''); var currentString = $('#pageType').val() ; if(currentString.length < 1){ $('.defaultLink').css('display','block'); diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css index 82acd3e..ebc1607 100755 --- a/doc/src/template/style/style.css +++ b/doc/src/template/style/style.css @@ -844,7 +844,7 @@ background-color: #e6e7e8; z-index: 4; } - #feedcloseX a + #feedcloseX { display: inline; padding: 5px 5px 0 0; @@ -998,17 +998,17 @@ .rightAlign { - /*text-align:right; */ + text-align:right; } .leftAlign { - /*text-align:left; */ + text-align:left; } .topAlign{ - /*vertical-align:top*/ + vertical-align:top } .functionIndex a{ @@ -1150,6 +1150,11 @@ padding:0px; .wrap .content .flowList p{ padding:0px; } +pre.highlightedCode { + display: block; + overflow:hidden; +} + } /* end of screen media */ diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index 09f0c96..b72a1eb 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -54,8 +54,6 @@ HTML.postheader = "
    \n" \ "
  • QML elements
  • \n" \ " \n" \ "
    \n" \ - "
    \n" \ - "
    \n" \ "
    \n" \ "
    \n" \ "

    \n" \ @@ -68,8 +66,6 @@ HTML.postheader = "
    \n" \ "
  • Platform-specific info
  • \n" \ " \n" \ "
    \n" \ - "
    \n" \ - "
    \n" \ "

    \n" \ "
    \n" \ "

    \n" \ @@ -83,8 +79,6 @@ HTML.postheader = "
    \n" \ "
  • QML Demos
  • \n" \ " \n" \ "
    \n" \ - "
    \n" \ - "
    \n" \ "

    \n" \ " \n" \ "
    \n" \ @@ -130,7 +124,6 @@ HTML.footer = " \n" \ "
    X
    \n" \ "
    \n" \ "

    \n" \ - " \n" \ "

    \n" \ "
    \n" \ "
    \n" \ -- cgit v0.12 From 49a6f4a7d87def3816cebf0115ddadf43e9c4d01 Mon Sep 17 00:00:00 2001 From: Carlos Manuel Duclos Vergara Date: Fri, 21 May 2010 14:23:22 +0200 Subject: Removal erroneous inclusion of new Public API in qmacstyle. When fixing qtbug-10401 I introduced some extra symbols in the public API. This commit fixes that and moves those symbols to QMacStylePrivate instead. Reviewed-by: jbache --- src/gui/styles/qmacstyle_mac_p.h | 255 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 255 insertions(+) create mode 100644 src/gui/styles/qmacstyle_mac_p.h diff --git a/src/gui/styles/qmacstyle_mac_p.h b/src/gui/styles/qmacstyle_mac_p.h new file mode 100644 index 0000000..7f8994e --- /dev/null +++ b/src/gui/styles/qmacstyle_mac_p.h @@ -0,0 +1,255 @@ +/**************************************************************************** +** +** 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 QtGui 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$ +** +****************************************************************************/ + + +#ifndef QMACSTYLE_MAC_P_H +#define QMACSTYLE_MAC_P_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +// These colors specify the titlebar gradient colors on +// Leopard. Ideally we should get them from the system. +static const QColor titlebarGradientActiveBegin(220, 220, 220); +static const QColor titlebarGradientActiveEnd(151, 151, 151); +static const QColor titlebarSeparatorLineActive(111, 111, 111); +static const QColor titlebarGradientInactiveBegin(241, 241, 241); +static const QColor titlebarGradientInactiveEnd(207, 207, 207); +static const QColor titlebarSeparatorLineInactive(131, 131, 131); + +// Gradient colors used for the dock widget title bar and +// non-unifed tool bar bacground. +static const QColor mainWindowGradientBegin(240, 240, 240); +static const QColor mainWindowGradientEnd(200, 200, 200); + +#if (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5) +enum { + kThemePushButtonTextured = 31, + kThemePushButtonTexturedSmall = 32, + kThemePushButtonTexturedMini = 33 +}; + +/* Search fields */ +enum { + kHIThemeFrameTextFieldRound = 1000, + kHIThemeFrameTextFieldRoundSmall = 1001, + kHIThemeFrameTextFieldRoundMini = 1002 +}; +#endif + +// Resolve these at run-time, since the functions was moved in Leopard. +typedef HIRect * (*PtrHIShapeGetBounds)(HIShapeRef, HIRect *); +static PtrHIShapeGetBounds ptrHIShapeGetBounds = 0; + +static int closeButtonSize = 12; + +/* + AHIG: + Apple Human Interface Guidelines + http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/ + + Builder: + Apple Interface Builder v. 3.1.1 +*/ + +// this works as long as we have at most 16 different control types +#define CT1(c) CT2(c, c) +#define CT2(c1, c2) ((uint(c1) << 16) | uint(c2)) + +enum QAquaWidgetSize { QAquaSizeLarge = 0, QAquaSizeSmall = 1, QAquaSizeMini = 2, + QAquaSizeUnknown = -1 }; + +#define SIZE(large, small, mini) \ + (controlSize == QAquaSizeLarge ? (large) : controlSize == QAquaSizeSmall ? (small) : (mini)) + +// same as return SIZE(...) but optimized +#define return_SIZE(large, small, mini) \ + do { \ + static const int sizes[] = { (large), (small), (mini) }; \ + return sizes[controlSize]; \ + } while (0) + +class QMacStylePrivate : public QObject +{ + Q_OBJECT + +public: + QMacStylePrivate(QMacStyle *style); + + // Ideally these wouldn't exist, but since they already exist we need some accessors. + static const int PushButtonLeftOffset; + static const int PushButtonTopOffset; + static const int PushButtonRightOffset; + static const int PushButtonBottomOffset; + static const int MiniButtonH; + static const int SmallButtonH; + static const int BevelButtonW; + static const int BevelButtonH; + static const int PushButtonContentPadding; + + + // Stuff from QAquaAnimate: + bool addWidget(QWidget *); + void removeWidget(QWidget *); + + enum Animates { AquaPushButton, AquaProgressBar, AquaListViewItemOpen }; + bool animatable(Animates, const QWidget *) const; + void stopAnimate(Animates, QWidget *); + void startAnimate(Animates, QWidget *); + static ThemeDrawState getDrawState(QStyle::State flags); + QAquaWidgetSize aquaSizeConstrain(const QStyleOption *option, const QWidget *widg, + QStyle::ContentsType ct = QStyle::CT_CustomBase, + QSize szHint=QSize(-1, -1), QSize *insz = 0) const; + void getSliderInfo(QStyle::ComplexControl cc, const QStyleOptionSlider *slider, + HIThemeTrackDrawInfo *tdi, const QWidget *needToRemoveMe); + bool doAnimate(Animates); + inline int animateSpeed(Animates) const { return 33; } + + // Utility functions + void drawColorlessButton(const HIRect &macRect, HIThemeButtonDrawInfo *bdi, + QPainter *p, const QStyleOption *opt) const; + + QSize pushButtonSizeFromContents(const QStyleOptionButton *btn) const; + + HIRect pushButtonContentBounds(const QStyleOptionButton *btn, + const HIThemeButtonDrawInfo *bdi) const; + + void initComboboxBdi(const QStyleOptionComboBox *combo, HIThemeButtonDrawInfo *bdi, + const QWidget *widget, const ThemeDrawState &tds); + + static HIRect comboboxInnerBounds(const HIRect &outerBounds, int buttonKind); + + static QRect comboboxEditBounds(const QRect &outerBounds, const HIThemeButtonDrawInfo &bdi); + + static void drawCombobox(const HIRect &outerBounds, const HIThemeButtonDrawInfo &bdi, QPainter *p); + static void drawTableHeader(const HIRect &outerBounds, bool drawTopBorder, bool drawLeftBorder, + const HIThemeButtonDrawInfo &bdi, QPainter *p); + bool contentFitsInPushButton(const QStyleOptionButton *btn, HIThemeButtonDrawInfo *bdi, + ThemeButtonKind buttonKindToCheck) const; + void initHIThemePushButton(const QStyleOptionButton *btn, const QWidget *widget, + const ThemeDrawState tds, + HIThemeButtonDrawInfo *bdi) const; + QPixmap generateBackgroundPattern() const; +protected: + bool eventFilter(QObject *, QEvent *); + void timerEvent(QTimerEvent *); + +private slots: + void startAnimationTimer(); + +public: + QPointer defaultButton; //default push buttons + int timerID; + QList > progressBars; //existing progress bars that need animation + + struct ButtonState { + int frame; + enum { ButtonDark, ButtonLight } dir; + } buttonState; + UInt8 progressFrame; + QPointer focusWidget; + CFAbsoluteTime defaultButtonStart; + QMacStyle *q; + bool mouseDown; +}; + +#endif // QMACSTYLE_MAC_P_H -- cgit v0.12 From 4377e247e135967eb7b4c89906415abecb283bd3 Mon Sep 17 00:00:00 2001 From: Carlos Manuel Duclos Vergara Date: Fri, 21 May 2010 14:32:05 +0200 Subject: Fixing incorrect addition of public API symbols. This commit is related to 49a6f4a7d87def3816cebf0115ddadf43e9c4d01 and contains all the files that were modified. The previous commit contained only the newly added file. Reviewed-by: jbache --- src/gui/kernel/qt_cocoa_helpers_mac_p.h | 5 + src/gui/styles/qmacstyle_mac.h | 11 -- src/gui/styles/qmacstyle_mac.mm | 181 ++++++-------------------------- src/gui/styles/qmacstyle_mac_p.h | 22 +--- src/gui/styles/qmacstylepixmaps_mac_p.h | 5 + src/gui/styles/styles.pri | 3 +- src/gui/widgets/qpushbutton.cpp | 9 +- 7 files changed, 55 insertions(+), 181 deletions(-) diff --git a/src/gui/kernel/qt_cocoa_helpers_mac_p.h b/src/gui/kernel/qt_cocoa_helpers_mac_p.h index 5db121a..44fb4f0 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac_p.h +++ b/src/gui/kernel/qt_cocoa_helpers_mac_p.h @@ -73,6 +73,9 @@ ** ****************************************************************************/ +#ifndef QT_COCOA_HELPERS_MAC_P_H +#define QT_COCOA_HELPERS_MAC_P_H + // // W A R N I N G // ------------- @@ -216,3 +219,5 @@ bool qt_cocoaPostMessage(id target, SEL selector); void qt_mac_post_retranslateAppMenu(); QT_END_NAMESPACE + +#endif // QT_COCOA_HELPERS_MAC_P_H diff --git a/src/gui/styles/qmacstyle_mac.h b/src/gui/styles/qmacstyle_mac.h index e594793..bcebb1d 100644 --- a/src/gui/styles/qmacstyle_mac.h +++ b/src/gui/styles/qmacstyle_mac.h @@ -120,17 +120,6 @@ public: bool event(QEvent *e); - // Ideally these wouldn't exist, but since they already exist we need some accessors. - static const int PushButtonLeftOffset; - static const int PushButtonTopOffset; - static const int PushButtonRightOffset; - static const int PushButtonBottomOffset; - static const int MiniButtonH; - static const int SmallButtonH; - static const int BevelButtonW; - static const int BevelButtonH; - static const int PushButtonContentPadding; - protected Q_SLOTS: QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *opt = 0, const QWidget *widget = 0) const; diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index e82e638..9cffc1e 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -101,22 +101,21 @@ #include #include #include +#include "qmacstyle_mac_p.h" QT_BEGIN_NAMESPACE -extern QRegion qt_mac_convert_mac_region(RgnHandle); //qregion_mac.cpp - // The following constants are used for adjusting the size // of push buttons so that they are drawn inside their bounds. -const int QMacStyle::PushButtonLeftOffset = 6; -const int QMacStyle::PushButtonTopOffset = 4; -const int QMacStyle::PushButtonRightOffset = 12; -const int QMacStyle::PushButtonBottomOffset = 12; -const int QMacStyle::MiniButtonH = 26; -const int QMacStyle::SmallButtonH = 30; -const int QMacStyle::BevelButtonW = 50; -const int QMacStyle::BevelButtonH = 22; -const int QMacStyle::PushButtonContentPadding = 6; +const int QMacStylePrivate::PushButtonLeftOffset = 6; +const int QMacStylePrivate::PushButtonTopOffset = 4; +const int QMacStylePrivate::PushButtonRightOffset = 12; +const int QMacStylePrivate::PushButtonBottomOffset = 12; +const int QMacStylePrivate::MiniButtonH = 26; +const int QMacStylePrivate::SmallButtonH = 30; +const int QMacStylePrivate::BevelButtonW = 50; +const int QMacStylePrivate::BevelButtonH = 22; +const int QMacStylePrivate::PushButtonContentPadding = 6; // These colors specify the titlebar gradient colors on // Leopard. Ideally we should get them from the system. @@ -134,25 +133,14 @@ static const QColor mainWindowGradientEnd(200, 200, 200); static const int DisclosureOffset = 4; -#if (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5) -enum { - kThemePushButtonTextured = 31, - kThemePushButtonTexturedSmall = 32, - kThemePushButtonTexturedMini = 33 -}; - -/* Search fields */ -enum { - kHIThemeFrameTextFieldRound = 1000, - kHIThemeFrameTextFieldRoundSmall = 1001, - kHIThemeFrameTextFieldRoundMini = 1002 -}; -#endif - // Resolve these at run-time, since the functions was moved in Leopard. typedef HIRect * (*PtrHIShapeGetBounds)(HIShapeRef, HIRect *); static PtrHIShapeGetBounds ptrHIShapeGetBounds = 0; +static int closeButtonSize = 12; + +extern QRegion qt_mac_convert_mac_region(RgnHandle); //qregion_mac.cpp + static bool isVerticalTabs(const QTabBar::Shape shape) { return (shape == QTabBar::RoundedEast || shape == QTabBar::TriangularEast @@ -160,8 +148,6 @@ static bool isVerticalTabs(const QTabBar::Shape shape) { || shape == QTabBar::TriangularWest); } -static int closeButtonSize = 12; - void drawTabCloseButton(QPainter *p, bool hover, bool active, bool selected) { // draw background circle @@ -380,32 +366,6 @@ void drawTabBase(QPainter *p, const QStyleOptionTabBarBaseV2 *tbb, const QWidget p->drawLine(tabRect.x(), height - 1, width, height - 1); } -/* - AHIG: - Apple Human Interface Guidelines - http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/ - - Builder: - Apple Interface Builder v. 3.1.1 -*/ - -// this works as long as we have at most 16 different control types -#define CT1(c) CT2(c, c) -#define CT2(c1, c2) ((uint(c1) << 16) | uint(c2)) - -enum QAquaWidgetSize { QAquaSizeLarge = 0, QAquaSizeSmall = 1, QAquaSizeMini = 2, - QAquaSizeUnknown = -1 }; - -#define SIZE(large, small, mini) \ - (controlSize == QAquaSizeLarge ? (large) : controlSize == QAquaSizeSmall ? (small) : (mini)) - -// same as return SIZE(...) but optimized -#define return_SIZE(large, small, mini) \ - do { \ - static const int sizes[] = { (large), (small), (mini) }; \ - return sizes[controlSize]; \ - } while (0) - static int getControlSize(const QStyleOption *option, const QWidget *widget) { if (option) { @@ -483,80 +443,9 @@ static inline ThemeTabDirection getTabDirection(QTabBar::Shape shape) return ttd; } -class QMacStylePrivate : public QObject -{ - Q_OBJECT - -public: - QMacStylePrivate(QMacStyle *style); - - // Stuff from QAquaAnimate: - bool addWidget(QWidget *); - void removeWidget(QWidget *); - - enum Animates { AquaPushButton, AquaProgressBar, AquaListViewItemOpen }; - bool animatable(Animates, const QWidget *) const; - void stopAnimate(Animates, QWidget *); - void startAnimate(Animates, QWidget *); - static ThemeDrawState getDrawState(QStyle::State flags); - QAquaWidgetSize aquaSizeConstrain(const QStyleOption *option, const QWidget *widg, - QStyle::ContentsType ct = QStyle::CT_CustomBase, - QSize szHint=QSize(-1, -1), QSize *insz = 0) const; - void getSliderInfo(QStyle::ComplexControl cc, const QStyleOptionSlider *slider, - HIThemeTrackDrawInfo *tdi, const QWidget *needToRemoveMe); - bool doAnimate(Animates); - inline int animateSpeed(Animates) const { return 33; } - - // Utility functions - void drawColorlessButton(const HIRect &macRect, HIThemeButtonDrawInfo *bdi, - QPainter *p, const QStyleOption *opt) const; - - QSize pushButtonSizeFromContents(const QStyleOptionButton *btn) const; - - HIRect pushButtonContentBounds(const QStyleOptionButton *btn, - const HIThemeButtonDrawInfo *bdi) const; - - void initComboboxBdi(const QStyleOptionComboBox *combo, HIThemeButtonDrawInfo *bdi, - const QWidget *widget, const ThemeDrawState &tds); - - static HIRect comboboxInnerBounds(const HIRect &outerBounds, int buttonKind); - - static QRect comboboxEditBounds(const QRect &outerBounds, const HIThemeButtonDrawInfo &bdi); - - static void drawCombobox(const HIRect &outerBounds, const HIThemeButtonDrawInfo &bdi, QPainter *p); - static void drawTableHeader(const HIRect &outerBounds, bool drawTopBorder, bool drawLeftBorder, - const HIThemeButtonDrawInfo &bdi, QPainter *p); - bool contentFitsInPushButton(const QStyleOptionButton *btn, HIThemeButtonDrawInfo *bdi, - ThemeButtonKind buttonKindToCheck) const; - void initHIThemePushButton(const QStyleOptionButton *btn, const QWidget *widget, - const ThemeDrawState tds, - HIThemeButtonDrawInfo *bdi) const; - QPixmap generateBackgroundPattern() const; -protected: - bool eventFilter(QObject *, QEvent *); - void timerEvent(QTimerEvent *); - -private slots: - void startAnimationTimer(); - -public: - QPointer defaultButton; //default push buttons - int timerID; - QList > progressBars; //existing progress bars that need animation - - struct ButtonState { - int frame; - enum { ButtonDark, ButtonLight } dir; - } buttonState; - UInt8 progressFrame; - QPointer focusWidget; - CFAbsoluteTime defaultButtonStart; - QMacStyle *q; - bool mouseDown; -}; - QT_BEGIN_INCLUDE_NAMESPACE -#include "qmacstyle_mac.moc" +#include "moc_qmacstyle_mac.cpp" +#include "moc_qmacstyle_mac_p.cpp" QT_END_INCLUDE_NAMESPACE /***************************************************************************** @@ -1057,10 +946,10 @@ HIRect QMacStylePrivate::pushButtonContentBounds(const QStyleOptionButton *btn, // Adjust the bounds to correct for // carbon not calculating the content bounds fully correct if (bdi->kind == kThemePushButton || bdi->kind == kThemePushButtonSmall){ - outerBounds.origin.y += QMacStyle::PushButtonTopOffset; - outerBounds.size.height -= QMacStyle::PushButtonBottomOffset; + outerBounds.origin.y += QMacStylePrivate::PushButtonTopOffset; + outerBounds.size.height -= QMacStylePrivate::PushButtonBottomOffset; } else if (bdi->kind == kThemePushButtonMini) { - outerBounds.origin.y += QMacStyle::PushButtonTopOffset; + outerBounds.origin.y += QMacStylePrivate::PushButtonTopOffset; } HIRect contentBounds; @@ -1076,7 +965,7 @@ QSize QMacStylePrivate::pushButtonSizeFromContents(const QStyleOptionButton *btn { QSize csz(0, 0); QSize iconSize = btn->icon.isNull() ? QSize(0, 0) - : (btn->iconSize + QSize(QMacStyle::PushButtonContentPadding, 0)); + : (btn->iconSize + QSize(QMacStylePrivate::PushButtonContentPadding, 0)); QRect textRect = btn->text.isEmpty() ? QRect(0, 0, 1, 1) : btn->fontMetrics.boundingRect(QRect(), Qt::AlignCenter, btn->text); csz.setWidth(iconSize.width() + textRect.width() @@ -1151,12 +1040,12 @@ void QMacStylePrivate::initHIThemePushButton(const QStyleOptionButton *btn, // Choose the button kind that closest match the button rect, but at the // same time displays the button contents without clipping. bdi->kind = kThemeBevelButton; - if (btn->rect.width() >= QMacStyle::BevelButtonW && btn->rect.height() >= QMacStyle::BevelButtonH){ + if (btn->rect.width() >= QMacStylePrivate::BevelButtonW && btn->rect.height() >= QMacStylePrivate::BevelButtonH){ if (widget && widget->testAttribute(Qt::WA_MacVariableSize)) { - if (btn->rect.height() <= QMacStyle::MiniButtonH){ + if (btn->rect.height() <= QMacStylePrivate::MiniButtonH){ if (contentFitsInPushButton(btn, bdi, kThemePushButtonMini)) bdi->kind = kThemePushButtonMini; - } else if (btn->rect.height() <= QMacStyle::SmallButtonH){ + } else if (btn->rect.height() <= QMacStylePrivate::SmallButtonH){ if (contentFitsInPushButton(btn, bdi, kThemePushButtonSmall)) bdi->kind = kThemePushButtonSmall; } else if (contentFitsInPushButton(btn, bdi, kThemePushButton)) { @@ -3497,21 +3386,21 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter // the focus 'shadow' will be inside. HIRect newRect = qt_hirectForQRect(btn->rect); if (bdi.kind == kThemePushButton || bdi.kind == kThemePushButtonSmall) { - newRect.origin.x += PushButtonLeftOffset; - newRect.origin.y += PushButtonTopOffset; - newRect.size.width -= PushButtonRightOffset; - newRect.size.height -= PushButtonBottomOffset; + newRect.origin.x += QMacStylePrivate::PushButtonLeftOffset; + newRect.origin.y += QMacStylePrivate::PushButtonTopOffset; + newRect.size.width -= QMacStylePrivate::PushButtonRightOffset; + newRect.size.height -= QMacStylePrivate::PushButtonBottomOffset; } else if (bdi.kind == kThemePushButtonMini) { - newRect.origin.x += PushButtonLeftOffset - 2; - newRect.origin.y += PushButtonTopOffset; - newRect.size.width -= PushButtonRightOffset - 4; + newRect.origin.x += QMacStylePrivate::PushButtonLeftOffset - 2; + newRect.origin.y += QMacStylePrivate::PushButtonTopOffset; + newRect.size.width -= QMacStylePrivate::PushButtonRightOffset - 4; } HIThemeDrawButton(&newRect, &bdi, cg, kHIThemeOrientationNormal, 0); if (btn->features & QStyleOptionButton::HasMenu) { int mbi = proxy()->pixelMetric(QStyle::PM_MenuButtonIndicator, btn, w); QRect ir = btn->rect; - HIRect arrowRect = CGRectMake(ir.right() - mbi - PushButtonRightOffset, + HIRect arrowRect = CGRectMake(ir.right() - mbi - QMacStylePrivate::PushButtonRightOffset, ir.height() / 2 - 4, mbi, ir.height() / 2); bool drawColorless = btn->palette.currentColorGroup() == QPalette::Active; if (drawColorless && tds == kThemeStateInactive) @@ -3605,14 +3494,14 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter if (btn->state & State_On) state = QIcon::On; QPixmap pixmap = btn->icon.pixmap(btn->iconSize, mode, state); - contentW += pixmap.width() + PushButtonContentPadding; + contentW += pixmap.width() + QMacStylePrivate::PushButtonContentPadding; int iconLeftOffset = freeContentRect.x() + (freeContentRect.width() - contentW) / 2; int iconTopOffset = freeContentRect.y() + (freeContentRect.height() - pixmap.height()) / 2; QRect iconDestRect(iconLeftOffset, iconTopOffset, pixmap.width(), pixmap.height()); QRect visualIconDestRect = visualRect(btn->direction, freeContentRect, iconDestRect); proxy()->drawItemPixmap(p, visualIconDestRect, Qt::AlignLeft | Qt::AlignVCenter, pixmap); int newOffset = iconDestRect.x() + iconDestRect.width() - + PushButtonContentPadding - textRect.x(); + + QMacStylePrivate::PushButtonContentPadding - textRect.x(); textRect.adjust(newOffset, 0, newOffset, 0); } // Draw the text: @@ -5708,8 +5597,8 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, // By default, we fit the contents inside a normal rounded push button. // Do this by add enough space around the contents so that rounded // borders (including highlighting when active) will show. - sz.rwidth() += PushButtonLeftOffset + PushButtonRightOffset + 12; - sz.rheight() += PushButtonTopOffset + PushButtonBottomOffset; + sz.rwidth() += QMacStylePrivate::PushButtonLeftOffset + QMacStylePrivate::PushButtonRightOffset + 12; + sz.rheight() += QMacStylePrivate::PushButtonTopOffset + QMacStylePrivate::PushButtonBottomOffset; break; case QStyle::CT_MenuItem: if (const QStyleOptionMenuItem *mi = qstyleoption_cast(opt)) { diff --git a/src/gui/styles/qmacstyle_mac_p.h b/src/gui/styles/qmacstyle_mac_p.h index 7f8994e..5a0ba4c 100644 --- a/src/gui/styles/qmacstyle_mac_p.h +++ b/src/gui/styles/qmacstyle_mac_p.h @@ -107,19 +107,7 @@ // We mean it. // -// These colors specify the titlebar gradient colors on -// Leopard. Ideally we should get them from the system. -static const QColor titlebarGradientActiveBegin(220, 220, 220); -static const QColor titlebarGradientActiveEnd(151, 151, 151); -static const QColor titlebarSeparatorLineActive(111, 111, 111); -static const QColor titlebarGradientInactiveBegin(241, 241, 241); -static const QColor titlebarGradientInactiveEnd(207, 207, 207); -static const QColor titlebarSeparatorLineInactive(131, 131, 131); - -// Gradient colors used for the dock widget title bar and -// non-unifed tool bar bacground. -static const QColor mainWindowGradientBegin(240, 240, 240); -static const QColor mainWindowGradientEnd(200, 200, 200); +QT_BEGIN_NAMESPACE #if (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5) enum { @@ -136,12 +124,6 @@ enum { }; #endif -// Resolve these at run-time, since the functions was moved in Leopard. -typedef HIRect * (*PtrHIShapeGetBounds)(HIShapeRef, HIRect *); -static PtrHIShapeGetBounds ptrHIShapeGetBounds = 0; - -static int closeButtonSize = 12; - /* AHIG: Apple Human Interface Guidelines @@ -252,4 +234,6 @@ public: bool mouseDown; }; +QT_END_NAMESPACE + #endif // QMACSTYLE_MAC_P_H diff --git a/src/gui/styles/qmacstylepixmaps_mac_p.h b/src/gui/styles/qmacstylepixmaps_mac_p.h index 6a5e0e6..58038c3 100644 --- a/src/gui/styles/qmacstylepixmaps_mac_p.h +++ b/src/gui/styles/qmacstylepixmaps_mac_p.h @@ -39,6 +39,9 @@ ** ****************************************************************************/ +#ifndef QMACSTYLEPIXMAPS_MAC_P_H +#define QMACSTYLEPIXMAPS_MAC_P_H + // // W A R N I N G // ------------- @@ -65,3 +68,5 @@ static const char * const qt_mac_toolbar_ext[]={ "aab###bb###baa", "ab###bb###baaa", ".###..###.aaaa"}; + +#endif // QMACSTYLEPIXMAPS_MAC_P_H diff --git a/src/gui/styles/styles.pri b/src/gui/styles/styles.pri index f920032..0a96272 100644 --- a/src/gui/styles/styles.pri +++ b/src/gui/styles/styles.pri @@ -46,7 +46,8 @@ x11{ contains( styles, mac ) { HEADERS += \ styles/qmacstyle_mac.h \ - styles/qmacstylepixmaps_mac_p.h + styles/qmacstylepixmaps_mac_p.h \ + styles/qmacstyle_mac_p.h OBJECTIVE_SOURCES += styles/qmacstyle_mac.mm !contains( styles, windows ) { diff --git a/src/gui/widgets/qpushbutton.cpp b/src/gui/widgets/qpushbutton.cpp index 7b8c0db..d73cf6f 100644 --- a/src/gui/widgets/qpushbutton.cpp +++ b/src/gui/widgets/qpushbutton.cpp @@ -68,6 +68,7 @@ #include "private/qmenu_p.h" #include "private/qpushbutton_p.h" +#include "private/qmacstyle_mac_p.h" QT_BEGIN_NAMESPACE @@ -705,10 +706,10 @@ bool QPushButton::hitButton(const QPoint &pos) const bool QPushButtonPrivate::hitButton(const QPoint &pos) { Q_Q(QPushButton); - QRect roundedRect(q->rect().left() + QMacStyle::PushButtonLeftOffset, - q->rect().top() + QMacStyle::PushButtonContentPadding, - q->rect().width() - QMacStyle::PushButtonRightOffset, - q->rect().height() - QMacStyle::PushButtonBottomOffset); + QRect roundedRect(q->rect().left() + QMacStylePrivate::PushButtonLeftOffset, + q->rect().top() + QMacStylePrivate::PushButtonContentPadding, + q->rect().width() - QMacStylePrivate::PushButtonRightOffset, + q->rect().height() - QMacStylePrivate::PushButtonBottomOffset); return roundedRect.contains(pos); } #endif // Q_WS_MAC -- cgit v0.12 From 634e3646cfbc53e85b66b42d2a75fb1fd4dab164 Mon Sep 17 00:00:00 2001 From: Carlos Manuel Duclos Vergara Date: Fri, 21 May 2010 15:18:46 +0200 Subject: Removing unneeded qDebug statement. Reviewed-by: Richard Moe Gustavsen --- src/gui/styles/qmacstyle_mac.mm | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index 9cffc1e..aaebe4b 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -3361,7 +3361,6 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter QCommonStyle::drawControl(ce, opt, p, w); break; case CE_PushButtonBevel: - qDebug() << "here"; if (const QStyleOptionButton *btn = ::qstyleoption_cast(opt)) { if (!(btn->state & (State_Raised | State_Sunken | State_On))) break; -- cgit v0.12 From e06bc69870d1ef79466557dd716ec1edb0e48fee Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Fri, 21 May 2010 16:14:38 +0200 Subject: QDebug operator for QFlags Output the flags one by one instead of just an integer Reviewed-by: Robert Griebl --- src/corelib/io/qdebug.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index bc68599..093312f 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -254,6 +254,29 @@ inline QDebug operator<<(QDebug debug, const QContiguousCache &cache) return debug.space(); } +#if defined(FORCE_UREF) +template +inline QDebug &operator<<(QDebug debug, const QFlags &flags) +#else +template +inline QDebug operator<<(QDebug debug, const QFlags &flags) +#endif +{ + debug.nospace() << "QFlags("; + bool needSeparator = false; + for (uint i = 0; i < sizeof(T) * 8; ++i) { + if (flags.testFlag(T(1 << i))) { + if (needSeparator) + debug.nospace() << '|'; + else + needSeparator = true; + debug.nospace() << "0x" << QByteArray::number(T(1 << i), 16).constData(); + } + } + debug << ')'; + return debug.space(); +} + #if !defined(QT_NO_DEBUG_STREAM) Q_CORE_EXPORT_INLINE QDebug qDebug() { return QDebug(QtDebugMsg); } -- cgit v0.12 From 1ec8acd77b6c048f5a68887ac7750b0764ade598 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 21 May 2010 12:05:15 +0200 Subject: Remove Q_PACKED from QChar and QLocale::Data. Reviewed-by: Olivier Goffart --- dist/changes-4.7.0 | 7 +++++++ src/corelib/tools/qchar.h | 6 +----- src/corelib/tools/qlocale.h | 6 +----- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/dist/changes-4.7.0 b/dist/changes-4.7.0 index 34d002c..4965ef5 100644 --- a/dist/changes-4.7.0 +++ b/dist/changes-4.7.0 @@ -333,3 +333,10 @@ QtScript: Changes due to updating src/3rdparty/javascriptcore: a column number of 1. - QScriptValueIterator will include the "length" property when iterating over Array objects. + +QtCore: + - QChar no longer carries the Q_PACKED tag on ARM. This flag was + used to allow proper alignment of QChar on 2 bytes on older ARM + ABIs, but it also allowed for unaligned access. Qt never generates + or uses unaligned access and the new EABI aligns as expected, so + the flag was removed. diff --git a/src/corelib/tools/qchar.h b/src/corelib/tools/qchar.h index 205f911..b9e7e01 100644 --- a/src/corelib/tools/qchar.h +++ b/src/corelib/tools/qchar.h @@ -358,11 +358,7 @@ private: QChar(uchar c); #endif ushort ucs; -} -#if (defined(__arm__) || defined(__ARMEL__)) - Q_PACKED -#endif - ; +}; Q_DECLARE_TYPEINFO(QChar, Q_MOVABLE_TYPE); diff --git a/src/corelib/tools/qlocale.h b/src/corelib/tools/qlocale.h index 5023201..f2fd892 100644 --- a/src/corelib/tools/qlocale.h +++ b/src/corelib/tools/qlocale.h @@ -685,11 +685,7 @@ public: struct Data { quint16 index; quint16 numberOptions; - } -#if (defined(__arm__) || defined(__ARMEL__)) - Q_PACKED -#endif - ; + }; private: friend struct QLocalePrivate; // ### We now use this field to pack an index into locale_data and NumberOptions. -- cgit v0.12 From b5f1a55c3112f46f27e2306fac7d93bde96152e6 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 21 May 2010 13:21:44 +0200 Subject: tst_bic: make it possible to test for cross-compilation --- tests/auto/bic/gen.sh | 2 +- tests/auto/bic/tst_bic.cpp | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/auto/bic/gen.sh b/tests/auto/bic/gen.sh index 8005880..7bcad24 100755 --- a/tests/auto/bic/gen.sh +++ b/tests/auto/bic/gen.sh @@ -56,7 +56,7 @@ fi for module in $modules; do echo "#include <$module/$module>" >test.cpp - g++ -c -I$QTDIR/include -DQT_NO_STL -DQT3_SUPPORT -fdump-class-hierarchy test.cpp + ${CXX-g++} $CXXFLAGS -c -I$QTDIR/include -DQT_NO_STL -DQT3_SUPPORT -fdump-class-hierarchy test.cpp mv test.cpp*.class $module.$2.txt # Remove template classes from the output perl -pi -e '$skip = 1 if (/^(Class|Vtable).* Date: Tue, 18 May 2010 20:15:36 +0200 Subject: QDBusAbstractInterface: don't set lastError outside the object's own thread --- src/dbus/qdbusabstractinterface.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dbus/qdbusabstractinterface.cpp b/src/dbus/qdbusabstractinterface.cpp index 1a7c417..4e9c1ad 100644 --- a/src/dbus/qdbusabstractinterface.cpp +++ b/src/dbus/qdbusabstractinterface.cpp @@ -42,6 +42,8 @@ #include "qdbusabstractinterface.h" #include "qdbusabstractinterface_p.h" +#include + #include "qdbusargument.h" #include "qdbuspendingcall.h" #include "qdbusmessage_p.h" @@ -440,7 +442,8 @@ QDBusMessage QDBusAbstractInterface::callWithArgumentList(QDBus::CallMode mode, msg.setArguments(args); QDBusMessage reply = d->connection.call(msg, mode); - d->lastError = reply; // will clear if reply isn't an error + if (thread() == QThread::currentThread()) + d->lastError = reply; // will clear if reply isn't an error // ensure that there is at least one element if (reply.arguments().isEmpty()) -- cgit v0.12 From 3d96cbd2ec0c104a77254219ef583b6ade3c547d Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 23 May 2010 10:07:54 +0200 Subject: Unbreak compilation outside Mac --- src/gui/widgets/qpushbutton.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widgets/qpushbutton.cpp b/src/gui/widgets/qpushbutton.cpp index d73cf6f..8a18ed0 100644 --- a/src/gui/widgets/qpushbutton.cpp +++ b/src/gui/widgets/qpushbutton.cpp @@ -60,6 +60,7 @@ #include "qdialogbuttonbox.h" #ifdef Q_WS_MAC #include "qmacstyle_mac.h" +#include "private/qmacstyle_mac_p.h" #endif // Q_WS_MAC #ifndef QT_NO_ACCESSIBILITY @@ -68,7 +69,6 @@ #include "private/qmenu_p.h" #include "private/qpushbutton_p.h" -#include "private/qmacstyle_mac_p.h" QT_BEGIN_NAMESPACE -- cgit v0.12 From b827967fef469f66a5a2f975bfafc3cdb82c4ffb Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki Date: Sun, 23 May 2010 19:51:22 +0200 Subject: Compile with QT_NO_ACTION. Merge-request: 643 Reviewed-by: Andreas Kling --- src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp index 7c55009..151a9e9 100644 --- a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp @@ -140,7 +140,9 @@ void QDeclarativeItemModule::defineModule() qmlRegisterType(); qmlRegisterType(); qmlRegisterType(); +#ifndef QT_NO_ACTION qmlRegisterType(); +#endif qmlRegisterType(); qmlRegisterType(); #ifndef QT_NO_GRAPHICSEFFECT -- cgit v0.12 From aee4174771cf9d64b3b36db6ab90f29b084a39d6 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 24 May 2010 16:07:18 +1000 Subject: Improve Bearer Management related documentation in QNetworkAccessManager Reviewed-by: trustme --- src/network/access/qnetworkaccessmanager.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index 1c7661d..c9e2638 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -141,6 +141,32 @@ static void ensureInitialized() can be: \snippet doc/src/snippets/code/src_network_access_qnetworkaccessmanager.cpp 1 + \section1 Network and Roaming support + + With the addition of the \l {Bearer Management} API to Qt 4.7 + QNetworkAccessManager gained the ability to manage network connections. + QNetworkAccessManager can start the network interface if the device is + offline and terminates the interface if the current process is the last + one to use the uplink. Note that some platform utilize grace periods from + when the last application stops using a uplink until the system actually + terminates the connectivity link. Roaming is equally transparent. Any + queued/pending network requests are automatically transferred to new + access point. + + Clients wanting to utlize this feature should not require any changes. In fact + it is likely that existing platform specific connection code can simply be + removed from the application. + + \note The network and roaming support in QNetworkAccessManager is conditional + upon the platform supporting connection management. The + \l QNetworkConfigurationManager::NetworkSessionRequired can be used to + detect whether QNetworkAccessManager utilizes this feature. Currently only + Meego/Harmattan and Symbian platforms provide connection management support. + + \note This feature cannot be used in combination with the Bearer Management + API as provided by QtMobility. Applications have to migrate to the Qt version + of Bearer Management. + \section1 Symbian Platform Security Requirements On Symbian, processes which use this class must have the -- cgit v0.12 From 2fa76dc524b97590e554f0f86e6e8c58b6396d51 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 24 May 2010 16:09:47 +1000 Subject: fix typo in documentation --- src/network/access/qnetworkaccessmanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index c9e2638..6669b5d 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -153,7 +153,7 @@ static void ensureInitialized() queued/pending network requests are automatically transferred to new access point. - Clients wanting to utlize this feature should not require any changes. In fact + Clients wanting to utilize this feature should not require any changes. In fact it is likely that existing platform specific connection code can simply be removed from the application. -- cgit v0.12 From 7c33aef69f59f92c9efbe43368aba33d6391be0c Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 25 May 2010 10:03:00 +0200 Subject: Revert "tst_bic: make it possible to test for cross-compilation" This reverts commit b5f1a55c3112f46f27e2306fac7d93bde96152e6. --- tests/auto/bic/gen.sh | 2 +- tests/auto/bic/tst_bic.cpp | 12 +++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/tests/auto/bic/gen.sh b/tests/auto/bic/gen.sh index 7bcad24..8005880 100755 --- a/tests/auto/bic/gen.sh +++ b/tests/auto/bic/gen.sh @@ -56,7 +56,7 @@ fi for module in $modules; do echo "#include <$module/$module>" >test.cpp - ${CXX-g++} $CXXFLAGS -c -I$QTDIR/include -DQT_NO_STL -DQT3_SUPPORT -fdump-class-hierarchy test.cpp + g++ -c -I$QTDIR/include -DQT_NO_STL -DQT3_SUPPORT -fdump-class-hierarchy test.cpp mv test.cpp*.class $module.$2.txt # Remove template classes from the output perl -pi -e '$skip = 1 if (/^(Class|Vtable).* Date: Tue, 25 May 2010 10:46:39 +0200 Subject: Fix architecture detection on GNU/Hurd. On GNU/Hurd, `uname -m` returns a string like "i686-AT386", which is not recognized. Instead, do a specific mangling on "GNU" host, the same done by autotools' config.guess, so the architecture can be identified and the proper atomic primitives used. Merge-request: 638 Reviewed-by: Oswald Buddenhagen --- configure | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/configure b/configure index f2023b8..0111f51 100755 --- a/configure +++ b/configure @@ -2755,6 +2755,17 @@ fi if [ -z "${CFG_HOST_ARCH}" ]; then case "$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_MACHINE" in + GNU:*:*) + CFG_HOST_ARCH=`echo ${UNAME_MACHINE} | sed -e 's,[-/].*$,,'` + case "$CFG_HOST_ARCH" in + i?86) + CFG_HOST_ARCH=i386 + ;; + esac + if [ "$OPT_VERBOSE" = "yes" ]; then + echo " GNU/Hurd ($CFG_HOST_ARCH)" + fi + ;; IRIX*:*:*) CFG_HOST_ARCH=`uname -p` if [ "$OPT_VERBOSE" = "yes" ]; then -- cgit v0.12 From d9e41640dcbd7a5f5f9d7afb1024e1c4f6672f6e Mon Sep 17 00:00:00 2001 From: John Brooks Date: Tue, 25 May 2010 10:51:39 +0200 Subject: Added MSVC 2010 project files to .gitignore Merge-request: 2394 Reviewed-by: Oswald Buddenhagen --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 04f6e7e..4e3b130 100644 --- a/.gitignore +++ b/.gitignore @@ -131,6 +131,8 @@ qrc_*.cpp *.vcproj *vcproj.*.*.user *.ncb +*.vcxproj +*.vcxproj.filters # MinGW generated files *.Debug -- cgit v0.12 From c6d92ebe915e4ed857aca5130e514c6ec81dd33f Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 25 May 2010 12:09:14 +0200 Subject: qdoc: Improved class index page. The classes.html page will look good with the correct css. --- doc/src/declarative/examples.qdoc | 5 +- doc/src/getting-started/examples.qdoc | 570 ++-------------------------------- tools/qdoc3/htmlgenerator.cpp | 193 ++++++------ 3 files changed, 120 insertions(+), 648 deletions(-) diff --git a/doc/src/declarative/examples.qdoc b/doc/src/declarative/examples.qdoc index 6e0426c..15d7652 100644 --- a/doc/src/declarative/examples.qdoc +++ b/doc/src/declarative/examples.qdoc @@ -42,12 +42,9 @@ /*! \page qdeclarativeexamples.html \title QML Examples and Demos + \brief Building UI's with QML \ingroup all-examples -\previouspage Graphics View Examples -\contentspage Qt Examples -\nextpage Painting Examples - \section1 Running the examples You can find many simple examples in the \c examples/declarative diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc index 61fa1cd..a3393dd 100644 --- a/doc/src/getting-started/examples.qdoc +++ b/doc/src/getting-started/examples.qdoc @@ -76,423 +76,11 @@ */ /*! - \page examples.html - \title Qt Examples - \brief The example programs provided with Qt. - - \previouspage Tutorials - \contentspage How to Learn Qt - \nextpage Qt Demonstrations - - Qt is supplied with a variety of examples that cover almost every aspect - of development. They are not all designed to be impressive when you run - them, but their source code is carefully written to show good Qt - programming practices. You can launch any of these programs from the - \l{Examples and Demos Launcher} application. - - These examples are ordered by functional area, but many examples often - use features from many parts of Qt to highlight one area in particular. - If you are new to Qt, you should probably start by going through the - \l{Tutorials} before you have a look at the - \l{mainwindows/application}{Application} example. - - In addition to the examples and the tutorial, Qt includes a - \l{Qt Demonstrations}{selection of demos} that deliberately show off - Qt's features. You might want to look at these as well. - - \section1 \l{Widgets Examples}{Widgets} - \beginfloatleft - \l{Widgets Examples}{\inlineimage widget-examples.png - } - - \endfloat - Qt comes with a large range of standard widgets that users of modern - applications have come to expect. You can also develop your own custom - widgets and controls, and use them alongside standard widgets. - - It is even possible to provide custom styles and themes for widgets that can - be used to change the appearance of standard widgets and appropriately - written custom widgets. - - \clearfloat - \section1 \l{Dialog Examples}{Dialogs} - \beginfloatleft - \l{Dialog Examples}{\inlineimage dialog-examples.png - } - - \endfloat - Qt includes standard dialogs for many common operations, such as file - selection, printing, and color selection. - - Custom dialogs can also be created for specialized modal or modeless - interactions with users. - - \clearfloat - \section1 \l{Main Window Examples}{Main Windows} - \beginfloatleft - \l{Main Window Examples}{\inlineimage mainwindow-examples.png - } - - \endfloat - All the standard features of application main windows are provided by Qt. - - Main windows can have pull down menus, tool bars, and dock windows. These - separate forms of user input are unified in an integrated action system that - also supports keyboard shortcuts and accelerator keys in menu items. - - \clearfloat - \section1 \l{Layout Examples}{Layouts} - \beginfloatleft - \l{Layout Examples}{\inlineimage layout-examples.png - } - - \endfloat - Qt uses a layout-based approach to widget management. Widgets are arranged in - the optimal positions in windows based on simple layout rules, leading to a - consistent look and feel. - - Custom layouts can be used to provide more control over the positions and - sizes of child widgets. - - \clearfloat - \section1 \l{Item Views Examples}{Item Views} - \beginfloatleft - \l{Item Views Examples}{\inlineimage itemview-examples.png - } - - \endfloat - Item views are widgets that typically display data sets. Qt 4's model/view - framework lets you handle large data sets by separating the underlying data - from the way it is represented to the user, and provides support for - customized rendering through the use of delegates. - - \clearfloat - \section1 \l{Graphics View Examples}{Graphics View} - \beginfloatleft - \l{Graphics View Examples}{\inlineimage graphicsview-examples.png - } - - \endfloat - Qt is provided with a comprehensive canvas through the GraphicsView - classes. - - \clearfloat - \section1 \l{QML Examples and Demos}{Declarative} - \beginfloatleft - \l{QML Examples and Demos}{\inlineimage declarative-examples.png - } - - \endfloat - The Qt Declarative module provides a declarative framework for building - highly dynamic, custom user interfaces. - - \clearfloat - \section1 \l{Painting Examples}{Painting} - \beginfloatleft - \l{Painting Examples}{\inlineimage painting-examples.png - } - - \endfloat - Qt's painting system is able to render vector graphics, images, and outline - font-based text with sub-pixel accuracy accuracy using anti-aliasing to - improve rendering quality. - - \clearfloat - \section1 \l{Rich Text Examples}{Rich Text} - \beginfloatleft - \l{Rich Text Examples}{\inlineimage richtext-examples.png - } - - \endfloat - Qt provides powerful document-oriented rich text engine that supports Unicode - and right-to-left scripts. Documents can be manipulated using a cursor-based - API, and their contents can be imported and exported as both HTML and in a - custom XML format. - - \clearfloat - \section1 \l{Desktop Examples}{Desktop} - \beginfloatleft - \l{Desktop Examples}{\inlineimage desktop-examples.png - } - - \endfloat - Qt provides features to enable applications to integrate with the user's - preferred desktop environment. - - Features such as system tray icons, access to the desktop widget, and - support for desktop services can be used to improve the appearance of - applications and take advantage of underlying desktop facilities. - - \clearfloat - \section1 \l{Drag and Drop Examples}{Drag and Drop} - \beginfloatleft - \l{Drag and Drop Examples}{\inlineimage draganddrop-examples.png - } - - \endfloat - Qt supports native drag and drop on all platforms via an extensible - MIME-based system that enables applications to send data to each other in the - most appropriate formats. - - Drag and drop can also be implemented for internal use by applications. - - \clearfloat - \section1 \l{Threading and Concurrent Programming Examples}{Threading and Concurrent Programming} - \beginfloatleft - \l{Threading and Concurrent Programming Examples}{\inlineimage thread-examples.png - } - - \endfloat - Qt 4 makes it easier than ever to write multithreaded applications. More - classes have been made usable from non-GUI threads, and the signals and slots - mechanism can now be used to communicate between threads. - - The QtConcurrent namespace includes a collection of classes and functions - for straightforward concurrent programming. - - \clearfloat - \section1 \l{Tools Examples}{Tools} - \beginfloatleft - \l{Tools Examples}{\inlineimage tool-examples.png - } - - \endfloat - Qt is equipped with a range of capable tool classes, from containers and - iterators to classes for string handling and manipulation. - - Other classes provide application infrastructure support, handling plugin - loading and managing configuration files. - - \clearfloat - \section1 \l{Network Examples}{Network} - \beginfloatleft - \l{Network Examples}{\inlineimage network-examples.png - } - - \endfloat - Qt is provided with an extensive set of network classes to support both - client-based and server side network programming. - - \clearfloat - \section1 \l{Inter-Process Communication Examples}{Inter-Process Communication} - \beginfloatleft - \l{Inter-Process Communication Examples}{\inlineimage ipc-examples.png - } - - \endfloat - Simple, lightweight inter-process communication can be performed using shared - memory and local sockets. - - \clearfloat - \section1 \l{OpenGL Examples}{OpenGL} and \l{OpenVG Examples}{OpenVG} Examples - \beginfloatleft - \l{OpenGL Examples}{\inlineimage opengl-examples.png - } - - \endfloat - Qt provides support for integration with OpenGL implementations on all - platforms, giving developers the opportunity to display hardware accelerated - 3D graphics alongside a more conventional user interface. - - Qt provides support for integration with OpenVG implementations on - platforms with suitable drivers. - - \clearfloat - \section1 \l{Multimedia Examples}{Multimedia Framework} - \beginfloatleft - \l{Multimedia Examples}{\inlineimage phonon-examples.png - } - - \endfloat - Qt provides low-level audio support on linux,windows and mac platforms by default and - an audio plugin API to allow developers to implement there own audio support for - custom devices and platforms. - - The Phonon Multimedia Framework brings multimedia support to Qt applications. - - \clearfloat - \section1 \l{SQL Examples}{SQL} - \beginfloatleft - \l{SQL Examples}{\inlineimage sql-examples.png - } - - \endfloat - Qt provides extensive database interoperability, with support for products - from both open source and proprietary vendors. - - SQL support is integrated with Qt's model/view architecture, making it easier - to provide GUI integration for your database applications. - - \clearfloat - \section1 \l{XML Examples}{XML} - \beginfloatleft - \l{XML Examples}{\inlineimage xml-examples.png - } - - \endfloat - XML parsing and handling is supported through SAX and DOM compliant APIs - as well as streaming classes. - - The XQuery/XPath and XML Schema engines in the QtXmlPatterns modules - provide classes for querying XML files and custom data models. - - \clearfloat - \section1 \l{Qt Designer Examples}{Qt Designer} - \beginfloatleft - \l{Qt Designer Examples}{\inlineimage designer-examples.png - } - - \endfloat - Qt Designer is a capable graphical user interface designer that lets you - create and configure forms without writing code. GUIs created with - Qt Designer can be compiled into an application or created at run-time. - - \clearfloat - \section1 \l{UiTools Examples}{UiTools} - \beginfloatleft - \l{UiTools Examples}{\inlineimage uitools-examples.png - } - - \endfloat - User interfaces created with Qt Designer can be loaded and displayed at - run-time using the facilities of the QtUiTools module without the need - to generate code in advance. - - \clearfloat - \section1 \l{Qt Linguist Examples}{Qt Linguist} - \beginfloatleft - \l{Qt Linguist Examples}{\inlineimage linguist-examples.png - } - - \endfloat - Internationalization is a core feature of Qt. - - \clearfloat - \section1 \l{Qt Script Examples}{Qt Script} - \beginfloatleft - \l{Qt Script Examples}{\inlineimage qtscript-examples.png - } - - \endfloat - Qt is provided with a powerful embedded scripting environment through the QtScript - classes. - - \clearfloat - \section1 \l{WebKit Examples}{WebKit} - \beginfloatleft - \l{WebKit Examples}{\inlineimage webkit-examples.png - } - - \endfloat - Qt provides an integrated Web browser component based on WebKit, the popular - open source browser engine. - - \clearfloat - \section1 \l{Help System Examples}{Help System} - \beginfloatleft - \l{Help System Examples}{\inlineimage assistant-examples.png - } - - \endfloat - Support for interactive help is provided by the Qt Assistant application. - Developers can take advantages of the facilities it offers to display - specially-prepared documentation to users of their applications. - - \clearfloat - \section1 \l{State Machine Examples}{State Machine} - \beginfloatleft - \l{State Machine Examples}{\inlineimage statemachine-examples.png - } - - \endfloat - Qt provides a powerful hierarchical finite state machine through the Qt State - Machine classes. - - \clearfloat - \section1 \l{Animation Framework Examples}{Animation Framework} - \beginfloatleft - \l{Animation Framework Examples}{\inlineimage animation-examples.png - } - - \endfloat - These examples show to to use the \l{The Animation Framework}{animation framework} - to build highly animated, high-performance GUIs. - - \clearfloat - \section1 \l{Multi-Touch Examples}{Multi-Touch Framework} - \beginfloatleft - \l{Multi-Touch Examples}{\inlineimage multitouch-examples.png - } - - \endfloat - Support for multi-touch input makes it possible for developers to create - extensible and intuitive user interfaces. - - \clearfloat - \section1 \l{Gestures Examples}{Gestures} - \beginfloatleft - \l{Gestures Examples}{\inlineimage gestures-examples.png - } - - \endfloat - Applications can be written to respond to gestures as a natural input method. - These examples show how to enable support for standard and custom gestures in - applications. - - \clearfloat - \section1 \l{D-Bus Examples}{D-Bus} - \beginfloatleft - \l{D-Bus Examples}{\inlineimage dbus-examples.png - } - - \endfloat - Systems with limited resources, specialized hardware, and small - screens require special attention. - - \clearfloat - \section1 \l{Qt for Embedded Linux Examples}{Qt for Embedded Linux} - \beginfloatleft - \l{Qt for Embedded Linux Examples}{\inlineimage qt-embedded-examples.png - } - - \endfloat - D-Bus is an inter-process communication protocol for Unix/Linux systems. - These examples demonstrate how to write application that communicate with - each other. - - \clearfloat - \section1 \l{ActiveQt Examples}{ActiveQt} - \beginfloatleft - \l{ActiveQt Examples}{\inlineimage activeqt-examples.png - } - - \endfloat - These examples demonstrate how to write ActiveX controls and control servers - with Qt, and how to use ActiveX controls and COM objects in a Qt application. - - \clearfloat - \section1 \l{Qt Quarterly}{Qt Quarterly} - \beginfloatleft - \l{Qt Quarterly}{\inlineimage qq-thumbnail.png - } - - \endfloat - One more valuable source for examples and explanations of Qt - features is the archive of \l{Qt Quarterly}, a newsletter for - Qt developers. - - \clearfloat -*/ - -/*! \page examples-widgets.html - \title Widgets Examples + \title Widget Examples \ingroup all-examples \brief Lots of examples of how to use different kinds of widgets. - \contentspage Qt Examples - \nextpage Dialog Examples - \image widget-examples.png Qt comes with a large range of standard widgets that users of modern @@ -541,10 +129,6 @@ \title Dialog Examples \brief Using Qt's standard dialogs and building and using custom dialogs. - \previouspage Widgets Examples - \contentspage Qt Examples - \nextpage Main Window Examples - \image dialog-examples.png Qt includes standard dialogs for many common operations, such as file @@ -573,10 +157,6 @@ \title Main Window Examples \brief Building applications around a main window. - \previouspage Dialog Examples - \contentspage Qt Examples - \nextpage Layout Examples - \image mainwindow-examples.png All the standard features of application main windows are provided by Qt. @@ -601,11 +181,7 @@ \page examples-layouts.html \ingroup all-examples \title Layout Examples - Using Qt's layout-based approach to widget management. - - \previouspage Main Window Examples - \contentspage Qt Examples - \nextpage Item Views Examples + \brief Using Qt's layout-based approach to widget management. \image layout-examples.png @@ -632,10 +208,6 @@ \title Item Views Examples \brief Using the model/view design pattern to separate presentation from data. - \previouspage Layout Examples - \contentspage Qt Examples - \nextpage Graphics View Examples - \image itemview-examples.png Item views are widgets that typically display data sets. Qt 4's model/view @@ -672,10 +244,6 @@ \title Graphics View Examples \brief Using Qt to manage and interact with a large (potentially) number of graphics items. - \previouspage Item Views Examples - \contentspage Qt Examples - \nextpage QML Examples and Demos - \image graphicsview-examples.png Qt is provided with a comprehensive canvas through the GraphicsView @@ -718,10 +286,7 @@ \page examples-painting.html \ingroup all-examples \title Painting Examples - - \previouspage QML Examples and Demos - \contentspage Qt Examples - \nextpage Rich Text Examples + \brief How to use the Qt painting system \image painting-examples.png @@ -751,10 +316,7 @@ \page examples-richtext.html \ingroup all-examples \title Rich Text Examples - - \previouspage Painting Examples - \contentspage Qt Examples - \nextpage Desktop Examples + \brief Using the document-oriented rich text engine \image richtext-examples.png @@ -775,10 +337,7 @@ \page examples-desktop.html \ingroup all-examples \title Desktop Examples - - \previouspage Rich Text Examples - \contentspage Qt Examples - \nextpage Drag and Drop Examples + \brief Integrating your Qt application with your favorite desktop \image desktop-examples.png @@ -798,11 +357,8 @@ /*! \page examples-draganddrop.html \ingroup all-examples - \title Drag and Drop Examples - - \previouspage Desktop Examples - \contentspage Qt Examples - \nextpage Threading and Concurrent Programming Examples + \title Drag & Drop Examples + \brief How to access your platform's native darg & drop functionality \image draganddrop-examples.png @@ -828,10 +384,7 @@ \page examples-threadandconcurrent.html \ingroup all-examples \title Threading and Concurrent Programming Examples - - \previouspage Drag and Drop Examples - \contentspage Qt Examples - \nextpage Tools Examples + \brief Threading and concurrent programming in Qt \image thread-examples.png @@ -869,10 +422,7 @@ \page examples.tools.html \ingroup all-examples \title Tools Examples - - \previouspage Threading and Concurrent Programming Examples - \contentspage Qt Examples - \nextpage Network Examples + \brief Using Qt's containers, iterators, and other tool classes \image tool-examples.png @@ -908,10 +458,7 @@ \page examples-network.html \ingroup all-examples \title Network Examples - - \previouspage Tools Examples - \contentspage Qt Examples - \nextpage Inter-Process Communication Examples + \brief How to do network programming in Qt \image network-examples.png @@ -946,11 +493,8 @@ /*! \page examples-ipc.html \ingroup all-examples - \title Inter-Process Communication Examples - - \previouspage Network Examples - \contentspage Qt Examples - \nextpage OpenGL Examples + \title IPC Examples + \brief Inter-Process Communication with Qt \image ipc-examples.png @@ -965,10 +509,7 @@ \page examples-opengl.html \ingroup all-examples \title OpenGL Examples - - \previouspage Inter-Process Communication Examples - \contentspage Qt Examples - \nextpage OpenVG Examples + \brief Accessing OpenGL from Qt \image opengl-examples.png @@ -1000,10 +541,7 @@ \page examples-openvg.html \ingroup all-examples \title OpenVG Examples - - \previouspage OpenGL Examples - \contentspage Qt Examples - \nextpage Multimedia Examples + \brief Accessing OpenVG from Qt \image openvg-examples.png @@ -1022,10 +560,7 @@ \page examples-multimedia.html \ingroup all-examples \title Multimedia Examples - - \previouspage OpenGL Examples - \contentspage Qt Examples - \nextpage SQL Examples + \brief Accessing audio support from Qt \image phonon-examples.png @@ -1072,10 +607,7 @@ \page examples-sql.html \ingroup all-examples \title SQL Examples - - \previouspage Multimedia Examples - \contentspage Qt Examples - \nextpage XML Examples + \brief Accessing your SQL database from Qt \image sql-examples.png @@ -1102,10 +634,7 @@ \page examples-xml.html \ingroup all-examples \title XML Examples - - \previouspage SQL Examples - \contentspage Qt Examples - \nextpage Qt Designer Examples + \brief Using XML with Qt \image xml-examples.png XML @@ -1139,10 +668,7 @@ \page examples-designer.html \ingroup all-examples \title Qt Designer Examples - - \previouspage XML Examples - \contentspage Qt Examples - \nextpage UiTools Examples + \brief Using Qt Designer to build your UI \image designer-examples.png QtDesigner @@ -1165,10 +691,7 @@ \page examples-uitools.html \ingroup all-examples \title UiTools Examples - - \previouspage Qt Designer Examples - \contentspage Qt Examples - \nextpage Qt Linguist Examples + \brief Using the QtUiTools module \image uitools-examples.png UiTools @@ -1182,10 +705,7 @@ \page examples-linguist.html \ingroup all-examples \title Qt Linguist Examples - - \previouspage UiTools Examples - \contentspage Qt Examples - \nextpage Qt Script Examples + \brief Using Qt Linguist to internationalize your Qt application \image linguist-examples.png @@ -1203,10 +723,7 @@ \page examples-script.html \ingroup all-examples \title Qt Script Examples - - \previouspage Qt Linguist Examples - \contentspage Qt Examples - \nextpage WebKit Examples + \brief Using the Qt scripting environment \image qtscript-examples.png QtScript @@ -1233,10 +750,7 @@ \page examples-webkit.html \ingroup all-examples \title WebKit Examples - - \previouspage Qt Script Examples - \contentspage Qt Examples - \nextpage Help System Examples + \brief Using WebKit in your Qt application \image webkit-examples.png WebKit @@ -1275,10 +789,7 @@ \page examples-helpsystem.html \ingroup all-examples \title Help System Examples - - \previouspage WebKit Examples - \contentspage Qt Examples - \nextpage State Machine Examples + \brief Adding interactive help to your Qt application \image assistant-examples.png HelpSystem @@ -1299,10 +810,7 @@ \page examples-statemachine.html \ingroup all-examples \title State Machine Examples - - \previouspage Help System Examples - \contentspage Qt Examples - \nextpage Animation Framework Examples + \brief Using Qt's finite state machine classes \image statemachine-examples.png StateMachine @@ -1326,10 +834,7 @@ \page examples-animation.html \ingroup all-examples \title Animation Framework Examples - - \previouspage State Machine Examples - \contentspage Qt Examples - \nextpage Multi-Touch Examples + \brief Doing animations with Qt \image animation-examples.png Animation @@ -1349,10 +854,7 @@ \page examples-multitouch.html \ingroup all-examples \title Multi-Touch Examples - - \previouspage Animation Framework Examples - \contentspage Qt Examples - \nextpage Gestures Examples + \brief Using Qt's multi-touch input capability Support for multi-touch input makes it possible for developers to create extensible and intuitive user interfaces. @@ -1369,10 +871,7 @@ \page examples-gestures.html \ingroup all-examples \title Gestures Examples - - \previouspage Multi-Touch Examples - \contentspage Qt Examples - \nextpage D-Bus Examples + \brief Gesture programming examples The API of the gesture framework is not yet finalized and still subject to change. @@ -1386,10 +885,7 @@ \page examples-dbus.html \ingroup all-examples \title D-Bus Examples - - \previouspage Gestures Examples - \contentspage Qt Examples - \nextpage Qt for Embedded Linux Examples + \brief Using D-Bus from Qt applications \list \o \l{dbus/dbus-chat}{Chat} @@ -1406,10 +902,7 @@ \page examples-embeddedlinux.html \ingroup all-examples \title Qt for Embedded Linux Examples - - \previouspage D-Bus Examples - \contentspage Qt Examples - \nextpage ActiveQt Examples + \brief Using Qt in Embedded Linux \image qt-embedded-examples.png QtEmbedded @@ -1429,10 +922,7 @@ \page examples-activeqt.html \ingroup all-examples \title ActiveQt Examples - - \previouspage Qt for Embedded Linux Examples - \contentspage Qt Examples - \nextpage Qt Quarterly + \brief Using ActiveX from Qt applications \image activeqt-examples.png ActiveQt diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index cf8ea7c..42db4e8 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -434,6 +434,9 @@ void HtmlGenerator::startText(const Node * /* relative */, sectionNumber.clear(); } +/*! + Generate html from an instance of Atom. + */ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMarker *marker) @@ -1217,6 +1220,9 @@ int HtmlGenerator::generateAtom(const Atom *atom, return skipAhead; } +/*! + Generate a reference page for a C++ class. + */ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, CodeMarker *marker) { @@ -1466,6 +1472,10 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, appendDcfSubSection(&dcfClassesRoot, classSection); } +/*! + Generate the html page for a qdoc file that doesn't map + to an underlying c++ file. + */ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) { SubTitleSize subTitleSize = LargeSubTitle; @@ -1682,6 +1692,9 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) } } +/*! + Returns "html" for this subclass of Generator. + */ QString HtmlGenerator::fileExtension(const Node * /* node */) const { return "html"; @@ -1735,10 +1748,10 @@ void HtmlGenerator::generateBreadCrumbs(const QString& title, } else if (node->subType() == Node::Page) { if (fn->name() == QString("examples.html")) { - out() << "
  • All Examples
  • "; + out() << "
  • Examples
  • "; } else if (fn->name().startsWith("examples-")) { - out() << "
  • All Examples
  • "; + out() << "
  • Examples
  • "; out() << "
  • name() << "\">" << title << "
  • "; } @@ -1756,7 +1769,7 @@ void HtmlGenerator::generateBreadCrumbs(const QString& title, << ""; } else if (node->subType() == Node::Example) { - out() << "
  • All Examples
  • "; + out() << "
  • Examples
  • "; QStringList sl = fn->name().split('/'); QString name = "examples-" + sl.at(0) + ".html"; QString t = CodeParser::titleFromName(name); @@ -2332,7 +2345,6 @@ void HtmlGenerator::generateCompactList(const Node *relative, QString commonPrefix) { const int NumParagraphs = 37; // '0' to '9', 'A' to 'Z', '_' - const int NumColumns = 1; // number of columns in the result if (classMap.isEmpty()) return; @@ -2415,18 +2427,18 @@ void HtmlGenerator::generateCompactList(const Node *relative, else key = pieces.last().toLower(); - int paragraphNo = NumParagraphs - 1; + int paragraphNr = NumParagraphs - 1; if (key[0].digitValue() != -1) { - paragraphNo = key[0].digitValue(); + paragraphNr = key[0].digitValue(); } else if (key[0] >= QLatin1Char('a') && key[0] <= QLatin1Char('z')) { - paragraphNo = 10 + key[0].unicode() - 'a'; + paragraphNr = 10 + key[0].unicode() - 'a'; } - paragraphName[paragraphNo] = key[0].toUpper(); + paragraphName[paragraphNr] = key[0].toUpper(); usedParagraphNames.insert(key[0].toLower().cell()); - paragraph[paragraphNo].insert(key, c.value()); + paragraph[paragraphNr].insert(key, c.value()); ++c; } @@ -2439,36 +2451,16 @@ void HtmlGenerator::generateCompactList(const Node *relative, start at offsets 0, 3, 4, 8, 9, 14, 23. */ int paragraphOffset[NumParagraphs + 1]; // 37 + 1 - int i, j, k; - paragraphOffset[0] = 0; - for (j = 0; j < NumParagraphs; j++) // j = 0..36 - paragraphOffset[j + 1] = paragraphOffset[j] + paragraph[j].count(); - - int firstOffset[NumColumns + 1]; - int currentOffset[NumColumns]; - int currentParagraphNo[NumColumns]; - int currentOffsetInParagraph[NumColumns]; + for (int i=0; i firstOffset[i]) - break; - if (paragraphOffset[j] <= firstOffset[i]) - curParagNo = j; - } - currentParagraphNo[i] = curParagNo; - currentOffsetInParagraph[i] = firstOffset[i] - - paragraphOffset[curParagNo]; - } - firstOffset[NumColumns] = classMap.count(); + int curParNr = 0; + int curParOffset = 0; + /* + Output the alphabet as a row of links. + */ if (includeAlphabet) { out() << "

    "; for (int i = 0; i < 26; i++) { @@ -2479,80 +2471,73 @@ void HtmlGenerator::generateCompactList(const Node *relative, out() << "

    \n"; } + /* + Output a
    element to contain all the
    elements. + */ out() << "
    \n"; - for (k = 0; k < numRows; k++) { - if (++numTableRows % 2 == 1) - out() << "
    "; - else - out() << "
    "; - //break; - -// out() << "\n"; - for (i = 0; i < NumColumns; i++) { - if (currentOffset[i] >= firstOffset[i + 1]) { - // this column is finished - out() << "
    \n
    \n"; // check why? + + for (int i=0; i. + */ + if (curParOffset == 0) { + if (i > 0) + out() << "
    \n"; + if (++numTableRows % 2 == 1) + out() << "
    "; + else + out() << "
    "; + out() << "

    "; + if (includeAlphabet) { + QChar c = paragraphName[curParNr][0].toLower(); + out() << QString("").arg(c); } - else { - while ((currentParagraphNo[i] < NumParagraphs) && - (currentOffsetInParagraph[i] == paragraph[currentParagraphNo[i]].count())) { - ++currentParagraphNo[i]; - currentOffsetInParagraph[i] = 0; - } -#if 0 - if (currentParagraphNo[i] >= NumParagraphs) { - qDebug() << "### Internal error ###" << __FILE__ << __LINE__ - << currentParagraphNo[i] << NumParagraphs; - currentParagraphNo[i] = NumParagraphs - 1; - } -#endif - out() << "

    "; - if (currentOffsetInParagraph[i] == 0) { - // start a new paragraph - if (includeAlphabet) { - QChar c = paragraphName[currentParagraphNo[i]][0].toLower(); - out() << QString("").arg(c); - } - out() << "" - << paragraphName[currentParagraphNo[i]] - << ""; - } - out() << "

    \n"; - - out() << "

    "; - if ((currentParagraphNo[i] < NumParagraphs) && - !paragraphName[currentParagraphNo[i]].isEmpty()) { - NodeMap::Iterator it; - it = paragraph[currentParagraphNo[i]].begin(); - for (j = 0; j < currentOffsetInParagraph[i]; j++) - ++it; - - // Previously, we used generateFullName() for this, but we - // require some special formatting. - out() << ""; - QStringList pieces; - if (it.value()->subType() == Node::QmlClass) - pieces << it.value()->name(); - else - pieces = fullName(it.value(), relative, marker).split("::"); - out() << protectEnc(pieces.last()); - out() << ""; - if (pieces.size() > 1) { - out() << " ("; - generateFullName(it.value()->parent(), relative, marker); - out() << ")"; - } - } - out() << "

    \n"; + out() << "" + << paragraphName[curParNr] + << ""; + out() << "

    \n"; + } - currentOffset[i]++; - currentOffsetInParagraph[i]++; + /* + Output a
    for the current offset in the current paragraph. + */ + out() << "

    "; + if ((curParNr < NumParagraphs) && + !paragraphName[curParNr].isEmpty()) { + NodeMap::Iterator it; + it = paragraph[curParNr].begin(); + for (int i=0; i"; + + QStringList pieces; + if (it.value()->subType() == Node::QmlClass) + pieces << it.value()->name(); + else + pieces = fullName(it.value(), relative, marker).split("::"); + out() << protectEnc(pieces.last()); + out() << ""; + if (pieces.size() > 1) { + out() << " ("; + generateFullName(it.value()->parent(), relative, marker); + out() << ")"; } } - out() << "

    \n"; + out() << "

    \n"; + curParOffset++; } + out() << "
    \n"; out() << "
    \n"; } -- cgit v0.12 From b5702253a08e315b4db5620a1d4b0ffd4c8e0d0f Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Tue, 25 May 2010 12:26:21 +0200 Subject: Doc: Correcting style to class lists --- doc/src/template/style/style.css | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css index ebc1607..c155d9b 100755 --- a/doc/src/template/style/style.css +++ b/doc/src/template/style/style.css @@ -989,6 +989,7 @@ border-width: 1px; border-style: solid; border-color: #E6E6E6; + width:100%; } .centerAlign @@ -1141,11 +1142,24 @@ /* end of screen media */ .flowList{ -display:inline-block; -width:260px; +vertical-align:top; } +.alphaChar{ +width:100%; +background-color:#F6F6F6; +border:1px solid #E6E6E6; +font-size:12pt; +padding-left:10px; +margin-top:10px; +margin-bottom:10px; +} + .flowList dl{ -padding:0px; +} +.flowList dd{ +display:inline-block; +margin-left:10px; +width:250px; } .wrap .content .flowList p{ padding:0px; -- cgit v0.12 From e3e814ece7a387b85dfe2f8becdfd444e2613f5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Tue, 25 May 2010 13:54:48 +0200 Subject: Updating 4.7.0 change log. --- dist/changes-4.7.0 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dist/changes-4.7.0 b/dist/changes-4.7.0 index 31130e8..e7b1e84 100644 --- a/dist/changes-4.7.0 +++ b/dist/changes-4.7.0 @@ -88,6 +88,9 @@ QtGui - QGraphicsItem * [QTBUG-8112] itemChange() is now called when transformation properties change (setRotation, setScale, setTransformOriginPoint). + * [QTBUG-9024] Improved performance when calling update() on items that + are clipped by an ancestor (QGraphicsItem::ItemClipsChildrenToShape). + * [QTBUG-7703], [QTBUG-8378] Fixed scrolling issues - QGraphicsTextItem * [QTBUG-7333] Fixed keyboard shortcuts not being triggered when the @@ -96,6 +99,7 @@ QtGui - QGraphicsView * [QTBUG-7438] Fixed viewport cursor getting reset when releasing the mouse. + * [QTBUG-10338] Fixed drawing artifacts due to rounding errors. - QImage * [QTBUG-9640] Prevented unneccessary copy in QImage::setAlphaChannel(). -- cgit v0.12 From 830067a683e9264bf075757fc2476e1e038ef7b3 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Tue, 25 May 2010 15:38:58 +0200 Subject: Doc: Fixing bugs in HTML generator --- tools/qdoc3/htmlgenerator.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 42db4e8..16df0c0 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -2493,7 +2493,7 @@ void HtmlGenerator::generateCompactList(const Node *relative, out() << "
    "; else out() << "
    "; - out() << "

    "; + out() << "

    "; if (includeAlphabet) { QChar c = paragraphName[curParNr][0].toLower(); out() << QString("").arg(c); @@ -2501,13 +2501,13 @@ void HtmlGenerator::generateCompactList(const Node *relative, out() << "" << paragraphName[curParNr] << ""; - out() << "

    \n"; + out() << "\n"; } /* Output a
    for the current offset in the current paragraph. */ - out() << "

    "; + out() << "

    "; if ((curParNr < NumParagraphs) && !paragraphName[curParNr].isEmpty()) { NodeMap::Iterator it; @@ -2534,7 +2534,7 @@ void HtmlGenerator::generateCompactList(const Node *relative, out() << ")"; } } - out() << "

    \n"; + out() << "\n"; curParOffset++; } out() << "
    \n"; -- cgit v0.12 From 245892ac07dd4f104601f4c3502094f54fc9c06e Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 25 May 2010 17:14:03 +0200 Subject: Remove unused function in QDBusConnectionPrivate --- src/dbus/qdbusconnection.cpp | 8 -------- src/dbus/qdbusconnection_p.h | 1 - 2 files changed, 9 deletions(-) diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp index abb3224..4382032 100644 --- a/src/dbus/qdbusconnection.cpp +++ b/src/dbus/qdbusconnection.cpp @@ -1003,14 +1003,6 @@ void QDBusConnectionPrivate::setSender(const QDBusConnectionPrivate *s) /*! \internal */ -void QDBusConnectionPrivate::setConnection(const QString &name, QDBusConnectionPrivate *c) -{ - _q_manager()->setConnection(name, c); -} - -/*! - \internal -*/ void QDBusConnectionPrivate::setBusService(const QDBusConnection &connection) { busService = new QDBusConnectionInterface(connection, this); diff --git a/src/dbus/qdbusconnection_p.h b/src/dbus/qdbusconnection_p.h index 34bb6b3..81af2c7 100644 --- a/src/dbus/qdbusconnection_p.h +++ b/src/dbus/qdbusconnection_p.h @@ -309,7 +309,6 @@ public: static QDBusConnection q(QDBusConnectionPrivate *connection) { return QDBusConnection(connection); } static void setSender(const QDBusConnectionPrivate *s); - static void setConnection(const QString &name, QDBusConnectionPrivate *c); friend class QDBusActivateObjectEvent; friend class QDBusCallDeliveryEvent; -- cgit v0.12 From ce05a9a2a4480344e6939f3c63620715c950f903 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Tue, 25 May 2010 12:55:00 +0200 Subject: Fix for Norwegian and Korean languages on symbian. Last commits added Norwegian Nynorsk and Korean locales support, however the array that contains the mapping between symbian locale constant and locale string should be sorted to work. Task-number: QT-3368 Task-number: QT-3370 Reviewed-by: trustme --- src/corelib/tools/qlocale.cpp | 1 + src/corelib/tools/qlocale_symbian.cpp | 121 +++++++++++++++++----------------- 2 files changed, 62 insertions(+), 60 deletions(-) diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 519ff3d..c000dc8 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -754,6 +754,7 @@ struct WindowsToISOListElt { char iso_name[6]; }; +/* NOTE: This array should be sorted by the first column! */ static const WindowsToISOListElt windows_to_iso_list[] = { { 0x0401, "ar_SA" }, { 0x0402, "bg\0 " }, diff --git a/src/corelib/tools/qlocale_symbian.cpp b/src/corelib/tools/qlocale_symbian.cpp index b6afa12..1e674af 100644 --- a/src/corelib/tools/qlocale_symbian.cpp +++ b/src/corelib/tools/qlocale_symbian.cpp @@ -93,72 +93,73 @@ struct symbianToISO { /* - Mapping from Symbian to ISO locale + Mapping from Symbian to ISO locale. + NOTE: This array should be sorted by the first column! */ static const symbianToISO symbian_to_iso_list[] = { - { ELangEnglish, "en_GB" }, - { ELangFrench, "fr_FR" }, - { ELangGerman, "de_DE" }, - { ELangSpanish, "es_ES" }, - { ELangItalian, "it_IT" }, - { ELangSwedish, "sv_SE" }, - { ELangDanish, "da_DK" }, - { ELangNorwegian, "no_NO" }, - { ELangNorwegianNynorsk, "nn_NO" }, - { ELangFinnish, "fi_FI" }, - { ELangAmerican, "en_US" }, - { ELangPortuguese, "pt_PT" }, - { ELangTurkish, "tr_TR" }, - { ELangIcelandic, "is_IS" }, - { ELangRussian, "ru_RU" }, - { ELangHungarian, "hu_HU" }, - { ELangDutch, "nl_NL" }, - { ELangBelgianFlemish, "nl_BE" }, - { ELangCzech, "cs_CZ" }, - { ELangSlovak, "sk_SK" }, - { ELangPolish, "pl_PL" }, - { ELangSlovenian, "sl_SI" }, - { ELangTaiwanChinese, "zh_TW" }, - { ELangHongKongChinese, "zh_HK" }, - { ELangPrcChinese, "zh_CN" }, - { ELangJapanese, "ja_JP" }, - { ELangThai, "th_TH" }, - { ELangArabic, "ar_AE" }, - { ELangTagalog, "tl_PH" }, - { ELangBulgarian, "bg_BG" }, - { ELangCatalan, "ca_ES" }, - { ELangCroatian, "hr_HR" }, - { ELangEstonian, "et_EE" }, - { ELangFarsi, "fa_IR" }, - { ELangCanadianFrench, "fr_CA" }, - { ELangGreek, "el_GR" }, - { ELangHebrew, "he_IL" }, - { ELangHindi, "hi_IN" }, - { ELangIndonesian, "id_ID" }, - { ELangLatvian, "lv_LV" }, - { ELangLithuanian, "lt_LT" }, - { ELangMalay, "ms_MY" }, - { ELangBrazilianPortuguese, "pt_BR" }, - { ELangRomanian, "ro_RO" }, - { ELangSerbian, "sr_RS" }, - { ELangLatinAmericanSpanish,"es_419" }, - { ELangUkrainian, "uk_UA" }, - { ELangUrdu, "ur_PK" }, // India/Pakistan - { ELangVietnamese, "vi_VN" }, - { ELangKorean, "ko_KO" }, + { ELangEnglish, "en_GB" }, // 1 + { ELangFrench, "fr_FR" }, // 2 + { ELangGerman, "de_DE" }, // 3 + { ELangSpanish, "es_ES" }, // 4 + { ELangItalian, "it_IT" }, // 5 + { ELangSwedish, "sv_SE" }, // 6 + { ELangDanish, "da_DK" }, // 7 + { ELangNorwegian, "no_NO" }, // 8 + { ELangFinnish, "fi_FI" }, // 9 + { ELangAmerican, "en_US" }, // 10 + { ELangPortuguese, "pt_PT" }, // 13 + { ELangTurkish, "tr_TR" }, // 14 + { ELangIcelandic, "is_IS" }, // 15 + { ELangRussian, "ru_RU" }, // 16 + { ELangHungarian, "hu_HU" }, // 17 + { ELangDutch, "nl_NL" }, // 18 + { ELangBelgianFlemish, "nl_BE" }, // 19 + { ELangCzech, "cs_CZ" }, // 25 + { ELangSlovak, "sk_SK" }, // 26 + { ELangPolish, "pl_PL" }, // 27 + { ELangSlovenian, "sl_SI" }, // 28 + { ELangTaiwanChinese, "zh_TW" }, // 29 + { ELangHongKongChinese, "zh_HK" }, // 30 + { ELangPrcChinese, "zh_CN" }, // 31 + { ELangJapanese, "ja_JP" }, // 32 + { ELangThai, "th_TH" }, // 33 + { ELangArabic, "ar_AE" }, // 37 + { ELangTagalog, "tl_PH" }, // 39 + { ELangBulgarian, "bg_BG" }, // 42 + { ELangCatalan, "ca_ES" }, // 44 + { ELangCroatian, "hr_HR" }, // 45 + { ELangEstonian, "et_EE" }, // 49 + { ELangFarsi, "fa_IR" }, // 50 + { ELangCanadianFrench, "fr_CA" }, // 51 + { ELangGreek, "el_GR" }, // 54 + { ELangHebrew, "he_IL" }, // 57 + { ELangHindi, "hi_IN" }, // 58 + { ELangIndonesian, "id_ID" }, // 59 + { ELangKorean, "ko_KO" }, // 65 + { ELangLatvian, "lv_LV" }, // 67 + { ELangLithuanian, "lt_LT" }, // 68 + { ELangMalay, "ms_MY" }, // 70 + { ELangNorwegianNynorsk, "nn_NO" }, // 75 + { ELangBrazilianPortuguese, "pt_BR" }, // 76 + { ELangRomanian, "ro_RO" }, // 78 + { ELangSerbian, "sr_RS" }, // 79 + { ELangLatinAmericanSpanish,"es_419" }, // 83 + { ELangUkrainian, "uk_UA" }, // 93 + { ELangUrdu, "ur_PK" }, // 94 - India/Pakistan + { ELangVietnamese, "vi_VN" }, // 96 #ifdef __E32LANG_H__ // 5.0 - { ELangBasque, "eu_ES" }, - { ELangGalician, "gl_ES" }, + { ELangBasque, "eu_ES" }, // 102 + { ELangGalician, "gl_ES" }, // 103 #endif #if !defined(__SERIES60_31__) - { ELangEnglish_Apac, "en" }, - { ELangEnglish_Taiwan, "en_TW" }, - { ELangEnglish_HongKong, "en_HK" }, - { ELangEnglish_Prc, "en_CN" }, - { ELangEnglish_Japan, "en_JP"}, - { ELangEnglish_Thailand, "en_TH" }, - { ELangMalay_Apac, "ms" } + { ELangEnglish_Apac, "en" }, // 129 + { ELangEnglish_Taiwan, "en_TW" }, // 157 ### Not supported by CLDR + { ELangEnglish_HongKong, "en_HK" }, // 158 + { 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 #endif }; -- cgit v0.12 From 132933df69b355695dd9401d81b7bc2ac5f5684f Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Tue, 25 May 2010 17:14:09 +0200 Subject: Fixed a typo in variable name in qlocale data generator. Reviewed-by: trustme --- util/local_database/cldr2qlocalexml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/local_database/cldr2qlocalexml.py b/util/local_database/cldr2qlocalexml.py index 20a7d34..1d9ccda 100755 --- a/util/local_database/cldr2qlocalexml.py +++ b/util/local_database/cldr2qlocalexml.py @@ -123,7 +123,7 @@ def generateLocaleInfo(path): result['language_id'] = language_id result['country_id'] = country_id - numberingSystem = None + numbering_system = None try: numbering_system = findEntry(path, "numbers/defaultNumberingSystem") except: -- cgit v0.12 From a32c96e753c2f5a123e518a92762ec9c9ff3b0b7 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Tue, 25 May 2010 17:27:38 +0200 Subject: Dont crash when assigning the same input context twice. Added a guard check to return if the given input context is the same is we already have. Explicitly mention in the doc that we take ownership of the given input context object. Task-number: QTBUG-10780 Reviewed-by: Thomas Zander --- src/gui/kernel/qapplication.cpp | 10 ++++++---- src/gui/kernel/qwidget.cpp | 4 ++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index b805a72..57c4c99 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -5270,18 +5270,20 @@ bool QApplication::keypadNavigationEnabled() This function replaces the QInputContext instance used by the application with \a inputContext. + Qt takes ownership of the given \a inputContext. + \sa inputContext() */ void QApplication::setInputContext(QInputContext *inputContext) { - Q_D(QApplication); - Q_UNUSED(d);// only static members being used. + if (inputContext == QApplicationPrivate::inputContext) + return; if (!inputContext) { qWarning("QApplication::setInputContext: called with 0 input context"); return; } - delete d->inputContext; - d->inputContext = inputContext; + delete QApplicationPrivate::inputContext; + QApplicationPrivate::inputContext = inputContext; } /*! diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 1c7f6ac..569af42 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -312,6 +312,8 @@ QInputContext *QWidget::inputContext() This function sets the input context \a context on this widget. + Qt takes ownership of the given input \a context. + \sa inputContext() */ void QWidget::setInputContext(QInputContext *context) @@ -320,6 +322,8 @@ void QWidget::setInputContext(QInputContext *context) if (!testAttribute(Qt::WA_InputMethodEnabled)) return; #ifndef QT_NO_IM + if (context == d->ic) + return; if (d->ic) delete d->ic; d->ic = context; -- cgit v0.12 From d0e1e7c1249348eeba128c71681cfa916c9e5ae1 Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Wed, 26 May 2010 09:43:11 +1000 Subject: Fix build when snap functionality is not available. --- src/plugins/bearer/symbian/qnetworksession_impl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.h b/src/plugins/bearer/symbian/qnetworksession_impl.h index 9767293..b045ff1 100644 --- a/src/plugins/bearer/symbian/qnetworksession_impl.h +++ b/src/plugins/bearer/symbian/qnetworksession_impl.h @@ -73,9 +73,9 @@ QT_BEGIN_NAMESPACE class ConnectionProgressNotifier; class SymbianEngine; -class QNetworkSessionPrivateImpl : public QNetworkSessionPrivate, public CActive, +class QNetworkSessionPrivateImpl : public QNetworkSessionPrivate, public CActive #ifdef SNAP_FUNCTIONALITY_AVAILABLE - public MMobilityProtocolResp + , public MMobilityProtocolResp #endif { Q_OBJECT -- cgit v0.12 From 5613693326eaa272d6fab5819072c52b743d7785 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 26 May 2010 10:26:42 +1000 Subject: Don't display unnecessary copyright headers in doc --- doc/src/declarative/extending-tutorial.qdoc | 8 ++++---- doc/src/declarative/globalobject.qdoc | 2 +- examples/declarative/sqllocalstorage/hello.qml | 2 +- examples/declarative/tutorials/extending/chapter1-basics/app.qml | 2 +- examples/declarative/tutorials/extending/chapter2-methods/app.qml | 2 +- .../declarative/tutorials/extending/chapter3-bindings/app.qml | 2 +- .../tutorials/extending/chapter4-customPropertyTypes/app.qml | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) 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 2885dd5..fcd227d 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 -- cgit v0.12 From f777fccd2db2d2dccd32fe42d0a0cd5c65c6347c Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Wed, 26 May 2010 12:09:53 +0200 Subject: Improve gradient docs --- src/declarative/graphicsitems/qdeclarativerectangle.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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 */ -- cgit v0.12 From ccc37850ddedba6f70b02919074097b3a716a243 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 26 May 2010 13:49:44 +0200 Subject: qdoc: Improved the address book tutorial I think this is not the final solution, but I need to decide how to handle \example commands. --- doc/src/getting-started/examples.qdoc | 2 +- doc/src/tutorials/addressbook.qdoc | 235 +++++++++++++++----------------- doc/src/tutorials/widgets-tutorial.qdoc | 2 +- 3 files changed, 112 insertions(+), 127 deletions(-) diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc index a3393dd..643e42b 100644 --- a/doc/src/getting-started/examples.qdoc +++ b/doc/src/getting-started/examples.qdoc @@ -560,7 +560,7 @@ \page examples-multimedia.html \ingroup all-examples \title Multimedia Examples - \brief Accessing audio support from Qt + \brief Audio, video, and Phonon with Qt \image phonon-examples.png diff --git a/doc/src/tutorials/addressbook.qdoc b/doc/src/tutorials/addressbook.qdoc index 04410eb..e5cb448a 100644 --- a/doc/src/tutorials/addressbook.qdoc +++ b/doc/src/tutorials/addressbook.qdoc @@ -42,15 +42,11 @@ /*! \page tutorials-addressbook.html - \startpage {index.html}{Qt Reference Documentation} - \contentspage Tutorials - \nextpage {tutorials/addressbook/part1}{Chapter 1} - \title Address Book Tutorial \brief An introduction to GUI programming, showing how to put together a simple yet fully-functioning application. - This tutorial gives an introduction to GUI programming using the Qt + This tutorial is an introduction to GUI programming with the Qt cross-platform framework. \image addressbook-tutorial-screenshot.png @@ -61,8 +57,8 @@ Some commonly used features are never used in this tutorial. \endomit - In the process, we will learn about some basic technologies provided by Qt, - such as + In this tutorial, you will learn about some of the basic + components of Qt, including: \list \o Widgets and layout managers @@ -71,13 +67,9 @@ \o Input and output devices \endlist - If you are completely new to Qt, please read \l{How to Learn Qt} if you - have not already done so. - - The tutorial's source code is located in Qt's \c examples/tutorials/addressbook - directory. + If you are new to Qt, we recommend reading \l{How to Learn Qt} first. - Tutorial chapters: + Tutorial contents: \list 1 \o \l{tutorials/addressbook/part1}{Designing the User Interface} @@ -89,28 +81,30 @@ \o \l{tutorials/addressbook/part7}{Additional Features} \endlist - Although this little application does not look much like a fully-fledged - modern GUI application, it uses many of the basic techniques that are used - in more complex applications. After you have worked through it, we - recommend checking out the \l{mainwindows/application}{Application} - example, which presents a small GUI application, with menus, toolbars, a - status bar, and so on. + The tutorial source code is located in \c{examples/tutorials/addressbook}. + + Although this little application does not look much like a + fully-fledged modern GUI application, it uses many of the basic + elements that are used in more complex applications. After you + have worked through this tutorial, we recommend reading the + \l{mainwindows/application}{Application} example, which presents a + small GUI application, with menus, toolbars, a status bar, and so + on. */ /*! \page tutorials-addressbook-part1.html - \contentspage {Address Book Tutorial}{Contents} - \nextpage {tutorials/addressbook/part2}{Chapter 2} + \example tutorials/addressbook/part1 - \title Address Book 1 - Designing the User Interface + \title Part 1 - Designing the User Interface - The first part of this tutorial covers the design of the basic graphical - user interface (GUI) we use for the Address Book application. + This first part covers the design of the basic graphical user + interface (GUI) for our address book application. - The first step to creating a GUI program is to design the user interface. - In this chapter, our goal is to set up the labels and input fields needed - to implement a basic address book application. The figure below is a - screenshot of our expected output. + The first step in creating a GUI program is to design the user + interface. Here the our goal is to set up the labels and input + fields to implement a basic address book. The figure below is a + screenshot of the expected output. \image addressbook-tutorial-part1-screenshot.png @@ -169,14 +163,15 @@ \snippet tutorials/addressbook/part1/addressbook.h class definition - The class holds declarations of \c nameLine and \c addressText, the - private instances of QLineEdit and QTextEdit mentioned earlier. - You will see, in the coming chapters, that data stored in \c nameLine and - \c addressText is needed for many of the address book's functions. + The class holds declarations of \c nameLine and \c addressText, + the private instances of QLineEdit and QTextEdit mentioned + earlier. The data stored in \c nameLine and \c addressText will + be needed for many of the address book functions. - We do not need to include declarations of the QLabel objects we will use - because we will not need to reference them once they have been created. - The way Qt tracks the ownership of objects is explained in the next section. + We don't include declarations of the QLabel objects we will use + because we will not need to reference them once they have been + created. The way Qt tracks the ownership of objects is explained + in the next section. The Q_OBJECT macro itself implements some of the more advanced features of Qt. For now, it is useful to think of the Q_OBJECT macro as a shortcut which allows @@ -195,15 +190,14 @@ \snippet tutorials/addressbook/part1/addressbook.cpp constructor and input fields - Within this constructor, we declare and instantiate two local QLabel objects, - \c nameLabel and \c addressLabel, as well as instantiate \c nameLine and - \c addressText. The - \l{QObject::tr()}{tr()} function returns a translated version of the - string, if there is one available; otherwise, it returns the string itself. - Think of this function as an \c{} marker to mark - QString objects for translation. You will notice, in the coming chapters as - well as in the \l{Qt Examples}, that we include it whenever we use a - translatable string. + In this constructor, the QLabel objects \c nameLabel and \c + addressLabel are instantiated, as well as \c nameLine and \c + addressText. The \l{QObject::tr()}{tr()} function returns a + translated version of the string, if there is one + available. Otherwise it returns the string itself. This function + marks its QString parameter as one that should be translated into + other languages. It should be used wherever a translatable string + appears. When programming with Qt, it is useful to know how layouts work. Qt provides three main layout classes: QHBoxLayout, QVBoxLayout @@ -254,14 +248,12 @@ /*! \page tutorials-addressbook-part2.html - \previouspage Address Book 1 - Designing the User Interface - \contentspage {Address Book Tutorial}{Contents} - \nextpage {tutorials/addressbook/part3}{Chapter 3} + \example tutorials/addressbook/part2 - \title Address Book 2 - Adding Addresses + \title Part 2 - Adding Addresses - The next step to creating our basic address book application is to allow - a little bit of user interaction. + The next step in creating the address book is to implement some + user interactions. \image addressbook-tutorial-part2-add-contact.png @@ -283,9 +275,9 @@ However, for an overview of Qt's signals and slots concept, you can refer to the \l{Signals and Slots} document. - Three QPushButton objects: \c addButton, \c submitButton and - \c cancelButton, are now included in our private variable declarations, - along with \c nameLine and \c addressText from the last chapter. + Three QPushButton objects (\c addButton, \c submitButton, and + \c cancelButton) are now included in our private variable declarations, + along with \c nameLine and \c addressText. \snippet tutorials/addressbook/part2/addressbook.h pushbutton declaration @@ -407,20 +399,20 @@ /*! \page tutorials-addressbook-part3.html - \previouspage Address Book 2 - Adding Addresses - \contentspage {Address Book Tutorial}{Contents} - \nextpage {tutorials/addressbook/part4}{Chapter 4} + \example tutorials/addressbook/part3 - \title Address Book 3 - Navigating between Entries + \title Part 3 - Navigating between Entries - The address book application is now half complete. We need to add some - functions to navigate between contacts. But first, we have to decide - what sort of a data structure we would like to use to hold these contacts. + The address book is now about half complete. We should add the + capability to navigate among the contacts, but first we must + decide what sort of a data structure we need for containing these + contacts. - In Chapter 2, we used a QMap of key-value pairs with the contact's name - as the \e key, and the contact's address as the \e value. This works well - for our case. However, in order to navigate and display each entry, a - little bit of enhancement is needed. + In the previous section, we used a QMap of key-value pairs with + the contact's name as the \e key, and the contact's address as the + \e value. This works well for our case. However, in order to + navigate and display each entry, a little bit of enhancement is + needed. We enhance the QMap by making it replicate a data structure similar to a circularly-linked list, where all elements are connected, including the @@ -431,9 +423,9 @@ \section1 Defining the AddressBook Class - In order to add navigation functions to the address book application, we - need to add two more slots to our \c AddressBook class: \c next() and - \c previous(). These are added to our \c addressbook.h file: + To add navigation functions to the address book, we must add two + more slots to the \c AddressBook class: \c next() and \c + previous() to the \c addressbook.h file: \snippet tutorials/addressbook/part3/addressbook.h navigation functions @@ -455,8 +447,7 @@ \snippet tutorials/addressbook/part3/addressbook.cpp connecting navigation signals - The image below is our expected graphical user interface. Notice that it - is getting closer to our final application. + The image below is the expected graphical user interface. \image addressbook-tutorial-part3-screenshot.png @@ -525,27 +516,26 @@ /*! \page tutorials-addressbook-part4.html - \previouspage Address Book 3 - Navigating between Entries - \contentspage {Address Book Tutorial}{Contents} - \nextpage {tutorials/addressbook/part5}{Chapter 5} + \example tutorials/addressbook/part4 - \title Address Book 4 - Editing and Removing Addresses + \title Part 4 - Editing and Removing Addresses - In this chapter, we look at ways to modify the contents of contacts stored - in the address book application. + Now we look at ways to modify the contents of contacts stored in + the address book. \image addressbook-tutorial-screenshot.png - We now have an address book that not only holds contacts in an organized - manner, but also allows navigation. It would be convenient to include - edit and remove functions so that a contact's details can be changed - when needed. However, this requires a little improvement, in the form of - enums. In our previous chapters, we had two modes: \c{AddingMode} and - \c{NavigationMode} - but they were not defined as enums. Instead, we - enabled and disabled the corresponding buttons manually, resulting in - multiple lines of repeated code. + We now have an address book that not only holds contacts in an + organized manner, but also allows navigation. It would be + convenient to include edit and remove functions so that a + contact's details can be changed when needed. However, this + requires a little improvement, in the form of enums. We defined + two modes: \c{AddingMode} and \c{NavigationMode}, but they were + not defined as enum values. Instead, we enabled and disabled the + corresponding buttons manually, resulting in multiple lines of + repeated code. - In this chapter, we define the \c Mode enum with three different values: + Here we define the \c Mode enum with three different values: \list \o \c{NavigationMode}, @@ -579,10 +569,10 @@ \section1 Implementing the AddressBook Class - We now have to implement the mode-changing features of the address book - application. The \c editButton and \c removeButton are instantiated and - disabled by default, as the address book starts up with zero contacts in - memory. + We now implement the mode-changing features of the address + book. The \c editButton and \c removeButton are instantiated and + disabled by default. The address book starts with zero contacts + in memory. \snippet tutorials/addressbook/part4/addressbook.cpp edit and remove buttons @@ -653,33 +643,31 @@ \snippet tutorials/addressbook/part4/addressbook.cpp update interface() part 2 - By performing the task of setting the mode and updating the user interface in - the same function, we avoid the possibility of the user interface getting "out - of sync" with the internal state of the application. -*/ + By setting the mode and updating the user interface in the same + function, we avoid the possibility of the user interface getting + out of sync with the internal state of the application. + */ /*! \page tutorials-addressbook-part5.html - \previouspage Address Book 4 - Editing and Removing Addresses - \contentspage {Address Book Tutorial}{Contents} - \nextpage {tutorials/addressbook/part6}{Chapter 6} + \example tutorials/addressbook/part5 - \title Address Book 5 - Adding a Find Function + \title Part 5 - Adding a Find Function - In this chapter, we look at ways to locate contacts and addresses in - the address book application. + Here we look at ways to locate contacts and addresses in the + address book. \image addressbook-tutorial-part5-screenshot.png - As we keep adding contacts to our address book application, it becomes - tedious to navigate them with the \e Next and \e Previous buttons. In this - case, a \e Find function would be more efficient in looking up contacts. - The screenshot above shows the \e Find button and its position on the panel - of buttons. + As we add contacts to our address book, it becomes tedious to + navigate the list with the \e Next and \e Previous buttons. A \e + Find function would be more efficient. The screenshot above shows + the \e Find button and its position on the panel of buttons. - When the user clicks on the \e Find button, it is useful to display a - dialog that can prompt the user for a contact's name. Qt provides QDialog, - which we subclass in this chapter, to implement a \c FindDialog class. + When the user clicks on the \e Find button, it is useful to + display a dialog that prompts for a contact's name. Qt provides + QDialog, which we subclass here to implement a \c FindDialog + class. \section1 Defining the FindDialog Class @@ -806,20 +794,18 @@ /*! \page tutorials-addressbook-part6.html - \previouspage Address Book 5 - Adding a Find Function - \contentspage {Address Book Tutorial}{Contents} - \nextpage {tutorials/addressbook/part7}{Chapter 7} + \example tutorials/addressbook/part6 - \title Address Book 6 - Loading and Saving + \title Part 6 - Loading and Saving - This chapter covers the file handling features of Qt that we use to write - loading and saving routines for the address book application. + This part covers the Qt file handling features we use to write + loading and saving routines for the address book. \image addressbook-tutorial-part6-screenshot.png - Although browsing and searching for contacts are useful features, our - address book is not ready for use until we can save existing contacts and - load them again at a later time. + Although browsing and searching the contact list are useful + features, our address book is not complete until we can save + existing contacts and load them again at a later time. Qt provides a number of classes for \l{Input/Output and Networking} {input and output}, but we have chosen to use two which are simple to use @@ -930,21 +916,20 @@ /*! \page tutorials-addressbook-part7.html - \previouspage Address Book 6 - Loading and Saving - \contentspage {Address Book Tutorial}{Contents} + \example tutorials/addressbook/part7 - \title Address Book 7 - Additional Features + \title Part 7 - Additional Features - This chapter covers some additional features that make the address book - application more convenient for everyday use. + This part covers some additional features that make the address + book more convenient for the frequent user. \image addressbook-tutorial-part7-screenshot.png - Although our address book application is useful in its own right, it would - be useful if we could exchange contact data with other applications. - The vCard format is a popular file format that can be used for this purpose. - In this chapter, we extend our address book client to allow contacts to - be exported to vCard \c{.vcf} files. + Although our address book is useful in isolation, it would be + better if we could exchange contact data with other applications. + The vCard format is a popular file format that can be used for + this purpose. Here we extend our address book client to allow + contacts to be exported to vCard \c{.vcf} files. \section1 Defining the AddressBook Class diff --git a/doc/src/tutorials/widgets-tutorial.qdoc b/doc/src/tutorials/widgets-tutorial.qdoc index 0422e1a..2b5f8cc 100644 --- a/doc/src/tutorials/widgets-tutorial.qdoc +++ b/doc/src/tutorials/widgets-tutorial.qdoc @@ -102,7 +102,7 @@ \section1 Real world widget examples - In these \l{Widgets examples} {more advanced examples}, the code + In these \l{Widget examples} {more advanced examples}, the code that creates the widgets and layouts is stored in other files. For example, the GUI for a main window may be created in the constructor of a QMainWindow subclass. -- cgit v0.12 From 01483b3d921eea7c4e3c8fa159ab60a3ca32f1ee Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 26 May 2010 14:18:31 +0200 Subject: qdoc: Fixed the French version of the address book tutorial --- doc/src/tutorials/addressbook-fr.qdoc | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/doc/src/tutorials/addressbook-fr.qdoc b/doc/src/tutorials/addressbook-fr.qdoc index 98c44a3..85a9acf 100644 --- a/doc/src/tutorials/addressbook-fr.qdoc +++ b/doc/src/tutorials/addressbook-fr.qdoc @@ -42,10 +42,6 @@ /*! \page tutorials-addressbook-fr.html - \startpage {index.html}{Qt Reference Documentation} - \contentspage Tutorials - \nextpage {tutorials/addressbook-fr/part1}{Chapitre 1} - \title Tutoriel "Carnet d'adresses" \brief Une introduction à la programation d'interface graphique montrant comment construire une application simple avec Qt. @@ -93,8 +89,7 @@ /*! \page tutorials-addressbook-fr-part1.html - \contentspage {Tutoriel "Carnet d'adresses"}{Sommaire} - \nextpage {tutorials/addressbook-fr/part2}{Chapitre 2} + \example tutorials/addressbook-fr/part1 \title Carnet d'adresses 1 - Conception de l'interface utilisateur @@ -252,9 +247,7 @@ /*! \page tutorials-addressbook-fr-part2.html - \previouspage {tutorials/addressbook-fr/part1}{Chapitre 1} - \contentspage {Tutoriel "Carnet d'adresses"}{Sommaire} - \nextpage {tutorials/addressbook-fr/part3}{Chapitre 3} + \example tutorials/addressbook-fr/part2 \title Carnet d'adresses 2 - Ajouter des adresses @@ -414,9 +407,7 @@ /*! \page tutorials-addressbook-fr-part3.html - \previouspage {tutorials/addressbook-fr/part2}{Chapitre 2} - \contentspage {Tutoriel "Carnet d'adresses"}{Sommaire} - \nextpage {tutorials/addressbook-fr/part4}{Chapitre 4} + \example tutorials/addressbook-fr/part3 \title Carnet d'adresses 3 - Navigation entre les éléments @@ -536,9 +527,7 @@ /*! \page tutorials-addressbook-fr-part4.html - \previouspage {tutorials/addressbook-fr/part3}{Chapitre 3} - \contentspage {Tutoriel "Carnet d'adresses"}{Sommaire} - \nextpage {tutorials/addressbook-fr/part5}{Chapitre 5} + \example tutorials/addressbook-fr/part4 \title Carnet d'Adresses 4 - éditer et supprimer des adresses @@ -688,9 +677,7 @@ /*! \page tutorials-addressbook-fr-part5.html - \previouspage {tutorials/addressbook-fr/part4}{Chapitre 4} - \contentspage {Tutoriel "Carnet d'adresses"}{Sommaire} - \nextpage {tutorials/addressbook-fr/part6}{Chapitre 6} + \example tutorials/addressbook-fr/part5 \title Carnet d'adresse 5 - Ajout d'une fonction de recherche @@ -839,9 +826,7 @@ /*! \page tutorials-addressbook-part6.html - \previouspage {tutorials/addressbook-fr/part5}{Chapitre 5} - \contentspage {Tutoriel "Carnet d'adresses"}{Sommaire} - \nextpage {tutorials/addressbook-fr/part7}{Chapitre 7} + \example tutorials/addressbook-fr/part6 \title Carnet d'Adresses 6 - Sauvegarde et chargement @@ -978,8 +963,7 @@ /*! \page tutorials-addressbook-fr-part7.html - \previouspage {tutorials/addressbook-fr/part6}{Chapitre 6} - \contentspage {Tutoriel "Carnet d'adresses"}{Sommaire} + \example tutorials/addressbook-fr/part7 \title Carnet d'adresse 7 - Fonctionnalités avancées -- cgit v0.12 From 44e33b3c8d776b66b2122eb3757177dfbd7baa4c Mon Sep 17 00:00:00 2001 From: Carlos Manuel Duclos Vergara Date: Wed, 26 May 2010 14:29:40 +0200 Subject: qaccessibility::eventTest(...) was failing. The problem here is the fact that to test the mouse click the test depended on some "magical" coordinates which are not valid anymore. But since QTest::mouseClick(...) will target the center of the button, there is no need to calculate coordinates. Reviewed-by: Richard Moe Gustavsen --- tests/auto/qaccessibility/tst_qaccessibility.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qaccessibility/tst_qaccessibility.cpp b/tests/auto/qaccessibility/tst_qaccessibility.cpp index e5a332a..cea259c 100644 --- a/tests/auto/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/qaccessibility/tst_qaccessibility.cpp @@ -475,7 +475,7 @@ void tst_QAccessibility::eventTest() QVERIFY_EVENT(button, 0, QAccessible::ObjectShow); button->setFocus(Qt::MouseFocusReason); QTestAccessibility::clearEvents(); - QTest::mouseClick(button, Qt::LeftButton, 0, QPoint(button->width()-7,button->height()-5)); + QTest::mouseClick(button, Qt::LeftButton, 0); QVERIFY_EVENT(button, 0, QAccessible::StateChanged); QVERIFY_EVENT(button, 0, QAccessible::StateChanged); -- cgit v0.12 From f1ba0329a90fe62a850e4b00bf3bd13011dbe4fa Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Wed, 26 May 2010 17:54:35 +0200 Subject: Add key event handling to the declarative web view This is a very simple approach, I don't know if a more nuanced system would be appropriate. Task-number: QTBUG-11025 --- src/imports/webkit/qdeclarativewebview.cpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) 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(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); -} +} /*! -- cgit v0.12 From c22dc63d5333c85afd167944675bfebec6b5c9a3 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 26 May 2010 13:54:40 +0200 Subject: complain about unescaped backslashes --- qmake/project.cpp | 6 ++++++ qmake/project.h | 1 + 2 files changed, 7 insertions(+) diff --git a/qmake/project.cpp b/qmake/project.cpp index 2be68be..9cf6a6f 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -671,6 +671,7 @@ QMakeProject::reset() scope_blocks.push(ScopeBlock()); iterator = 0; function = 0; + backslashWarned = false; } bool @@ -2933,6 +2934,11 @@ QMakeProject::doVariableReplaceExpand(const QString &str, QMap Date: Wed, 26 May 2010 14:05:58 +0200 Subject: escape backslashes this makes windows-style path specs *ugly*. that's intentional. :-P --- demos/embedded/desktopservices/desktopservices.pro | 4 +-- examples/painting/svgviewer/svgviewer.pro | 6 ++-- examples/xml/dombookmarks/dombookmarks.pro | 2 +- examples/xml/saxbookmarks/saxbookmarks.pro | 2 +- mkspecs/common/symbian/symbian-makefile.conf | 2 +- mkspecs/common/wince/qmake.conf | 6 ++-- mkspecs/features/dbusadaptors.prf | 2 +- mkspecs/features/dbusinterfaces.prf | 2 +- mkspecs/features/incredibuild_xge.prf | 4 +-- mkspecs/features/lex.prf | 6 ++-- mkspecs/features/moc.prf | 6 ++-- mkspecs/features/sis_targets.prf | 2 +- mkspecs/features/symbian/add_mmp_rules.prf | 2 +- mkspecs/features/symbian/application_icon.prf | 4 +-- mkspecs/features/symbian/def_files.prf | 2 +- mkspecs/features/symbian/moc.prf | 6 ++-- mkspecs/features/symbian/symbian_building.prf | 14 ++++----- mkspecs/features/uic.prf | 8 ++--- mkspecs/features/win32/embed_manifest_dll.prf | 6 ++-- mkspecs/features/win32/embed_manifest_exe.prf | 6 ++-- mkspecs/features/win32/qaxserver.prf | 6 ++-- mkspecs/features/yacc.prf | 10 +++--- mkspecs/win32-borland/qmake.conf | 8 ++--- mkspecs/win32-icc/qmake.conf | 6 ++-- mkspecs/win32-msvc2003/qmake.conf | 6 ++-- mkspecs/win32-msvc2005/qmake.conf | 6 ++-- mkspecs/win32-msvc2008/qmake.conf | 6 ++-- mkspecs/win32-msvc2010/qmake.conf | 6 ++-- projects.pro | 36 +++++++++++----------- src/3rdparty/webkit/WebCore/WebCore.pro | 2 +- .../webkit/WebKit/qt/Api/DerivedSources.pro | 6 ++-- src/3rdparty/webkit/WebKit/qt/docs/docs.pri | 2 +- src/activeqt/control/control.pro | 2 +- .../auto/declarative/parserstress/parserstress.pro | 2 +- .../lupdate/testdata/good/backslashes/project.pro | 4 +-- .../auto/patternistexamples/patternistexamples.pro | 2 +- tests/auto/qaccessibility/qaccessibility.pro | 2 +- tests/auto/qdesktopservices/qdesktopservices.pro | 22 ++++++------- tests/auto/qdirmodel/qdirmodel.pro | 6 ++-- tests/auto/qfile/test/test.pro | 8 ++--- tests/auto/qfileinfo/qfileinfo.pro | 2 +- tests/auto/qgraphicsscene/qgraphicsscene.pro | 4 +-- tests/auto/qimagewriter/qimagewriter.pro | 4 +-- tests/auto/qlibrary/lib2/lib2.pro | 6 ++-- tests/auto/qlocale/test/test.pro | 2 +- tests/auto/qlocalsocket/test/test.pro | 2 +- tests/auto/qmainwindow/qmainwindow.pro | 2 +- tests/auto/qmake/testdata/functions/functions.pro | 2 +- tests/auto/qmovie/qmovie.pro | 4 +-- tests/auto/qnetworkreply/test/test.pro | 2 +- tests/auto/qobject/tst_qobject.pro | 2 +- tests/auto/qprocess/test/test.pro | 2 +- .../qsocks5socketengine/qsocks5socketengine.pro | 2 +- tests/auto/solutions.pri | 4 +-- tests/auto/windowsmobile/test/test.pro | 2 +- .../lib/fulltextsearch/fulltextsearch.pro | 2 +- 56 files changed, 142 insertions(+), 142 deletions(-) diff --git a/demos/embedded/desktopservices/desktopservices.pro b/demos/embedded/desktopservices/desktopservices.pro index bff7c46..94ddedd 100644 --- a/demos/embedded/desktopservices/desktopservices.pro +++ b/demos/embedded/desktopservices/desktopservices.pro @@ -24,8 +24,8 @@ symbian { } wince*{ - music.path = "\My Documents\My Music" - image.path = "\My Documents\My Pictures" + music.path = "\\My Documents\\My Music" + image.path = "\\My Documents\\My Pictures" DEPLOYMENT += music image } diff --git a/examples/painting/svgviewer/svgviewer.pro b/examples/painting/svgviewer/svgviewer.pro index 5af8731..4809b91 100644 --- a/examples/painting/svgviewer/svgviewer.pro +++ b/examples/painting/svgviewer/svgviewer.pro @@ -17,15 +17,15 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/painting/svgviewer INSTALLS += target sources wince*: { - addFiles.sources = files\*.svg - addFiles.path = \My Documents + addFiles.sources = files\\*.svg + addFiles.path = "\\My Documents" DEPLOYMENT += addFiles } symbian: { TARGET.UID3 = 0xA000A64E include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) - addFiles.sources = files\*.svg + addFiles.sources = files\\*.svg addFiles.path = . DEPLOYMENT += addFiles } diff --git a/examples/xml/dombookmarks/dombookmarks.pro b/examples/xml/dombookmarks/dombookmarks.pro index 25e21cd..f906d2f 100644 --- a/examples/xml/dombookmarks/dombookmarks.pro +++ b/examples/xml/dombookmarks/dombookmarks.pro @@ -15,6 +15,6 @@ symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) wince*: { addFiles.sources = frank.xbel jennifer.xbel - addFiles.path = \My Documents + addFiles.path = "\\My Documents" DEPLOYMENT += addFiles } diff --git a/examples/xml/saxbookmarks/saxbookmarks.pro b/examples/xml/saxbookmarks/saxbookmarks.pro index 4af3ddd..7293bd1 100644 --- a/examples/xml/saxbookmarks/saxbookmarks.pro +++ b/examples/xml/saxbookmarks/saxbookmarks.pro @@ -15,7 +15,7 @@ INSTALLS += target sources wince*: { addFiles.sources = frank.xbel jennifer.xbel - addFiles.path = \My Documents + addFiles.path = "\\My Documents" DEPLOYMENT += addFiles } diff --git a/mkspecs/common/symbian/symbian-makefile.conf b/mkspecs/common/symbian/symbian-makefile.conf index 66b3d7f..a3aade7 100644 --- a/mkspecs/common/symbian/symbian-makefile.conf +++ b/mkspecs/common/symbian/symbian-makefile.conf @@ -32,7 +32,7 @@ QMAKE_PREFIX_STATICLIB = QMAKE_EXTENSION_STATICLIB = lib QMAKE_SYMBIAN_SHLIB = 1 -DEFINES *= __PRODUCT_INCLUDE__=\<$${EPOCROOT}epoc32/include/variant/symbian_os.hrh\> \ +DEFINES *= __PRODUCT_INCLUDE__=\\<$${EPOCROOT}epoc32/include/variant/symbian_os.hrh\\> \ __SYMBIAN32__ \ __MARM_INTERWORK__ \ _UNICODE \ diff --git a/mkspecs/common/wince/qmake.conf b/mkspecs/common/wince/qmake.conf index 705cdc3..57b89b9 100644 --- a/mkspecs/common/wince/qmake.conf +++ b/mkspecs/common/wince/qmake.conf @@ -70,9 +70,9 @@ QMAKE_LIBS_OPENGL_ES2 = libGLESv2.lib QMAKE_LIBS_QT_ENTRY = -lqtmain -QMAKE_MOC = $$[QT_INSTALL_BINS]\moc.exe -QMAKE_UIC = $$[QT_INSTALL_BINS]\uic.exe -QMAKE_IDC = $$[QT_INSTALL_BINS]\idc.exe +QMAKE_MOC = $$[QT_INSTALL_BINS]\\moc.exe +QMAKE_UIC = $$[QT_INSTALL_BINS]\\uic.exe +QMAKE_IDC = $$[QT_INSTALL_BINS]\\idc.exe QMAKE_IDL = midl QMAKE_LIB = lib diff --git a/mkspecs/features/dbusadaptors.prf b/mkspecs/features/dbusadaptors.prf index 17dffa5..3463d58 100644 --- a/mkspecs/features/dbusadaptors.prf +++ b/mkspecs/features/dbusadaptors.prf @@ -2,7 +2,7 @@ qtPrepareTool(QMAKE_QDBUSXML2CPP, qdbusxml2cpp) for(DBUS_ADAPTOR, $$list($$unique(DBUS_ADAPTORS))) { - !contains(DBUS_ADAPTOR, .*\w\.xml$) { + !contains(DBUS_ADAPTOR, .*\\w\\.xml$) { warning("Invalid D-BUS adaptor: '$${DBUS_ADAPTOR}', please use 'com.mydomain.myinterface.xml' instead.") next() } diff --git a/mkspecs/features/dbusinterfaces.prf b/mkspecs/features/dbusinterfaces.prf index 412e80f..1828802 100644 --- a/mkspecs/features/dbusinterfaces.prf +++ b/mkspecs/features/dbusinterfaces.prf @@ -4,7 +4,7 @@ qtPrepareTool(QMAKE_QDBUSXML2CPP, qdbusxml2cpp) for(DBUS_INTERFACE, $$list($$unique(DBUS_INTERFACES))) { - !contains(DBUS_INTERFACE, .*\w\.xml$) { + !contains(DBUS_INTERFACE, .*\\w\\.xml$) { warning("Invalid D-BUS interface : '$${DBUS_INTERFACE}', please use 'com.mydomain.myinterface.xml' instead.") next() } diff --git a/mkspecs/features/incredibuild_xge.prf b/mkspecs/features/incredibuild_xge.prf index e241ca4..b8ca571 100644 --- a/mkspecs/features/incredibuild_xge.prf +++ b/mkspecs/features/incredibuild_xge.prf @@ -1,9 +1,9 @@ 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)) diff --git a/mkspecs/features/lex.prf b/mkspecs/features/lex.prf index df76a68..43d8fbd 100644 --- a/mkspecs/features/lex.prf +++ b/mkspecs/features/lex.prf @@ -14,9 +14,9 @@ QMAKE_LEXEXTRAFLAGS = $$QMAKE_LEXFLAGS !yacc_no_name_mangle:QMAKE_LEXEXTRAFLAGS += $$QMAKE_LEXFLAGS_MANGLE - lex.commands = $$QMAKE_LEX $$QMAKE_LEXEXTRAFLAGS ${QMAKE_FILE_IN}$$escape_expand(\n\t) \ - $$QMAKE_DEL_FILE $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_lex$${first(QMAKE_EXT_CPP)}$$escape_expand(\n\t) \ - $$QMAKE_MOVE lex.${QMAKE_FILE_BASE}.c $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_lex$${first(QMAKE_EXT_CPP)}$$escape_expand(\n\t) + lex.commands = $$QMAKE_LEX $$QMAKE_LEXEXTRAFLAGS ${QMAKE_FILE_IN}$$escape_expand(\\n\\t) \ + $$QMAKE_DEL_FILE $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_lex$${first(QMAKE_EXT_CPP)}$$escape_expand(\\n\\t) \ + $$QMAKE_MOVE lex.${QMAKE_FILE_BASE}.c $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_lex$${first(QMAKE_EXT_CPP)}$$escape_expand(\\n\\t) lex.output = $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_lex$${first(QMAKE_EXT_CPP)} silent:lex.commands = @echo Lex ${QMAKE_FILE_IN} && $$lex.commands diff --git a/mkspecs/features/moc.prf b/mkspecs/features/moc.prf index e1032fd..abda78f 100644 --- a/mkspecs/features/moc.prf +++ b/mkspecs/features/moc.prf @@ -14,13 +14,13 @@ win32:count($$list($$INCLUDEPATH), 40, >) { WIN_INCLUDETEMP=$$INCLUDETEMP - EOC = $$escape_expand(\n\t) + EOC = $$escape_expand(\\n\\t) if(contains(TEMPLATE, "vc.*")|contains(TEMPLATE_PREFIX, "vc")) { # the VCPROJ generator will replace the \r\h with the coded \r\n: # No other generator understands the \h - if(win32-msvc2*|wince*msvc*): EOC = $$escape_expand(\r\h) - else: EOC = $$escape_expand(\\)$$escape_expand(\n\t) + if(win32-msvc2*|wince*msvc*): EOC = $$escape_expand(\\r\\h) + else: EOC = $$escape_expand(\\\\\\n\\t) } unset(INCFILELIST) diff --git a/mkspecs/features/sis_targets.prf b/mkspecs/features/sis_targets.prf index da2d250..13ee1ad 100644 --- a/mkspecs/features/sis_targets.prf +++ b/mkspecs/features/sis_targets.prf @@ -96,7 +96,7 @@ contains(TEMPLATE, app)|!count(DEPLOYMENT, 1) { } } else { sis_destdir = $$DESTDIR - !isEmpty(sis_destdir):!contains(sis_destdir, "[/\\]$"):sis_destdir = $${sis_destdir}/ + !isEmpty(sis_destdir):!contains(sis_destdir, "[/\\\\]$"):sis_destdir = $${sis_destdir}/ contains(QMAKE_HOST.os, "Windows"):sis_destdir = $$replace(sis_destdir, "/", "\\") sis_target.target = sis diff --git a/mkspecs/features/symbian/add_mmp_rules.prf b/mkspecs/features/symbian/add_mmp_rules.prf index 5384dbe..7f96b81 100644 --- a/mkspecs/features/symbian/add_mmp_rules.prf +++ b/mkspecs/features/symbian/add_mmp_rules.prf @@ -23,7 +23,7 @@ defineTest(addMMPRules) { # No value defined for current condition, so use default varVal = $$eval($${var}.default) } - !isEmpty(varVal): libBlock += "$$join(varVal,$$escape_expand(\n))" + !isEmpty(varVal): libBlock += "$$join(varVal,$$escape_expand(\\n))" } MMP_RULES += $$libBlock diff --git a/mkspecs/features/symbian/application_icon.prf b/mkspecs/features/symbian/application_icon.prf index 76f9ba1..c5654d9 100644 --- a/mkspecs/features/symbian/application_icon.prf +++ b/mkspecs/features/symbian/application_icon.prf @@ -21,11 +21,11 @@ contains( CONFIG, no_icon ) { # only uses filename from RSS_RULES.icon_file when referring to icon file name. baseTarget = $$basename(TARGET) baseTarget = $$replace(baseTarget, /,_) - baseTarget = $$replace(baseTarget, \\,_) + baseTarget = $$replace(baseTarget, \\\\,_) baseTarget = $$replace(baseTarget, " ",_) symbian-abld|symbian-sbsv2 { baseTarget = $$replace(baseTarget, -,_) - baseTarget = $$replace(baseTarget, \.,_) + baseTarget = $$replace(baseTarget, \\.,_) baseTarget = $$replace(baseTarget, :,_) } diff --git a/mkspecs/features/symbian/def_files.prf b/mkspecs/features/symbian/def_files.prf index 8bcd096..eb17402 100644 --- a/mkspecs/features/symbian/def_files.prf +++ b/mkspecs/features/symbian/def_files.prf @@ -63,7 +63,7 @@ symbian-abld|symbian-sbsv2 { freeze_target.target = freeze freeze_target.depends = first # The perl part is to convert to unix line endings and remove comments, which the s60 tools refuse to do. - freeze_target.commands = perl -n -e \'next if (/; NEW/); s/\r//g; if (/MISSING:(.*)/x) { print(\"\$\$1 ABSENT\\n\"); } else { print; }\' < $$symbianObjdir/$${TARGET}.def > $$elf2e32FileToAdd + freeze_target.commands = perl -n -e \'next if (/; NEW/); s/\\r//g; if (/MISSING:(.*)/x) { print(\"\$\$1 ABSENT\\n\"); } else { print; }\' < $$symbianObjdir/$${TARGET}.def > $$elf2e32FileToAdd QMAKE_EXTRA_TARGETS += freeze_target } else:contains(TEMPLATE, subdirs) { freeze_target.target = freeze diff --git a/mkspecs/features/symbian/moc.prf b/mkspecs/features/symbian/moc.prf index 29e0d8d..6030944 100644 --- a/mkspecs/features/symbian/moc.prf +++ b/mkspecs/features/symbian/moc.prf @@ -1,17 +1,17 @@ load(moc) symbian-abld|symbian-sbsv2 { - RET = $$find(MOC_DIR, "(/|^)\.[^/]+/?$") + RET = $$find(MOC_DIR, "(/|^)\\.[^/]+/?$") !isEmpty(RET):{ error("Symbian does not support directories starting with a dot. Please set MOC_DIR to a different value in your profile. MOC_DIR: $$MOC_DIR") } - RET = $$find(RCC_DIR, "(/|^)\.[^/]+/?$") + RET = $$find(RCC_DIR, "(/|^)\\.[^/]+/?$") !isEmpty(RET):{ error("Symbian does not support directories starting with a dot. Please set RCC_DIR to a different value in your profile. RCC_DIR: $$RCC_DIR") } - RET = $$find(OBJECTS_DIR, "(/|^)\.[^/]+/?$") + RET = $$find(OBJECTS_DIR, "(/|^)\\.[^/]+/?$") !isEmpty(RET):{ error("Symbian does not support directories starting with a dot. Please set OBJECTS_DIR to a different value in your profile. OBJECTS_DIR: $$OBJECTS_DIR") } diff --git a/mkspecs/features/symbian/symbian_building.prf b/mkspecs/features/symbian/symbian_building.prf index 802adde..c230272 100644 --- a/mkspecs/features/symbian/symbian_building.prf +++ b/mkspecs/features/symbian/symbian_building.prf @@ -22,16 +22,16 @@ contains(QMAKE_CFLAGS, "--thumb")|contains(QMAKE_CXXFLAGS, "--thumb")|contains(Q } defineReplace(processSymbianLibraries) { - library = $$replace(1, "\.dll$", ".dso") + library = $$replace(1, "\\.dll$", ".dso") library = $$replace(library, "^-l", "") - isFullName = $$find(library, \.) + isFullName = $$find(library, \\.) isEmpty(isFullName):library="$${library}.dso" linux-gcce { newLIB = "-l:$${library}" } else { newLIB = "$${library}" } - contains(library, "\.dso$")|contains(library, ".lib$"):PRE_TARGETDEPS += $$library + contains(library, "\\.dso$")|contains(library, "\\.lib$"):PRE_TARGETDEPS += $$library return($$newLIB) } @@ -55,7 +55,7 @@ isEmpty(VERSION) { } # Check for version validity. -!isEmpty(VERSION):!contains(VERSION, "[0-9]+"):!contains(VERSION, "[0-9]+\.[0-9]+")!contains(VERSION, "[0-9]+(\.[0-9]+){2}") { +!isEmpty(VERSION):!contains(VERSION, "[0-9]+"):!contains(VERSION, "[0-9]+\\.[0-9]+")!contains(VERSION, "[0-9]+(\\.[0-9]+){2}") { error("Invalid VERSION for Symbian: $$VERSION") } @@ -86,7 +86,7 @@ isEmpty(TARGET.UID2):TARGET.UID2 = 0x00000000 capability = $$replace(TARGET.CAPABILITY, " ", "+") capability = $$join(capability, "+") -capability = $$replace(capability, "\+-", "-") +capability = $$replace(capability, "\\+-", "-") isEmpty(capability): capability = "None" capability = "--capability=$$capability" @@ -214,9 +214,9 @@ symbian_resources_INCLUDES += "-I $$symbian_resources_RCC_DIR" for(symbian_resource, SYMBIAN_RESOURCES) { symbian_resource = $$basename(symbian_resource) - symbian_resource_clean = $$replace(symbian_resource, "\.rss$", ".rsc") + symbian_resource_clean = $$replace(symbian_resource, "\\.rss$", ".rsc") QMAKE_DISTCLEAN += $${symbianDestdir}/$${symbian_resource_clean} - symbian_resource_clean = $$replace(symbian_resource, "\.rss$", ".rpp") + symbian_resource_clean = $$replace(symbian_resource, "\\.rss$", ".rpp") QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${symbian_resource_clean} } diff --git a/mkspecs/features/uic.prf b/mkspecs/features/uic.prf index c87372d..5324e65 100644 --- a/mkspecs/features/uic.prf +++ b/mkspecs/features/uic.prf @@ -86,14 +86,14 @@ defineReplace(imageCollectionCmd) { for(image, $$list($$split(1))) { EMBEDDED_IMAGES += $$image count(EMBEDDED_IMAGES, 5) { - isEmpty(RET): RET += echo $$EMBEDDED_IMAGES > images.tmp $$escape_expand(\n\t) - else: RET += echo $$EMBEDDED_IMAGES >> images.tmp $$escape_expand(\n\t) + isEmpty(RET): RET += echo $$EMBEDDED_IMAGES > images.tmp $$escape_expand(\\n\\t) + else: RET += echo $$EMBEDDED_IMAGES >> images.tmp $$escape_expand(\\n\\t) unset(EMBEDDED_IMAGES) } } - !isEmpty(EMBEDDED_IMAGES):RET += echo $$EMBEDDED_IMAGES >> images.tmp $$escape_expand(\n\t) + !isEmpty(EMBEDDED_IMAGES):RET += echo $$EMBEDDED_IMAGES >> images.tmp $$escape_expand(\\n\\t) !isEmpty(RET) { - RET += $$QMAKE_UIC3 -embed $$TARGET -f images.tmp -o $$2 $$escape_expand(\n\t) + RET += $$QMAKE_UIC3 -embed $$TARGET -f images.tmp -o $$2 $$escape_expand(\\n\\t) return($$RET) } return($$QMAKE_UIC3 -embed $$TARGET $$1 -o $$2) diff --git a/mkspecs/features/win32/embed_manifest_dll.prf b/mkspecs/features/win32/embed_manifest_dll.prf index 60a55ce..7305c04 100644 --- a/mkspecs/features/win32/embed_manifest_dll.prf +++ b/mkspecs/features/win32/embed_manifest_dll.prf @@ -2,12 +2,12 @@ MANIFEST_DIR = $$OBJECTS_DIR isEmpty(MANIFEST_DIR):MANIFEST_DIR = . !if(plugin:no_plugin_manifest):if(win32-msvc2005*|win32-msvc2008*|win32-msvc2010*):!static:!equals(TEMPLATE_PREFIX, "vc"):equals(TEMPLATE, "lib") { NOPATH_TARGET = $$TARGET - NOPATH_TARGET ~= s,\\ , ,q # Remove space escaping (NOPATH_TARGET is quoted) - NOPATH_TARGET ~= s,\\,/,g # Change to single type separators + NOPATH_TARGET ~= s,\\\\ , ,q # Remove space escaping (NOPATH_TARGET is quoted) + NOPATH_TARGET ~= s,\\\\,/,g # Change to single type separators NOPATH_TARGET ~= s,^(.*/)+,, # Remove all paths QMAKE_LFLAGS += /MANIFEST $$quote(/MANIFESTFILE:\"$${MANIFEST_DIR}\\$${NOPATH_TARGET}.intermediate.manifest\") QMAKE_PREV_POST_LINK = $$QMAKE_POST_LINK - QMAKE_POST_LINK = $$quote(mt.exe -nologo -manifest \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" -outputresource:$(DESTDIR_TARGET);2$$escape_expand(\n\t)) + QMAKE_POST_LINK = $$quote(mt.exe -nologo -manifest \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" -outputresource:$(DESTDIR_TARGET);2$$escape_expand(\\n\\t)) QMAKE_POST_LINK += $$QMAKE_PREV_POST_LINK QMAKE_CLEAN += \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" } diff --git a/mkspecs/features/win32/embed_manifest_exe.prf b/mkspecs/features/win32/embed_manifest_exe.prf index 169134d..5b37a6d 100644 --- a/mkspecs/features/win32/embed_manifest_exe.prf +++ b/mkspecs/features/win32/embed_manifest_exe.prf @@ -2,12 +2,12 @@ MANIFEST_DIR = $$OBJECTS_DIR isEmpty(MANIFEST_DIR):MANIFEST_DIR = . if(win32-msvc2005*|win32-msvc2008*|win32-msvc2010*):!equals(TEMPLATE_PREFIX, "vc"):equals(TEMPLATE, "app") { NOPATH_TARGET = $$TARGET - NOPATH_TARGET ~= s,\\ , ,q # Remove space escaping (NOPATH_TARGET is quoted) - NOPATH_TARGET ~= s,\\,/,g # Change to single type separators + NOPATH_TARGET ~= s,\\\\ , ,q # Remove space escaping (NOPATH_TARGET is quoted) + NOPATH_TARGET ~= s,\\\\,/,g # Change to single type separators NOPATH_TARGET ~= s,^(.*/)+,, # Remove all paths QMAKE_LFLAGS += /MANIFEST $$quote(/MANIFESTFILE:\"$${MANIFEST_DIR}\\$${NOPATH_TARGET}.intermediate.manifest\") QMAKE_PREV_POST_LINK = $$QMAKE_POST_LINK - QMAKE_POST_LINK = $$quote(mt.exe -nologo -manifest \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" -outputresource:$(DESTDIR_TARGET);1$$escape_expand(\n\t)) + QMAKE_POST_LINK = $$quote(mt.exe -nologo -manifest \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" -outputresource:$(DESTDIR_TARGET);1$$escape_expand(\\n\\t)) QMAKE_POST_LINK += $$QMAKE_PREV_POST_LINK QMAKE_CLEAN += \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" } diff --git a/mkspecs/features/win32/qaxserver.prf b/mkspecs/features/win32/qaxserver.prf index 1ff6825..2899976 100644 --- a/mkspecs/features/win32/qaxserver.prf +++ b/mkspecs/features/win32/qaxserver.prf @@ -19,10 +19,10 @@ equals(ACTIVEQT_IDE, "VisualStudio") { ACTIVEQT_IDL = $${QMAKE_IDL} ACTIVEQT_TARGET = "$(TargetPath)" win32-msvc { - ACTIVEQT_NEWLINE = $$escape_expand(\t) + ACTIVEQT_NEWLINE = $$escape_expand(\\t) ACTIVEQT_OUTPUT = $(IntDir)/$${TARGET} } else { - ACTIVEQT_NEWLINE = $$escape_expand(\n\t) + ACTIVEQT_NEWLINE = $$escape_expand(\\n\\t) ACTIVEQT_OUTPUT = $(IntDir)$${TARGET} } ACTIVEQT_TLBOUT = "$(TargetDir)/$${TARGET}.tlb" @@ -31,7 +31,7 @@ equals(ACTIVEQT_IDE, "VisualStudio") { equals(ACTIVEQT_IDE, "makefile") { ACTIVEQT_IDC = -$(IDC) ACTIVEQT_IDL = -$(IDL) - ACTIVEQT_NEWLINE = $$escape_expand(\n\t) + ACTIVEQT_NEWLINE = $$escape_expand(\\n\\t) ACTIVEQT_TARGET = $(DESTDIR_TARGET) ACTIVEQT_OUTPUT = $(OBJECTS_DIR)/$${TARGET} isEmpty(DESTDIR) { diff --git a/mkspecs/features/yacc.prf b/mkspecs/features/yacc.prf index c078e09..4d7e0a3 100644 --- a/mkspecs/features/yacc.prf +++ b/mkspecs/features/yacc.prf @@ -21,10 +21,10 @@ !yacc_no_name_mangle:QMAKE_YACCDECLFLAGS += $$QMAKE_YACCFLAGS_MANGLE yacc_decl.commands = \ - $$QMAKE_YACC $$QMAKE_YACCDECLFLAGS ${QMAKE_FILE_IN}$$escape_expand(\n\t) \ - $$QMAKE_DEL_FILE $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_yacc$${first(QMAKE_EXT_H)} $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_yacc$${first(QMAKE_EXT_CPP)}$$escape_expand(\n\t) \ - $$QMAKE_MOVE $${QMAKE_YACC_HEADER} $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_yacc$${first(QMAKE_EXT_H)}$$escape_expand(\n\t) \ - $$QMAKE_MOVE $${QMAKE_YACC_SOURCE} $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_yacc$${first(QMAKE_EXT_CPP)}$$escape_expand(\n\t) + $$QMAKE_YACC $$QMAKE_YACCDECLFLAGS ${QMAKE_FILE_IN}$$escape_expand(\\n\\t) \ + $$QMAKE_DEL_FILE $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_yacc$${first(QMAKE_EXT_H)} $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_yacc$${first(QMAKE_EXT_CPP)}$$escape_expand(\\n\\t) \ + $$QMAKE_MOVE $${QMAKE_YACC_HEADER} $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_yacc$${first(QMAKE_EXT_H)}$$escape_expand(\\n\\t) \ + $$QMAKE_MOVE $${QMAKE_YACC_SOURCE} $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_yacc$${first(QMAKE_EXT_CPP)}$$escape_expand(\\n\\t) yacc_decl.output = $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_yacc$${first(QMAKE_EXT_H)} silent:yacc_decl.commands = @echo Yacc ${QMAKE_FILE_IN} && $$yacc_decl.commands @@ -35,7 +35,7 @@ yacc_impl.name = source for ${QMAKE_FILE_IN} yacc_impl.input = YACCSOURCES yacc_impl.variable_out = GENERATED_SOURCES - yacc_impl.commands = $$escape_expand(\n) # We don't want any commands where, but if command is empty no rules are created + yacc_impl.commands = $$escape_expand(\\n) # We don't want any commands where, but if command is empty no rules are created yacc_impl.depends = $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_yacc$${first(QMAKE_EXT_H)} # Make sure we depend on the step above yacc_impl.output = $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_yacc$${first(QMAKE_EXT_CPP)} # Faked output from this step, output really created in step above QMAKE_EXTRA_COMPILERS += yacc_impl diff --git a/mkspecs/win32-borland/qmake.conf b/mkspecs/win32-borland/qmake.conf index 63bf07a..2ba742c 100644 --- a/mkspecs/win32-borland/qmake.conf +++ b/mkspecs/win32-borland/qmake.conf @@ -41,7 +41,7 @@ QMAKE_CXXFLAGS_EXCEPTIONS_ON = QMAKE_CXXFLAGS_EXCEPTIONS_OFF = -x- QMAKE_INCDIR = -QMAKE_LIBDIR = $(BCB)\lib +QMAKE_LIBDIR = $(BCB)\\lib QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] @@ -69,9 +69,9 @@ QMAKE_LIBS_QT_ENTRY = -lqtmain #QMAKE_LIBS_OPENGL = #QMAKE_LFLAGS_OPENGL = /dopengl32.dll -QMAKE_MOC = $$[QT_INSTALL_BINS]\moc.exe -QMAKE_UIC = $$[QT_INSTALL_BINS]\uic.exe -QMAKE_IDC = $$[QT_INSTALL_BINS]\idc.exe +QMAKE_MOC = $$[QT_INSTALL_BINS]\\moc.exe +QMAKE_UIC = $$[QT_INSTALL_BINS]\\uic.exe +QMAKE_IDC = $$[QT_INSTALL_BINS]\\idc.exe QMAKE_IDL = midl QMAKE_LIB = tlib /C /P256 diff --git a/mkspecs/win32-icc/qmake.conf b/mkspecs/win32-icc/qmake.conf index fcc7691..acff5e1 100644 --- a/mkspecs/win32-icc/qmake.conf +++ b/mkspecs/win32-icc/qmake.conf @@ -67,9 +67,9 @@ QMAKE_LIBS_OPENGL = opengl32.lib glu32.lib gdi32.lib user32.lib delayimp.l QMAKE_LIBS_COMPAT = advapi32.lib shell32.lib comdlg32.lib user32.lib gdi32.lib ws2_32.lib QMAKE_LIBS_QT_ENTRY = -lqtmain -QMAKE_MOC = $$[QT_INSTALL_BINS]\moc.exe -QMAKE_UIC = $$[QT_INSTALL_BINS]\uic.exe -QMAKE_IDC = $$[QT_INSTALL_BINS]\idc.exe +QMAKE_MOC = $$[QT_INSTALL_BINS]\\moc.exe +QMAKE_UIC = $$[QT_INSTALL_BINS]\\uic.exe +QMAKE_IDC = $$[QT_INSTALL_BINS]\\idc.exe QMAKE_IDL = midl QMAKE_LIB = lib /NOLOGO diff --git a/mkspecs/win32-msvc2003/qmake.conf b/mkspecs/win32-msvc2003/qmake.conf index e92df12..5344331 100644 --- a/mkspecs/win32-msvc2003/qmake.conf +++ b/mkspecs/win32-msvc2003/qmake.conf @@ -64,9 +64,9 @@ QMAKE_LIBS_COMPAT = advapi32.lib shell32.lib comdlg32.lib user32.lib gdi32 QMAKE_LIBS_QT_ENTRY = -lqtmain -QMAKE_MOC = $$[QT_INSTALL_BINS]\moc.exe -QMAKE_UIC = $$[QT_INSTALL_BINS]\uic.exe -QMAKE_IDC = $$[QT_INSTALL_BINS]\idc.exe +QMAKE_MOC = $$[QT_INSTALL_BINS]\\moc.exe +QMAKE_UIC = $$[QT_INSTALL_BINS]\\uic.exe +QMAKE_IDC = $$[QT_INSTALL_BINS]\\idc.exe QMAKE_IDL = midl QMAKE_LIB = lib /NOLOGO diff --git a/mkspecs/win32-msvc2005/qmake.conf b/mkspecs/win32-msvc2005/qmake.conf index 5ed8e01..84e831f 100644 --- a/mkspecs/win32-msvc2005/qmake.conf +++ b/mkspecs/win32-msvc2005/qmake.conf @@ -67,9 +67,9 @@ QMAKE_LIBS_COMPAT = advapi32.lib shell32.lib comdlg32.lib user32.lib gdi32 QMAKE_LIBS_QT_ENTRY = -lqtmain -QMAKE_MOC = $$[QT_INSTALL_BINS]\moc.exe -QMAKE_UIC = $$[QT_INSTALL_BINS]\uic.exe -QMAKE_IDC = $$[QT_INSTALL_BINS]\idc.exe +QMAKE_MOC = $$[QT_INSTALL_BINS]\\moc.exe +QMAKE_UIC = $$[QT_INSTALL_BINS]\\uic.exe +QMAKE_IDC = $$[QT_INSTALL_BINS]\\idc.exe QMAKE_IDL = midl QMAKE_LIB = lib /NOLOGO diff --git a/mkspecs/win32-msvc2008/qmake.conf b/mkspecs/win32-msvc2008/qmake.conf index 373a36d..3e0bfb5 100644 --- a/mkspecs/win32-msvc2008/qmake.conf +++ b/mkspecs/win32-msvc2008/qmake.conf @@ -67,9 +67,9 @@ QMAKE_LIBS_COMPAT = advapi32.lib shell32.lib comdlg32.lib user32.lib gdi32 QMAKE_LIBS_QT_ENTRY = -lqtmain -QMAKE_MOC = $$[QT_INSTALL_BINS]\moc.exe -QMAKE_UIC = $$[QT_INSTALL_BINS]\uic.exe -QMAKE_IDC = $$[QT_INSTALL_BINS]\idc.exe +QMAKE_MOC = $$[QT_INSTALL_BINS]\\moc.exe +QMAKE_UIC = $$[QT_INSTALL_BINS]\\uic.exe +QMAKE_IDC = $$[QT_INSTALL_BINS]\\idc.exe QMAKE_IDL = midl QMAKE_LIB = lib /NOLOGO diff --git a/mkspecs/win32-msvc2010/qmake.conf b/mkspecs/win32-msvc2010/qmake.conf index 2a48938..d9fe711 100644 --- a/mkspecs/win32-msvc2010/qmake.conf +++ b/mkspecs/win32-msvc2010/qmake.conf @@ -67,9 +67,9 @@ QMAKE_LIBS_COMPAT = advapi32.lib shell32.lib comdlg32.lib user32.lib gdi32 QMAKE_LIBS_QT_ENTRY = -lqtmain -QMAKE_MOC = $$[QT_INSTALL_BINS]\moc.exe -QMAKE_UIC = $$[QT_INSTALL_BINS]\uic.exe -QMAKE_IDC = $$[QT_INSTALL_BINS]\idc.exe +QMAKE_MOC = $$[QT_INSTALL_BINS]\\moc.exe +QMAKE_UIC = $$[QT_INSTALL_BINS]\\uic.exe +QMAKE_IDC = $$[QT_INSTALL_BINS]\\idc.exe QMAKE_IDL = midl QMAKE_LIB = lib /NOLOGO diff --git a/projects.pro b/projects.pro index 45fb8da..373b049 100644 --- a/projects.pro +++ b/projects.pro @@ -104,33 +104,33 @@ unix:!symbian { (cd qmake && $(MAKE) distclean); } win32 { - confclean.commands += -$(DEL_FILE) src\core\global\qconfig.h $$escape_expand(\n\t) \ - -$(DEL_FILE) src\core\global\qconfig.cpp $$escape_expand(\n\t) \ - -$(DEL_FILE) mkspecs\qconfig.pri $$escape_expand(\n\t) \ - -$(DEL_FILE) .qmake.cache $$escape_expand(\n\t) \ + confclean.commands += -$(DEL_FILE) src\\core\\global\\qconfig.h $$escape_expand(\\n\\t) \ + -$(DEL_FILE) src\\core\\global\\qconfig.cpp $$escape_expand(\\n\\t) \ + -$(DEL_FILE) mkspecs\\qconfig.pri $$escape_expand(\\n\\t) \ + -$(DEL_FILE) .qmake.cache $$escape_expand(\\n\\t) \ (cd qmake && $(MAKE) distclean) } symbian { confclean.depends += distclean contains(QMAKE_HOST.os, "Windows") { confclean.commands += \ - (cd src\tools\moc && $(MAKE) distclean) $$escape_expand(\n\t) \ - (cd src\tools\rcc && $(MAKE) distclean) $$escape_expand(\n\t) \ - (cd src\tools\uic && $(MAKE) distclean) $$escape_expand(\n\t) \ - -$(DEL_FILE) src\corelib\global\qconfig.h $$escape_expand(\n\t) \ - -$(DEL_FILE) src\corelib\global\qconfig.cpp $$escape_expand(\n\t) \ - -$(DEL_FILE) mkspecs\qconfig.pri $$escape_expand(\n\t) \ - -$(DEL_FILE) .qmake.cache $$escape_expand(\n\t) \ + (cd src\\tools\\moc && $(MAKE) distclean) $$escape_expand(\\n\\t) \ + (cd src\\tools\\rcc && $(MAKE) distclean) $$escape_expand(\\n\\t) \ + (cd src\\tools\\uic && $(MAKE) distclean) $$escape_expand(\\n\\t) \ + -$(DEL_FILE) src\\corelib\\global\\qconfig.h $$escape_expand(\\n\\t) \ + -$(DEL_FILE) src\\corelib\\global\\qconfig.cpp $$escape_expand(\\n\\t) \ + -$(DEL_FILE) mkspecs\\qconfig.pri $$escape_expand(\\n\\t) \ + -$(DEL_FILE) .qmake.cache $$escape_expand(\\n\\t) \ (cd qmake && $(MAKE) distclean) } else { confclean.commands += \ - (cd src/tools/moc && $(MAKE) distclean) $$escape_expand(\n\t) \ - (cd src/tools/rcc && $(MAKE) distclean) $$escape_expand(\n\t) \ - (cd src/tools/uic && $(MAKE) distclean) $$escape_expand(\n\t) \ - -$(DEL_FILE) src/corelib/global/qconfig.h $$escape_expand(\n\t) \ - -$(DEL_FILE) src/corelib/global/qconfig.cpp $$escape_expand(\n\t) \ - -$(DEL_FILE) mkspecs/qconfig.pri $$escape_expand(\n\t) \ - -$(DEL_FILE) .qmake.cache $$escape_expand(\n\t) \ + (cd src/tools/moc && $(MAKE) distclean) $$escape_expand(\\n\\t) \ + (cd src/tools/rcc && $(MAKE) distclean) $$escape_expand(\\n\\t) \ + (cd src/tools/uic && $(MAKE) distclean) $$escape_expand(\\n\\t) \ + -$(DEL_FILE) src/corelib/global/qconfig.h $$escape_expand(\\n\\t) \ + -$(DEL_FILE) src/corelib/global/qconfig.cpp $$escape_expand(\\n\\t) \ + -$(DEL_FILE) mkspecs/qconfig.pri $$escape_expand(\\n\\t) \ + -$(DEL_FILE) .qmake.cache $$escape_expand(\\n\\t) \ (cd qmake && $(MAKE) distclean) } } diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro index 5def728..63e78a7 100644 --- a/src/3rdparty/webkit/WebCore/WebCore.pro +++ b/src/3rdparty/webkit/WebCore/WebCore.pro @@ -159,7 +159,7 @@ defineTest(addExtraCompiler) { for(file,input) { base = $$basename(file) - base ~= s/\..+// + base ~= s/\\..+// newfile=$$replace(outputRule,\\$\\{QMAKE_FILE_BASE\\},$$base) SOURCES += $$newfile } diff --git a/src/3rdparty/webkit/WebKit/qt/Api/DerivedSources.pro b/src/3rdparty/webkit/WebKit/qt/Api/DerivedSources.pro index 389fb5f..22d4c8d 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/DerivedSources.pro +++ b/src/3rdparty/webkit/WebKit/qt/Api/DerivedSources.pro @@ -28,7 +28,7 @@ qtheader_module.commands += echo $${QUOTE}$${LITERAL_HASH}define QT_QTWEBKIT_MOD qtheader_module.commands += echo $${QUOTE}$${LITERAL_HASH}include $${ESCAPE}$${QUOTE} >> $${qtheader_module.target} && WEBKIT_CLASS_HEADERS = $${LITERAL_DOLLAR}$${LITERAL_DOLLAR}$${LITERAL_DOLLAR}$${LITERAL_DOLLAR}PWD/QtWebKit -regex = ".*\sclass\sQWEBKIT_EXPORT\s(\w+)\s(.*)" +regex = ".*\\sclass\\sQWEBKIT_EXPORT\\s(\\w+)\\s(.*)" for(HEADER, WEBKIT_API_HEADERS) { # 1. Append to QtWebKit header that includes all other header files @@ -70,7 +70,7 @@ for(HEADER, WEBKIT_API_HEADERS) { res = $$find(src, $$regex) isEmpty(res):break() - exp = $$replace(src, $$regex, "EXPORTED_CLASS = \1") + exp = $$replace(src, $$regex, "EXPORTED_CLASS = \\1") eval($$exp) CLASS_TARGET = "qtheader_$${EXPORTED_CLASS}" @@ -87,7 +87,7 @@ for(HEADER, WEBKIT_API_HEADERS) { # Qt's QRegExp does not support inline non-greedy matching, # so we'll have to work around it by updating the haystack - src = $$replace(src, $$regex, "\2") + src = $$replace(src, $$regex, "\\2") src_words = $$join(src, $${LITERAL_WHITESPACE}) } } diff --git a/src/3rdparty/webkit/WebKit/qt/docs/docs.pri b/src/3rdparty/webkit/WebKit/qt/docs/docs.pri index 804817b..a56ddb4 100644 --- a/src/3rdparty/webkit/WebKit/qt/docs/docs.pri +++ b/src/3rdparty/webkit/WebKit/qt/docs/docs.pri @@ -3,7 +3,7 @@ include(../../../WebKit.pri) unix { QDOC = SRCDIR=$$PWD/../../.. OUTPUT_DIR=$$OUTPUT_DIR $$(QTDIR)/bin/qdoc3 } else { - QDOC = $$(QTDIR)\bin\qdoc3.exe + QDOC = $$(QTDIR)\\bin\\qdoc3.exe } unix { diff --git a/src/activeqt/control/control.pro b/src/activeqt/control/control.pro index bf3647e..44eb928 100644 --- a/src/activeqt/control/control.pro +++ b/src/activeqt/control/control.pro @@ -15,7 +15,7 @@ TARGET = QAxServer } CONFIG += qt warn_off staticlib -QTDIR_build:DESTDIR = $$QT_BUILD_TREE\lib +QTDIR_build:DESTDIR = $$QT_BUILD_TREE\\lib DEFINES += QAX_SERVER win32-g++:DEFINES += QT_NEEDS_QMAIN diff --git a/tests/auto/declarative/parserstress/parserstress.pro b/tests/auto/declarative/parserstress/parserstress.pro index a95a855..3a675e4 100644 --- a/tests/auto/declarative/parserstress/parserstress.pro +++ b/tests/auto/declarative/parserstress/parserstress.pro @@ -6,7 +6,7 @@ SOURCES += tst_parserstress.cpp symbian: { DEFINES += SRCDIR=\".\" - importFiles.sources = ..\..\qscriptjstestsuite\tests + importFiles.sources = ..\\..\\qscriptjstestsuite\\tests importFiles.path = DEPLOYMENT = importFiles } else { diff --git a/tests/auto/linguist/lupdate/testdata/good/backslashes/project.pro b/tests/auto/linguist/lupdate/testdata/good/backslashes/project.pro index 4698b2b..d4dcda8 100644 --- a/tests/auto/linguist/lupdate/testdata/good/backslashes/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/backslashes/project.pro @@ -1,3 +1,3 @@ -SOURCES += src\main.cpp +SOURCES += src\\main.cpp -TRANSLATIONS = ts\project.ts +TRANSLATIONS = ts\\project.ts diff --git a/tests/auto/patternistexamples/patternistexamples.pro b/tests/auto/patternistexamples/patternistexamples.pro index 4092fc8..c528c93 100644 --- a/tests/auto/patternistexamples/patternistexamples.pro +++ b/tests/auto/patternistexamples/patternistexamples.pro @@ -13,7 +13,7 @@ wince*|symbian*: { recipes.sources = $$QT_SOURCE_TREE/examples/xmlpatterns/recipes/* recipes.path = recipes files.sources = $$QT_SOURCE_TREE/examples/xmlpatterns/recipes/files/* - files.path = recipes\files + files.path = recipes\\files DEPLOYMENT += snippets widgetRen globVar filetree recipes files # take care of dependency diff --git a/tests/auto/qaccessibility/qaccessibility.pro b/tests/auto/qaccessibility/qaccessibility.pro index e33c04d..1b30beb 100644 --- a/tests/auto/qaccessibility/qaccessibility.pro +++ b/tests/auto/qaccessibility/qaccessibility.pro @@ -5,7 +5,7 @@ unix:!mac:LIBS+=-lm contains(QT_CONFIG, qt3support): QT += qt3support wince*: { - accessneeded.sources = $$QT_BUILD_TREE\plugins\accessible\*.dll + accessneeded.sources = $$QT_BUILD_TREE\\plugins\\accessible\\*.dll accessneeded.path = accessible DEPLOYMENT += accessneeded } \ No newline at end of file diff --git a/tests/auto/qdesktopservices/qdesktopservices.pro b/tests/auto/qdesktopservices/qdesktopservices.pro index 9ef557d..d32ed4c 100644 --- a/tests/auto/qdesktopservices/qdesktopservices.pro +++ b/tests/auto/qdesktopservices/qdesktopservices.pro @@ -3,23 +3,23 @@ CONFIG += qttest_p4 SOURCES += tst_qdesktopservices.cpp TARGET = tst_qdesktopservices symbian: { - dummy.sources = text\testfile.txt + dummy.sources = text\\testfile.txt dummy.path = . - text.sources = text\* - text.path = \data\others\ + text.sources = text\\* + text.path = \\data\\others - image.sources = image\* - image.path = \data\images\ + image.sources = image\\* + image.path = \\data\\images - audio.sources = audio\* - audio.path = \data\sounds\ + audio.sources = audio\\* + audio.path = \\data\\sounds - video.sources = video\* - video.path = \data\videos\ + video.sources = video\\* + video.path = \\data\\videos - install.sources = install\* - install.path = \data\installs\ + install.sources = install\\* + install.path = \\data\\installs DEPLOYMENT += image audio video install diff --git a/tests/auto/qdirmodel/qdirmodel.pro b/tests/auto/qdirmodel/qdirmodel.pro index 5a66883..36929b9 100644 --- a/tests/auto/qdirmodel/qdirmodel.pro +++ b/tests/auto/qdirmodel/qdirmodel.pro @@ -2,9 +2,9 @@ load(qttest_p4) SOURCES += tst_qdirmodel.cpp wince*|symbian { - addit.sources = dirtest\test1\* - addit.path = dirtest\test1 - tests.sources = test\* + addit.sources = dirtest\\test1\\* + addit.path = dirtest\\test1 + tests.sources = test\\* tests.path = test sourceFile.sources = tst_qdirmodel.cpp sourceFile.path = . diff --git a/tests/auto/qfile/test/test.pro b/tests/auto/qfile/test/test.pro index faaa927..70c93ce 100644 --- a/tests/auto/qfile/test/test.pro +++ b/tests/auto/qfile/test/test.pro @@ -3,11 +3,11 @@ SOURCES += ../tst_qfile.cpp wince*|symbian { QT = core gui - files.sources += ..\dosfile.txt ..\noendofline.txt ..\testfile.txt \ - ..\testlog.txt ..\two.dots.file ..\tst_qfile.cpp \ - ..\Makefile ..\forCopying.txt ..\forRenaming.txt + files.sources += ..\\dosfile.txt ..\\noendofline.txt ..\\testfile.txt \ + ..\\testlog.txt ..\\two.dots.file ..\\tst_qfile.cpp \ + ..\\Makefile ..\\forCopying.txt ..\\forRenaming.txt files.path = . - resour.sources += ..\resources\file1.ext1 + resour.sources += ..\\resources\\file1.ext1 resour.path = resources DEPLOYMENT = files resour diff --git a/tests/auto/qfileinfo/qfileinfo.pro b/tests/auto/qfileinfo/qfileinfo.pro index 93599f4..2038514 100644 --- a/tests/auto/qfileinfo/qfileinfo.pro +++ b/tests/auto/qfileinfo/qfileinfo.pro @@ -8,7 +8,7 @@ RESOURCES += qfileinfo.qrc wince*:|symbian*: { deploy.sources += qfileinfo.qrc tst_qfileinfo.cpp - res.sources = resources\file1 resources\file1.ext1 resources\file1.ext1.ext2 + res.sources = resources\\file1 resources\\file1.ext1 resources\\file1.ext1.ext2 res.path = resources DEPLOYMENT = deploy res } diff --git a/tests/auto/qgraphicsscene/qgraphicsscene.pro b/tests/auto/qgraphicsscene/qgraphicsscene.pro index 31bb769..401c9eb 100644 --- a/tests/auto/qgraphicsscene/qgraphicsscene.pro +++ b/tests/auto/qgraphicsscene/qgraphicsscene.pro @@ -9,8 +9,8 @@ DEFINES += QT_NO_CAST_TO_ASCII wince*|symbian*: { rootFiles.sources = Ash_European.jpg graphicsScene_selection.data rootFiles.path = . - renderFiles.sources = testData\render\* - renderFiles.path = testData\render + renderFiles.sources = testData\\render\\* + renderFiles.path = testData\\render DEPLOYMENT += rootFiles renderFiles } wince*:{ diff --git a/tests/auto/qimagewriter/qimagewriter.pro b/tests/auto/qimagewriter/qimagewriter.pro index 8da2942..2171c3e 100644 --- a/tests/auto/qimagewriter/qimagewriter.pro +++ b/tests/auto/qimagewriter/qimagewriter.pro @@ -6,12 +6,12 @@ win32-msvc:QMAKE_CXXFLAGS -= -Zm200 win32-msvc:QMAKE_CXXFLAGS += -Zm800 wince*: { - addFiles.sources = images\*.* + addFiles.sources = images\\*.* addFiles.path = images DEPLOYMENT += addFiles DEFINES += SRCDIR=\\\".\\\" } else:symbian* { - addFiles.sources = images\*.* + addFiles.sources = images\\*.* addFiles.path = images DEPLOYMENT += addFiles qt_not_deployed { diff --git a/tests/auto/qlibrary/lib2/lib2.pro b/tests/auto/qlibrary/lib2/lib2.pro index 4654f4d..b441569 100644 --- a/tests/auto/qlibrary/lib2/lib2.pro +++ b/tests/auto/qlibrary/lib2/lib2.pro @@ -38,9 +38,9 @@ symbian-abld: { TARGET.CAPABILITY=ALL -TCB FIXEDROOT = $$replace(EPOCROOT,/,\\) QMAKE_POST_LINK = \ - copy /Y $${FIXEDROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dll $${FIXEDROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dl2 && \ - copy /Y $${FIXEDROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dll $${FIXEDROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\system.trolltech.test.mylib.dll && \ - IF NOT "$(PLATFORM)==WINSCW" copy /Y $${FIXEDROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dll ..\tst\mylib.dl2 + copy /Y $${FIXEDROOT}epoc32\\release\\$(PLATFORM)\\$(CFG)\\mylib.dll $${FIXEDROOT}epoc32\\release\\$(PLATFORM)\\$(CFG)\\mylib.dl2 && \ + copy /Y $${FIXEDROOT}epoc32\\release\\$(PLATFORM)\\$(CFG)\\mylib.dll $${FIXEDROOT}epoc32\\release\\$(PLATFORM)\\$(CFG)\\system.trolltech.test.mylib.dll && \ + IF NOT "$(PLATFORM)==WINSCW" copy /Y $${FIXEDROOT}epoc32\\release\\$(PLATFORM)\\$(CFG)\\mylib.dll ..\\tst\\mylib.dl2 } symbian-sbsv2: { diff --git a/tests/auto/qlocale/test/test.pro b/tests/auto/qlocale/test/test.pro index 7bc9f59..d57f2d1 100644 --- a/tests/auto/qlocale/test/test.pro +++ b/tests/auto/qlocale/test/test.pro @@ -25,7 +25,7 @@ wince*: { addFiles.sources = \ ../syslocaleapp - addFiles.path = \Program Files\tst_qlocale + addFiles.path = "\\Program Files\\tst_qlocale" DEPLOYMENT += addFiles } diff --git a/tests/auto/qlocalsocket/test/test.pro b/tests/auto/qlocalsocket/test/test.pro index cfdc89b..687aae2 100644 --- a/tests/auto/qlocalsocket/test/test.pro +++ b/tests/auto/qlocalsocket/test/test.pro @@ -34,7 +34,7 @@ wince* { symbian { additionalFiles.sources = lackey.exe - additionalFiles.path = \sys\bin + additionalFiles.path = \\sys\\bin TARGET.UID3 = 0xE0340005 DEFINES += SYMBIAN_SRCDIR_UID=$$lower($$replace(TARGET.UID3,"0x","")) } diff --git a/tests/auto/qmainwindow/qmainwindow.pro b/tests/auto/qmainwindow/qmainwindow.pro index 43d73ae..e015f95 100644 --- a/tests/auto/qmainwindow/qmainwindow.pro +++ b/tests/auto/qmainwindow/qmainwindow.pro @@ -2,5 +2,5 @@ load(qttest_p4) SOURCES += tst_qmainwindow.cpp # Symbian toolchain does not support correct include semantics -symbian:INCPATH+=..\..\..\include\QtGui\private +symbian:INCPATH+=..\\..\\..\\include\\QtGui\\private diff --git a/tests/auto/qmake/testdata/functions/functions.pro b/tests/auto/qmake/testdata/functions/functions.pro index 5e089e4..ad66ee8 100644 --- a/tests/auto/qmake/testdata/functions/functions.pro +++ b/tests/auto/qmake/testdata/functions/functions.pro @@ -53,7 +53,7 @@ include( infiletest.pro, "", true ) #replace VERSION=1.0.0 -VERSION_replaced=$$replace(VERSION,\.,_) +VERSION_replaced=$$replace(VERSION,\\.,_) !isEqual(VERSION_replaced, 1_0_0) { message( "FAILED: replace function: $$VERSION_replaced" ) } diff --git a/tests/auto/qmovie/qmovie.pro b/tests/auto/qmovie/qmovie.pro index 30e5901..a8ec478 100644 --- a/tests/auto/qmovie/qmovie.pro +++ b/tests/auto/qmovie/qmovie.pro @@ -7,14 +7,14 @@ MOC_DIR=tmp !contains(QT_CONFIG, no-mng):DEFINES += QTEST_HAVE_MNG wince*: { - addFiles.sources = animations\* + addFiles.sources = animations\\* addFiles.path = animations DEPLOYMENT += addFiles } symbian*: { - addFiles.sources = animations\* + addFiles.sources = animations\\* addFiles.path = animations DEPLOYMENT += addFiles diff --git a/tests/auto/qnetworkreply/test/test.pro b/tests/auto/qnetworkreply/test/test.pro index 7bf3852..b9ece38 100644 --- a/tests/auto/qnetworkreply/test/test.pro +++ b/tests/auto/qnetworkreply/test/test.pro @@ -31,7 +31,7 @@ symbian:{ DEPLOYMENT += certFiles # Symbian toolchain does not support correct include semantics - INCPATH+=..\..\..\..\include\QtNetwork\private + INCPATH+=..\\..\\..\\..\\include\\QtNetwork\\private # bigfile test case requires more heap TARGET.EPOCHEAPSIZE="0x100 0x1000000" TARGET.CAPABILITY="ALL -TCB" diff --git a/tests/auto/qobject/tst_qobject.pro b/tests/auto/qobject/tst_qobject.pro index 0200f3e..1d6993a 100644 --- a/tests/auto/qobject/tst_qobject.pro +++ b/tests/auto/qobject/tst_qobject.pro @@ -16,6 +16,6 @@ wince*: { } symbian: { addFiles.sources = signalbug.exe - addFiles.path = \sys\bin + addFiles.path = \\sys\\bin DEPLOYMENT += addFiles } diff --git a/tests/auto/qprocess/test/test.pro b/tests/auto/qprocess/test/test.pro index e1afd22..d555067 100644 --- a/tests/auto/qprocess/test/test.pro +++ b/tests/auto/qprocess/test/test.pro @@ -118,7 +118,7 @@ symbian: { testProcessOutput.exe \ nospace.exe \ testSpaceInName.exe - binDep.path = \sys\bin + binDep.path = \\sys\\bin DEPLOYMENT += binDep } diff --git a/tests/auto/qsocks5socketengine/qsocks5socketengine.pro b/tests/auto/qsocks5socketengine/qsocks5socketengine.pro index cd5e6e7..62c0c87 100644 --- a/tests/auto/qsocks5socketengine/qsocks5socketengine.pro +++ b/tests/auto/qsocks5socketengine/qsocks5socketengine.pro @@ -10,7 +10,7 @@ MOC_DIR=tmp QT = core network # Symbian toolchain does not support correct include semantics -symbian:INCPATH+=..\..\..\include\QtNetwork\private +symbian:INCPATH+=..\\..\\..\\include\\QtNetwork\\private symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/solutions.pri b/tests/auto/solutions.pri index bcffb64..5c069c5 100644 --- a/tests/auto/solutions.pri +++ b/tests/auto/solutions.pri @@ -7,10 +7,10 @@ SOLUTIONBASEDIR = $$(SOLUTIONBASEDIR) # strip the trailing "..." -# SOLUTIONBASEDIR ~= s/\.\.\.$// +# SOLUTIONBASEDIR ~= s/\\.\\.\\.$// # replace \ with / -# win32:SOLUTIONBASEDIR ~= s.\\./.g +# win32:SOLUTIONBASEDIR ~= s.\\\\./.g isEmpty(SOLUTIONBASEDIR):DEFINES += QT_NO_SOLUTIONS diff --git a/tests/auto/windowsmobile/test/test.pro b/tests/auto/windowsmobile/test/test.pro index 61e275d..f3124a3 100644 --- a/tests/auto/windowsmobile/test/test.pro +++ b/tests/auto/windowsmobile/test/test.pro @@ -11,7 +11,7 @@ wincewm*: { addFiles.sources = $$OUT_PWD/../testQMenuBar/*.exe - addFiles.path = "\Program Files\tst_windowsmobile" + addFiles.path = "\\Program Files\\tst_windowsmobile" DEPLOYMENT += addFiles } diff --git a/tools/assistant/lib/fulltextsearch/fulltextsearch.pro b/tools/assistant/lib/fulltextsearch/fulltextsearch.pro index e0cd13a..fb1a0dd 100644 --- a/tools/assistant/lib/fulltextsearch/fulltextsearch.pro +++ b/tools/assistant/lib/fulltextsearch/fulltextsearch.pro @@ -46,5 +46,5 @@ win32-msvc.net | win32-msvc2* { # the following define could be set globally in case we need it elsewhere solaris* { - DEFINES += Q_SOLARIS_VERSION=$$system(uname -r | sed -e 's/5\.//') + DEFINES += Q_SOLARIS_VERSION=$$system(uname -r | sed -e 's/5\\.//') } -- cgit v0.12 From 487c05895751985a695f117fd984d1ecfe7b1252 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 26 May 2010 14:06:27 +0200 Subject: escape quotes meant for the shell --- mkspecs/features/unix/separate_debug_info.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/unix/separate_debug_info.prf b/mkspecs/features/unix/separate_debug_info.prf index c675828..40d52cb 100644 --- a/mkspecs/features/unix/separate_debug_info.prf +++ b/mkspecs/features/unix/separate_debug_info.prf @@ -1,7 +1,7 @@ !separate_debug_info_nocopy:!staticlib:!static:!contains(TEMPLATE, subdirs):!isEmpty(QMAKE_OBJCOPY) { QMAKE_SEPARATE_DEBUG_INFO = (test -z \"$(DESTDIR)\" || cd \"$(DESTDIR)\" ; targ=`basename $(TARGET)`; $$QMAKE_OBJCOPY --only-keep-debug \"\$\$targ\" \"\$\$targ.debug\" && $$QMAKE_OBJCOPY --strip-debug \"\$\$targ\" && $$QMAKE_OBJCOPY --add-gnu-debuglink=\"\$\$targ.debug\" \"\$\$targ\" && chmod -x \"\$\$targ.debug\" ) ; - QMAKE_INSTALL_SEPARATE_DEBUG_INFO = test -z "$(DESTDIR)" || cd \"$(DESTDIR)\" ; $(INSTALL_FILE) `basename $(TARGET)`.debug $(INSTALL_ROOT)/\$\$target_path/ + QMAKE_INSTALL_SEPARATE_DEBUG_INFO = test -z \"$(DESTDIR)\" || cd \"$(DESTDIR)\" ; $(INSTALL_FILE) `basename $(TARGET)`.debug $(INSTALL_ROOT)/\$\$target_path/ QMAKE_POST_LINK = $$QMAKE_SEPARATE_DEBUG_INFO $$QMAKE_POST_LINK silent:QMAKE_POST_LINK = @echo creating $@.debug && $$QMAKE_POST_LINK -- cgit v0.12 From a5391f187b91aaf9d6932f2ad1e81701e6cd0352 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 27 May 2010 08:59:03 +1000 Subject: Remove deprecated Flickable::overshoot property. --- .../graphicsitems/qdeclarativeflickable.cpp | 19 ------------------- .../graphicsitems/qdeclarativeflickable_p.h | 5 ----- 2 files changed, 24 deletions(-) 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 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 flickableData(); QDeclarativeListProperty 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(); -- cgit v0.12 From 0da1b076bf4e33f239ebe9dc4d8f5363ee24110b Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 27 May 2010 14:30:23 +1000 Subject: If a pathview delegate changes size, reposition center on path Task-number: QTBUG-11006 --- .../graphicsitems/qdeclarativepathview.cpp | 15 ++++++++++++++ .../graphicsitems/qdeclarativepathview_p.h | 1 + .../graphicsitems/qdeclarativepathview_p_p.h | 24 ++++++++++++++++++---- .../qdeclarativepathview/data/pathview0.qml | 6 ++++-- .../tst_qdeclarativepathview.cpp | 6 ++++++ 5 files changed, 46 insertions(+), 6 deletions(-) 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(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(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/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; } -- cgit v0.12 From f1603f8a4bd3027be201920fa99c9370264bee03 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Thu, 27 May 2010 15:21:28 +1000 Subject: Improve QML framerate debugging --- src/declarative/debugger/debugger.pri | 6 +- .../debugger/qdeclarativedebugservice.cpp | 11 +++ .../debugger/qdeclarativedebugtiming.cpp | 95 +++++++++++++++++++++ .../debugger/qdeclarativedebugtiming_p.h | 96 +++++++++++++++++++++ src/declarative/qml/qdeclarativecomponent.cpp | 8 ++ src/declarative/util/qdeclarativeview.cpp | 98 +++++++++++----------- 6 files changed, 265 insertions(+), 49 deletions(-) create mode 100644 src/declarative/debugger/qdeclarativedebugtiming.cpp create mode 100644 src/declarative/debugger/qdeclarativedebugtiming_p.h 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 + +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/src/declarative/debugger/qdeclarativedebugtiming_p.h b/src/declarative/debugger/qdeclarativedebugtiming_p.h new file mode 100644 index 0000000..d9ed67c --- /dev/null +++ b/src/declarative/debugger/qdeclarativedebugtiming_p.h @@ -0,0 +1,96 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +#ifndef QDECLARATIVEDEBUGTIMING_P_H +#define QDECLARATIVEDEBUGTIMING_P_H + +#include +#include + +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/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 #include @@ -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 #include #include -#include -#include #include #include +#include + #include #include #include @@ -66,66 +66,64 @@ #include #include #include +#include #include 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; } -- cgit v0.12 From 1f40fe507e6b6c74144cbb998cc91f88f9e33168 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 26 May 2010 15:11:34 +0200 Subject: Ensure that activation object has been created before popping scope of native context One shouldn't have to call activationObject() or scopeChain() before calling popScope(); the scope chain should always have 2 items (activation and global object) before we start popping anything from the internal chain. Task-number: QTBUG-11020 Reviewed-by: Olivier Goffart --- src/script/api/qscriptcontext.cpp | 1 + tests/auto/qscriptcontext/tst_qscriptcontext.cpp | 45 ++++++++++++++++++++++++ 2 files changed, 46 insertions(+) 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/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; -- cgit v0.12 From fe824f6175ebbeb1940872275b31f9894d056ad0 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Wed, 26 May 2010 16:09:49 +0200 Subject: Added support for Indonesian language on Symbian. We have support for ELangIndonesian, but we also need to support new ELangIndonesian_Apac which has appeared in Symbian^3. Task-number: QT-3369 Reviewed-by: trustme --- src/corelib/tools/qlocale_symbian.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 }; /*! -- cgit v0.12 From bc5e4da28c1ffbc0da1cbfcaa1e6236ff4c2d4e3 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Thu, 27 May 2010 12:15:54 +0200 Subject: Fixed a crash when creating QGtkStyle before QApplication Task-number: QTBUG-10758 Reviewed-by: ogoffart --- src/gui/styles/qgtkstyle.cpp | 2 ++ src/gui/styles/qgtkstyle_p.cpp | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) 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) -- cgit v0.12 From 975dbe047590253e9d4433030d76ab26969f621f Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Thu, 27 May 2010 13:37:58 +0200 Subject: Update documentation for the -font command line option This option is ignored when Qt is built with fontconfig support, make sure it is documented. Task-number: QTBUG-3671 --- src/gui/kernel/qapplication.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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. -- cgit v0.12 From 773cfe5b87e8f92aba1e5648dc57f559c6e43741 Mon Sep 17 00:00:00 2001 From: kh1 Date: Thu, 27 May 2010 14:41:12 +0200 Subject: Remove superfluous forward declaration. Task-number: QTBUG-11049 Reviewed-by: ck --- tools/assistant/lib/qhelpsearchindexreader_default_p.h | 3 --- 1 file changed, 3 deletions(-) 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 { -- cgit v0.12 From 5f66639e069f276a20f27373a0c2e7dd9d94f390 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Thu, 27 May 2010 15:35:17 +0200 Subject: Tweak aesthetics of QML viewer inside QtDemo Make the UX more controlled from QML, and tweak the frame to be better. Blur mechanism has been reworked, but still disabled by default. --- demos/qtdemo/MagicAnim.qml | 60 --------------- demos/qtdemo/colors.cpp | 2 +- demos/qtdemo/mainwindow.cpp | 12 +-- demos/qtdemo/menumanager.cpp | 35 ++++----- demos/qtdemo/menumanager.h | 3 +- demos/qtdemo/qmlShell.qml | 177 +++++++++++++++++++++++-------------------- demos/qtdemo/qtdemo.pro | 3 +- demos/qtdemo/qtdemo.qrc | 1 - 8 files changed, 118 insertions(+), 175 deletions(-) delete mode 100644 demos/qtdemo/MagicAnim.qml diff --git a/demos/qtdemo/MagicAnim.qml b/demos/qtdemo/MagicAnim.qml deleted file mode 100644 index 7ac3e1c..0000000 --- a/demos/qtdemo/MagicAnim.qml +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** 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 demonstration applications 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$ -** -****************************************************************************/ - -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 } -} - 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] [-use-loop] [-use-balls] " + "[-animation-speed] [-fps] " 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("Effects", 1, 0, "Blur"); + qmlRegisterType("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.
    If you installed Qt's QML modules this is a bug!
    " + + 'Report it at http://bugreports.qt.nokia.com'; + 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!
    ' - +'Report it at http://bugreports.qt.nokia.com'; - 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 @@ qmlShell.qml - MagicAnim.qml -- cgit v0.12 From 2c54f49584023633c5992579d23dc6819ec79c9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Thu, 27 May 2010 15:28:26 +0200 Subject: Wrong QGraphicsItem::childrenBoundingRect() when applying effects. Problem was that we used the children's raw bounding rect instead of using their effective bounding rect when calculating the bounds. Auto test included. Task-number: QTBUG-10756 --- src/gui/graphicsview/qgraphicsitem.cpp | 6 +++--- tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 29 ++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index db6c4c5..36d21a6 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -1275,14 +1275,14 @@ void QGraphicsItemPrivate::childrenBoundingRectHelper(QTransform *x, QRectF *rec QTransform matrix = childd->transformToParent(); if (x) matrix *= *x; - *rect |= matrix.mapRect(child->boundingRect()); + *rect |= matrix.mapRect(child->d_ptr->effectiveBoundingRect()); if (!childd->children.isEmpty()) childd->childrenBoundingRectHelper(&matrix, rect); } else { if (x) - *rect |= x->mapRect(child->boundingRect()); + *rect |= x->mapRect(child->d_ptr->effectiveBoundingRect()); else - *rect |= child->boundingRect(); + *rect |= child->d_ptr->effectiveBoundingRect(); if (!childd->children.isEmpty()) childd->childrenBoundingRectHelper(x, rect); } diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 300afc3..5547b02 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -348,6 +348,7 @@ private slots: void childrenBoundingRect2(); void childrenBoundingRect3(); void childrenBoundingRect4(); + void childrenBoundingRect5(); void group(); void setGroup(); void setGroup2(); @@ -3369,6 +3370,34 @@ void tst_QGraphicsItem::childrenBoundingRect4() QCOMPARE(rect2->childrenBoundingRect(), rect3->boundingRect()); } +void tst_QGraphicsItem::childrenBoundingRect5() +{ + QGraphicsScene scene; + + QGraphicsRectItem *parent = scene.addRect(QRectF(0, 0, 100, 100)); + QGraphicsRectItem *child = scene.addRect(QRectF(0, 0, 100, 100)); + child->setParentItem(parent); + + QGraphicsView view(&scene); + view.show(); + + QTest::qWaitForWindowShown(&view); + + // Try to mess up the cached bounding rect. + QRectF expectedChildrenBoundingRect = parent->boundingRect(); + QCOMPARE(parent->childrenBoundingRect(), expectedChildrenBoundingRect); + + // Apply some effects. + QGraphicsDropShadowEffect *dropShadow = new QGraphicsDropShadowEffect; + dropShadow->setOffset(25, 25); + child->setGraphicsEffect(dropShadow); + parent->setGraphicsEffect(new QGraphicsOpacityEffect); + + QVERIFY(parent->childrenBoundingRect() != expectedChildrenBoundingRect); + expectedChildrenBoundingRect |= dropShadow->boundingRect(); + QCOMPARE(parent->childrenBoundingRect(), expectedChildrenBoundingRect); +} + void tst_QGraphicsItem::group() { QGraphicsScene scene; -- cgit v0.12 From 7fbd0a170a90f8fba8e81abb964ec06702f25448 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 27 May 2010 16:35:28 +0200 Subject: Upgrade harfbuzz to the latest version Merge the folling changes from harfbuzz: commit 85ad0ddd092522b4cff251f324128662f100991f Author: Lars Knoll Date: Thu May 27 16:05:00 2010 +0200 use unsigned char instead of unsigned in the bitfield. This saves significant memory, as the HB_CharAttributes and HB_GlyphAttributes structures are not 4 byte aligned anymore, by aligned to 1 resp. 2 bytes. The change is not compliant with ISO C, but accepted by almost all compilers. commit 30f0e6c3d0aa67ab9ff95c60903fe28c4df80fbc Author: Behdad Esfahbod Date: Mon May 17 15:43:46 2010 -0400 [hangul] Fix typo Reviewed-By: Thiago Macieira --- src/3rdparty/harfbuzz/src/harfbuzz-hangul.c | 2 +- src/3rdparty/harfbuzz/src/harfbuzz-shaper.h | 36 +++++++++++++++++++---------- 2 files changed, 25 insertions(+), 13 deletions(-) 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_ { -- cgit v0.12 From 19c2aef89f7a8748c11161ffab9765313d0e2e7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Thu, 27 May 2010 16:36:19 +0200 Subject: Removed unused variable Reviewed-by: Olivier Goffart --- src/gui/itemviews/qitemdelegate.cpp | 1 - 1 file changed, 1 deletion(-) 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)) -- cgit v0.12 From c3d652967c313cdc1853e9d905440ddf645c49f4 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 27 May 2010 15:42:10 +0200 Subject: fix & unify path separator escaping Reviewed-by: mauricek --- configure.exe | Bin 1316864 -> 1317888 bytes tools/configure/configureapp.cpp | 104 +++++++++++++++++++++------------------ tools/configure/configureapp.h | 3 +- 3 files changed, 58 insertions(+), 49 deletions(-) diff --git a/configure.exe b/configure.exe index a19f515..1fddc81 100755 Binary files a/configure.exe and b/configure.exe differ 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); -- cgit v0.12 From c86bb735e9b783b03010bc830c2a7a2fbcdb71b7 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 27 May 2010 16:31:57 +0200 Subject: escape backslashes in QMAKE_PRL_LIBS they may contain (absolute) windows paths, which need escaping now. Reviewed-by: mauricek --- qmake/generators/makefile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } } -- cgit v0.12 From f399b0deede15c7c5cb1108db261b77452afb394 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 27 May 2010 16:39:11 +0200 Subject: fix escaping - by not using eval the left-hand-side of qmake assignments is expanded, so there is no need to use eval. --- mkspecs/features/incredibuild_xge.prf | 6 +++--- src/src.pro | 16 ++++++++-------- src/tools/tools.pro | 16 ++++++++-------- 3 files changed, 19 insertions(+), 19 deletions(-) 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/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} } -- cgit v0.12 From aaf3e8013d21b7f9247da7751a340b75d1deedc2 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Fri, 28 May 2010 17:40:08 +1000 Subject: Make QGLBuffer copiable Reviewed-by: Gunnar --- src/opengl/qglbuffer.cpp | 92 +++++++++++++++++++++++++++++++++++++++++++----- src/opengl/qglbuffer.h | 9 +++-- 2 files changed, 90 insertions(+), 11 deletions(-) diff --git a/src/opengl/qglbuffer.cpp b/src/opengl/qglbuffer.cpp index 223243c..d6e0109 100644 --- a/src/opengl/qglbuffer.cpp +++ b/src/opengl/qglbuffer.cpp @@ -42,6 +42,7 @@ #include #include #include +#include #include "qglbuffer.h" QT_BEGIN_NAMESPACE @@ -55,6 +56,20 @@ QT_BEGIN_NAMESPACE Buffer objects are created in the GL server so that the client application can avoid uploading vertices, indices, texture image data, etc every time they are needed. + + QGLBuffer objects can be copied around as a reference to the + underlying GL buffer object: + + \code + QGLBuffer buffer1(QGLBuffer::IndexBuffer); + buffer1.create(); + + QGLBuffer buffer2 = buffer1; + \endcode + + QGLBuffer performs a shallow copy when objects are copied in this + manner, but does not implement copy-on-write semantics. The original + object will be affected whenever the copy is modified. */ /*! @@ -116,13 +131,15 @@ class QGLBufferPrivate { public: QGLBufferPrivate(QGLBuffer::Type t) - : type(t), + : ref(1), + type(t), guard(0), usagePattern(QGLBuffer::StaticDraw), actualUsagePattern(QGLBuffer::StaticDraw) { } + QAtomicInt ref; QGLBuffer::Type type; QGLSharedResourceGuard guard; QGLBuffer::UsagePattern usagePattern; @@ -130,6 +147,19 @@ public: }; /*! + Constructs a new buffer object of type QGLBuffer::VertexBuffer. + + Note: this constructor just creates the QGLBuffer instance. The actual + buffer object in the GL server is not created until create() is called. + + \sa create() +*/ +QGLBuffer::QGLBuffer() + : d_ptr(new QGLBufferPrivate(QGLBuffer::VertexBuffer)) +{ +} + +/*! Constructs a new buffer object of \a type. Note: this constructor just creates the QGLBuffer instance. The actual @@ -142,6 +172,18 @@ QGLBuffer::QGLBuffer(QGLBuffer::Type type) { } +/*! + Constructs a shallow copy of \a other. + + Note: QGLBuffer does not implement copy-on-write semantics, + so \a other will be affected whenever the copy is modified. +*/ +QGLBuffer::QGLBuffer(const QGLBuffer &other) + : d_ptr(other.d_ptr) +{ + d_ptr->ref.ref(); +} + #define ctx d->guard.context() /*! @@ -150,13 +192,27 @@ QGLBuffer::QGLBuffer(QGLBuffer::Type type) */ QGLBuffer::~QGLBuffer() { - Q_D(QGLBuffer); - GLuint bufferId = d->guard.id(); - if (bufferId) { - // Switch to the original creating context to destroy it. - QGLShareContextScope scope(d->guard.context()); - glDeleteBuffers(1, &bufferId); + if (!d_ptr->ref.deref()) { + destroy(); + delete d_ptr; + } +} + +/*! + Assigns a shallow copy of \a other to this object. + + Note: QGLBuffer does not implement copy-on-write semantics, + so \a other will be affected whenever the copy is modified. +*/ +QGLBuffer &QGLBuffer::operator=(const QGLBuffer &other) +{ + if (d_ptr != other.d_ptr) { + other.d_ptr->ref.ref(); + if (!d_ptr->ref.deref()) + destroy(); + d_ptr = other.d_ptr; } + return *this; } /*! @@ -215,7 +271,7 @@ void QGLBuffer::setUsagePattern(QGLBuffer::UsagePattern value) This function will return false if the GL implementation does not support buffers, or there is no current QGLContext. - \sa isCreated(), allocate(), write() + \sa isCreated(), allocate(), write(), destroy() */ bool QGLBuffer::create() { @@ -242,7 +298,7 @@ bool QGLBuffer::create() /*! Returns true if this buffer has been created; false otherwise. - \sa create() + \sa create(), destroy() */ bool QGLBuffer::isCreated() const { @@ -251,6 +307,24 @@ bool QGLBuffer::isCreated() const } /*! + Destroys this buffer object, including the storage being + used in the GL server. All references to the buffer will + become invalid. +*/ +void QGLBuffer::destroy() +{ + Q_D(QGLBuffer); + GLuint bufferId = d->guard.id(); + if (bufferId) { + // Switch to the original creating context to destroy it. + QGLShareContextScope scope(d->guard.context()); + glDeleteBuffers(1, &bufferId); + } + d->guard.setId(0); + d->guard.setContext(0); +} + +/*! Reads the \a count bytes in this buffer starting at \a offset into \a data. Returns true on success; false if reading from the buffer is not supported. Buffer reading is not supported diff --git a/src/opengl/qglbuffer.h b/src/opengl/qglbuffer.h index 2fe1f1f..a1b45ff 100644 --- a/src/opengl/qglbuffer.h +++ b/src/opengl/qglbuffer.h @@ -64,9 +64,13 @@ public: PixelUnpackBuffer = 0x88EC // GL_PIXEL_UNPACK_BUFFER }; + QGLBuffer(); explicit QGLBuffer(QGLBuffer::Type type); + QGLBuffer(const QGLBuffer &other); ~QGLBuffer(); + QGLBuffer &operator=(const QGLBuffer &other); + enum UsagePattern { StreamDraw = 0x88E0, // GL_STREAM_DRAW @@ -95,6 +99,8 @@ public: bool create(); bool isCreated() const; + void destroy(); + bool bind() const; void release() const; @@ -114,9 +120,8 @@ public: bool unmap(); private: - QScopedPointer d_ptr; + QGLBufferPrivate *d_ptr; - Q_DISABLE_COPY(QGLBuffer) Q_DECLARE_PRIVATE(QGLBuffer) }; -- cgit v0.12 From b9d899339118f24b34182e7dbe7aed5956d927e7 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 25 May 2010 15:16:38 +0200 Subject: add test for QMetaMethod::invoke --- tests/auto/qmetaobject/tst_qmetaobject.cpp | 51 ++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/tests/auto/qmetaobject/tst_qmetaobject.cpp b/tests/auto/qmetaobject/tst_qmetaobject.cpp index c0b1303..b6d4558 100644 --- a/tests/auto/qmetaobject/tst_qmetaobject.cpp +++ b/tests/auto/qmetaobject/tst_qmetaobject.cpp @@ -172,6 +172,8 @@ private slots: void stdSet(); void classInfo(); + void metaMethod(); + signals: void value6Changed(); void value7Changed(const QString &); @@ -886,5 +888,54 @@ void tst_QMetaObject::classInfo() QCOMPARE(QLatin1String(b.metaObject()->classInfo(index).value()), QLatin1String("Christopher Pike")); } +void tst_QMetaObject::metaMethod() +{ + QString str("foo"); + QString ret("bar"); + QMetaMethod method; + QVERIFY(!method.invoke(this)); + QVERIFY(!method.invoke(this, Q_ARG(QString, str))); + QVERIFY(!method.invoke(this, Q_RETURN_ARG(QString, ret), Q_ARG(QString, str))); + QCOMPARE(str, QString("foo")); + QCOMPARE(ret, QString("bar")); + + + QtTestObject obj; + QString t1("1"); QString t2("2"); QString t3("3"); QString t4("4"); QString t5("5"); + QString t6("6"); QString t7("7"); QString t8("8"); QString t9("9"); QString t10("X"); + + int index = QtTestObject::staticMetaObject.indexOfMethod("sl5(QString,QString,QString,QString,QString)"); + QVERIFY(index > 0); + method = QtTestObject::staticMetaObject.method(index); + //wrong args + QVERIFY(!method.invoke(&obj, Q_ARG(QString, "1"), Q_ARG(QString, "2"), Q_ARG(QString, "3"), Q_ARG(QString, "4"))); + //QVERIFY(!method.invoke(&obj, Q_ARG(QString, "1"), Q_ARG(QString, "2"), Q_ARG(QString, "3"), Q_ARG(QString, "4"), Q_ARG(QString, "5"), Q_ARG(QString, "6"))); + //QVERIFY(!method.invoke(&obj, Q_ARG(QString, "1"), Q_ARG(QString, "2"), Q_ARG(QString, "3"), Q_ARG(QString, "4"), Q_ARG(int, 5))); + QVERIFY(!method.invoke(&obj, Q_RETURN_ARG(QString, ret), Q_ARG(QString, "1"), Q_ARG(QString, "2"), Q_ARG(QString, "3"), Q_ARG(QString, "4"), Q_ARG(QString, "5"))); + + //wrong object + //QVERIFY(!method.invoke(this, Q_ARG(QString, "1"), Q_ARG(QString, "2"), Q_ARG(QString, "3"), Q_ARG(QString, "4"), Q_ARG(QString, "5"))); + QVERIFY(!method.invoke(0, Q_ARG(QString, "1"), Q_ARG(QString, "2"), Q_ARG(QString, "3"), Q_ARG(QString, "4"), Q_ARG(QString, "5"))); + QCOMPARE(ret, QString("bar")); + QCOMPARE(obj.slotResult, QString()); + + QVERIFY(method.invoke(&obj, Q_ARG(QString, "1"), Q_ARG(QString, "2"), Q_ARG(QString, "3"), Q_ARG(QString, "4"), Q_ARG(QString, "5"))); + QCOMPARE(obj.slotResult, QString("sl5:12345")); + + index = QtTestObject::staticMetaObject.indexOfMethod("sl13(QList)"); + QVERIFY(index > 0); + QMetaMethod sl13 = QtTestObject::staticMetaObject.method(index); + QList returnValue, argument; + argument << QString("one") << QString("two") << QString("three"); + //wrong object + //QVERIFY(!sl13.invoke(this, Q_RETURN_ARG(QList, returnValue), Q_ARG(QList, argument))); + QVERIFY(!sl13.invoke(0, Q_RETURN_ARG(QList, returnValue), Q_ARG(QList, argument))); + QCOMPARE(returnValue, QList()); + + QVERIFY(sl13.invoke(&obj, Q_RETURN_ARG(QList, returnValue), Q_ARG(QList, argument))); + QCOMPARE(returnValue, argument); + QCOMPARE(obj.slotResult, QString("sl13")); +} + QTEST_MAIN(tst_QMetaObject) #include "tst_qmetaobject.moc" -- cgit v0.12 From 49a5cf7cd44584e04d1f54f3fbd0d5c86fe55c83 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 28 May 2010 11:49:20 +0200 Subject: QMetaMethod::invoke: Document that the function does not check the arguments And added an assert to ease debugging Task-number: QTBUG-10945 --- src/corelib/kernel/qmetaobject.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index 4ad78fd..79a38cd 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -1454,6 +1454,11 @@ QMetaMethod::MethodType QMetaMethod::methodType() const If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail. + \warning this method will not test the validity of the arguments: \a object + must be an instance of the class of the QMetaObject of which this QMetaMethod + has been constructed with. The arguments must have the same type as the ones + expected by the method, else, the behaviour is undefined. + \sa Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), QMetaObject::invokeMethod() */ bool QMetaMethod::invoke(QObject *object, @@ -1473,6 +1478,8 @@ bool QMetaMethod::invoke(QObject *object, if (!object || !mobj) return false; + Q_ASSERT(mobj->cast(object)); + // check return type if (returnValue.data()) { const char *retType = typeName(); -- cgit v0.12 From fa7dfb24c2d165cad438eb28c83ac2fd60831b29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Thu, 27 May 2010 16:07:46 +0200 Subject: Improve precision of testlib benchmarking. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 20 ms is a bit too to get a precise measurement due to limited timer resolution. We increase the limit to 50 ms and introduce a warm-up iteration to prevent any state or cache-related issues which can be hard to account for in the tests. On the N900 this seems to decrease the variance of test results by 30 %, and fixes some cases where the results were way off due to hidden state. Task-number: QT-3390 Reviewed-by: Morten Sørvig --- src/testlib/qbenchmarkmeasurement.cpp | 7 ++++++- src/testlib/qbenchmarkmeasurement_p.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/testlib/qbenchmarkmeasurement.cpp b/src/testlib/qbenchmarkmeasurement.cpp index c03cbff..0a84792 100644 --- a/src/testlib/qbenchmarkmeasurement.cpp +++ b/src/testlib/qbenchmarkmeasurement.cpp @@ -66,7 +66,7 @@ qint64 QBenchmarkTimeMeasurer::stop() bool QBenchmarkTimeMeasurer::isMeasurementAccepted(qint64 measurement) { - return (measurement > 20); + return (measurement > 50); } int QBenchmarkTimeMeasurer::adjustIterationCount(int suggestion) @@ -74,6 +74,11 @@ int QBenchmarkTimeMeasurer::adjustIterationCount(int suggestion) return suggestion; } +bool QBenchmarkTimeMeasurer::needsWarmupIteration() +{ + return true; +} + int QBenchmarkTimeMeasurer::adjustMedianCount(int) { return 1; diff --git a/src/testlib/qbenchmarkmeasurement_p.h b/src/testlib/qbenchmarkmeasurement_p.h index 8ad3613..932852c 100644 --- a/src/testlib/qbenchmarkmeasurement_p.h +++ b/src/testlib/qbenchmarkmeasurement_p.h @@ -84,6 +84,7 @@ public: bool isMeasurementAccepted(qint64 measurement); int adjustIterationCount(int sugestion); int adjustMedianCount(int suggestion); + bool needsWarmupIteration(); QTest::QBenchmarkMetric metricType(); private: QTime time; -- cgit v0.12 From 60c12264b0ff01bb4888323b3acda0bc581021a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Fri, 28 May 2010 11:55:47 +0200 Subject: Fixed bug where testlib would not respect the -iterations option. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Morten Sørvig --- src/testlib/qbenchmark.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/testlib/qbenchmark.cpp b/src/testlib/qbenchmark.cpp index 23c5639..c88ecb0 100644 --- a/src/testlib/qbenchmark.cpp +++ b/src/testlib/qbenchmark.cpp @@ -159,7 +159,7 @@ void QBenchmarkTestMethodData::setResult( if (QBenchmarkGlobalData::current->iterationCount != -1) accepted = true; - if (QBenchmarkTestMethodData::current->runOnce || !setByMacro) { + else if (QBenchmarkTestMethodData::current->runOnce || !setByMacro) { iterationCount = 1; accepted = true; } -- cgit v0.12