summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xconfigure10
-rw-r--r--demos/declarative/calculator/Core/calculator.js4
-rw-r--r--demos/declarative/calculator/calculator.qml14
-rw-r--r--demos/qtdemo/examplecontent.cpp4
-rw-r--r--doc/src/declarative/examples.qdoc5
-rw-r--r--doc/src/declarative/qdeclarativestates.qdoc183
-rw-r--r--doc/src/declarative/qmlviewer.qdoc8
-rw-r--r--doc/src/development/developing-with-qt.qdoc61
-rw-r--r--doc/src/examples/qml-examples.qdoc8
-rw-r--r--doc/src/files-and-resources/resources.qdoc2
-rw-r--r--doc/src/frameworks-technologies/eventsandfilters.qdoc2
-rw-r--r--doc/src/getting-started/gettingstarted.qdoc26
-rw-r--r--doc/src/index.qdoc12
-rw-r--r--doc/src/internationalization/linguist-manual.qdoc4
-rw-r--r--doc/src/porting/porting4.qdoc14
-rw-r--r--doc/src/qt-webpages.qdoc8
-rw-r--r--doc/src/snippets/declarative/state-when.qml55
-rw-r--r--doc/src/snippets/declarative/state.qml18
-rw-r--r--doc/src/snippets/declarative/states.qml38
-rw-r--r--doc/src/template/style/OfflineStyle.css251
-rw-r--r--doc/src/template/style/narrow.css21
-rwxr-xr-xdoc/src/template/style/style.css6
-rw-r--r--doc/src/template/style/superfish_skin.css83
-rw-r--r--doc/src/widgets-and-layouts/layout.qdoc2
-rw-r--r--examples/declarative/screenorientation/Core/Bubble.qml91
-rw-r--r--examples/declarative/screenorientation/Core/Button.qml72
-rw-r--r--examples/declarative/screenorientation/Core/screenorientation.js95
-rw-r--r--examples/declarative/screenorientation/screenorientation.qml202
-rw-r--r--examples/declarative/screenorientation/screenorientation.qmlproject16
-rw-r--r--src/3rdparty/libconninet/src/dbusdispatcher.cpp2
-rw-r--r--src/3rdparty/phonon/mmf/abstractmediaplayer.cpp28
-rw-r--r--src/3rdparty/phonon/mmf/abstractmediaplayer.h6
-rw-r--r--src/3rdparty/phonon/mmf/abstractplayer.h4
-rw-r--r--src/3rdparty/phonon/mmf/abstractvideoplayer.cpp6
-rw-r--r--src/3rdparty/phonon/mmf/abstractvideoplayer.h1
-rw-r--r--src/3rdparty/phonon/mmf/audioplayer.cpp6
-rw-r--r--src/3rdparty/phonon/mmf/audioplayer.h1
-rw-r--r--src/3rdparty/phonon/mmf/dummyplayer.cpp2
-rw-r--r--src/3rdparty/phonon/mmf/dummyplayer.h2
-rw-r--r--src/3rdparty/phonon/mmf/mediaobject.cpp75
-rw-r--r--src/3rdparty/phonon/mmf/mediaobject.h11
-rw-r--r--src/3rdparty/phonon/phonon/mediasource.cpp1
-rw-r--r--src/corelib/io/qfilesystemwatcher_kqueue.cpp5
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp5
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.cpp75
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp6
-rw-r--r--src/declarative/graphicsitems/qdeclarativetranslate.cpp8
-rw-r--r--src/declarative/util/qdeclarativepixmapcache.cpp33
-rw-r--r--src/declarative/util/qdeclarativestate.cpp19
-rw-r--r--src/gui/kernel/qpalette.cpp4
-rw-r--r--src/gui/painting/qpaintengine_x11.cpp22
-rw-r--r--src/gui/s60framework/qs60maindocument.cpp6
-rw-r--r--src/gui/text/qfontengine_mac.mm32
-rw-r--r--src/gui/text/qstatictext.cpp7
-rw-r--r--src/gui/util/qdesktopservices_x11.cpp12
-rw-r--r--src/network/bearer/qnetworkconfiguration.cpp2
-rw-r--r--src/network/bearer/qnetworkconfiguration_p.h2
-rw-r--r--src/s60installs/bwins/QtGuiu.def3
-rw-r--r--src/s60installs/bwins/QtNetworku.def2
-rw-r--r--src/s60installs/eabi/QtGuiu.def3
-rw-r--r--src/s60installs/eabi/QtNetworku.def4
-rw-r--r--src/s60installs/s60installs.pro4
-rw-r--r--src/script/api/qscriptcontext.cpp10
-rw-r--r--src/script/api/qscriptcontextinfo.cpp11
-rw-r--r--src/script/api/qscriptcontextinfo.h4
-rw-r--r--src/script/api/qscriptengine.cpp15
-rw-r--r--src/script/api/qscriptengineagent.cpp7
-rw-r--r--tests/auto/declarative/qdeclarativepixmapcache/data/massive.pngbin0 -> 31834 bytes
-rw-r--r--tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp40
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/extendsBug.qml26
-rw-r--r--tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp16
-rw-r--r--tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp36
-rw-r--r--tests/auto/mediaobject/tst_mediaobject.cpp4
-rw-r--r--tests/auto/qpainter/tst_qpainter.cpp65
-rw-r--r--tools/qdoc3/main.cpp4
-rw-r--r--tools/qdoc3/test/assistant.qdocconf52
-rw-r--r--tools/qdoc3/test/qdeclarative.qdocconf52
-rw-r--r--tools/qdoc3/test/qt-api-only.qdocconf5
-rw-r--r--tools/qdoc3/test/qt-build-docs.qdocconf1
-rw-r--r--tools/qdoc3/test/qt-cpp-ignore.qdocconf1
-rw-r--r--tools/qdoc3/test/qt-html-templates.qdocconf2
-rw-r--r--tools/qdoc3/test/qt.qdocconf4
-rw-r--r--tools/qml/deviceorientation_symbian.cpp15
-rw-r--r--tools/qml/qml.pro3
-rw-r--r--tools/qml/qmlruntime.cpp74
-rw-r--r--tools/qml/qmlruntime.h3
86 files changed, 1508 insertions, 656 deletions
diff --git a/configure b/configure
index c61250b..c322634 100755
--- a/configure
+++ b/configure
@@ -2397,6 +2397,14 @@ if [ "$OPT_SHADOW" = "yes" ]; then
ln -s "$relpath"/mkspecs/* "$outpath/mkspecs"
rm -f "$outpath/mkspecs/default"
+ # Special case for mkspecs/features directory.
+ # To be able to place .prf files into a shadow build directory,
+ # we're creating links for files only. The directory structure is reproduced.
+ # A simple "cp -rs" doesn't work on Mac. :(
+ rm -rf "$outpath/mkspecs/features"
+ find "$relpath/mkspecs/features" -type d | sed "s,^$relpath,$outpath," | xargs mkdir -p
+ find "$relpath/mkspecs/features" -type f | sed "s,^$relpath/,," | xargs -n 1 -I % ln -s "$relpath/%" "$outpath/%"
+
# symlink the doc directory
rm -rf "$outpath/doc"
ln -s "$relpath/doc" "$outpath/doc"
@@ -8438,7 +8446,7 @@ for file in .projects .projects.3; do
*winmain/winmain.pro)
[ "$XPLATFORM_MINGW" = "yes" ] || continue
SPEC=$XQMAKESPEC ;;
- *s60main/s60main.pro) if [ -z "`echo "$XPLATFORM" | grep "symbian" >/dev/null`"]; then
+ *s60main/s60main.pro) if [ -z "`echo "$XPLATFORM" | grep "symbian" >/dev/null`" ]; then
continue
fi;;
*examples/activeqt/*) continue ;;
diff --git a/demos/declarative/calculator/Core/calculator.js b/demos/declarative/calculator/Core/calculator.js
index c80c42f..16cc309 100644
--- a/demos/declarative/calculator/Core/calculator.js
+++ b/demos/declarative/calculator/Core/calculator.js
@@ -83,9 +83,9 @@ function doOperation(op) {
display.text ="0"
}
- if (op == rotateLeft)
- main.state = "orientation " + Orientation.Landscape
if (op == rotateRight)
+ main.state = "orientation " + Orientation.Landscape
+ if (op == rotateLeft)
main.state = ''
}
diff --git a/demos/declarative/calculator/calculator.qml b/demos/declarative/calculator/calculator.qml
index 63b6c55..288455b 100644
--- a/demos/declarative/calculator/calculator.qml
+++ b/demos/declarative/calculator/calculator.qml
@@ -85,7 +85,7 @@ Rectangle {
Button {
id: rotateButton
- width: column.w; height: column.h; color: 'purple'; operation: rotateLeft
+ width: column.w; height: column.h; color: 'purple'; operation: rotateRight
}
Button { width: column.w; height: column.h; color: 'purple'; operation: leftArrow }
Button { width: column.w; height: column.h; color: 'purple'; operation: "C" }
@@ -134,18 +134,18 @@ Rectangle {
states: [
State {
name: "orientation " + Orientation.Landscape
- PropertyChanges { target: main; rotation: -90; width: window.height; height: window.width }
- PropertyChanges { target: rotateButton; operation: rotateRight }
+ PropertyChanges { target: main; rotation: 90; width: window.height; height: window.width }
+ PropertyChanges { target: rotateButton; operation: rotateLeft }
},
State {
name: "orientation " + Orientation.PortraitInverted
- PropertyChanges { target: main; rotation: -180; }
- PropertyChanges { target: rotateButton; operation: rotateLeft }
+ PropertyChanges { target: main; rotation: 180; }
+ PropertyChanges { target: rotateButton; operation: rotateRight }
},
State {
name: "orientation " + Orientation.LandscapeInverted
- PropertyChanges { target: main; rotation: -270; width: window.height; height: window.width }
- PropertyChanges { target: rotateButton; operation: rotateRight }
+ PropertyChanges { target: main; rotation: 270; width: window.height; height: window.width }
+ PropertyChanges { target: rotateButton; operation: rotateLeft }
}
]
diff --git a/demos/qtdemo/examplecontent.cpp b/demos/qtdemo/examplecontent.cpp
index 19be3e0..65c078d 100644
--- a/demos/qtdemo/examplecontent.cpp
+++ b/demos/qtdemo/examplecontent.cpp
@@ -91,8 +91,8 @@ QString ExampleContent::loadDescription()
if (paragraphs.length() < 1 && Colors::verbose)
qDebug() << "- ExampleContent::loadDescription(): Could not load description:"
<< MenuManager::instance()->info[this->name]["docfile"];
- QString description = Colors::contentColor +
- QLatin1String("Could not load description. Ensure that the documentation for Qt is built.");
+ QString description = Colors::contentColor + QLatin1String("");
+ //QLatin1String("Could not load description. Ensure that the documentation for Qt is built."); // QTBUG-12522: If there is no description why show an error to the user when qDebug above communications the issue (if it is indeed an issue at all) when demos are built?
for (int p = 0; p < int(paragraphs.length()); ++p) {
description = this->extractTextFromParagraph(paragraphs.item(p));
if (this->isSummary(description)) {
diff --git a/doc/src/declarative/examples.qdoc b/doc/src/declarative/examples.qdoc
index 39da323..9929cfe 100644
--- a/doc/src/declarative/examples.qdoc
+++ b/doc/src/declarative/examples.qdoc
@@ -203,6 +203,11 @@ The examples can be found in Qt's \c examples/declarative directory.
\o \l{declarative/threading/workerscript}{WorkerScript}
\endlist
+\section2 Screen orientation
+\list
+\o \l{declarative/screenorientation}{Example}
+\endlist
+
\section2 SQL Local Storage
\list
\o \l{declarative/sqllocalstorage}{Example}
diff --git a/doc/src/declarative/qdeclarativestates.qdoc b/doc/src/declarative/qdeclarativestates.qdoc
index e7607c6..0b91756 100644
--- a/doc/src/declarative/qdeclarativestates.qdoc
+++ b/doc/src/declarative/qdeclarativestates.qdoc
@@ -32,57 +32,174 @@
\section1 Overview
-QML states typically describe user interface configurations, including:
+User interfaces are designed to present different interface configurations in
+different scenarios, or to modify their appearances in response to user
+interaction. Often, there are a set of changes that are made concurrently, such
+that the interface could be seen to be internally changing from one \e state to
+another.
+
+This applies generally to interface elements regardless of their complexity.
+A photo viewer may initially present images in a grid, and when an image is
+clicked, change to a "detailed" state where the individual image is expanded
+and the interface is changed to present new options for image editing. On the
+other end of the scale, when a simple button is pressed, it may change to a
+"pressed" state in which its color and position is modified to give a pressed
+appearance.
+
+In QML, any object can change between different \e states to apply sets of
+changes that modify the properties of relevant items. Each \e state could
+present a different configuration that could, for example:
+
\list
-\o What UI elements are present
-\o The properties of those elements (including how they behave)
-\o What actions are available
+\o Show some UI elements and hide others
+\o Present different available actions to the user
+\o Start, stop or pause animations
+\o Execute some script required in the new state
+\o Change a property value for a particular item
+\o Show a different view or "screen"
\endlist
-A state can also be thought of as a set of batched changes from a default configuration.
+Changes between states can be animated using \l {Transitions}{transitions}, as
+discussed further below.
-Examples of states in modern UI:
-\list
-\o An Address Book application with a 'View Contact' state and an 'Edit Contact' State. In the first state the contact information presented is read-only (using labels), and in the second it is editable (using editors).
-\o A button with a pressed and unpressed state. When pressed the text moves slightly down and to the right, and the button has a slightly darker appearance.
-\endlist
+All \l {Item}-based objects have a \e {default state}, and can specify additional
+states by adding new \l State objects to the item's \l {Item::}{states}
+property. Each state has a \e name that is unique for all states within that
+item; the default state's name is an empty string. To change the current state
+of an item, set the \l {Item::}{state} property to the name of the state.
+
+Non-Item objects can use states through the StateGroup element.
-\section1 States in QML
-In QML:
+\section1 Creating states
+
+To create a state, add a \l State object to the item's \l {Item::}{states} property,
+which holds a list of states for that item.
+
+Following is an example. Here, the \l Rectangle is initially placed in the
+default (0, 0) position. It has defined an additional state named "moved", in
+which a PropertyChanges object repositions the rectangle to (50, 50). Clicking
+within the MouseArea changes the state to the "moved" state, thus moving the \l
+Rectangle.
+
+\snippet doc/src/snippets/declarative/states.qml 0
+
+A \l State item defines all the changes to be made in the new state. You
+could specify additional properties to be changed, or create additional
+PropertyChanges for other objects. (Note that a \l State can modify the
+properties of other objects, not just the object that owns the state.)
+
+For example:
+
+\qml
+State {
+ name: "moved"
+ PropertyChanges { target: myRect; x: 50; y: 50; color: "blue" }
+ PropertyChanges { target: someOtherItem; width: 1000 }
+}
+\endqml
+
+A \l State is not limited to performing modifications on property values. It
+can also:
+
\list
-\o Any object can use states.
-\o There is a default state. The default state can be explicitly set.
-\o A state can affect the properties of other objects, not just the object owning the state (and not just that object's children).
+\o Run some script using StateChangeScript
+\o Override an existing signal handler for an object using PropertyChanges
+\o Re-parent an \l Item using ParentChanges
+\o Modify anchor values using AnchorChanges
\endlist
-To define a state for an item, add a \l State element to the \l{Item::states}{states} property. To
-change the current state of an \l Item, set the \l{Item::state}{state} property to the name
-of the required state.
+The \l {declarative/animation/states}{States and Transitions example}
+demonstrates how to declare a basic set of states and apply animated
+transitions between them.
-Here is an example of using states. In the default state \c myRect is positioned at 0,0. In the 'moved' state it is positioned at 50,50. Clicking within the mouse area changes the state from the default state to the 'moved' state, thus moving the rectangle.
-\snippet doc/src/snippets/declarative/states.qml 0
-\snippet doc/src/snippets/declarative/states.qml 1
+\section1 The default state
-State changes can be animated using \l{state-transitions}{Transitions}.
+Of course, the \l Rectangle in the example above could have simply been moved
+by setting its position to (50, 50) in the mouse area's \c onClicked handler.
+However, aside from enabling batched property changes, the use of states allows
+an item to revert to its \e {default state}, which contains all of the items'
+initial property values before they were modified in a state change.
-For example, adding this code to the above \c Item element animates the transition to the "moved" state:
+The default state is specified by an empty string. If the MouseArea in the
+above example was changed to this:
-\snippet doc/src/snippets/declarative/states.qml transitions
+\qml
+MouseArea {
+ anchors.fill: parent
+ onClicked: myRect.state == 'moved' ? myRect.state = "" : myRect.state = 'moved';
+}
+\endqml
-See \l{state-transitions}{Transitions} for more information.
+This would toggle the \l Rectangle's state between the \e moved and \e default
+states when clicked. The properties can be reverted to their initial
+values without requiring the definition of another \l State that defines these
+value changes.
-Other things you can do in a state change:
-\list
-\o Override signal handlers with PropertyChanges
-\o Change an item's visual parent with ParentChange
-\o Change an item's anchors with AnchorChanges
-\o Run some script with StateChangeScript
-\endlist
+\section1 The "when" property
+
+The \l {State::}{when} property is useful for specifying when a state should be
+applied. This can be set to an expression that evaluates to \c true when an
+item should change to a particular state.
+
+If the above example was changed to this:
+
+\qml
+Rectangle {
+ ...
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ }
+
+ states: State {
+ name: "moved"; when: mouseArea.pressed
+ ...
+ }
+\endqml
+
+The \l Rectangle would automatically change to the \e moved state when the
+mouse is pressed, and revert to the default state when it is released. This is
+simpler (and a better, more declarative method) than creating \c onPressed
+and \c onReleased handlers in the MouseArea to set the current state.
+
+
+\section1 Animating state changes
+
+
+State changes can be easily animated through \l {Transitions}{transitions}. A
+\l Transition defines the animations that should be applied when an item
+changes from one state to another.
+
+If the above example was modified to include the following \l Transition, the
+movement of the \l Rectangle would be animated:
+
+\qml
+Rectangle {
+ ...
+
+ MouseArea { ... }
+
+ states: [
+ ...
+ ]
+
+ transitions: [
+ Transition {
+ NumberAnimation { properties: "x,y"; duration: 500 }
+ }
+ ]
+ }
+\endqml
+
+This \l Transition defines that if any \c x or \c y properties have changed
+during a state change within this item, their values should be animated over 500
+millliseconds.
-The \l {declarative/animation/states}{States and Transitions example} demonstrates how to declare a basic set of states and then apply animated transitions between them.
+See the \l Transitions documentation for more information.
*/
diff --git a/doc/src/declarative/qmlviewer.qdoc b/doc/src/declarative/qmlviewer.qdoc
index 5efc0ce..41c4c80 100644
--- a/doc/src/declarative/qmlviewer.qdoc
+++ b/doc/src/declarative/qmlviewer.qdoc
@@ -197,10 +197,10 @@ Rectangle {
\o \c runtime.orientation
\o This property indicates the current orientation of the QML Viewer. On the
-N900 platform, this property automatically updates to reflect the device's
-actual orientation; on other platforms, this indicates the orientation currently
-selected in the QML Viewer's \e {Settings -> Properties} menu. The
-\c orientation value can be one of the following:
+N900 platform and most S60 5.0-based or newer Symbian devices, this property
+automatically updates to reflect the device's actual orientation; on other platforms,
+this indicates the orientation currently selected in the QML Viewer's
+\e {Settings -> Properties} menu. The \c orientation value can be one of the following:
\list
\o \c Orientation.Portrait
diff --git a/doc/src/development/developing-with-qt.qdoc b/doc/src/development/developing-with-qt.qdoc
index ffc5a8e..f9b38b8 100644
--- a/doc/src/development/developing-with-qt.qdoc
+++ b/doc/src/development/developing-with-qt.qdoc
@@ -27,12 +27,22 @@
/*!
\page developing-with-qt.html
- \title Cross Platform Development with Qt
+
+ \title Cross-platform & Platform-specific Development
+ Qt allows you to write advanced applications and UIs once, and deploy them
+ across desktop and embedded operating systems without rewriting the source
+ code. The top section of this page provides an overview of the tools and
+ techniques used in Qt application development. Still, you might want to add
+ platform-specific features to your code. The bottom section of the page
+ links to documents that describe platform-specific features provided by Qt,
+ and discuss issues related to particular platforms and environments.
+
+ \section1 Cross-platform Development with Qt
Qt is provided with a set of build tools to help developers automate
the process of building and installing Qt applications.
- \table 100%
+ \table
\header \o Development \o Cross-Platform Issues \o Specific Tools
\row
\o
@@ -57,4 +67,49 @@
\o \l {Resource Compiler (rcc)}
\endlist
\endtable
-*/
+
+ \section1 Platform-specific Development with Qt
+
+ These documents describe platform-specific features provided by Qt, and
+ discuss issues related to particular platforms and environments.
+
+ \table
+ \row
+ \o
+ \list
+ \o \l {Calling Qt Functions From Unix Signal Handlers}
+ \o \l {Compiler Notes}
+ \o \l {Developing Qt Applications for Mac OS X}
+ \o \l {Known Issues}
+ \o \l {Platform Notes}
+ \o \l {Platform Notes - Symbian}
+ \o \l {Qt For ActiveX}
+ \o \l {Qt for Embedded Linux Classes}
+ \o \l {Qt for Embedded Platforms}
+ \o \l {Qt for Mac OS X - Specific Issues}
+ \o \l {Qt is Mac OS X Native}
+ \o \l {Supported Platforms}
+ \o \l {The qtmain Library}
+ \o \l {Window System Specific Notes}
+ \endlist
+ \o
+ \list
+ \o Workaround to make it work.
+ \o Information about the C++ compilers and tools used to build Qt.
+ \o Information for developing Qt applications for Mac OS X
+ \o A summary of known issues in this Qt version at the time of release.
+ \o Information about the platforms on which Qt can be used.
+ \o Information about the state of support for the Symbian platform.
+ \o Qt API's for using ActiveX controls, servers, and COM.
+ \o Classes that are specific to Qt for Embedded Linux.
+ \o Documents related to Qt for Embedded Platforms.
+ \o A description of issues with Qt that are specific to Mac OS X.
+ \o An explanation of Qt's native features on Mac OS X.
+ \o The platforms supported by Nokia for Qt.
+ \o Describes the use and license of the qtmain helper library.
+ \o Collections of notes about Qt implementations on different window systems.
+ \endlist
+ \endtable
+
+
+*/ \ No newline at end of file
diff --git a/doc/src/examples/qml-examples.qdoc b/doc/src/examples/qml-examples.qdoc
index a8be401..8d3aa25 100644
--- a/doc/src/examples/qml-examples.qdoc
+++ b/doc/src/examples/qml-examples.qdoc
@@ -412,6 +412,14 @@
\endtable
*/
+
+/*!
+ \title Screen orientation
+ \example declarative/screenorientation
+
+ This example shows how to implement screen orientation support for your application.
+*/
+
/*!
\title SQL Local Storage Example
\example declarative/sqllocalstorage
diff --git a/doc/src/files-and-resources/resources.qdoc b/doc/src/files-and-resources/resources.qdoc
index b0b0e3c..3177af8 100644
--- a/doc/src/files-and-resources/resources.qdoc
+++ b/doc/src/files-and-resources/resources.qdoc
@@ -54,7 +54,7 @@
The resource system is based on tight cooperation between \l qmake,
\l rcc (Qt's resource compiler), and QFile. It obsoletes Qt 3's
\c qembed tool and the
- \l{http://qt.nokia.com/doc/qq/qq05-iconography.html#imagestorage}{image
+ \l{http://doc.qt.nokia.com/qq/qq05-iconography.html}{image
collection} mechanism.
\section1 Resource Collection Files (\c{.qrc})
diff --git a/doc/src/frameworks-technologies/eventsandfilters.qdoc b/doc/src/frameworks-technologies/eventsandfilters.qdoc
index e792161..fb14a3b 100644
--- a/doc/src/frameworks-technologies/eventsandfilters.qdoc
+++ b/doc/src/frameworks-technologies/eventsandfilters.qdoc
@@ -100,7 +100,7 @@
event delivery mechanisms are flexible. The documentation for
QCoreApplication::notify() concisely tells the whole story; the
\e{Qt Quarterly} article
- \l{http://qt.nokia.com/doc/qq/qq11-events.html}{Another Look at Events}
+ \l{http://doc.qt.nokia.com/qq/qq11-events.html}{Another Look at Events}
rehashes it less concisely. Here we will explain enough for 95%
of applications.
diff --git a/doc/src/getting-started/gettingstarted.qdoc b/doc/src/getting-started/gettingstarted.qdoc
index 391aec3..9b6b5d5 100644
--- a/doc/src/getting-started/gettingstarted.qdoc
+++ b/doc/src/getting-started/gettingstarted.qdoc
@@ -62,7 +62,7 @@
12 }
\endcode
- Let's go through the code line by line. In the first two lines, we
+ Let us go through the code line by line. In the first two lines, we
include the header files for QApplication and QTextEdit, which are
the two classes that we need for this example. All Qt classes have
a header file named after them.
@@ -97,9 +97,9 @@
following shell commands build the program.
\code
- vattekar@positive:~/testing/gssnippets/part1$ qmake -project
- vattekar@positive:~/testing/gssnippets/part1$ qmake
- vattekar@positive:~/testing/gssnippets/part1$ make
+ qmake -project
+ qmake
+ make
\endcode
This will leave an executable in the \c part1 directory (note that
@@ -134,7 +134,7 @@
\image gs2.png
- Let's take a look at the code.
+ Let us take a look at the code.
\code
1 #include <QtGui>
@@ -217,7 +217,7 @@
\image gs3.png
- Let's look at the code:
+ Let us look at the code:
\code
5 class Notepad : public QWidget
@@ -275,7 +275,7 @@
We now use the function \l{QObject::}{tr()} around our user
visible strings. This function is necessary when you want to
provide your application in more than one language (e.g. English
- and Chinese). We won't go into details here, but you can follow
+ and Chinese). We will not go into details here, but you can follow
the \c {Qt Linguist} link from the learn more table.
\section2 Learn More
@@ -312,8 +312,8 @@
The following shell commands build the example.
\code
- vattekar@positive:~/testing/gssnippets/part3$ qmake
- vattekar@positive:~/testing/gssnippets/part3$ make
+ qmake
+ make
\endcode
\section1 Using a QMainWindow
@@ -326,7 +326,7 @@
\image gs4.png
- Let's look at the new \c Notepad class definition.
+ Let us look at the new \c Notepad class definition.
\code
#include <QtGui>
@@ -422,7 +422,7 @@
\image gs5.png
- Let's start with the \c open() slot:
+ We will start with the \c open() slot:
\code
QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), "",
@@ -451,7 +451,7 @@
If we have a file name, we try to open the file with
\l{QIODevice::}{open()}, which returns true if the file could be
- opened. We won't go into error handling here, but you can follow
+ opened. We will not go into error handling here, but you can follow
the links from the learn more section. If the file could not be
opened, we use QMessageBox to display a dialog with an error
message (see the QMessageBox class description for further
@@ -465,7 +465,7 @@
edit. We then \l{QIODevice::}{close()} the file to return the file
descriptor back to the operating system.
- Now, let's move on to the the \c save() slot.
+ Now, let us move on to the the \c save() slot.
\code
QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"), "",
diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc
index 4acf212..7efd1e6 100644
--- a/doc/src/index.qdoc
+++ b/doc/src/index.qdoc
@@ -65,8 +65,8 @@
</div>
<div class="sectionlist tricol">
<ul>
- <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>
- <li><a href="qt-basic-concepts.html">Qt Architecture</a></li>
+ <!-- <li><a href="qt-basic-concepts.html">Programming with Qt</a></li> -->
+ <li><a href="qt-basic-concepts.html">Basic Qt Architecture</a></li>
<li><a href="developing-with-qt.html">Cross-platform &amp; Platform-specific Development</a></li>
<li><a href="technology-apis.html">Qt &amp; standard technologies </a></li>
<li><a href="best-practices.html">Qt How-to's &amp; best practices</a></li>
@@ -78,7 +78,7 @@
<li><a href="qdeclarativeintroduction.html">Introduction to QML</a></li>
<li><a href="qdeclarativeelements.html">QML Elements</a></li>
<li><a href="qt-gui-concepts.html">UI components</a></li>
- <li><a href="declarativeui.html">Qt & GUI design</a></li>
+ <!-- <li><a href="declarativeui.html">Qt & GUI design</a></li> -->
</ul>
</div>
</div>
@@ -94,12 +94,12 @@
</div>
<div class="section sectionlist">
<ul>
- <li><a href="http://doc.qt.nokia.com/qtcreator-2.0/index.html">Qt Creator</a></li>
+ <li><a href="http://doc.qt.nokia.com/qtcreator-2.0/index.html">Qt Creator</a> (online document)</li>
<li><a href="designer-manual.html">Qt Designer</a></li>
<li><a href="linguist-manual.html">Qt Linguist</a></li>
<li><a href="assistant-manual.html">Qt Assistant</a></li>
- <li><a href="http://doc.qt.nokia.com/qtsimulator-1.0/simulator-description.html">Qt Simulator</a></li>
- <li><a href="http://qt.nokia.com/developer/eclipse-integration">Integration</a> and <a href="http://qt.nokia.com/products/appdev">add-ins</a></li>
+ <li><a href="http://doc.qt.nokia.com/qtsimulator-1.0/simulator-description.html">Qt Simulator</a> (online document)</li>
+ <li><a href="http://qt.nokia.com/developer/eclipse-integration">Integration</a> (online document) and <a href="http://qt.nokia.com/products/appdev">add-ins</a> (online document)</li>
<li><a href="qvfb.html">Virtual Framebuffer</a></li>
</ul>
</div>
diff --git a/doc/src/internationalization/linguist-manual.qdoc b/doc/src/internationalization/linguist-manual.qdoc
index c8d8e9d..fa992af 100644
--- a/doc/src/internationalization/linguist-manual.qdoc
+++ b/doc/src/internationalization/linguist-manual.qdoc
@@ -1414,8 +1414,8 @@
\c -pluralonly command line option, which allows the creation of
TS files containing only entries with plural forms.
- See the \l{http://qt.nokia.com/doc/qq/}{Qt Quarterly} Article
- \l{http://qt.nokia.com/doc/qq/qq19-plurals.html}{Plural Forms in Translations}
+ See the \l{http://doc.qt.nokia.com/qq/}{Qt Quarterly} Article
+ \l{http://doc.qt.nokia.com/qq/qq19-plurals.html}{Plural Forms in Translations}
for further details on this issue.
\section2 Coping With C++ Namespaces
diff --git a/doc/src/porting/porting4.qdoc b/doc/src/porting/porting4.qdoc
index f355e7b..0bbf35f 100644
--- a/doc/src/porting/porting4.qdoc
+++ b/doc/src/porting/porting4.qdoc
@@ -472,7 +472,7 @@
\section1 Explicit Sharing
Qt 4 is the first version of Qt that contains no \link
- http://qt.nokia.com/doc/3.3/shclass.html explicitly shared
+ http://doc.qt.nokia.com/3.3/shclass.html explicitly shared
\endlink classes. All classes that were explicitly shared in Qt 3
are \e implicitly shared in Qt 4:
@@ -1079,7 +1079,7 @@
ensuring that the string is '\\0'-terminated. Another important
issue was that conversions between \c QCString and QByteArray often
gave confusing results. (See the
- \l{http://qt.nokia.com/doc/qq/qq05-achtung.html#qcstringisastringofchars}{Achtung!
+ \l{http://doc.qt.nokia.com/qq/qq05-achtung.html#qcstringisastringofchars}{Achtung!
Binary and Character Data} article in \e{Qt Quarterly} for an
overview of the pitfalls.)
@@ -2440,13 +2440,13 @@
that provides the old semantics. See the Q3Painter documentation
for details and for the reasons why we had to make this change.
- The \l{http://qt.nokia.com/doc/3.3/qpainter.html#CoordinateMode-enum}{QPainter::CoordinateMode}
+ The \l{http://doc.qt.nokia.com/3.3/qpainter.html#CoordinateMode-enum}{QPainter::CoordinateMode}
enum has been removed in Qt 4. All clipping
operations are now defined using logical coordinates and are subject
to transformation operations.
The
- \l{http://qt.nokia.com/doc/3.3/qpainter.html#RasterOP-enum}{QPainter::RasterOP}
+ \l{http://doc.qt.nokia.com/3.3/qpainter.html#RasterOP-enum}{QPainter::RasterOP}
enum has been replaced with QPainter::CompositionMode.
\section1 QPicture
@@ -3258,7 +3258,7 @@
\list \o If you use Q3SocketDevice in a thread to perform blocking
network I/O (a technique encouraged by the \e{Qt Quarterly}
- article \l{http://qt.nokia.com/doc/qq/qq09-networkthread.html}
+ article \l{http://doc.qt.nokia.com/qq/qq09-networkthread.html}
{Unblocking Networking}), you can now use QTcpSocket, QFtp, or
QNetworkAccessManager, which can be used from non-GUI threads.
@@ -4052,7 +4052,7 @@
Sample code on how to do obtain similar behavior from Qt 4, previously
handled by some of the above functions can be found in the
- \l{http://qt.nokia.com/doc/qwidget-qt3.html}{Qt 3 Support Members for QWidget}
+ \l{http://doc.qt.nokia.com/qwidget-qt3.html}{Qt 3 Support Members for QWidget}
page.
A widget now receives change events in its QWidget::changeEvent()
@@ -4150,7 +4150,7 @@
clearWFlags() has no direct replacement. You can use
QWidget::setAttribute() instead. For example,
\c{setAttribute(..., false)} to clear an attribute. More information
- is available \l{http://qt.nokia.com/doc/qwidget.html#setAttribute}{here}.
+ is available \l{http://doc.qt.nokia.com/qwidget.html#setAttribute}{here}.
testWFlags() was renamed to \l{QWidget::testAttribute()}{testAttribute()}.
diff --git a/doc/src/qt-webpages.qdoc b/doc/src/qt-webpages.qdoc
index 89d564f..0c61285 100644
--- a/doc/src/qt-webpages.qdoc
+++ b/doc/src/qt-webpages.qdoc
@@ -141,7 +141,7 @@
*/
/*!
- \externalpage http://qt.nokia.com/doc/supported-platforms.html
+ \externalpage http://doc.qt.nokia.com/supported-platforms.html
\title Platform Support Policy
*/
@@ -151,7 +151,7 @@
*/
/*!
- \externalpage http://qt.nokia.com/doc/supported-platforms.html
+ \externalpage http://doc.qt.nokia.com/supported-platforms.html
\title Qt 4 Platforms Overview
*/
@@ -161,7 +161,7 @@
*/
/*!
- \externalpage http://qt.nokia.com/doc/qq/
+ \externalpage http://doc.qt.nokia.com/qq/
\title Qt Quarterly
*/
@@ -181,7 +181,7 @@
*/
/*!
- \externalpage http://qt.nokia.com/doc/qtcanvas
+ \externalpage http://doc.qt.nokia.com/qtcanvas
\title QtCanvas
*/
diff --git a/doc/src/snippets/declarative/state-when.qml b/doc/src/snippets/declarative/state-when.qml
new file mode 100644
index 0000000..6d3bb75
--- /dev/null
+++ b/doc/src/snippets/declarative/state-when.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+import Qt 4.7
+//![0]
+Rectangle {
+ id: myRect
+ width: 100; height: 100
+ color: "red"
+
+ MouseArea { id: mouseArea; anchors.fill: parent }
+
+ states: State {
+ name: "hidden"; when: mouseArea.pressed
+ PropertyChanges { target: myRect; opacity: 0 }
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/state.qml b/doc/src/snippets/declarative/state.qml
index af6b103..ce2653b 100644
--- a/doc/src/snippets/declarative/state.qml
+++ b/doc/src/snippets/declarative/state.qml
@@ -44,13 +44,19 @@ import Qt 4.7
Rectangle {
id: myRect
width: 100; height: 100
- color: "red"
+ color: "black"
- MouseArea { id: mouseArea; anchors.fill: parent }
-
- states: State {
- name: "hidden"; when: mouseArea.pressed
- PropertyChanges { target: myRect; opacity: 0 }
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: myRect.state == 'clicked' ? myRect.state = "" : myRect.state = 'clicked';
}
+
+ states: [
+ State {
+ name: "clicked"
+ PropertyChanges { target: myRect; color: "red" }
+ }
+ ]
}
//![0]
diff --git a/doc/src/snippets/declarative/states.qml b/doc/src/snippets/declarative/states.qml
index c3b1796..127e3a7 100644
--- a/doc/src/snippets/declarative/states.qml
+++ b/doc/src/snippets/declarative/states.qml
@@ -40,42 +40,22 @@
****************************************************************************/
//![0]
import Qt 4.7
-
-Item {
- id: myItem
+
+Rectangle {
+ id: myRect
width: 200; height: 200
+ color: "red"
- Rectangle {
- id: myRect
- width: 100; height: 100
- color: "red"
+ MouseArea {
+ anchors.fill: parent
+ onClicked: myRect.state = 'moved'
}
states: [
State {
name: "moved"
- PropertyChanges {
- target: myRect
- x: 50
- y: 50
- }
+ PropertyChanges { target: myRect; x: 50; y: 50 }
}
]
-
- MouseArea {
- anchors.fill: parent
- onClicked: myItem.state = 'moved'
- }
-//![0]
-
-//![transitions]
-transitions: [
- Transition {
- NumberAnimation { properties: "x,y"; duration: 500 }
- }
-]
-//![transitions]
-
-//![1]
}
-//![1]
+//![0]
diff --git a/doc/src/template/style/OfflineStyle.css b/doc/src/template/style/OfflineStyle.css
deleted file mode 100644
index 9f5d28b..0000000
--- a/doc/src/template/style/OfflineStyle.css
+++ /dev/null
@@ -1,251 +0,0 @@
-@media screen
-{
-
- .wrapper
- {
- top:50px;
- background: none;
-
- }
- .wrapper .bd
- {
- background: none;
- position: relative;
- }
-
-
-
-
- body.offline
- {
- background-image: none;
- background-color: #FFFFFF;
-
- }
-
- .offline .footer {
- margin: 0;
- }
- .offline .header
- {
- width: 100%;
- margin: 0;
- height: auto;
- background-color: #ffffff;
- padding: 10px 0 5px 0;
- overflow: visible;
- border-bottom: solid #E5E5E5 1px;
- z-index:1;
- position:fixed;
- }
-
- .offline .header .content
- {
- }
- .offline .header .qtref
- {
- color: #00732F;
- position: static;
- float: left;
- margin-left: 5px;
- font: bold 18px/1 Arial;
- }
-
- .offline .header .qtref:visited
- {
- color: #00732F;
- }
- .offline .header .qtref:hover
- {
- color: #00732F;
- text-decoration:none;
- }
- .offline .header .qtref span
- {
- background-image: none;
- text-indent: 0;
- text-decoration:none;
- }
-
- .offline .wrap
- {
- margin: 0 5px 0 5px;
- }
-
- .offline .wrap .toolbar
- {
- display:block;
- padding-top:5px;
- }
-
- .offline .wrap .breadcrumb ul li {
- font-weight: normal;
- }
-
- .offline .wrap .breadcrumb ul li a {
- /*color: #44a51c;*/
- }
-
- .offline .wrap .breadcrumb ul li.last a {
- /*color: #363534;*/
- }
-
-
-
- .narrow .indexboxcont .section {
- width: 64%;
- padding-left: 0;
- }
-
- .narrow .indexboxcont .sectionlist {
- width: 32.5%;
- }
-
- .header .icon,
- .sidebar,
- .feedback,
- .t_button,
- .feedback,
- #feedbackBox,
- #feedback,
- #blurpage,
- .indexbox .indexIcon span,
- .wrapper .hd,
- .offline .indexbox .indexIcon,
- .offline .header #nav-logo,
- #offlinemenu,
- #offlinesearch,
- .offline .header #nav-topright,
- .offline .header #shortCut ,
- .offline .wrapper .hd,
- .offline .wrapper .ft,
- .offline .sidebar,
- .offline .wrap .feedback
- {
- display:none;
- }
-
- /* end offline mode */
-#narrowmenu {
- display: none;
- float: right;
- margin: 15px 40px 0 0;
- font-size: 11px;
- }
-
- .narrow #narrowmenu {
- display: block;
- }
-
- #narrowsearch{
- display:none;
- }
-
- #narrowmenu ul
- {
- border-bottom:solid 1px #E5E5E5;
- border-left:solid 1px #E5E5E5;
- border-right:solid 1px #E5E5E5;
- }
-
- #narrowmenu a {
- line-height: 1.1;
- background: url(../images/arrow_down.png) no-repeat 100% 50%;
- white-space: nowrap;
- padding: 0 16px 0 5px;
- }
-
- #narrowmenu li {
- margin-left: 20px;
- }
-
- #narrowmenu li li {
- margin: 0 0 5px 0;
- }
-
- #narrowmenu li li a {
- padding: 0;
- background-image: none;
- }
-
- #narrowmenu li,
- #narrowmenu li ul {
- background-color: #fff;
- }
-
- #narrowmenu li ul {
- width: auto;
- padding: 5px;
- margin-top:-15px;
- }
-
- .sf-menu li:hover ul, .sf-menu li.sfHover ul {
- top: 1.2em;
- }
-.sf-menu, .sf-menu * {
- margin: 0;
- padding: 0;
- list-style: none;
-}
-.sf-menu {
- line-height: 1.0;
-}
-.sf-menu ul {
- position: absolute;
- top: -999em;
- width: 10em; /* left offset of submenus need to match (see below) */
-}
-.sf-menu ul li {
- width: 100%;
-}
-.sf-menu li:hover {
- visibility: inherit; /* fixes IE7 'sticky bug' */
-}
-.sf-menu li {
- float: left;
- position: relative;
-}
-.sf-menu a {
- display: block;
- position: relative;
-}
-.sf-menu li:hover ul,
-.sf-menu li.sfHover ul {
- left: 0;
- top: 2.5em; /* match top ul list item height */
- z-index: 99;
-}
-ul.sf-menu li:hover li ul,
-ul.sf-menu li.sfHover li ul {
- top: -999em;
-}
-ul.sf-menu li li:hover ul,
-ul.sf-menu li li.sfHover ul {
- left: 10em; /* match ul width */
- top: 0;
-}
-ul.sf-menu li li:hover li ul,
-ul.sf-menu li li.sfHover li ul {
- top: -999em;
-}
-ul.sf-menu li li li:hover ul,
-ul.sf-menu li li li.sfHover ul {
- left: 10em; /* match ul width */
- top: 0;
-}
- .wrap .content ol li {
- background:none;
- font:400 10pt/1 Verdana;
- margin-bottom:10px;
- margin-left:12px;
- }
- .wrap .content ol li {
- list-style-type:decimal;
-
- }
-
-
-
-}
-/* end of screen media */
-
diff --git a/doc/src/template/style/narrow.css b/doc/src/template/style/narrow.css
index 05159aa..e4ad135 100644
--- a/doc/src/template/style/narrow.css
+++ b/doc/src/template/style/narrow.css
@@ -15,7 +15,12 @@
}
.narrow .footer {
- margin: 0;
+ margin: 0px;
+ }
+
+ .creator .header, .creator .header .content, .creator .footer, .creator .wrapper {
+ margin: 0px;
+ min-width: 300px;
}
.narrow .header
{
@@ -126,6 +131,11 @@
margin: 0 5px 0 5px;
}
+ .creator .wrap
+ {
+ margin: 0px;
+ background:#FFFFFF;
+ }
.narrow .wrap .toolbar
{
border-bottom: none;
@@ -135,7 +145,14 @@
{
padding-top: 15px;
}
-
+ .creator .wrap .content
+ {
+ padding-top: 10px;
+ }
+ .creator .wrap .content .guide
+ {
+ padding-top: 15px;
+ }
.narrow .wrap .feedback
{
display: none;
diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css
index 9f80921..259591f 100755
--- a/doc/src/template/style/style.css
+++ b/doc/src/template/style/style.css
@@ -1345,7 +1345,7 @@
font: normal 13px/1.2 Verdana;
color: #363534;
- background-color: #FFFFFF;
+ background-color: #FAFAFA;
}
@@ -1406,7 +1406,9 @@
border-bottom:1px solid #E5E5E5;
- width:100%,
+ /*width:100%;*/
+ margin-left:-5px;
+ margin-right:-5px;
}
.creator .wrap .breadcrumb ul li a
{
diff --git a/doc/src/template/style/superfish_skin.css b/doc/src/template/style/superfish_skin.css
deleted file mode 100644
index 8d84827..0000000
--- a/doc/src/template/style/superfish_skin.css
+++ /dev/null
@@ -1,83 +0,0 @@
-
-/*** DEMO SKIN ***/
-.sf-menu {
- float: left;
- margin-bottom: 1em;
-}
-.sf-menu a {
- border-left: 1px solid #fff;
- border-top: 1px solid #CFDEFF;
- padding: .75em 1em;
- text-decoration:none;
-}
-.sf-menu a, .sf-menu a:visited { /* visited pseudo selector so IE6 applies text colour*/
- color: #13a;
-}
-.sf-menu li {
- background: #BDD2FF;
-}
-.sf-menu li li {
- background: #AABDE6;
-}
-.sf-menu li li li {
- background: #9AAEDB;
-}
-.sf-menu li:hover, .sf-menu li.sfHover,
-.sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active {
- background: #CFDEFF;
- outline: 0;
-}
-
-/*** arrows **/
-.sf-menu a.sf-with-ul {
- padding-right: 2.25em;
- min-width: 1px; /* trigger IE7 hasLayout so spans position accurately */
-}
-.sf-sub-indicator {
- position: absolute;
- display: block;
- right: .75em;
- top: 1.05em; /* IE6 only */
- width: 10px;
- height: 10px;
- text-indent: -999em;
- overflow: hidden;
- background: url('../images/arrows-ffffff.png') no-repeat -10px -100px; /* 8-bit indexed alpha png. IE6 gets solid image only */
-}
-a > .sf-sub-indicator { /* give all except IE6 the correct values */
- top: .8em;
- background-position: 0 -100px; /* use translucent arrow for modern browsers*/
-}
-/* apply hovers to modern browsers */
-a:focus > .sf-sub-indicator,
-a:hover > .sf-sub-indicator,
-a:active > .sf-sub-indicator,
-li:hover > a > .sf-sub-indicator,
-li.sfHover > a > .sf-sub-indicator {
- background-position: -10px -100px; /* arrow hovers for modern browsers*/
-}
-
-/* point right for anchors in subs */
-.sf-menu ul .sf-sub-indicator { background-position: -10px 0; }
-.sf-menu ul a > .sf-sub-indicator { background-position: 0 0; }
-/* apply hovers to modern browsers */
-.sf-menu ul a:focus > .sf-sub-indicator,
-.sf-menu ul a:hover > .sf-sub-indicator,
-.sf-menu ul a:active > .sf-sub-indicator,
-.sf-menu ul li:hover > a > .sf-sub-indicator,
-.sf-menu ul li.sfHover > a > .sf-sub-indicator {
- background-position: -10px 0; /* arrow hovers for modern browsers*/
-}
-
-/*** shadows for all but IE6 ***/
-.sf-shadow ul {
- background: url('../images/shadow.png') no-repeat bottom right;
- padding: 0 8px 9px 0;
- -moz-border-radius-bottomleft: 17px;
- -moz-border-radius-topright: 17px;
- -webkit-border-top-right-radius: 17px;
- -webkit-border-bottom-left-radius: 17px;
-}
-.sf-shadow ul.sf-shadow-off {
- background: transparent;
-}
diff --git a/doc/src/widgets-and-layouts/layout.qdoc b/doc/src/widgets-and-layouts/layout.qdoc
index aa4a933..798a7a1 100644
--- a/doc/src/widgets-and-layouts/layout.qdoc
+++ b/doc/src/widgets-and-layouts/layout.qdoc
@@ -242,7 +242,7 @@
For further guidance when implementing these functions, see the
\e{Qt Quarterly} article
- \l{http://qt.nokia.com/doc/qq/qq04-height-for-width.html}
+ \l{http://doc.qt.nokia.com/qq/qq04-height-for-width.html}
{Trading Height for Width}.
diff --git a/examples/declarative/screenorientation/Core/Bubble.qml b/examples/declarative/screenorientation/Core/Bubble.qml
new file mode 100644
index 0000000..2474f30
--- /dev/null
+++ b/examples/declarative/screenorientation/Core/Bubble.qml
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+import Qt 4.7
+
+Rectangle {
+ property bool rising: false
+ property bool verticalRise: true
+ property real xAttractor: 0
+ property real yAttractor: 0
+
+ width: 5 + 10*Math.random()
+ height: width
+ radius: Math.floor(width/2)-1
+ property real amountOfGray: Math.random()
+ color: Qt.rgba(amountOfGray,amountOfGray,amountOfGray,1)
+
+ y: (rising && verticalRise) ? yAttractor : Math.random()*(main.inPortrait ? main.baseHeight : main.baseWidth)
+ x: (rising && !verticalRise) ? xAttractor : Math.random()*(main.inPortrait ? main.baseWidth : main.baseHeight)
+ Behavior on x {
+ id: xBehavior
+ SmoothedAnimation {
+ velocity: 100+Math.random()*100
+ }
+ }
+ Behavior on y {
+ id: yBehavior
+ SmoothedAnimation {
+ velocity: 100+Math.random()*100
+ }
+ }
+ Timer {
+ interval: 80+Math.random()*40
+ repeat: true
+ running: true
+ onTriggered: {
+ if (rising) {
+ if (x > main.width || x < 0) {
+ xBehavior.enabled = false;
+ rising = false;
+ xBehavior.enabled = true;
+ rising = true;
+ }
+ if (y > main.height || y < 0) {
+ yBehavior.enabled = false;
+ rising = false;
+ yBehavior.enabled = true;
+ rising = true;
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/examples/declarative/screenorientation/Core/Button.qml b/examples/declarative/screenorientation/Core/Button.qml
new file mode 100644
index 0000000..60083d8
--- /dev/null
+++ b/examples/declarative/screenorientation/Core/Button.qml
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+import Qt 4.7
+Item {
+ id: button
+ signal clicked
+ property string text
+ property bool toggled: false
+ width: 100
+ height: 60
+ Rectangle {
+ anchors.fill: button
+ anchors.margins: mouseArea.pressed ? 3 : 2
+ color: toggled ? (mouseArea.pressed ? "#442222" : "darkred") : (mouseArea.pressed ? "#333333": "black")
+ radius: mouseArea.pressed ? 8 : 6
+ Text {
+ id: text
+ anchors.centerIn: parent
+ text: button.text
+ font.pixelSize: mouseArea.pressed ? 12 : 14
+ color: "white"
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ }
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: {
+ button.clicked()
+ }
+ }
+ }
+}
diff --git a/examples/declarative/screenorientation/Core/screenorientation.js b/examples/declarative/screenorientation/Core/screenorientation.js
new file mode 100644
index 0000000..f0a5574
--- /dev/null
+++ b/examples/declarative/screenorientation/Core/screenorientation.js
@@ -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$
+**
+****************************************************************************/
+
+function printOrientation(orientation) {
+ var orientationString;
+ if (orientation == Orientation.Portrait) {
+ orientationString = "Portrait";
+ } else if (orientation == Orientation.Landscape) {
+ orientationString = "Landscape";
+ } else if (orientation == Orientation.PortraitInverted) {
+ orientationString = "Portrait inverted";
+ } else if (orientation == Orientation.LandscapeInverted) {
+ orientationString = "Landscape inverted";
+ } else {
+ orientationString = "UnknownOrientation";
+ }
+ return orientationString;
+}
+
+function getAngle(orientation) {
+ var angle;
+ if (orientation == Orientation.Portrait) {
+ angle = 0;
+ } else if (orientation == Orientation.Landscape) {
+ angle = 90;
+ } else if (orientation == Orientation.PortraitInverted) {
+ angle = 180;
+ } else if (orientation == Orientation.LandscapeInverted) {
+ angle = 270;
+ } else {
+ angle = 0;
+ }
+ return angle;
+}
+
+function parallel(firstOrientation, secondOrientation) {
+ var difference = getAngle(firstOrientation) - getAngle(secondOrientation)
+ return difference % 180 == 0;
+}
+
+function calculateGravityPoint(firstOrientation, secondOrientation) {
+ var position = Qt.point(0, 0);
+ var difference = getAngle(firstOrientation) - getAngle(secondOrientation)
+ if (difference < 0) {
+ difference = 360 + difference;
+ }
+ if (difference == 0) {
+ position = Qt.point(0, -10);
+ } else if (difference == 90) {
+ position = Qt.point(-10, 0);
+ } else if (difference == 180) {
+ position = Qt.point(0, 1000);
+ } else if (difference == 270) {
+ position = Qt.point(1000, 0);
+ }
+ return position;
+}
diff --git a/examples/declarative/screenorientation/screenorientation.qml b/examples/declarative/screenorientation/screenorientation.qml
new file mode 100644
index 0000000..6af38bb
--- /dev/null
+++ b/examples/declarative/screenorientation/screenorientation.qml
@@ -0,0 +1,202 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+import Qt 4.7
+import "Core"
+import "Core/screenorientation.js" as ScreenOrientation
+
+Rectangle {
+ id: window
+ width: 360
+ height: 640
+ color: "white"
+
+ Rectangle {
+ id: main
+ clip: true
+ property variant selectedOrientation: Orientation.UnknownOrientation
+ property variant activeOrientation: selectedOrientation == Orientation.UnknownOrientation ? runtime.orientation : selectedOrientation
+ state: "orientation " + activeOrientation
+ property bool inPortrait: (activeOrientation == Orientation.Portrait || activeOrientation == Orientation.PortraitInverted);
+
+ // rotation correction for landscape devices like N900
+ property bool landscapeWindow: window.width > window.height
+ property variant rotationDelta: landscapeWindow ? -90 : 0
+ rotation: rotationDelta
+
+ // initial state is portrait
+ property real baseWidth: landscapeWindow ? window.height-10 : window.width-10
+ property real baseHeight: landscapeWindow ? window.width-10 : window.height-10
+
+ width: baseWidth
+ height: baseHeight
+ anchors.centerIn: parent
+
+ color: "black"
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: Qt.rgba(0.5,0.5,0.5,0.5) }
+ GradientStop { position: 0.8; color: "black" }
+ GradientStop { position: 1.0; color: "black" }
+ }
+ Item {
+ id: bubbles
+ property bool rising: false
+ anchors.fill: parent
+ property variant gravityPoint: ScreenOrientation.calculateGravityPoint(main.activeOrientation, runtime.orientation)
+ Repeater {
+ model: 24
+ Bubble {
+ rising: bubbles.rising
+ verticalRise: ScreenOrientation.parallel(main.activeOrientation, runtime.orientation)
+ xAttractor: parent.gravityPoint.x
+ yAttractor: parent.gravityPoint.y
+ }
+ }
+ Component.onCompleted: bubbles.rising = true;
+ }
+
+ Column {
+ width: centeredText.width
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenterOffset: 30
+ Text {
+ text: "Orientation"
+ color: "white"
+ font.pixelSize: 22
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ Text {
+ id: centeredText
+ text: ScreenOrientation.printOrientation(main.activeOrientation)
+ color: "white"
+ font.pixelSize: 40
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ Text {
+ text: "sensor: " + ScreenOrientation.printOrientation(runtime.orientation)
+ color: "white"
+ font.pixelSize: 14
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+ Flow {
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.margins: 10
+ spacing: 4
+ Button {
+ width: main.inPortrait ? (parent.width-4)/2 : (parent.width-8)/3
+ text: "Portrait"
+ onClicked: main.selectedOrientation = Orientation.Portrait
+ toggled: main.selectedOrientation == Orientation.Portrait
+ }
+ Button {
+ width: main.inPortrait ? (parent.width-4)/2 : (parent.width-8)/3
+ text: "Portrait inverted"
+ onClicked: main.selectedOrientation = Orientation.PortraitInverted
+ toggled: main.selectedOrientation == Orientation.PortraitInverted
+ }
+ Button {
+ width: main.inPortrait ? (parent.width-4)/2 : (parent.width-8)/3
+ text: "Landscape"
+ onClicked: main.selectedOrientation = Orientation.Landscape
+ toggled: main.selectedOrientation == Orientation.Landscape
+ }
+ Button {
+ width: main.inPortrait ? (parent.width-4)/2 : (parent.width-8)/3
+ text: "Landscape inverted"
+ onClicked: main.selectedOrientation = Orientation.LandscapeInverted
+ toggled: main.selectedOrientation == Orientation.LandscapeInverted
+ }
+ Button {
+ width: main.inPortrait ? parent.width : 2*(parent.width-2)/3
+ text: "From runtime.orientation"
+ onClicked: main.selectedOrientation = Orientation.UnknownOrientation
+ toggled: main.selectedOrientation == Orientation.UnknownOrientation
+ }
+ }
+ states: [
+ State {
+ name: "orientation " + Orientation.Landscape
+ PropertyChanges {
+ target: main
+ rotation: ScreenOrientation.getAngle(Orientation.Landscape)+rotationDelta
+ width: baseHeight
+ height: baseWidth
+ }
+ },
+ State {
+ name: "orientation " + Orientation.PortraitInverted
+ PropertyChanges {
+ target: main
+ rotation: ScreenOrientation.getAngle(Orientation.PortraitInverted)+rotationDelta
+ width: baseWidth
+ height: baseHeight
+ }
+ },
+ State {
+ name: "orientation " + Orientation.LandscapeInverted
+ PropertyChanges {
+ target: main
+ rotation: ScreenOrientation.getAngle(Orientation.LandscapeInverted)+rotationDelta
+ width: baseHeight
+ height: baseWidth
+ }
+ }
+ ]
+ transitions: Transition {
+ ParallelAnimation {
+ RotationAnimation {
+ direction: RotationAnimation.Shortest
+ duration: 300
+ easing.type: Easing.InOutQuint
+ }
+ NumberAnimation {
+ properties: "x,y,width,height"
+ duration: 300
+ easing.type: Easing.InOutQuint
+ }
+ }
+ }
+ }
+}
diff --git a/examples/declarative/screenorientation/screenorientation.qmlproject b/examples/declarative/screenorientation/screenorientation.qmlproject
new file mode 100644
index 0000000..d4909f8
--- /dev/null
+++ b/examples/declarative/screenorientation/screenorientation.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/src/3rdparty/libconninet/src/dbusdispatcher.cpp b/src/3rdparty/libconninet/src/dbusdispatcher.cpp
index 7581982..f5b830a 100644
--- a/src/3rdparty/libconninet/src/dbusdispatcher.cpp
+++ b/src/3rdparty/libconninet/src/dbusdispatcher.cpp
@@ -31,7 +31,7 @@
namespace Maemo {
/*!
- \class DBusDispatcher
+ \class Maemo::DBusDispatcher
\brief DBusDispatcher is a class, which is able to send DBUS method call
messages and receive unicast signals from DBUS object.
diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
index be2a568..3702560 100644
--- a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
+++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
@@ -16,6 +16,7 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <QResource>
#include <QUrl>
#include "abstractmediaplayer.h"
@@ -216,9 +217,10 @@ void MMF::AbstractMediaPlayer::doSetTickInterval(qint32 interval)
TRACE_EXIT_0();
}
-void MMF::AbstractMediaPlayer::open(const MediaSource &source, RFile& file)
+void MMF::AbstractMediaPlayer::open()
{
- TRACE_CONTEXT(AbstractMediaPlayer::setFileSource, EAudioApi);
+ TRACE_CONTEXT(AbstractMediaPlayer::open, EAudioApi);
+ const MediaSource source = m_parent->source();
TRACE_ENTRY("state %d source.type %d", privateState(), source.type());
close();
@@ -229,7 +231,9 @@ void MMF::AbstractMediaPlayer::open(const MediaSource &source, RFile& file)
switch (source.type()) {
case MediaSource::LocalFile: {
- symbianErr = openFile(file);
+ RFile *const file = m_parent->file();
+ Q_ASSERT(file);
+ symbianErr = openFile(*file);
if (KErrNone != symbianErr)
errorMessage = tr("Error opening file");
break;
@@ -237,9 +241,10 @@ void MMF::AbstractMediaPlayer::open(const MediaSource &source, RFile& file)
case MediaSource::Url: {
const QUrl url(source.url());
-
if (url.scheme() == QLatin1String("file")) {
- symbianErr = openFile(file);
+ RFile *const file = m_parent->file();
+ Q_ASSERT(file);
+ symbianErr = openFile(*file);
if (KErrNone != symbianErr)
errorMessage = tr("Error opening file");
} else {
@@ -251,6 +256,19 @@ void MMF::AbstractMediaPlayer::open(const MediaSource &source, RFile& file)
break;
}
+ case MediaSource::Stream: {
+ QResource *const resource = m_parent->resource();
+ if (resource) {
+ m_buffer.Set(resource->data(), resource->size());
+ symbianErr = openDescriptor(m_buffer);
+ if (KErrNone != symbianErr)
+ errorMessage = tr("Error opening resource");
+ } else {
+ errorMessage = tr("Error opening source: resource not opened");
+ }
+ break;
+ }
+
// Other source types are handled in MediaObject::createPlayer
// Protection against adding new media types and forgetting to update this switch
diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.h b/src/3rdparty/phonon/mmf/abstractmediaplayer.h
index 7d28caf..e795ecb 100644
--- a/src/3rdparty/phonon/mmf/abstractmediaplayer.h
+++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.h
@@ -47,7 +47,7 @@ protected:
AbstractMediaPlayer(MediaObject *parent, const AbstractPlayer *player);
public:
- virtual void open(const Phonon::MediaSource&, RFile&);
+ virtual void open();
// MediaObjectInterface
virtual void play();
@@ -70,6 +70,7 @@ protected:
virtual int setDeviceVolume(int mmfVolume) = 0;
virtual int openFile(RFile& file) = 0;
virtual int openUrl(const QString& url) = 0;
+ virtual int openDescriptor(const TDesC8 &des) = 0;
virtual int bufferStatus() const = 0;
void updateMetaData();
@@ -123,6 +124,9 @@ private:
bool m_prefinishMarkSent;
bool m_aboutToFinishSent;
+ // Used for playback of resource files
+ TPtrC8 m_buffer;
+
QMultiMap<QString, QString> m_metaData;
};
diff --git a/src/3rdparty/phonon/mmf/abstractplayer.h b/src/3rdparty/phonon/mmf/abstractplayer.h
index 30d5243..dd98c7c 100644
--- a/src/3rdparty/phonon/mmf/abstractplayer.h
+++ b/src/3rdparty/phonon/mmf/abstractplayer.h
@@ -26,8 +26,6 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#include "abstractvideooutput.h"
-class RFile;
-
QT_BEGIN_NAMESPACE
namespace Phonon
@@ -54,7 +52,7 @@ class AbstractPlayer : public QObject
public:
AbstractPlayer(const AbstractPlayer *player);
- virtual void open(const Phonon::MediaSource&, RFile&) = 0;
+ virtual void open() = 0;
virtual void close() = 0;
// MediaObjectInterface (implemented)
diff --git a/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp b/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp
index 9ea4d18..fb20bea 100644
--- a/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp
+++ b/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp
@@ -144,6 +144,12 @@ int MMF::AbstractVideoPlayer::openUrl(const QString &url)
return err;
}
+int MMF::AbstractVideoPlayer::openDescriptor(const TDesC8 &des)
+{
+ TRAPD(err, m_player->OpenDesL(des));
+ return err;
+}
+
int MMF::AbstractVideoPlayer::bufferStatus() const
{
int result = 0;
diff --git a/src/3rdparty/phonon/mmf/abstractvideoplayer.h b/src/3rdparty/phonon/mmf/abstractvideoplayer.h
index d854793..3ff3c75 100644
--- a/src/3rdparty/phonon/mmf/abstractvideoplayer.h
+++ b/src/3rdparty/phonon/mmf/abstractvideoplayer.h
@@ -66,6 +66,7 @@ public:
virtual int setDeviceVolume(int mmfVolume);
virtual int openFile(RFile &file);
virtual int openUrl(const QString &url);
+ virtual int openDescriptor(const TDesC8 &des);
virtual int bufferStatus() const;
virtual void close();
diff --git a/src/3rdparty/phonon/mmf/audioplayer.cpp b/src/3rdparty/phonon/mmf/audioplayer.cpp
index f49e898..7c8b9bd 100644
--- a/src/3rdparty/phonon/mmf/audioplayer.cpp
+++ b/src/3rdparty/phonon/mmf/audioplayer.cpp
@@ -137,6 +137,12 @@ int MMF::AudioPlayer::openUrl(const QString& /*url*/)
return 0;
}
+int MMF::AudioPlayer::openDescriptor(const TDesC8 &des)
+{
+ TRAPD(err, m_player->OpenDesL(des));
+ return err;
+}
+
int MMF::AudioPlayer::bufferStatus() const
{
int result = 0;
diff --git a/src/3rdparty/phonon/mmf/audioplayer.h b/src/3rdparty/phonon/mmf/audioplayer.h
index 0eb8bb7..e43cadd 100644
--- a/src/3rdparty/phonon/mmf/audioplayer.h
+++ b/src/3rdparty/phonon/mmf/audioplayer.h
@@ -67,6 +67,7 @@ typedef CMdaAudioPlayerUtility NativePlayer;
virtual int setDeviceVolume(int mmfVolume);
virtual int openFile(RFile& file);
virtual int openUrl(const QString& url);
+ virtual int openDescriptor(const TDesC8 &des);
virtual int bufferStatus() const;
virtual void close();
diff --git a/src/3rdparty/phonon/mmf/dummyplayer.cpp b/src/3rdparty/phonon/mmf/dummyplayer.cpp
index d39ef76..ba75b02 100644
--- a/src/3rdparty/phonon/mmf/dummyplayer.cpp
+++ b/src/3rdparty/phonon/mmf/dummyplayer.cpp
@@ -92,7 +92,7 @@ qint64 MMF::DummyPlayer::totalTime() const
return 0;
}
-void MMF::DummyPlayer::open(const Phonon::MediaSource &, RFile &)
+void MMF::DummyPlayer::open()
{
}
diff --git a/src/3rdparty/phonon/mmf/dummyplayer.h b/src/3rdparty/phonon/mmf/dummyplayer.h
index 9d45696..5b00411 100644
--- a/src/3rdparty/phonon/mmf/dummyplayer.h
+++ b/src/3rdparty/phonon/mmf/dummyplayer.h
@@ -57,7 +57,7 @@ public:
virtual qint64 totalTime() const;
// AbstractPlayer
- virtual void open(const Phonon::MediaSource&, RFile&);
+ virtual void open();
virtual void close();
virtual void doSetTickInterval(qint32 interval);
};
diff --git a/src/3rdparty/phonon/mmf/mediaobject.cpp b/src/3rdparty/phonon/mmf/mediaobject.cpp
index d264377..98326b8 100644
--- a/src/3rdparty/phonon/mmf/mediaobject.cpp
+++ b/src/3rdparty/phonon/mmf/mediaobject.cpp
@@ -34,6 +34,7 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#include "mediaobject.h"
#include <QDir>
+#include <QResource>
#include <QUrl>
QT_BEGIN_NAMESPACE
@@ -52,6 +53,8 @@ using namespace Phonon::MMF;
MMF::MediaObject::MediaObject(QObject *parent) : MMF::MediaNode::MediaNode(parent)
, m_recognizerOpened(false)
, m_nextSourceSet(false)
+ , m_file(0)
+ , m_resource(0)
{
m_player.reset(new DummyPlayer());
@@ -68,7 +71,12 @@ MMF::MediaObject::~MediaObject()
TRACE_CONTEXT(MediaObject::~MediaObject, EAudioApi);
TRACE_ENTRY_0();
- m_file.Close();
+ delete m_resource;
+
+ if (m_file)
+ m_file->Close();
+ delete m_file;
+
m_fileServer.Close();
m_recognizer.Close();
@@ -122,12 +130,13 @@ MMF::MediaType MMF::MediaObject::fileMediaType
const QHBufC fileNameSymbian(QDir::toNativeSeparators(fileName));
- m_file.Close();
- TInt err = m_file.Open(m_fileServer, *fileNameSymbian, EFileRead | EFileShareReadersOnly);
+ Q_ASSERT(!m_file);
+ m_file = new RFile;
+ TInt err = m_file->Open(m_fileServer, *fileNameSymbian, EFileRead | EFileShareReadersOnly);
if (KErrNone == err) {
TDataRecognitionResult recognizerResult;
- err = m_recognizer.RecognizeData(m_file, recognizerResult);
+ err = m_recognizer.RecognizeData(*m_file, recognizerResult);
if (KErrNone == err) {
const TPtrC mimeType = recognizerResult.iDataType.Des();
result = Utils::mimeTypeToMediaType(mimeType);
@@ -142,6 +151,23 @@ MMF::MediaType MMF::MediaObject::fileMediaType
return result;
}
+MMF::MediaType MMF::MediaObject::bufferMediaType(const uchar *data, qint64 size)
+{
+ TRACE_CONTEXT(MediaObject::bufferMediaType, EAudioInternal);
+ MediaType result = MediaTypeUnknown;
+ if (openRecognizer()) {
+ TDataRecognitionResult recognizerResult;
+ const TPtrC8 des(data, size);
+ const TInt err = m_recognizer.RecognizeData(KNullDesC, des, recognizerResult);
+ if (KErrNone == err) {
+ const TPtrC mimeType = recognizerResult.iDataType.Des();
+ result = Utils::mimeTypeToMediaType(mimeType);
+ } else {
+ TRACE("RApaLsSession::RecognizeData error %d", err);
+ }
+ }
+ return result;
+}
//-----------------------------------------------------------------------------
// MediaObjectInterface
@@ -228,9 +254,17 @@ void MMF::MediaObject::setSource(const MediaSource &source)
void MMF::MediaObject::switchToSource(const MediaSource &source)
{
+ if (m_file)
+ m_file->Close();
+ delete m_file;
+ m_file = 0;
+
+ delete m_resource;
+ m_resource = 0;
+
createPlayer(source);
m_source = source;
- m_player->open(m_source, m_file);
+ m_player->open();
emit currentSourceChanged(m_source);
}
@@ -272,10 +306,29 @@ void MMF::MediaObject::createPlayer(const MediaSource &source)
case MediaSource::Invalid:
case MediaSource::Disc:
- case MediaSource::Stream:
errorMessage = tr("Error opening source: type not supported");
break;
+ case MediaSource::Stream:
+ {
+ const QString fileName = source.url().toLocalFile();
+ if (fileName.startsWith(QLatin1String(":/")) || fileName.startsWith(QLatin1String("qrc://"))) {
+ Q_ASSERT(!m_resource);
+ m_resource = new QResource(fileName);
+ if (m_resource->isValid()) {
+ if (m_resource->isCompressed())
+ errorMessage = tr("Error opening source: resource is compressed");
+ else
+ mediaType = bufferMediaType(m_resource->data(), m_resource->size());
+ } else {
+ errorMessage = tr("Error opening source: resource not valid");
+ }
+ } else {
+ errorMessage = tr("Error opening source: type not supported");
+ }
+ }
+ break;
+
case MediaSource::Empty:
TRACE_0("Empty media source");
break;
@@ -374,6 +427,16 @@ void MMF::MediaObject::volumeChanged(qreal volume)
m_player->volumeChanged(volume);
}
+RFile* MMF::MediaObject::file() const
+{
+ return m_file;
+}
+
+QResource* MMF::MediaObject::resource() const
+{
+ return m_resource;
+}
+
//-----------------------------------------------------------------------------
// MediaNode
//-----------------------------------------------------------------------------
diff --git a/src/3rdparty/phonon/mmf/mediaobject.h b/src/3rdparty/phonon/mmf/mediaobject.h
index f15eb21..5399e27 100644
--- a/src/3rdparty/phonon/mmf/mediaobject.h
+++ b/src/3rdparty/phonon/mmf/mediaobject.h
@@ -33,6 +33,8 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
QT_BEGIN_NAMESPACE
+class QResource;
+
namespace Phonon
{
namespace MMF
@@ -87,6 +89,9 @@ public:
void setVideoOutput(AbstractVideoOutput* videoOutput);
+ RFile* file() const;
+ QResource* resource() const;
+
public Q_SLOTS:
void volumeChanged(qreal volume);
void switchToNextSource();
@@ -117,6 +122,7 @@ private:
// Audio / video media type recognition
MediaType fileMediaType(const QString& fileName);
+ MediaType bufferMediaType(const uchar *data, qint64 size);
// TODO: urlMediaType function
static qint64 toMilliSeconds(const TTimeIntervalMicroSeconds &);
@@ -132,9 +138,8 @@ private:
MediaSource m_nextSource;
bool m_nextSourceSet;
- // Storing the file handle here to work around KErrInUse error
- // from MMF player utility OpenFileL functions
- RFile m_file;
+ RFile* m_file;
+ QResource* m_resource;
QScopedPointer<AbstractPlayer> m_player;
diff --git a/src/3rdparty/phonon/phonon/mediasource.cpp b/src/3rdparty/phonon/phonon/mediasource.cpp
index 11d2428..d70b38b 100644
--- a/src/3rdparty/phonon/phonon/mediasource.cpp
+++ b/src/3rdparty/phonon/phonon/mediasource.cpp
@@ -58,6 +58,7 @@ MediaSource::MediaSource(const QString &filename)
d->type = Stream;
d->ioDevice = new QFile(filename);
d->setStream(new IODeviceStream(d->ioDevice, d->ioDevice));
+ d->url = QUrl::fromLocalFile(fileInfo.absoluteFilePath());
#else
d->type = Invalid;
#endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM
diff --git a/src/corelib/io/qfilesystemwatcher_kqueue.cpp b/src/corelib/io/qfilesystemwatcher_kqueue.cpp
index 99c165e..378ad20 100644
--- a/src/corelib/io/qfilesystemwatcher_kqueue.cpp
+++ b/src/corelib/io/qfilesystemwatcher_kqueue.cpp
@@ -295,12 +295,12 @@ void QKqueueFileSystemWatcherEngine::run()
path = idToPath.value(id);
if (path.isEmpty()) {
DEBUG() << "QKqueueFileSystemWatcherEngine: received a kevent for a file we're not watching";
- continue;
+ goto process_next_event;
}
}
if (kev.filter != EVFILT_VNODE) {
DEBUG() << "QKqueueFileSystemWatcherEngine: received a kevent with the wrong filter";
- continue;
+ goto process_next_event;
}
if ((kev.fflags & (NOTE_DELETE | NOTE_REVOKE | NOTE_RENAME)) != 0) {
@@ -337,6 +337,7 @@ void QKqueueFileSystemWatcherEngine::run()
}
// are there any more?
+process_next_event:
r = kevent(kqfd, 0, 0, &kev, 1, &ZeroTimeout);
} while (r > 0);
}
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index f02ef6b..68a4c64 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -1278,6 +1278,11 @@ void QDeclarativeGridView::setDelegate(QDeclarativeComponent *delegate)
if (QDeclarativeVisualDataModel *dataModel = qobject_cast<QDeclarativeVisualDataModel*>(d->model)) {
dataModel->setDelegate(delegate);
if (isComponentComplete()) {
+ for (int i = 0; i < d->visibleItems.count(); ++i)
+ d->releaseItem(d->visibleItems.at(i));
+ d->visibleItems.clear();
+ d->releaseItem(d->currentItem);
+ d->currentItem = 0;
refill();
d->moveReason = QDeclarativeGridViewPrivate::SetIndex;
d->updateCurrent(d->currentIndex);
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index 2c295cd..50998eb 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -1432,11 +1432,6 @@ QDeclarativeKeysAttached *QDeclarativeKeysAttached::qmlAttachedProperties(QObjec
*/
/*!
- \fn void QDeclarativeItem::childrenChanged()
- \internal
-*/
-
-/*!
\fn void QDeclarativeItem::focusChanged(bool)
\internal
*/
@@ -2855,6 +2850,41 @@ void QDeclarativeItem::setSmooth(bool smooth)
}
/*!
+ \property QDeclarativeItem::anchors
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::left
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::right
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::horizontalCenter
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::top
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::bottom
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::verticalCenter
+ \internal
+*/
+
+/*!
\property QDeclarativeItem::focus
\internal
*/
@@ -2875,6 +2905,41 @@ void QDeclarativeItem::setSmooth(bool smooth)
*/
/*!
+ \property QDeclarativeItem::baseline
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::data
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::resources
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::state
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::states
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::transformOriginPoint
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::transitions
+ \internal
+*/
+
+/*!
\internal
Return the width of the item
*/
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index b0a11b9..82b3e1c 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -575,9 +575,11 @@ FxListItem *QDeclarativeListViewPrivate::createItem(int modelIndex)
listItem->attached->m_prevSection = item->attached->section();
else
listItem->attached->m_prevSection = sectionAt(modelIndex-1);
+ }
+ if (modelIndex < model->count()-1) {
if (FxListItem *item = visibleItem(modelIndex+1))
listItem->attached->m_nextSection = item->attached->section();
- else if (modelIndex < model->count()-1)
+ else
listItem->attached->m_nextSection = sectionAt(modelIndex+1);
}
}
@@ -1618,6 +1620,8 @@ void QDeclarativeListView::setDelegate(QDeclarativeComponent *delegate)
for (int i = 0; i < d->visibleItems.count(); ++i)
d->releaseItem(d->visibleItems.at(i));
d->visibleItems.clear();
+ d->releaseItem(d->currentItem);
+ d->currentItem = 0;
refill();
d->moveReason = QDeclarativeListViewPrivate::SetIndex;
d->updateCurrent(d->currentIndex);
diff --git a/src/declarative/graphicsitems/qdeclarativetranslate.cpp b/src/declarative/graphicsitems/qdeclarativetranslate.cpp
index be9b3f3..0bae0cd 100644
--- a/src/declarative/graphicsitems/qdeclarativetranslate.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetranslate.cpp
@@ -125,12 +125,4 @@ void QDeclarativeTranslate::applyTo(QMatrix4x4 *matrix) const
matrix->translate(d->x, d->y, 0);
}
-/*!
- \fn QDeclarativeTranslate::positionChanged()
-
- QDeclarativeTranslate emits this signal when its position changes.
-
- \sa QDeclarativeTranslate::x, QDeclarativeTranslate::y
-*/
-
QT_END_NAMESPACE
diff --git a/src/declarative/util/qdeclarativepixmapcache.cpp b/src/declarative/util/qdeclarativepixmapcache.cpp
index a83cac8..9ced14f 100644
--- a/src/declarative/util/qdeclarativepixmapcache.cpp
+++ b/src/declarative/util/qdeclarativepixmapcache.cpp
@@ -70,6 +70,16 @@
QT_BEGIN_NAMESPACE
+// The cache limit describes the maximum "junk" in the cache.
+// These are the same defaults as QPixmapCache
+#if defined(Q_OS_SYMBIAN)
+static int cache_limit = 1024 * 1024; // 1048 KB cache limit for symbian
+#elif defined(Q_WS_QWS) || defined(Q_WS_WINCE)
+static int cache_limit = 2048 * 1024; // 2048 KB cache limit for embedded
+#else
+static int cache_limit = 10240 * 1024; // 10 MB cache limit for desktop
+#endif
+
class QDeclarativePixmapReader;
class QDeclarativePixmapData;
class QDeclarativePixmapReply : public QObject
@@ -580,6 +590,8 @@ public:
QHash<QDeclarativePixmapKey, QDeclarativePixmapData *> m_cache;
private:
+ void shrinkCache(int remove);
+
QDeclarativePixmapData *m_unreferencedPixmaps;
QDeclarativePixmapData *m_lastUnreferencedPixmap;
@@ -613,7 +625,9 @@ void QDeclarativePixmapStore::unreferencePixmap(QDeclarativePixmapData *data)
m_unreferencedCost += data->cost();
- if (m_timerId == -1)
+ shrinkCache(-1); // Shrink the cache incase it has become larger than cache_limit
+
+ if (m_timerId == -1 && m_unreferencedPixmaps)
m_timerId = startTimer(CACHE_EXPIRE_TIME * 1000);
}
@@ -636,11 +650,9 @@ void QDeclarativePixmapStore::referencePixmap(QDeclarativePixmapData *data)
m_unreferencedCost -= data->cost();
}
-void QDeclarativePixmapStore::timerEvent(QTimerEvent *)
+void QDeclarativePixmapStore::shrinkCache(int remove)
{
- int removalCost = m_unreferencedCost / CACHE_REMOVAL_FRACTION;
-
- while (removalCost > 0 && m_lastUnreferencedPixmap) {
+ while ((remove > 0 || m_unreferencedCost > cache_limit) && m_lastUnreferencedPixmap) {
QDeclarativePixmapData *data = m_lastUnreferencedPixmap;
Q_ASSERT(data->nextUnreferenced == 0);
@@ -649,10 +661,17 @@ void QDeclarativePixmapStore::timerEvent(QTimerEvent *)
data->prevUnreferencedPtr = 0;
data->prevUnreferenced = 0;
- removalCost -= data->cost();
+ remove -= data->cost();
data->removeFromCache();
delete data;
}
+}
+
+void QDeclarativePixmapStore::timerEvent(QTimerEvent *)
+{
+ int removalCost = m_unreferencedCost / CACHE_REMOVAL_FRACTION;
+
+ shrinkCache(removalCost);
if (m_unreferencedPixmaps == 0) {
killTimer(m_timerId);
@@ -702,7 +721,7 @@ bool QDeclarativePixmapReply::event(QEvent *event)
int QDeclarativePixmapData::cost() const
{
- return pixmap.width() * pixmap.height() * pixmap.depth();
+ return (pixmap.width() * pixmap.height() * pixmap.depth()) / 8;
}
void QDeclarativePixmapData::addref()
diff --git a/src/declarative/util/qdeclarativestate.cpp b/src/declarative/util/qdeclarativestate.cpp
index 9f4cc39..0d43d21 100644
--- a/src/declarative/util/qdeclarativestate.cpp
+++ b/src/declarative/util/qdeclarativestate.cpp
@@ -229,20 +229,7 @@ bool QDeclarativeState::isWhenKnown() const
be applied. For example, the following \l Rectangle changes in and out of the "hidden"
state when the \l MouseArea is pressed:
- \qml
- Rectangle {
- id: myRect
- width: 100; height: 100
- color: "red"
-
- MouseArea { id: mouseArea; anchors.fill: parent }
-
- states: State {
- name: "hidden"; when: mouseArea.pressed
- PropertyChanges { target: myRect; opacity: 0 }
- }
- }
- \endqml
+ \snippet doc/src/snippets/declarative/state-when.qml 0
If multiple states in a group have \c when clauses that evaluate to \c true at the same time,
the first matching state will be applied. For example, in the following snippet
@@ -358,8 +345,10 @@ QDeclarativeStatePrivate::generateActionList(QDeclarativeStateGroup *group) cons
if (!extends.isEmpty()) {
QList<QDeclarativeState *> states = group->states();
for (int ii = 0; ii < states.count(); ++ii)
- if (states.at(ii)->name() == extends)
+ if (states.at(ii)->name() == extends) {
+ qmlExecuteDeferred(states.at(ii));
applyList = static_cast<QDeclarativeStatePrivate*>(states.at(ii)->d_func())->generateActionList(group);
+ }
}
foreach(QDeclarativeStateOperation *op, operations)
diff --git a/src/gui/kernel/qpalette.cpp b/src/gui/kernel/qpalette.cpp
index 38ec806..55d5727 100644
--- a/src/gui/kernel/qpalette.cpp
+++ b/src/gui/kernel/qpalette.cpp
@@ -872,7 +872,7 @@ void QPalette::detach()
\note The current ColorGroup is not taken into account when
comparing palettes
- \sa operator==
+ \sa operator==()
*/
/*!
@@ -882,7 +882,7 @@ void QPalette::detach()
\note The current ColorGroup is not taken into account when
comparing palettes
- \sa operator!=
+ \sa operator!=()
*/
bool QPalette::operator==(const QPalette &p) const
{
diff --git a/src/gui/painting/qpaintengine_x11.cpp b/src/gui/painting/qpaintengine_x11.cpp
index 910b2df..e521e01 100644
--- a/src/gui/painting/qpaintengine_x11.cpp
+++ b/src/gui/painting/qpaintengine_x11.cpp
@@ -696,11 +696,10 @@ void QX11PaintEngine::drawLines(const QLine *lines, int lineCount)
linef = d->matrix.map(QLineF(lines[i]));
}
if (clipLine(&linef, d->polygonClipper.boundingRect())) {
- int x1 = qRound(linef.x1() + aliasedCoordinateDelta);
- int y1 = qRound(linef.y1() + aliasedCoordinateDelta);
- int x2 = qRound(linef.x2() + aliasedCoordinateDelta);
- int y2 = qRound(linef.y2() + aliasedCoordinateDelta);
-
+ int x1 = qFloor(linef.x1() + aliasedCoordinateDelta);
+ int y1 = qFloor(linef.y1() + aliasedCoordinateDelta);
+ int x2 = qFloor(linef.x2() + aliasedCoordinateDelta);
+ int y2 = qFloor(linef.y2() + aliasedCoordinateDelta);
XDrawLine(d->dpy, d->hd, d->gc, x1, y1, x2, y2);
}
}
@@ -730,11 +729,10 @@ void QX11PaintEngine::drawLines(const QLineF *lines, int lineCount)
for (int i = 0; i < lineCount; ++i) {
QLineF linef = d->matrix.map(lines[i]);
if (clipLine(&linef, d->polygonClipper.boundingRect())) {
- int x1 = qRound(linef.x1() + aliasedCoordinateDelta);
- int y1 = qRound(linef.y1() + aliasedCoordinateDelta);
- int x2 = qRound(linef.x2() + aliasedCoordinateDelta);
- int y2 = qRound(linef.y2() + aliasedCoordinateDelta);
-
+ int x1 = qFloor(linef.x1() + aliasedCoordinateDelta);
+ int y1 = qFloor(linef.y1() + aliasedCoordinateDelta);
+ int x2 = qFloor(linef.x2() + aliasedCoordinateDelta);
+ int y2 = qFloor(linef.y2() + aliasedCoordinateDelta);
XDrawLine(d->dpy, d->hd, d->gc, x1, y1, x2, y2);
}
}
@@ -1690,8 +1688,8 @@ void QX11PaintEnginePrivate::strokePolygon_dev(const QPointF *polygonPoints, int
if (clippedCount > 0) {
QVarLengthArray<XPoint> xpoints(clippedCount);
for (int i = 0; i < clippedCount; ++i) {
- xpoints[i].x = qRound(clippedPoints[i].x + aliasedCoordinateDelta);
- xpoints[i].y = qRound(clippedPoints[i].y + aliasedCoordinateDelta);
+ xpoints[i].x = qFloor(clippedPoints[i].x + aliasedCoordinateDelta);
+ xpoints[i].y = qFloor(clippedPoints[i].y + aliasedCoordinateDelta);
}
uint numberPoints = qMin(clippedCount, xlibMaxLinePoints);
XPoint *pts = xpoints.data();
diff --git a/src/gui/s60framework/qs60maindocument.cpp b/src/gui/s60framework/qs60maindocument.cpp
index ed33a41..26e2d00 100644
--- a/src/gui/s60framework/qs60maindocument.cpp
+++ b/src/gui/s60framework/qs60maindocument.cpp
@@ -105,11 +105,17 @@ CEikAppUi *QS60MainDocument::CreateAppUiL()
return (static_cast <CEikAppUi*>(new(ELeave)QS60MainAppUi));
}
+/*!
+ \internal
+ */
CFileStore *QS60MainDocument::OpenFileL(TBool aDoOpen, const TDesC &aFilename, RFs &aFs)
{
return QS60MainDocumentBase::OpenFileL(aDoOpen, aFilename, aFs);
}
+/*!
+ \internal
+ */
void QS60MainDocument::OpenFileL(CFileStore *&aFileStore, RFile &aFile)
{
QS60MainDocumentBase::OpenFileL(aFileStore, aFile);
diff --git a/src/gui/text/qfontengine_mac.mm b/src/gui/text/qfontengine_mac.mm
index deaad57..91b6082 100644
--- a/src/gui/text/qfontengine_mac.mm
+++ b/src/gui/text/qfontengine_mac.mm
@@ -349,11 +349,32 @@ bool QCoreTextFontEngineMulti::stringToCMap(const QChar *str, int len, QGlyphLay
int *nglyphs, QTextEngine::ShaperFlags flags) const
{
*nglyphs = len;
+ QCFType<CFStringRef> cfstring;
+
QVarLengthArray<CGGlyph> cgGlyphs(len);
CTFontGetGlyphsForCharacters(ctfont, (const UniChar*)str, cgGlyphs.data(), len);
- for (int i = 0; i < len; ++i)
- glyphs->glyphs[i] = cgGlyphs[i];
+ for (int i = 0; i < len; ++i) {
+ if (cgGlyphs[i]) {
+ glyphs->glyphs[i] = cgGlyphs[i];
+ } else {
+ if (!cfstring)
+ cfstring = CFStringCreateWithCharactersNoCopy(0, reinterpret_cast<const UniChar *>(str), len, kCFAllocatorNull);
+ QCFType<CTFontRef> substituteFont = CTFontCreateForString(ctfont, cfstring, CFRangeMake(i, 1));
+ CGGlyph substituteGlyph = 0;
+ CTFontGetGlyphsForCharacters(substituteFont, (const UniChar*)str + i, &substituteGlyph, 1);
+ if (substituteGlyph) {
+ const uint fontIndex = (fontIndexForFont(substituteFont) << 24);
+ glyphs->glyphs[i] = substituteGlyph | fontIndex;
+ if (!(flags & QTextEngine::GlyphIndicesOnly)) {
+ CGSize advance;
+ CTFontGetAdvancesForGlyphs(substituteFont, kCTFontHorizontalOrientation, &substituteGlyph, &advance, 1);
+ glyphs->advances_x[i] = QFixed::fromReal(advance.width);
+ glyphs->advances_y[i] = QFixed::fromReal(advance.height);
+ }
+ }
+ }
+ }
if (flags & QTextEngine::GlyphIndicesOnly)
return true;
@@ -362,9 +383,14 @@ bool QCoreTextFontEngineMulti::stringToCMap(const QChar *str, int len, QGlyphLay
CTFontGetAdvancesForGlyphs(ctfont, kCTFontHorizontalOrientation, cgGlyphs.data(), advances.data(), len);
for (int i = 0; i < len; ++i) {
+ if (glyphs->glyphs[i] & 0xff000000)
+ continue;
glyphs->advances_x[i] = QFixed::fromReal(advances[i].width);
glyphs->advances_y[i] = QFixed::fromReal(advances[i].height);
- if (fontDef.styleStrategy & QFont::ForceIntegerMetrics) {
+ }
+
+ if (fontDef.styleStrategy & QFont::ForceIntegerMetrics) {
+ for (int i = 0; i < len; ++i) {
glyphs->advances_x[i] = glyphs->advances_x[i].round();
glyphs->advances_y[i] = glyphs->advances_y[i].round();
}
diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp
index f6daed8..7396bcd 100644
--- a/src/gui/text/qstatictext.cpp
+++ b/src/gui/text/qstatictext.cpp
@@ -472,7 +472,12 @@ namespace {
memcpy(charsDestination, ti.chars, sizeof(QChar) * currentItem.numChars);
m_items.append(currentItem);
- }
+ }
+
+ virtual void drawPolygon(const QPointF *, int , PolygonDrawMode )
+ {
+ /* intentionally empty */
+ }
virtual bool begin(QPaintDevice *) { return true; }
virtual bool end() { return true; }
diff --git a/src/gui/util/qdesktopservices_x11.cpp b/src/gui/util/qdesktopservices_x11.cpp
index fe7f9a6..75e7209 100644
--- a/src/gui/util/qdesktopservices_x11.cpp
+++ b/src/gui/util/qdesktopservices_x11.cpp
@@ -71,10 +71,12 @@ static bool openDocument(const QUrl &url)
if (launch(url, QLatin1String("xdg-open")))
return true;
- if (X11->desktopEnvironment == DE_GNOME && launch(url, QLatin1String("gnome-open"))) {
+ // Use the X11->desktopEnvironment value if X11 is non-NULL,
+ // otherwise just attempt to launch command regardless of the desktop environment
+ if ((!X11 || (X11 && X11->desktopEnvironment == DE_GNOME)) && launch(url, QLatin1String("gnome-open"))) {
return true;
} else {
- if (X11->desktopEnvironment == DE_KDE && launch(url, QLatin1String("kfmclient exec")))
+ if ((!X11 || (X11 && X11->desktopEnvironment == DE_KDE)) && launch(url, QLatin1String("kfmclient exec")))
return true;
}
@@ -104,10 +106,12 @@ static bool launchWebBrowser(const QUrl &url)
if (launch(url, QString::fromLocal8Bit(getenv("BROWSER"))))
return true;
- if (X11->desktopEnvironment == DE_GNOME && launch(url, QLatin1String("gnome-open"))) {
+ // Use the X11->desktopEnvironment value if X11 is non-NULL,
+ // otherwise just attempt to launch command regardless of the desktop environment
+ if ((!X11 || (X11 && X11->desktopEnvironment == DE_GNOME)) && launch(url, QLatin1String("gnome-open"))) {
return true;
} else {
- if (X11->desktopEnvironment == DE_KDE && launch(url, QLatin1String("kfmclient openURL")))
+ if ((!X11 || (X11 && X11->desktopEnvironment == DE_KDE)) && launch(url, QLatin1String("kfmclient openURL")))
return true;
}
diff --git a/src/network/bearer/qnetworkconfiguration.cpp b/src/network/bearer/qnetworkconfiguration.cpp
index b645916..3190a30 100644
--- a/src/network/bearer/qnetworkconfiguration.cpp
+++ b/src/network/bearer/qnetworkconfiguration.cpp
@@ -506,7 +506,7 @@ QString QNetworkConfiguration::bearerTypeName() const
return QLatin1String("WiMAX");
}
- return QString();
+ return QLatin1String("Unknown");
}
QT_END_NAMESPACE
diff --git a/src/network/bearer/qnetworkconfiguration_p.h b/src/network/bearer/qnetworkconfiguration_p.h
index 0fc6ee9..2b0bbf6 100644
--- a/src/network/bearer/qnetworkconfiguration_p.h
+++ b/src/network/bearer/qnetworkconfiguration_p.h
@@ -81,7 +81,7 @@ public:
virtual QString bearerTypeName() const
{
- return QString();
+ return QLatin1String("Unknown");
}
QMap<unsigned int, QNetworkConfigurationPrivatePointer> serviceNetworkMembers;
diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def
index 53ec18c..7844688 100644
--- a/src/s60installs/bwins/QtGuiu.def
+++ b/src/s60installs/bwins/QtGuiu.def
@@ -12883,4 +12883,7 @@ EXPORTS
?focusScopeItemChange@QGraphicsItemPrivate@@UAEX_N@Z @ 12882 NONAME ; void QGraphicsItemPrivate::focusScopeItemChange(bool)
?setTimeout@QTapAndHoldGesture@@SAXH@Z @ 12883 NONAME ; void QTapAndHoldGesture::setTimeout(int)
?childrenBoundingRectHelper@QGraphicsItemPrivate@@QAEXPAVQTransform@@PAVQRectF@@_N@Z @ 12884 NONAME ; void QGraphicsItemPrivate::childrenBoundingRectHelper(class QTransform *, class QRectF *, bool)
+ ?zScaleChanged@QGraphicsScale@@IAEXXZ @ 12885 NONAME ; void QGraphicsScale::zScaleChanged(void)
+ ?xScaleChanged@QGraphicsScale@@IAEXXZ @ 12886 NONAME ; void QGraphicsScale::xScaleChanged(void)
+ ?yScaleChanged@QGraphicsScale@@IAEXXZ @ 12887 NONAME ; void QGraphicsScale::yScaleChanged(void)
diff --git a/src/s60installs/bwins/QtNetworku.def b/src/s60installs/bwins/QtNetworku.def
index 48af60c..2cf62a8 100644
--- a/src/s60installs/bwins/QtNetworku.def
+++ b/src/s60installs/bwins/QtNetworku.def
@@ -1143,4 +1143,6 @@ EXPORTS
?setNetworkAccessible@QNetworkAccessManager@@QAEXW4NetworkAccessibility@1@@Z @ 1142 NONAME ; void QNetworkAccessManager::setNetworkAccessible(enum QNetworkAccessManager::NetworkAccessibility)
??_EQBearerEngineFactoryInterface@@UAE@I@Z @ 1143 NONAME ; QBearerEngineFactoryInterface::~QBearerEngineFactoryInterface(unsigned int)
?enablePolling@QNetworkConfigurationManagerPrivate@@QAEXXZ @ 1144 NONAME ; void QNetworkConfigurationManagerPrivate::enablePolling(void)
+ ?bearerTypeName@QNetworkConfiguration@@QBE?AVQString@@XZ @ 1145 NONAME ; class QString QNetworkConfiguration::bearerTypeName(void) const
+ ?bearerType@QNetworkConfiguration@@QBE?AW4BearerType@1@XZ @ 1146 NONAME ; enum QNetworkConfiguration::BearerType QNetworkConfiguration::bearerType(void) const
diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def
index 559c896..a22b4d9 100644
--- a/src/s60installs/eabi/QtGuiu.def
+++ b/src/s60installs/eabi/QtGuiu.def
@@ -12088,4 +12088,7 @@ EXPORTS
_ZN18QTapAndHoldGesture7timeoutEv @ 12087 NONAME
_ZN20QGraphicsItemPrivate20focusScopeItemChangeEb @ 12088 NONAME
_ZN20QGraphicsItemPrivate26childrenBoundingRectHelperEP10QTransformP6QRectFb @ 12089 NONAME
+ _ZN14QGraphicsScale13xScaleChangedEv @ 12090 NONAME
+ _ZN14QGraphicsScale13yScaleChangedEv @ 12091 NONAME
+ _ZN14QGraphicsScale13zScaleChangedEv @ 12092 NONAME
diff --git a/src/s60installs/eabi/QtNetworku.def b/src/s60installs/eabi/QtNetworku.def
index eb30832..6b34a19 100644
--- a/src/s60installs/eabi/QtNetworku.def
+++ b/src/s60installs/eabi/QtNetworku.def
@@ -1131,7 +1131,7 @@ EXPORTS
_ZNK21QNetworkAccessManager13configurationEv @ 1130 NONAME
_ZNK21QNetworkAccessManager17networkAccessibleEv @ 1131 NONAME
_ZNK21QNetworkAccessManager19activeConfigurationEv @ 1132 NONAME
- _ZNK21QNetworkConfiguration10bearerNameEv @ 1133 NONAME
+ _ZNK21QNetworkConfiguration10bearerNameEv @ 1133 NONAME ABSENT
_ZNK21QNetworkConfiguration10identifierEv @ 1134 NONAME
_ZNK21QNetworkConfiguration18isRoamingAvailableEv @ 1135 NONAME
_ZNK21QNetworkConfiguration4nameEv @ 1136 NONAME
@@ -1167,4 +1167,6 @@ EXPORTS
_ZN14QAuthenticator9setOptionERK7QStringRK8QVariant @ 1166 NONAME
_ZNK14QAuthenticator6optionERK7QString @ 1167 NONAME
_ZNK14QAuthenticator7optionsEv @ 1168 NONAME
+ _ZNK21QNetworkConfiguration10bearerTypeEv @ 1169 NONAME
+ _ZNK21QNetworkConfiguration14bearerTypeNameEv @ 1170 NONAME
diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro
index 4addb84..8a8167b 100644
--- a/src/s60installs/s60installs.pro
+++ b/src/s60installs/s60installs.pro
@@ -57,8 +57,8 @@ symbian: {
bearerPluginLocation = $${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)
bearerStubZ = $${EPOCROOT}$${HW_ZDIR}$${QT_PLUGINS_BASE_DIR}/bearer/qsymbianbearer$${QT_LIBINFIX}.qtplugin
BLD_INF_RULES.prj_exports += \
- "qsymbianbearer.qtplugin $$bearerStubZ" \
- "qsymbianbearer.qtplugin $${EPOCROOT}epoc32/winscw/c$${QT_PLUGINS_BASE_DIR}/bearer/qsymbianbearer$${QT_LIBINFIX}.qtplugin"
+ "qsymbianbearer.qtplugin /$${HW_ZDIR}$${QT_PLUGINS_BASE_DIR}/bearer/qsymbianbearer$${QT_LIBINFIX}.qtplugin" \
+ "qsymbianbearer.qtplugin /epoc32/winscw/c$${QT_PLUGINS_BASE_DIR}/bearer/qsymbianbearer$${QT_LIBINFIX}.qtplugin"
} else {
pluginLocations = $$QT_BUILD_TREE/plugins/s60
bearerPluginLocation = $$QT_BUILD_TREE/plugins/bearer
diff --git a/src/script/api/qscriptcontext.cpp b/src/script/api/qscriptcontext.cpp
index 3f08e74..1a11100 100644
--- a/src/script/api/qscriptcontext.cpp
+++ b/src/script/api/qscriptcontext.cpp
@@ -323,6 +323,9 @@ QScriptValue QScriptContext::argumentsObject() const
When a function is called as constructor, the thisObject()
contains the newly constructed object to be initialized.
+
+ \note This function is only guarenteed to work for a context
+ corresponding to native functions.
*/
bool QScriptContext::isCalledAsConstructor() const
{
@@ -413,6 +416,9 @@ void QScriptContext::setReturnValue(const QScriptValue &result)
object provides access to the local variables associated with this
context.
+ \note The activation object might not be available if there is no
+ active QScriptEngineAgent, as it might be optimized.
+
\sa argument(), argumentsObject()
*/
@@ -472,6 +478,10 @@ QScriptValue QScriptContext::activationObject() const
activation.
If \a activation is not an object, this function does nothing.
+
+ \note For a context corresponding to a JavaScript function, this is only
+ guarenteed to work if there was an QScriptEngineAgent active on the
+ engine while the function was evaluated.
*/
void QScriptContext::setActivationObject(const QScriptValue &activation)
{
diff --git a/src/script/api/qscriptcontextinfo.cpp b/src/script/api/qscriptcontextinfo.cpp
index ebb1770..a90e014 100644
--- a/src/script/api/qscriptcontextinfo.cpp
+++ b/src/script/api/qscriptcontextinfo.cpp
@@ -53,8 +53,7 @@ QT_BEGIN_NAMESPACE
current statement.
If the called function is executing Qt Script code, you can obtain
- the script location with the functions fileName(), lineNumber() and
- columnNumber().
+ the script location with the functions fileName() and lineNumber().
You can obtain the starting line number and ending line number of a
Qt Script function definition with functionStartLineNumber() and
@@ -317,13 +316,7 @@ int QScriptContextInfo::lineNumber() const
}
/*!
- Returns the column number corresponding to the statement being
- executed, or -1 if the column number is not available.
-
- The column number is only available if Qt Script code is being
- executed.
-
- \sa lineNumber(), fileName()
+ \obsolete
*/
int QScriptContextInfo::columnNumber() const
{
diff --git a/src/script/api/qscriptcontextinfo.h b/src/script/api/qscriptcontextinfo.h
index d0b3f21..64a1e15 100644
--- a/src/script/api/qscriptcontextinfo.h
+++ b/src/script/api/qscriptcontextinfo.h
@@ -69,7 +69,9 @@ public:
qint64 scriptId() const;
QString fileName() const;
int lineNumber() const;
- int columnNumber() const;
+#ifdef QT_DEPRECATED
+ QT_DEPRECATED int columnNumber() const;
+#endif
QString functionName() const;
FunctionType functionType() const;
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index 26673f4..8560214 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -44,7 +44,6 @@
#include "CodeBlock.h"
#include "Error.h"
-#include "JSLock.h"
#include "Interpreter.h"
#include "PrototypeFunction.h"
@@ -152,8 +151,7 @@ QT_BEGIN_NAMESPACE
evaluation caused an exception by calling hasUncaughtException(). In
that case, you can call toString() on the error object to obtain an
error message. The current uncaught exception is also available
- through uncaughtException(). You can obtain a human-readable
- backtrace of the exception with uncaughtExceptionBacktrace().
+ through uncaughtException().
Calling clearExceptions() will cause any uncaught exceptions to be
cleared.
@@ -1003,7 +1001,6 @@ QScriptEnginePrivate::~QScriptEnginePrivate()
detachAllRegisteredScriptStrings();
qDeleteAll(m_qobjectData);
qDeleteAll(m_typeInfos);
- JSC::JSLock lock(false);
globalData->heap.destroy();
globalData->deref();
while (freeScriptValues) {
@@ -1292,7 +1289,6 @@ bool QScriptEnginePrivate::isCollecting() const
void QScriptEnginePrivate::collectGarbage()
{
- JSC::JSLock lock(false);
QScript::APIShim shim(this);
globalData->heap.collectAllGarbage();
}
@@ -1322,7 +1318,6 @@ JSC::JSValue QScriptEnginePrivate::evaluateHelper(JSC::ExecState *exec, intptr_t
bool &compile)
{
Q_Q(QScriptEngine);
- JSC::JSLock lock(false); // ### hmmm
QBoolBlocker inEvalBlocker(inEval, true);
q->currentContext()->activationObject(); //force the creation of a context for native function;
@@ -2800,8 +2795,7 @@ void QScriptEnginePrivate::popContext()
The exception state is cleared when evaluate() is called.
- \sa uncaughtException(), uncaughtExceptionLineNumber(),
- uncaughtExceptionBacktrace()
+ \sa uncaughtException(), uncaughtExceptionLineNumber()
*/
bool QScriptEngine::hasUncaughtException() const
{
@@ -2819,7 +2813,6 @@ bool QScriptEngine::hasUncaughtException() const
message.
\sa hasUncaughtException(), uncaughtExceptionLineNumber(),
- uncaughtExceptionBacktrace()
*/
QScriptValue QScriptEngine::uncaughtException() const
{
@@ -2839,7 +2832,7 @@ QScriptValue QScriptEngine::uncaughtException() const
Line numbers are 1-based, unless a different base was specified as
the second argument to evaluate().
- \sa hasUncaughtException(), uncaughtExceptionBacktrace()
+ \sa hasUncaughtException()
*/
int QScriptEngine::uncaughtExceptionLineNumber() const
{
@@ -2851,7 +2844,7 @@ int QScriptEngine::uncaughtExceptionLineNumber() const
/*!
Returns a human-readable backtrace of the last uncaught exception.
- Each line is of the form \c{<function-name>(<arguments>)@<file-name>:<line-number>}.
+ It is in the form \c{<function-name>()@<file-name>:<line-number>}.
\sa uncaughtException()
*/
diff --git a/src/script/api/qscriptengineagent.cpp b/src/script/api/qscriptengineagent.cpp
index c3d1566..b1f131e 100644
--- a/src/script/api/qscriptengineagent.cpp
+++ b/src/script/api/qscriptengineagent.cpp
@@ -372,9 +372,8 @@ void QScriptEngineAgent::functionExit(qint64 scriptId,
/*!
This function is called when the engine is about to execute a new
statement in the script identified by \a scriptId. The statement
- begins on the line and column specified by \a lineNumber and \a
- columnNumber. This event is not generated for native Qt Script
- functions.
+ begins on the line and column specified by \a lineNumber
+ This event is not generated for native Qt Script functions.
Reimplement this function to handle this event. For example, a
debugger implementation could reimplement this function to provide
@@ -383,6 +382,8 @@ void QScriptEngineAgent::functionExit(qint64 scriptId,
The default implementation does nothing.
+ \note \a columnNumber is undefined
+
\sa scriptLoad(), functionEntry()
*/
void QScriptEngineAgent::positionChange(qint64 scriptId,
diff --git a/tests/auto/declarative/qdeclarativepixmapcache/data/massive.png b/tests/auto/declarative/qdeclarativepixmapcache/data/massive.png
new file mode 100644
index 0000000..bc6cc9e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepixmapcache/data/massive.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp b/tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp
index 0c7780c..16d2063 100644
--- a/tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp
+++ b/tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp
@@ -70,6 +70,7 @@ private slots:
void single_data();
void parallel();
void parallel_data();
+ void massive();
private:
QDeclarativeEngine engine;
@@ -276,6 +277,45 @@ void tst_qdeclarativepixmapcache::parallel()
qDeleteAll(pixmaps);
}
+void tst_qdeclarativepixmapcache::massive()
+{
+ QUrl url = thisfile.resolved(QUrl("data/massive.png"));
+
+ // Confirm that massive images remain in the cache while they are
+ // in use by the application.
+ {
+ qint64 cachekey = 0;
+ QDeclarativePixmap p(0, url);
+ QVERIFY(p.isReady());
+ QVERIFY(p.pixmap().size() == QSize(10000, 1000));
+ cachekey = p.pixmap().cacheKey();
+
+ QDeclarativePixmap p2(0, url);
+ QVERIFY(p2.isReady());
+ QVERIFY(p2.pixmap().size() == QSize(10000, 1000));
+
+ QVERIFY(p2.pixmap().cacheKey() == cachekey);
+ }
+
+ // Confirm that massive images are removed from the cache when
+ // they become unused
+ {
+ qint64 cachekey = 0;
+ {
+ QDeclarativePixmap p(0, url);
+ QVERIFY(p.isReady());
+ QVERIFY(p.pixmap().size() == QSize(10000, 1000));
+ cachekey = p.pixmap().cacheKey();
+ }
+
+ QDeclarativePixmap p2(0, url);
+ QVERIFY(p2.isReady());
+ QVERIFY(p2.pixmap().size() == QSize(10000, 1000));
+
+ QVERIFY(p2.pixmap().cacheKey() != cachekey);
+ }
+}
+
QTEST_MAIN(tst_qdeclarativepixmapcache)
#include "tst_qdeclarativepixmapcache.moc"
diff --git a/tests/auto/declarative/qdeclarativestates/data/extendsBug.qml b/tests/auto/declarative/qdeclarativestates/data/extendsBug.qml
new file mode 100644
index 0000000..a3c4827
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/extendsBug.qml
@@ -0,0 +1,26 @@
+import Qt 4.7
+
+Rectangle {
+ width: 200
+ height: 200
+
+ Rectangle {
+ id: rect
+ objectName: "greenRect"
+ width: 100
+ height: 100
+ color: "green"
+ }
+
+ states:[
+ State {
+ name: "a"
+ PropertyChanges { target: rect; x: 100 }
+ },
+ State {
+ name: "b"
+ extend:"a"
+ PropertyChanges { target: rect; y: 100 }
+ }
+ ]
+}
diff --git a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
index 3b6a420..6ae2759 100644
--- a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
+++ b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
@@ -139,6 +139,7 @@ private slots:
void urlResolution();
void unnamedWhen();
void returnToBase();
+ void extendsBug();
};
void tst_qdeclarativestates::initTestCase()
@@ -1186,6 +1187,21 @@ void tst_qdeclarativestates::returnToBase()
QCOMPARE(rect->property("stateString").toString(), QLatin1String("originalState"));
}
+//QTBUG-12559
+void tst_qdeclarativestates::extendsBug()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/extendsBug.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QDeclarativeRectangle *greenRect = rect->findChild<QDeclarativeRectangle*>("greenRect");
+
+ rectPrivate->setState("b");
+ QCOMPARE(greenRect->x(), qreal(100));
+ QCOMPARE(greenRect->y(), qreal(100));
+}
QTEST_MAIN(tst_qdeclarativestates)
diff --git a/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp b/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp
index de8d222..1c1c04b 100644
--- a/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp
+++ b/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp
@@ -43,9 +43,11 @@
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativeview.h>
#include <QtDeclarative/qdeclarativeitem.h>
+#include <QtDeclarative/qdeclarativecontext.h>
#include <QtGui/qmenubar.h>
#include "../../../shared/util.h"
#include "qmlruntime.h"
+#include "deviceorientation.h"
#include "../../../shared/util.h"
#ifdef Q_OS_SYMBIAN
@@ -67,7 +69,7 @@ public:
tst_QDeclarativeViewer();
private slots:
- void orientation();
+ void runtimeContextProperty();
void loading();
void fileBrowser();
void resizing();
@@ -94,7 +96,7 @@ tst_QDeclarativeViewer::tst_QDeclarativeViewer()
QCOMPARE(viewer->size(), viewer->sizeHint()); \
}
-void tst_QDeclarativeViewer::orientation()
+void tst_QDeclarativeViewer::runtimeContextProperty()
{
QDeclarativeViewer *viewer = new QDeclarativeViewer();
QVERIFY(viewer);
@@ -103,17 +105,30 @@ void tst_QDeclarativeViewer::orientation()
QVERIFY(viewer->menuBar());
QDeclarativeItem* rootItem = qobject_cast<QDeclarativeItem*>(viewer->view()->rootObject());
QVERIFY(rootItem);
+ QObject *runtimeObject = qvariant_cast<QObject*>(viewer->view()->engine()->rootContext()->contextProperty("runtime"));
+ QVERIFY(runtimeObject);
+
+ // test isActiveWindow property
+ QVERIFY(!runtimeObject->property("isActiveWindow").toBool());
+
viewer->show();
-
QApplication::setActiveWindow(viewer);
QTest::qWaitForWindowShown(viewer);
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(viewer));
+ QVERIFY(runtimeObject->property("isActiveWindow").toBool());
+
TEST_INITIAL_SIZES(viewer);
+ // test orientation property
+ QCOMPARE(runtimeObject->property("orientation").toInt(), int(DeviceOrientation::Portrait));
+
viewer->rotateOrientation();
qApp->processEvents();
+ QCOMPARE(runtimeObject->property("orientation").toInt(), int(DeviceOrientation::Landscape));
+ QCOMPARE(rootItem->width(), 300.0);
+
QCOMPARE(rootItem->width(), 300.0);
QCOMPARE(rootItem->height(), 200.0);
QTRY_COMPARE(viewer->view()->size(), QSize(300, 200));
@@ -124,6 +139,8 @@ void tst_QDeclarativeViewer::orientation()
viewer->rotateOrientation();
qApp->processEvents();
+ QCOMPARE(runtimeObject->property("orientation").toInt(), int(DeviceOrientation::PortraitInverted));
+
QCOMPARE(rootItem->width(), 200.0);
QCOMPARE(rootItem->height(), 300.0);
QTRY_COMPARE(viewer->view()->size(), QSize(200, 300));
@@ -131,6 +148,19 @@ void tst_QDeclarativeViewer::orientation()
QCOMPARE(viewer->size(), QSize(200, 300 + MENUBAR_HEIGHT(viewer)));
QCOMPARE(viewer->size(), viewer->sizeHint());
+ viewer->rotateOrientation();
+ qApp->processEvents();
+
+ QCOMPARE(runtimeObject->property("orientation").toInt(), int(DeviceOrientation::LandscapeInverted));
+
+ viewer->rotateOrientation();
+ qApp->processEvents();
+
+ QCOMPARE(runtimeObject->property("orientation").toInt(), int(DeviceOrientation::Portrait));
+
+ viewer->hide();
+ QVERIFY(!runtimeObject->property("isActiveWindow").toBool());
+
delete viewer;
}
diff --git a/tests/auto/mediaobject/tst_mediaobject.cpp b/tests/auto/mediaobject/tst_mediaobject.cpp
index 2f98521..322e2e4 100644
--- a/tests/auto/mediaobject/tst_mediaobject.cpp
+++ b/tests/auto/mediaobject/tst_mediaobject.cpp
@@ -201,9 +201,6 @@ void tst_MediaObject::stateChanged(Phonon::State newstate, Phonon::State oldstat
void tst_MediaObject::testPlayFromResource()
{
-#ifdef Q_OS_SYMBIAN
- QSKIP("Not implemented yet.", SkipAll);
-#else
MediaObject media;
media.setCurrentSource(QString(MEDIA_FILEPATH));
QVERIFY(media.state() != Phonon::ErrorState);
@@ -214,7 +211,6 @@ void tst_MediaObject::testPlayFromResource()
if (media.state() != Phonon::PlayingState)
QTest::waitForSignal(&media, SIGNAL(stateChanged(Phonon::State, Phonon::State)), 10000);
QCOMPARE(media.state(), Phonon::PlayingState);
-#endif
}
void tst_MediaObject::testPlayIllegalFile()
diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp
index f358681..2cbb9b2 100644
--- a/tests/auto/qpainter/tst_qpainter.cpp
+++ b/tests/auto/qpainter/tst_qpainter.cpp
@@ -118,10 +118,12 @@ private slots:
void drawLine_task190634();
void drawLine_task229459();
void drawLine_task234891();
+ void drawHorizontalLineF();
void drawRect_data() { fillData(); }
void drawRect();
void drawRect2();
+ void drawRectFHorizontalLine();
void fillRect();
void fillRect2();
@@ -251,6 +253,7 @@ private slots:
void setPenColorOnPixmap();
void QTBUG5939_attachPainterPrivate();
+ void drawHorizontalLine();
private:
void fillData();
@@ -1218,6 +1221,26 @@ void tst_QPainter::drawLine_task234891()
QCOMPARE(expected, img);
}
+void tst_QPainter::drawHorizontalLineF()
+{
+ QPixmap pixmap(100, 3);
+ pixmap.fill();
+
+ {
+ QPainter painter(&pixmap);
+ painter.drawLine(QLineF(1.5f, 1.5f, 98.5f, 1.5f));
+ }
+
+ QImage refImage(100, 3, QImage::Format_ARGB32);
+ refImage.fill(0xFFFFFFFF);
+ {
+ QPainter painter(&refImage);
+ painter.drawLine(QLineF(1.5f, 1.5f, 98.5f, 1.5f));
+ }
+
+ QCOMPARE(pixmap.toImage().convertToFormat(QImage::Format_ARGB32), refImage);
+}
+
void tst_QPainter::drawLine_task216948()
{
QImage img(1, 10, QImage::Format_ARGB32_Premultiplied);
@@ -1302,6 +1325,26 @@ void tst_QPainter::drawRect2()
}
}
+void tst_QPainter::drawRectFHorizontalLine()
+{
+ QPixmap pixmap(100, 3);
+ pixmap.fill();
+
+ {
+ QPainter painter(&pixmap);
+ painter.drawRect(QRectF(1.5f, 1.5f, 98.5f, 1.5f));
+ }
+
+ QImage refImage(100, 3, QImage::Format_ARGB32);
+ refImage.fill(0xFFFFFFFF);
+ {
+ QPainter painter(&refImage);
+ painter.drawRect(QRectF(1.5f, 1.5f, 98.5f, 1.5f));
+ }
+
+ QCOMPARE(pixmap.toImage().convertToFormat(QImage::Format_ARGB32), refImage);
+}
+
void tst_QPainter::fillRect()
{
QImage image(100, 100, QImage::Format_ARGB32_Premultiplied);
@@ -4522,6 +4565,28 @@ void tst_QPainter::QTBUG5939_attachPainterPrivate()
QCOMPARE(widget->deviceTransform, proxy->deviceTransform);
}
+void tst_QPainter::drawHorizontalLine()
+{
+ QPixmap pixmap(100, 3);
+ pixmap.fill();
+
+ {
+ QPainter painter(&pixmap);
+ painter.translate(0.3, 0.3);
+ painter.drawLine(QLine(1, 1, 99, 1));
+ }
+
+ QImage refImage(100, 3, QImage::Format_ARGB32);
+ refImage.fill(0xFFFFFFFF);
+ {
+ QPainter painter(&refImage);
+ painter.translate(0.3, 0.3);
+ painter.drawLine(QLine(1, 1, 99, 1));
+ }
+
+ QCOMPARE(pixmap.toImage().convertToFormat(QImage::Format_ARGB32), refImage);
+}
+
QTEST_MAIN(tst_QPainter)
#include "tst_qpainter.moc"
diff --git a/tools/qdoc3/main.cpp b/tools/qdoc3/main.cpp
index 44f9572..47a4b67 100644
--- a/tools/qdoc3/main.cpp
+++ b/tools/qdoc3/main.cpp
@@ -521,8 +521,10 @@ int main(int argc, char **argv)
/*
Main loop.
*/
- foreach (QString qf, qdocFiles)
+ foreach (QString qf, qdocFiles) {
+ qDebug() << "PROCESSING:" << qf;
processQdocconfFile(qf);
+ }
qDeleteAll(trees);
return EXIT_SUCCESS;
diff --git a/tools/qdoc3/test/assistant.qdocconf b/tools/qdoc3/test/assistant.qdocconf
index efe3b3b..119a676 100644
--- a/tools/qdoc3/test/assistant.qdocconf
+++ b/tools/qdoc3/test/assistant.qdocconf
@@ -19,39 +19,39 @@ qhp.Assistant.file = assistant.qhp
qhp.Assistant.namespace = com.trolltech.assistant.470
qhp.Assistant.virtualFolder = qdoc
qhp.Assistant.indexTitle = Qt Assistant Manual
-qhp.Assistant.extraFiles = images/bg_l.png \
- images/bg_l_blank.png \
- images/bg_ll_blank.png \
- images/bg_ul_blank.png \
- images/header_bg.png \
+qhp.Assistant.extraFiles = images/bg_l.png \
+ images/bg_l_blank.png \
+ images/bg_ll_blank.png \
+ images/bg_ul_blank.png \
+ images/header_bg.png \
images/bg_r.png \
- images/box_bg.png \
- images/breadcrumb.png \
- images/bullet_gt.png \
+ images/box_bg.png \
+ images/breadcrumb.png \
+ images/bullet_gt.png \
images/bullet_dn.png \
- images/bullet_sq.png \
+ images/bullet_sq.png \
images/bullet_up.png \
- images/arrow_down.png \
+ images/arrow_down.png \
images/feedbackground.png \
images/horBar.png \
- images/page.png \
- images/page_bg.png \
- images/sprites-combined.png \
- images/spinner.gif \
+ 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 \
- images/dynamiclayouts-example.png \
- scripts/functions.js \
- scripts/jquery.js \
- scripts/narrow.js \
- scripts/superfish.js \
- style/narrow.css \
- style/superfish.css \
- style/style_ie6.css \
- style/style_ie7.css \
- style/style_ie8.css \
- style/style.css
+ images/coloreditorfactoryimage.png \
+ images/dynamiclayouts-example.png \
+ scripts/functions.js \
+ scripts/jquery.js \
+ scripts/narrow.js \
+ scripts/superfish.js \
+ style/narrow.css \
+ style/superfish.css \
+ style/style_ie6.css \
+ style/style_ie7.css \
+ style/style_ie8.css \
+ style/style.css
qhp.Assistant.filterAttributes = qt 4.7.0 tools assistant
qhp.Assistant.customFilters.Assistant.name = Qt Assistant Manual
diff --git a/tools/qdoc3/test/qdeclarative.qdocconf b/tools/qdoc3/test/qdeclarative.qdocconf
index 0cff98e..7628519 100644
--- a/tools/qdoc3/test/qdeclarative.qdocconf
+++ b/tools/qdoc3/test/qdeclarative.qdocconf
@@ -31,32 +31,32 @@ qhp.Qml.indexTitle = Qml Reference
# Files not referenced in any qdoc file
# See also extraimages.HTML
qhp.Qml.extraFiles = images/bg_l.png \
- images/bg_l_blank.png \
- images/bg_r.png \
- images/box_bg.png \
- images/breadcrumb.png \
- images/bullet_gt.png \
- images/bullet_dn.png \
- images/bullet_sq.png \
- images/bullet_up.png \
- images/feedbackground.png \
- images/horBar.png \
- images/page.png \
- images/page_bg.png \
- images/sprites-combined.png \
- images/arrow-down.png \
- images/spinner.png \
- images/stylesheet-coffee-plastique.png \
- images/taskmenuextension-example.png \
- images/coloreditorfactoryimage.png \
- images/dynamiclayouts-example.png \
- scripts/functions.js \
- scripts/jquery.js \
- style/OfflineStyle.css \
- style/style_ie6.css \
- style/style_ie7.css \
- style/style_ie8.css \
- style/style.css
+ images/bg_l_blank.png \
+ images/bg_r.png \
+ images/box_bg.png \
+ images/breadcrumb.png \
+ images/bullet_gt.png \
+ images/bullet_dn.png \
+ images/bullet_sq.png \
+ images/bullet_up.png \
+ images/feedbackground.png \
+ images/horBar.png \
+ images/page.png \
+ images/page_bg.png \
+ images/sprites-combined.png \
+ images/arrow-down.png \
+ images/spinner.png \
+ images/stylesheet-coffee-plastique.png \
+ images/taskmenuextension-example.png \
+ images/coloreditorfactoryimage.png \
+ images/dynamiclayouts-example.png \
+ scripts/functions.js \
+ scripts/jquery.js \
+ style/OfflineStyle.css \
+ style/style_ie6.css \
+ style/style_ie7.css \
+ style/style_ie8.css \
+ style/style.css
qhp.Qml.filterAttributes = qt 4.7.0 qtrefdoc
qhp.Qml.customFilters.Qt.name = Qt 4.7.0
diff --git a/tools/qdoc3/test/qt-api-only.qdocconf b/tools/qdoc3/test/qt-api-only.qdocconf
index 1ec0c6b..7387810 100644
--- a/tools/qdoc3/test/qt-api-only.qdocconf
+++ b/tools/qdoc3/test/qt-api-only.qdocconf
@@ -30,10 +30,7 @@ qhp.Qt.excluded += $QT_SOURCE_TREE/doc/src/development/assistant-manual.qdoc \
# Remove the QML documentation from the Qt-only documentation.
-excludedirs += $QT_SOURCE_TREE/src/declarative \
- $QT_SOURCE_TREE/src/imports \
- $QT_SOURCE_TREE/src/3rdparty/webkit/WebKit/qt/declarative \
- $QT_SOURCE_TREE/doc/src/declarative
+excludedirs += $QT_SOURCE_TREE/src/imports
outputdir = $QT_BUILD_TREE/doc-build/html-qt
tagfile = $QT_BUILD_TREE/doc-build/html-qt/qt.tags
diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf
index f663016..415457e 100644
--- a/tools/qdoc3/test/qt-build-docs.qdocconf
+++ b/tools/qdoc3/test/qt-build-docs.qdocconf
@@ -21,6 +21,7 @@ qhp.Qt.file = qt.qhp
qhp.Qt.namespace = com.trolltech.qt.470
qhp.Qt.virtualFolder = qdoc
qhp.Qt.indexTitle = Qt Reference Documentation
+qhp.Qt.indexRoot =
# Files not referenced in any qdoc file (last four are needed by qtdemo)
# See also extraimages.HTML
diff --git a/tools/qdoc3/test/qt-cpp-ignore.qdocconf b/tools/qdoc3/test/qt-cpp-ignore.qdocconf
index 4963b96..b78b512 100644
--- a/tools/qdoc3/test/qt-cpp-ignore.qdocconf
+++ b/tools/qdoc3/test/qt-cpp-ignore.qdocconf
@@ -64,6 +64,7 @@ Cpp.ignoretokens = QAXFACTORY_EXPORT \
Q_XMLSTREAM_EXPORT \
Q_XMLPATTERNS_EXPORT \
QDBUS_EXPORT \
+ Q_DBUS_EXPORT \
QT_BEGIN_NAMESPACE \
QT_BEGIN_INCLUDE_NAMESPACE \
QT_END_NAMESPACE \
diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf
index e439708..cf15628 100644
--- a/tools/qdoc3/test/qt-html-templates.qdocconf
+++ b/tools/qdoc3/test/qt-html-templates.qdocconf
@@ -30,7 +30,7 @@ HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \
" <div id=\"shortCut\">\n" \
" <ul>\n" \
" <li class=\"shortCut-topleft-inactive\"><span><a href=\"index.html\">Qt 4.7</a></span></li>\n" \
- " <li class=\"shortCut-topleft-active\"><a href=\"http://qt.nokia.com/doc/\">ALL VERSIONS" \
+ " <li class=\"shortCut-topleft-active\"><a href=\"http://doc.qt.nokia.com\">ALL VERSIONS" \
" </a></li>\n" \
" </ul>\n" \
" </div>\n" \
diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf
index 08492e3..a5e6578 100644
--- a/tools/qdoc3/test/qt.qdocconf
+++ b/tools/qdoc3/test/qt.qdocconf
@@ -9,9 +9,9 @@ versionsym =
version = %VERSION%
description = Qt Reference Documentation
url = http://qt.nokia.com/doc/4.7
-online = false
+online = true
offline = false
-creator = true
+creator = false
sourceencoding = UTF-8
outputencoding = UTF-8
diff --git a/tools/qml/deviceorientation_symbian.cpp b/tools/qml/deviceorientation_symbian.cpp
index c305f94..307c417 100644
--- a/tools/qml/deviceorientation_symbian.cpp
+++ b/tools/qml/deviceorientation_symbian.cpp
@@ -110,22 +110,27 @@ private:
void DataReceived(CSensrvChannel &channel, TInt count, TInt dataLost)
{
+ Q_UNUSED(dataLost)
if (channel.GetChannelInfo().iChannelType == KSensrvChannelTypeIdOrientationData) {
TSensrvOrientationData data;
for (int i = 0; i < count; ++i) {
TPckgBuf<TSensrvOrientationData> dataBuf;
channel.GetData(dataBuf);
data = dataBuf();
- Orientation o = UnknownOrientation;
+ Orientation orientation = UnknownOrientation;
switch (data.iDeviceOrientation) {
case TSensrvOrientationData::EOrientationDisplayUp:
- o = Portrait;
+ orientation = Portrait;
break;
case TSensrvOrientationData::EOrientationDisplayRightUp:
- o = Landscape;
+ orientation = Landscape;
break;
case TSensrvOrientationData::EOrientationDisplayLeftUp:
+ orientation = LandscapeInverted;
+ break;
case TSensrvOrientationData::EOrientationDisplayDown:
+ orientation = PortraitInverted;
+ break;
case TSensrvOrientationData::EOrientationUndefined:
case TSensrvOrientationData::EOrientationDisplayUpwards:
case TSensrvOrientationData::EOrientationDisplayDownwards:
@@ -133,8 +138,8 @@ private:
break;
}
- if (m_current != o && o != UnknownOrientation) {
- m_current = o;
+ if (m_current != orientation && orientation != UnknownOrientation) {
+ m_current = orientation;
emit orientationChanged();
}
}
diff --git a/tools/qml/qml.pro b/tools/qml/qml.pro
index bb69e8a..efb82d1 100644
--- a/tools/qml/qml.pro
+++ b/tools/qml/qml.pro
@@ -40,6 +40,9 @@ symbian {
!contains(S60_VERSION, 3.1):!contains(S60_VERSION, 3.2) {
LIBS += -lsensrvclient -lsensrvutil
}
+ contains(QT_CONFIG, s60): {
+ LIBS += -lavkon -lcone
+ }
}
mac {
QMAKE_INFO_PLIST=Info_mac.plist
diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp
index 08a578c..b9fd570 100644
--- a/tools/qml/qmlruntime.cpp
+++ b/tools/qml/qmlruntime.cpp
@@ -98,6 +98,10 @@
#include <QGLWidget>
#endif
+#if defined(Q_WS_S60)
+#include <aknappui.h> // For locking app orientation
+#endif
+
#include <qdeclarativetester.h>
QT_BEGIN_NAMESPACE
@@ -600,6 +604,7 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags)
: QMainWindow(parent, flags)
, loggerWindow(new LoggerWidget(this))
, frame_stream(0)
+ , rotateAction(0)
, orientation(0)
, showWarningsWindow(0)
, m_scriptOptions(0)
@@ -742,22 +747,28 @@ void QDeclarativeViewer::createMenu()
fullscreenAction->setCheckable(true);
connect(fullscreenAction, SIGNAL(triggered()), this, SLOT(toggleFullScreen()));
- QAction *rotateOrientation = new QAction(tr("Rotate orientation"), this);
- rotateOrientation->setShortcut(QKeySequence("Ctrl+T"));
- connect(rotateOrientation, SIGNAL(triggered()), this, SLOT(rotateOrientation()));
+ rotateAction = new QAction(tr("Rotate orientation"), this);
+ rotateAction->setShortcut(QKeySequence("Ctrl+T"));
+ connect(rotateAction, SIGNAL(triggered()), this, SLOT(rotateOrientation()));
orientation = new QActionGroup(this);
orientation->setExclusive(true);
connect(orientation, SIGNAL(triggered(QAction*)), this, SLOT(changeOrientation(QAction*)));
+#if defined(Q_OS_SYMBIAN)
+ QAction *autoOrientationAction = new QAction(tr("Auto-orientation"), this);
+ autoOrientationAction->setCheckable(true);
+#endif
QAction *portraitAction = new QAction(tr("Portrait"), this);
portraitAction->setCheckable(true);
QAction *landscapeAction = new QAction(tr("Landscape"), this);
landscapeAction->setCheckable(true);
+#if !defined(Q_OS_SYMBIAN)
QAction *portraitInvAction = new QAction(tr("Portrait (inverted)"), this);
portraitInvAction->setCheckable(true);
QAction *landscapeInvAction = new QAction(tr("Landscape (inverted)"), this);
landscapeInvAction->setCheckable(true);
+#endif
QAction *aboutAction = new QAction(tr("&About Qt..."), this);
aboutAction->setMenuRole(QAction::AboutQtRole);
@@ -801,9 +812,9 @@ void QDeclarativeViewer::createMenu()
fileMenu->addAction(reloadAction);
fileMenu->addSeparator();
fileMenu->addAction(closeAction);
+#if !defined(Q_OS_SYMBIAN)
fileMenu->addAction(quitAction);
-#if !defined(Q_OS_SYMBIAN)
QMenu *recordMenu = menu->addMenu(tr("&Recording"));
recordMenu->addAction(snapshotAction);
recordMenu->addAction(recordAction);
@@ -813,22 +824,27 @@ void QDeclarativeViewer::createMenu()
debugMenu->addAction(showWarningsWindow);
#endif // ! Q_OS_SYMBIAN
- QMenu *settingsMenu = menu->addMenu(tr("S&ettings"));
+ QMenu *settingsMenu = menu->addMenu(tr("&Settings"));
settingsMenu->addAction(proxyAction);
-#if !defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_SYMBIAN)
+ settingsMenu->addAction(fullscreenAction);
+#else
settingsMenu->addAction(recordOptions);
settingsMenu->addMenu(loggerWindow->preferencesMenu());
-#else // ! Q_OS_SYMBIAN
- settingsMenu->addAction(fullscreenAction);
-#endif // Q_OS_SYMBIAN
- settingsMenu->addAction(rotateOrientation);
+#endif // !Q_OS_SYMBIAN
+ settingsMenu->addAction(rotateAction);
QMenu *propertiesMenu = settingsMenu->addMenu(tr("Properties"));
+#if defined(Q_OS_SYMBIAN)
+ orientation->addAction(autoOrientationAction);
+#endif
orientation->addAction(portraitAction);
orientation->addAction(landscapeAction);
+#if !defined(Q_OS_SYMBIAN)
orientation->addAction(portraitInvAction);
orientation->addAction(landscapeInvAction);
+#endif
propertiesMenu->addActions(orientation->actions());
QMenu *helpMenu = menu->addMenu(tr("&Help"));
@@ -852,6 +868,23 @@ void QDeclarativeViewer::proxySettingsChanged()
void QDeclarativeViewer::rotateOrientation()
{
+#if defined(Q_WS_S60)
+ CAknAppUi *appUi = static_cast<CAknAppUi *>(CEikonEnv::Static()->AppUi());
+ if (appUi) {
+ CAknAppUi::TAppUiOrientation oldOrientation = appUi->Orientation();
+ QString newOrientation;
+ if (oldOrientation == CAknAppUi::EAppUiOrientationPortrait) {
+ newOrientation = QLatin1String("Landscape");
+ } else {
+ newOrientation = QLatin1String("Portrait");
+ }
+ foreach (QAction *action, orientation->actions()) {
+ if (action->text() == newOrientation) {
+ changeOrientation(action);
+ }
+ }
+ }
+#else
QAction *current = orientation->checkedAction();
QList<QAction *> actions = orientation->actions();
int index = actions.indexOf(current);
@@ -860,6 +893,7 @@ void QDeclarativeViewer::rotateOrientation()
QAction *newOrientation = actions[(index + 1) % actions.count()];
changeOrientation(newOrientation);
+#endif
}
void QDeclarativeViewer::toggleFullScreen()
@@ -1369,9 +1403,24 @@ void QDeclarativeViewer::changeOrientation(QAction *action)
{
if (!action)
return;
- action->setChecked(true);
-
QString o = action->text();
+ action->setChecked(true);
+#if defined(Q_WS_S60)
+ CAknAppUi *appUi = static_cast<CAknAppUi *>(CEikonEnv::Static()->AppUi());
+ if (appUi) {
+ CAknAppUi::TAppUiOrientation orientation = appUi->Orientation();
+ if (o == QLatin1String("Auto-orientation")) {
+ appUi->SetOrientationL(CAknAppUi::EAppUiOrientationAutomatic);
+ rotateAction->setVisible(false);
+ } else if (o == QLatin1String("Portrait")) {
+ appUi->SetOrientationL(CAknAppUi::EAppUiOrientationPortrait);
+ rotateAction->setVisible(true);
+ } else if (o == QLatin1String("Landscape")) {
+ appUi->SetOrientationL(CAknAppUi::EAppUiOrientationLandscape);
+ rotateAction->setVisible(true);
+ }
+ }
+#else
if (o == QLatin1String("Portrait"))
DeviceOrientation::instance()->setOrientation(DeviceOrientation::Portrait);
else if (o == QLatin1String("Landscape"))
@@ -1380,6 +1429,7 @@ void QDeclarativeViewer::changeOrientation(QAction *action)
DeviceOrientation::instance()->setOrientation(DeviceOrientation::PortraitInverted);
else if (o == QLatin1String("Landscape (inverted)"))
DeviceOrientation::instance()->setOrientation(DeviceOrientation::LandscapeInverted);
+#endif
}
void QDeclarativeViewer::orientationChanged()
diff --git a/tools/qml/qmlruntime.h b/tools/qml/qmlruntime.h
index 7385b14..6fa7d81 100644
--- a/tools/qml/qmlruntime.h
+++ b/tools/qml/qmlruntime.h
@@ -170,8 +170,6 @@ private:
int record_autotime;
bool devicemode;
QAction *recordAction;
- QString currentSkin;
- bool scaleSkin;
RecordingDialog *recdlg;
void senseImageMagick();
@@ -180,6 +178,7 @@ private:
bool ffmpegAvailable;
bool convertAvailable;
+ QAction *rotateAction;
QActionGroup *orientation;
QAction *showWarningsWindow;