summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-06-16 06:34:50 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-06-16 06:34:50 (GMT)
commitec733c88ff54a2d7bebb0e5e471f40711ece3d5b (patch)
tree13e75d4a022f4de31472521257417275b9cb0f3d
parentcfbca0bd925b76fff533dc093c67ad72dbd73de5 (diff)
parentbb8142436bacf5a4fa31880b58a8b3b6bc7b4d5b (diff)
downloadQt-ec733c88ff54a2d7bebb0e5e471f40711ece3d5b.zip
Qt-ec733c88ff54a2d7bebb0e5e471f40711ece3d5b.tar.gz
Qt-ec733c88ff54a2d7bebb0e5e471f40711ece3d5b.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
-rw-r--r--doc/src/declarative/qdeclarativedebugging.qdoc31
-rw-r--r--examples/declarative/modelviews/listview/PetsModel.qml (renamed from examples/declarative/modelviews/listview/dummydata/MyPetsModel.qml)0
-rw-r--r--examples/declarative/modelviews/listview/RecipesModel.qml (renamed from examples/declarative/modelviews/listview/dummydata/Recipes.qml)0
-rw-r--r--examples/declarative/modelviews/listview/content/PressAndHoldButton.qml (renamed from examples/declarative/modelviews/listview/content/ClickAutoRepeating.qml)42
-rw-r--r--examples/declarative/modelviews/listview/content/TextButton.qml (renamed from examples/declarative/modelviews/listview/content/MediaButton.qml)47
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist.qml244
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates.qml74
-rw-r--r--examples/declarative/modelviews/listview/highlight.qml34
-rw-r--r--examples/declarative/modelviews/listview/highlightranges.qml70
-rw-r--r--examples/declarative/modelviews/listview/sections.qml77
-rw-r--r--mkspecs/modules/qt_webkit_version.pri6
-rw-r--r--qmake/generators/symbian/symbiancommon.cpp3
-rw-r--r--qmake/generators/symbian/symmake_sbsv2.cpp4
-rw-r--r--src/3rdparty/webkit/.tag2
-rw-r--r--src/3rdparty/webkit/VERSION2
-rw-r--r--src/3rdparty/webkit/WebCore/ChangeLog13
-rw-r--r--src/3rdparty/webkit/WebCore/WebCore.pri2
-rw-r--r--src/3rdparty/webkit/WebCore/WebCore.pro7
-rw-r--r--src/corelib/global/qglobal.cpp27
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp6
-rw-r--r--src/gui/image/qbmphandler.cpp10
-rw-r--r--src/gui/image/qimage.cpp13
-rw-r--r--src/gui/image/qpnghandler.cpp10
-rw-r--r--src/gui/image/qppmhandler.cpp10
-rw-r--r--src/gui/image/qxbmhandler.cpp10
-rw-r--r--src/gui/image/qxpmhandler.cpp8
-rw-r--r--src/gui/itemviews/qtreewidget.cpp4
-rw-r--r--src/gui/painting/qgrayraster.c35
-rw-r--r--src/gui/painting/qgrayraster_p.h4
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp13
-rw-r--r--src/gui/painting/qpaintengine_x11.cpp5
-rw-r--r--src/gui/painting/qpainter.cpp4
-rw-r--r--src/gui/painting/qrasterdefs_p.h6
-rw-r--r--src/gui/styles/qs60style.cpp105
-rw-r--r--src/gui/styles/qs60style_s60.cpp10
-rw-r--r--src/gui/text/qfontengine_ft.cpp2
-rw-r--r--src/gui/text/qstatictext.cpp34
-rw-r--r--src/gui/text/qstatictext.h5
-rw-r--r--src/gui/text/qstatictext_p.h6
-rw-r--r--src/gui/widgets/qslider.cpp2
-rw-r--r--src/plugins/imageformats/gif/qgifhandler.cpp4
-rw-r--r--src/plugins/imageformats/jpeg/qjpeghandler.cpp10
-rw-r--r--src/plugins/imageformats/mng/qmnghandler.cpp8
-rw-r--r--src/s60installs/s60installs.pro4
-rw-r--r--tests/auto/qimagereader/tst_qimagereader.cpp28
-rw-r--r--tools/shared/symbian/epocroot.cpp4
47 files changed, 577 insertions, 472 deletions
diff --git a/doc/src/declarative/qdeclarativedebugging.qdoc b/doc/src/declarative/qdeclarativedebugging.qdoc
index 4ff7fde..99dd2d2 100644
--- a/doc/src/declarative/qdeclarativedebugging.qdoc
+++ b/doc/src/declarative/qdeclarativedebugging.qdoc
@@ -60,8 +60,35 @@ Rectangle {
\section1 Debugging Transitions
When a transition doesn't look quite right, it can be helpful to view it in slow
-motion to see what is happening more clearly. The \l {Qt Declarative UI Runtime}{qml} tool provides a
-"Slow Down Animations" menu option to facilitate this.
+motion to see what is happening more clearly. This functionality is supported
+in the \l {Qt Declarative UI Runtime}{qmlviewer} tool: to enable this,
+click on the "Debugging" menu, then "Slow Down Animations".
+
+
+\section1 Debugging module imports
+
+The \c QML_IMPORT_TRACE environment variable can be set to enable debug output
+from QML's import loading mechanisms.
+
+For example, for a simple QML file like this:
+
+\qml
+import Qt 4.7
+
+Rectangle { width: 100; height: 100 }
+\endqml
+
+If you set \c {QML_IMPORT_TRACE=1} before running the \l {Qt Declarative UI Runtime}{qmlviewer}
+(or your QML C++ application), you will see output similar to this:
+
+\code
+QDeclarativeImportDatabase::addImportPath "/qt-sdk/imports"
+QDeclarativeImportDatabase::addImportPath "/qt-sdk/bin/QMLViewer.app/Contents/MacOS"
+QDeclarativeImportDatabase::addToImport 0x106237370 "." -1.-1 File as ""
+QDeclarativeImportDatabase::addToImport 0x106237370 "Qt" 4.7 Library as ""
+QDeclarativeImportDatabase::resolveType "Rectangle" = "QDeclarativeRectangle"
+\endcode
+
\section1 Debugging with Qt Creator
diff --git a/examples/declarative/modelviews/listview/dummydata/MyPetsModel.qml b/examples/declarative/modelviews/listview/PetsModel.qml
index 70cdcdd..70cdcdd 100644
--- a/examples/declarative/modelviews/listview/dummydata/MyPetsModel.qml
+++ b/examples/declarative/modelviews/listview/PetsModel.qml
diff --git a/examples/declarative/modelviews/listview/dummydata/Recipes.qml b/examples/declarative/modelviews/listview/RecipesModel.qml
index 03ab961..03ab961 100644
--- a/examples/declarative/modelviews/listview/dummydata/Recipes.qml
+++ b/examples/declarative/modelviews/listview/RecipesModel.qml
diff --git a/examples/declarative/modelviews/listview/content/ClickAutoRepeating.qml b/examples/declarative/modelviews/listview/content/PressAndHoldButton.qml
index dc23b78..7c174e3 100644
--- a/examples/declarative/modelviews/listview/content/ClickAutoRepeating.qml
+++ b/examples/declarative/modelviews/listview/content/PressAndHoldButton.qml
@@ -40,32 +40,40 @@
import Qt 4.7
-Item {
- id: page
- property int repeatdelay: 300
- property int repeatperiod: 75
- property bool isPressed: false
+Image {
+ id: container
+
+ property int repeatDelay: 300
+ property int repeatDuration: 75
+ property bool pressed: false
- signal pressed
- signal released
signal clicked
- SequentialAnimation on isPressed {
+ scale: pressed ? 0.9 : 1
+
+ SequentialAnimation on pressed {
+ id: autoRepeatClicks
running: false
- id: autoRepeat
- PropertyAction { target: page; property: "isPressed"; value: true }
- ScriptAction { script: page.pressed() }
- ScriptAction { script: page.clicked() }
- PauseAnimation { duration: repeatdelay }
+
+ PropertyAction { target: container; property: "pressed"; value: true }
+ ScriptAction { script: container.clicked() }
+ PauseAnimation { duration: repeatDelay }
+
SequentialAnimation {
loops: Animation.Infinite
- ScriptAction { script: page.clicked() }
- PauseAnimation { duration: repeatperiod }
+ ScriptAction { script: container.clicked() }
+ PauseAnimation { duration: repeatDuration }
}
}
+
MouseArea {
anchors.fill: parent
- onPressed: autoRepeat.start()
- onReleased: { autoRepeat.stop(); parent.isPressed = false; page.released() }
+
+ onPressed: autoRepeatClicks.start()
+ onReleased: {
+ autoRepeatClicks.stop()
+ container.pressed = false
+ }
}
}
+
diff --git a/examples/declarative/modelviews/listview/content/MediaButton.qml b/examples/declarative/modelviews/listview/content/TextButton.qml
index 2aed6e0..ded7a11 100644
--- a/examples/declarative/modelviews/listview/content/MediaButton.qml
+++ b/examples/declarative/modelviews/listview/content/TextButton.qml
@@ -40,36 +40,39 @@
import Qt 4.7
-Item {
- property variant text
+Rectangle {
+ id: container
+
+ property alias text: label.text
+
signal clicked
- id: container
- Image {
- id: normal
- source: "pics/button.png"
- }
- Image {
- id: pressed
- source: "pics/button-pressed.png"
- opacity: 0
+ width: label.width + 20; height: label.height + 6
+ smooth: true
+ radius: 10
+
+ gradient: Gradient {
+ GradientStop { id: gradientStop; position: 0.0; color: palette.light }
+ GradientStop { position: 1.0; color: palette.button }
}
+
+ SystemPalette { id: palette }
+
MouseArea {
- id: clickRegion
- anchors.fill: normal
- onClicked: { container.clicked(); }
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: { container.clicked() }
}
+
Text {
- font.bold: true
- color: "white"
- anchors.centerIn: normal
- text: container.text
+ id: label
+ anchors.centerIn: parent
}
- width: normal.width
states: State {
- name: "Pressed"
- when: clickRegion.pressed == true
- PropertyChanges { target: pressed; opacity: 1 }
+ name: "pressed"
+ when: mouseArea.pressed
+ PropertyChanges { target: gradientStop; color: palette.dark }
}
}
+
diff --git a/examples/declarative/modelviews/listview/dynamiclist.qml b/examples/declarative/modelviews/listview/dynamiclist.qml
index df2e094..0e290f5 100644
--- a/examples/declarative/modelviews/listview/dynamiclist.qml
+++ b/examples/declarative/modelviews/listview/dynamiclist.qml
@@ -37,16 +37,18 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-
import Qt 4.7
import "content"
-import "../../ui-components/scrollbar"
+
+// This example shows how items can be dynamically added to and removed from
+// a ListModel, and how these list modifications can be animated.
Rectangle {
id: container
width: 640; height: 480
color: "#343434"
+ // The model:
ListModel {
id: fruitModel
@@ -77,55 +79,43 @@ Rectangle {
ListElement { description: "Smelly" }
]
}
- ListElement {
- name: "Elderberry"; cost: 0.05
- attributes: [
- ListElement { description: "Berry" }
- ]
- }
- ListElement {
- name: "Fig"; cost: 0.25
- attributes: [
- ListElement { description: "Flower" }
- ]
- }
}
+ // The delegate for each fruit in the model:
Component {
- id: fruitDelegate
-
+ id: listDelegate
+
Item {
- id: wrapper
- width: container.width; height: 55
+ id: delegateItem
+ width: listView.width; height: 55
+ clip: true
- Column {
- id: moveButtons
- x: 5; width: childrenRect.width; anchors.verticalCenter: parent.verticalCenter
+ Row {
+ anchors.verticalCenter: parent.verticalCenter
+ spacing: 10
- Image {
- source: "content/pics/go-up.png"
- MouseArea { anchors.fill: parent; onClicked: fruitModel.move(index,index-1,1) }
- }
- Image { source: "content/pics/go-down.png"
- MouseArea { anchors.fill: parent; onClicked: fruitModel.move(index,index+1,1) }
+ Column {
+ Image {
+ source: "content/pics/go-up.png"
+ MouseArea { anchors.fill: parent; onClicked: fruitModel.move(index,index-1,1) }
+ }
+ Image { source: "content/pics/go-down.png"
+ MouseArea { anchors.fill: parent; onClicked: fruitModel.move(index,index+1,1) }
+ }
}
- }
- Column {
- anchors { right: itemButtons.left; verticalCenter: parent.verticalCenter; left: moveButtons.right; leftMargin: 10 }
+ Column {
+ anchors.verticalCenter: parent.verticalCenter
- Text {
- id: label
- width: parent.width
- color: "White"
- font.bold: true; font.pixelSize: 15
- text: name; elide: Text.ElideRight
- }
- Row {
- spacing: 5
- Repeater {
- model: attributes
- Component {
+ Text {
+ text: name
+ font.pixelSize: 15
+ color: "white"
+ }
+ Row {
+ spacing: 5
+ Repeater {
+ model: attributes
Text { text: description; color: "White" }
}
}
@@ -133,149 +123,81 @@ Rectangle {
}
Row {
- id: itemButtons
-
- anchors { right: removeButton.left; rightMargin: 35; verticalCenter: parent.verticalCenter }
- width: childrenRect.width
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
spacing: 10
- Image {
+ PressAndHoldButton {
+ anchors.verticalCenter: parent.verticalCenter
source: "content/pics/list-add.png"
- scale: clickUp.isPressed ? 0.9 : 1
-
- ClickAutoRepeating {
- id: clickUp
- anchors.fill: parent
- onClicked: fruitModel.setProperty(index, "cost", cost+0.25)
- }
+ onClicked: fruitModel.setProperty(index, "cost", cost + 0.25)
}
- Text { id: costText; text: '$'+Number(cost).toFixed(2); font.pixelSize: 15; color: "White"; font.bold: true; }
+ Text {
+ id: costText
+ anchors.verticalCenter: parent.verticalCenter
+ text: '$' + Number(cost).toFixed(2)
+ font.pixelSize: 15
+ color: "white"
+ font.bold: true
+ }
- Image {
+ PressAndHoldButton {
+ anchors.verticalCenter: parent.verticalCenter
source: "content/pics/list-remove.png"
- scale: clickDown.isPressed ? 0.9 : 1
+ onClicked: fruitModel.setProperty(index, "cost", Math.max(0,cost-0.25))
+ }
- ClickAutoRepeating {
- id: clickDown
- anchors.fill: parent
- onClicked: fruitModel.setProperty(index, "cost", Math.max(0,cost-0.25))
- }
+ Image {
+ source: "content/pics/archive-remove.png"
+ MouseArea { anchors.fill:parent; onClicked: fruitModel.remove(index) }
}
}
- Image {
- id: removeButton
- anchors { verticalCenter: parent.verticalCenter; right: parent.right; rightMargin: 10 }
- source: "content/pics/archive-remove.png"
- MouseArea { anchors.fill:parent; onClicked: fruitModel.remove(index) }
+ // Animate adding and removing of items:
+
+ ListView.onAdd: SequentialAnimation {
+ PropertyAction { target: delegateItem; property: "height"; value: 0 }
+ NumberAnimation { target: delegateItem; property: "height"; to: 55; duration: 250; easing.type: Easing.InOutQuad }
}
- // Animate adding and removing items
- ListView.delayRemove: true // so that the item is not destroyed immediately
- ListView.onAdd: state = "add"
- ListView.onRemove: state = "remove"
- states: [
- State {
- name: "add"
- PropertyChanges { target: wrapper; height: 55; clip: true }
- },
- State {
- name: "remove"
- PropertyChanges { target: wrapper; height: 0; clip: true }
- }
- ]
- transitions: [
- Transition {
- to: "add"
- SequentialAnimation {
- NumberAnimation { properties: "height"; from: 0; to: 55 }
- PropertyAction { target: wrapper; property: "state"; value: "" }
- }
- },
- Transition {
- to: "remove"
- SequentialAnimation {
- NumberAnimation { properties: "height" }
- // Make sure delayRemove is set back to false so that the item can be destroyed
- PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: false }
- }
- }
- ]
+ ListView.onRemove: SequentialAnimation {
+ PropertyAction { target: delegateItem; property: "ListView.delayRemove"; value: true }
+ NumberAnimation { target: delegateItem; property: "height"; to: 0; duration: 250; easing.type: Easing.InOutQuad }
+
+ // Make sure delayRemove is set back to false so that the item can be destroyed
+ PropertyAction { target: delegateItem; property: "ListView.delayRemove"; value: false }
+ }
}
}
+ // The view:
ListView {
- id: view
- anchors { top: parent.top; left: parent.left; right: parent.right; bottom: buttons.top }
+ id: listView
+ anchors.fill: parent; anchors.margins: 20
model: fruitModel
- delegate: fruitDelegate
- }
-
- // Attach scrollbar to the right edge of the view.
- ScrollBar {
- id: verticalScrollBar
-
- width: 8; height: view.height; anchors.right: view.right
- opacity: 0
- orientation: Qt.Vertical
- position: view.visibleArea.yPosition
- pageSize: view.visibleArea.heightRatio
-
- // Only show the scrollbar when the view is moving.
- states: State {
- name: "ShowBars"; when: view.movingVertically
- PropertyChanges { target: verticalScrollBar; opacity: 1 }
- }
- transitions: Transition {
- NumberAnimation { properties: "opacity"; duration: 400 }
- }
+ delegate: listDelegate
}
Row {
- id: buttons
-
- x: 8; width: childrenRect.width; height: childrenRect.height
- anchors { bottom: parent.bottom; bottomMargin: 8 }
- spacing: 8
-
- Image {
- source: "content/pics/archive-insert.png"
-
- MouseArea {
- anchors.fill: parent
- onClicked: {
- fruitModel.append({
- "name": "Pizza Margarita",
- "cost": 5.95,
- "attributes": [{"description": "Cheese"},{"description": "Tomato"}]
- })
- }
- }
- }
-
- Image {
- source: "content/pics/archive-insert.png"
-
- MouseArea {
- anchors.fill: parent;
- onClicked: {
- fruitModel.insert(0, {
- "name": "Pizza Supreme",
- "cost": 9.95,
- "attributes": [{"description": "Cheese"},{"description": "Tomato"},{"description": "The Works"}]
- })
- }
+ anchors { left: parent.left; bottom: parent.bottom; margins: 20 }
+ spacing: 10
+
+ TextButton {
+ text: "Add an item"
+ onClicked: {
+ fruitModel.append({
+ "name": "Pizza Margarita",
+ "cost": 5.95,
+ "attributes": [{"description": "Cheese"}, {"description": "Tomato"}]
+ })
}
}
- Image {
- source: "content/pics/archive-remove.png"
-
- MouseArea {
- anchors.fill: parent
- onClicked: fruitModel.clear()
- }
+ TextButton {
+ text: "Remove all items"
+ onClicked: fruitModel.clear()
}
}
}
+
diff --git a/examples/declarative/modelviews/listview/expandingdelegates.qml b/examples/declarative/modelviews/listview/expandingdelegates.qml
index f4b97ea..94ea48f 100644
--- a/examples/declarative/modelviews/listview/expandingdelegates.qml
+++ b/examples/declarative/modelviews/listview/expandingdelegates.qml
@@ -41,7 +41,7 @@
import Qt 4.7
import "content"
-// This example illustrates expanding a list item to show a more detailed view
+// This example illustrates expanding a list item to show a more detailed view.
Rectangle {
id: page
@@ -49,13 +49,13 @@ Rectangle {
color: "black"
// Delegate for the recipes. This delegate has two modes:
- // 1. the list mode (default), which just shows the picture and title of the recipe.
- // 2. the details mode, which also shows the ingredients and method.
+ // 1. List mode (default), which just shows the picture and title of the recipe.
+ // 2. Details mode, which also shows the ingredients and method.
Component {
id: recipeDelegate
Item {
- id: wrapper
+ id: recipe
// Create a property to contain the visibility of the details.
// We can bind multiple element's opacity to this one property,
@@ -63,14 +63,15 @@ Rectangle {
// want to fade.
property real detailsOpacity : 0
- width: list.width
+ width: listView.width
+ height: 70
// A simple rounded rectangle for the background
Rectangle {
id: background
- x: 1; y: 2; width: parent.width - 2; height: parent.height - 4
- color: "#FEFFEE"
- border.color: "#FFBE4F"
+ x: 2; y: 2; width: parent.width - x*2; height: parent.height - y*2
+ color: "ivory"
+ border.color: "orange"
radius: 5
}
@@ -78,50 +79,53 @@ Rectangle {
// When clicked it changes mode to 'Details'. If we are already
// in Details mode, then no change will happen.
MouseArea {
- id: pageMouse
anchors.fill: parent
- onClicked: wrapper.state = 'Details';
+ onClicked: recipe.state = 'Details';
}
- // Layout the page. Picture, title and ingredients at the top, method at the
+ // Lay out the page: picture, title and ingredients at the top, and method at the
// bottom. Note that elements that should not be visible in the list
- // mode have their opacity set to wrapper.detailsOpacity.
+ // mode have their opacity set to recipe.detailsOpacity.
Row {
id: topLayout
- x: 10; y: 10; height: recipePic.height; width: parent.width
+ x: 10; y: 10; height: recipeImage.height; width: parent.width
spacing: 10
Image {
- id: recipePic
- source: picture; width: 48; height: 48
+ id: recipeImage
+ width: 50; height: 50
+ source: picture
}
Column {
- width: background.width-recipePic.width-20; height: recipePic.height;
+ width: background.width - recipeImage.width - 20; height: recipeImage.height
spacing: 5
- Text { id: name; text: title; font.bold: true; font.pointSize: 16 }
+ Text {
+ text: title
+ font.bold: true; font.pointSize: 16
+ }
Text {
text: "Ingredients"
font.pointSize: 12; font.bold: true
- opacity: wrapper.detailsOpacity
+ opacity: recipe.detailsOpacity
}
Text {
text: ingredients
wrapMode: Text.WordWrap
width: parent.width
- opacity: wrapper.detailsOpacity
+ opacity: recipe.detailsOpacity
}
}
}
Item {
id: details
- x: 10; width: parent.width-20
+ x: 10; width: parent.width - 20
anchors { top: topLayout.bottom; topMargin: 10; bottom: parent.bottom; bottomMargin: 10 }
- opacity: wrapper.detailsOpacity
+ opacity: recipe.detailsOpacity
Text {
id: methodTitle
@@ -153,30 +157,28 @@ Rectangle {
}
// A button to close the detailed view, i.e. set the state back to default ('').
- MediaButton {
- y: 10; anchors { right: background.right; rightMargin: 5 }
- opacity: wrapper.detailsOpacity
+ TextButton {
+ y: 10
+ anchors { right: background.right; rightMargin: 10 }
+ opacity: recipe.detailsOpacity
text: "Close"
- onClicked: wrapper.state = '';
+ onClicked: recipe.state = '';
}
- // Set the default height to the height of the picture, plus margin.
- height: 68
-
states: State {
name: "Details"
PropertyChanges { target: background; color: "white" }
- PropertyChanges { target: recipePic; width: 128; height: 128 } // Make picture bigger
- PropertyChanges { target: wrapper; detailsOpacity: 1; x: 0 } // Make details visible
- PropertyChanges { target: wrapper; height: list.height } // Fill the entire list area with the detailed view
+ PropertyChanges { target: recipeImage; width: 130; height: 130 } // Make picture bigger
+ PropertyChanges { target: recipe; detailsOpacity: 1; x: 0 } // Make details visible
+ PropertyChanges { target: recipe; height: listView.height } // Fill the entire list area with the detailed view
// Move the list so that this item is at the top.
- PropertyChanges { target: wrapper.ListView.view; explicit: true; contentY: wrapper.y }
+ PropertyChanges { target: recipe.ListView.view; explicit: true; contentY: recipe.y }
// Disallow flicking while we're in detailed view
- PropertyChanges { target: wrapper.ListView.view; interactive: false }
+ PropertyChanges { target: recipe.ListView.view; interactive: false }
}
transitions: Transition {
@@ -191,10 +193,10 @@ Rectangle {
// The actual list
ListView {
- id: list
+ id: listView
anchors.fill: parent
- clip: true
- model: Recipes
+ model: RecipesModel {}
delegate: recipeDelegate
+ clip: true
}
}
diff --git a/examples/declarative/modelviews/listview/highlight.qml b/examples/declarative/modelviews/listview/highlight.qml
index 239272a..5748974 100644
--- a/examples/declarative/modelviews/listview/highlight.qml
+++ b/examples/declarative/modelviews/listview/highlight.qml
@@ -41,12 +41,7 @@
import Qt 4.7
Rectangle {
- width: 400; height: 300
-
- // MyPets model is defined in dummydata/MyPetsModel.qml
- // The launcher automatically loads files in dummydata/* to assist
- // development without a real data source.
- // This one contains my pets.
+ width: 200; height: 300
// Define a delegate component. A component will be
// instantiated for each visible item in the list.
@@ -54,42 +49,45 @@ Rectangle {
id: petDelegate
Item {
id: wrapper
- width: 200; height: 50
+ width: 200; height: 55
Column {
Text { text: 'Name: ' + name }
Text { text: 'Type: ' + type }
Text { text: 'Age: ' + age }
}
- // Use the ListView.isCurrentItem attached property to
- // indent the item if it is the current item.
+ // indent the item if it is the current item
states: State {
name: "Current"
when: wrapper.ListView.isCurrentItem
- PropertyChanges { target: wrapper; x: 10 }
+ PropertyChanges { target: wrapper; x: 20 }
}
transitions: Transition {
NumberAnimation { properties: "x"; duration: 200 }
}
}
}
- // Specify a highlight with custom movement. Note that highlightFollowsCurrentItem
- // is set to false in the ListView so that we can control how the
- // highlight moves to the current item.
+
+ // Define a highlight with customised movement between items.
Component {
- id: petHighlight
+ id: highlightBar
Rectangle {
width: 200; height: 50
color: "#FFFF88"
- SpringFollow on y { to: list1.currentItem.y; spring: 3; damping: 0.1 }
+ SpringFollow on y { to: listView.currentItem.y; spring: 3; damping: 0.1 }
}
}
ListView {
- id: list1
+ id: listView
width: 200; height: parent.height
- model: MyPetsModel
+
+ model: PetsModel {}
delegate: petDelegate
- highlight: petHighlight; highlightFollowsCurrentItem: false
focus: true
+
+ // Set the highlight delegate. Note we must also set highlightFollowsCurrentItem
+ // to false so the highlight delegate can control how the highlight is moved.
+ highlight: highlightBar
+ highlightFollowsCurrentItem: false
}
}
diff --git a/examples/declarative/modelviews/listview/highlightranges.qml b/examples/declarative/modelviews/listview/highlightranges.qml
index a8a95c4..162d8b7 100644
--- a/examples/declarative/modelviews/listview/highlightranges.qml
+++ b/examples/declarative/modelviews/listview/highlightranges.qml
@@ -43,46 +43,20 @@ import Qt 4.7
Rectangle {
width: 600; height: 300
- // MyPets model is defined in dummydata/MyPetsModel.qml
- // The viewer automatically loads files in dummydata/* to assist
- // development without a real data source.
- // This one contains my pets.
-
- // Define a delegate component. A component will be
- // instantiated for each visible item in the list.
- Component {
- id: petDelegate
- Item {
- width: 200; height: 50
- Column {
- Text { text: 'Name: ' + name }
- Text { text: 'Type: ' + type }
- Text { text: 'Age: ' + age }
- }
- }
- }
-
- // Define a highlight component. Just one of these will be instantiated
- // by each ListView and placed behind the current item.
- Component {
- id: petHighlight
- Rectangle { color: "#FFFF88" }
- }
-
// Show the model in three lists, with different highlight ranges.
// preferredHighlightBegin and preferredHighlightEnd set the
// range in which to attempt to maintain the highlight.
//
- // Note that the second and third ListView
- // set their currentIndex to be the same as the first, and that
- // the first ListView is given keyboard focus.
+ // The second and third ListView set their currentIndex to be the
+ // same as the first, and the first ListView is given keyboard focus.
//
- // The default mode allows the currentItem to move freely
- // within the visible area. If it would move outside the visible
- // area, the view is scrolled to keep it visible.
+ // The first list does not set a highlight range, so its currentItem
+ // can move freely within the visible area. If it moves outside the
+ // visible area, the view is automatically scrolled to keep the current
+ // item visible.
//
// The second list sets a highlight range which attempts to keep the
- // current item within the the bounds of the range, however
+ // current item within the the bounds of the range. However,
// items will not scroll beyond the beginning or end of the view,
// forcing the highlight to move outside the range at the ends.
//
@@ -98,21 +72,22 @@ Rectangle {
ListView {
id: list1
width: 200; height: parent.height
- model: MyPetsModel
+ model: PetsModel {}
delegate: petDelegate
- highlight: petHighlight
+ highlight: Rectangle { color: "lightsteelblue" }
currentIndex: list3.currentIndex
focus: true
}
ListView {
id: list2
- x: 200; width: 200; height: parent.height
- model: MyPetsModel
+ x: list1.width
+ width: 200; height: parent.height
+ model: PetsModel {}
delegate: petDelegate
- highlight: petHighlight
+ highlight: Rectangle { color: "yellow" }
currentIndex: list1.currentIndex
preferredHighlightBegin: 80; preferredHighlightEnd: 220
highlightRangeMode: ListView.ApplyRange
@@ -120,14 +95,25 @@ Rectangle {
ListView {
id: list3
- x: 400; width: 200; height: parent.height
- model: MyPetsModel
+ x: list1.width + list2.width
+ width: 200; height: parent.height
+ model: PetsModel {}
delegate: petDelegate
- highlight: Rectangle { color: "lightsteelblue" }
+ highlight: Rectangle { color: "yellow" }
currentIndex: list1.currentIndex
preferredHighlightBegin: 125; preferredHighlightEnd: 125
highlightRangeMode: ListView.StrictlyEnforceRange
- flickDeceleration: 1000
+ }
+
+ // The delegate for each list
+ Component {
+ id: petDelegate
+ Column {
+ width: 200
+ Text { text: 'Name: ' + name }
+ Text { text: 'Type: ' + type }
+ Text { text: 'Age: ' + age }
+ }
}
}
diff --git a/examples/declarative/modelviews/listview/sections.qml b/examples/declarative/modelviews/listview/sections.qml
index d2f9aba..8c038a0 100644
--- a/examples/declarative/modelviews/listview/sections.qml
+++ b/examples/declarative/modelviews/listview/sections.qml
@@ -42,70 +42,43 @@ import Qt 4.7
//! [0]
Rectangle {
+ id: container
width: 200
- height: 240
+ height: 250
- // MyPets model is defined in dummydata/MyPetsModel.qml
- // The viewer automatically loads files in dummydata/* to assist
- // development without a real data source.
- // This one contains my pets.
-
- // Define a delegate component that includes a separator for sections.
- Component {
- id: petDelegate
-
- Item {
- id: wrapper
- width: 200
- height: desc.height // height is the combined height of the description and the section separator
+ ListModel {
+ id: animalsModel
+ ListElement { name: "Parrot"; size: "Small" }
+ ListElement { name: "Guinea pig"; size: "Small" }
+ ListElement { name: "Dog"; size: "Medium" }
+ ListElement { name: "Cat"; size: "Medium" }
+ ListElement { name: "Elephant"; size: "Large" }
+ }
- Item {
- id: desc
- x: 5; height: layout.height + 4
+ // The delegate for each section header
+ Component {
+ id: sectionHeading
+ Rectangle {
+ width: container.width
+ height: childrenRect.height
+ color: "lightsteelblue"
- Column {
- id: layout
- y: 2
- Text { text: 'Name: ' + name }
- Text { text: 'Type: ' + type }
- Text { text: 'Age: ' + age }
- }
+ Text {
+ text: section
+ font.bold: true
}
}
}
- // Define a highlight component. Just one of these will be instantiated
- // by each ListView and placed behind the current item.
- Component {
- id: petHighlight
- Rectangle { color: "#FFFF88" }
- }
-
- // The list
ListView {
- id: myList
+ anchors.fill: parent
+ model: animalsModel
+ delegate: Text { text: name }
- width: 200; height: parent.height
- model: MyPetsModel
- delegate: petDelegate
- highlight: petHighlight
- focus: true
-
- // The sectionExpression is simply the size of the pet.
- // We use this to determine which section we are in above.
section.property: "size"
section.criteria: ViewSection.FullString
- section.delegate: Rectangle {
- color: "lightsteelblue"
- width: 200
- height: 20
- Text {
- x: 2; height: parent.height
- verticalAlignment: Text.AlignVCenter
- text: section
- font.bold: true
- }
- }
+ section.delegate: sectionHeading
}
}
//! [0]
+
diff --git a/mkspecs/modules/qt_webkit_version.pri b/mkspecs/modules/qt_webkit_version.pri
index 0370720..ffd192c 100644
--- a/mkspecs/modules/qt_webkit_version.pri
+++ b/mkspecs/modules/qt_webkit_version.pri
@@ -1,2 +1,4 @@
-# The version information comes from our copy of
-include($$PWD/../../src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri)
+QT_WEBKIT_VERSION = 4.7.0
+QT_WEBKIT_MAJOR_VERSION = 4
+QT_WEBKIT_MINOR_VERSION = 7
+QT_WEBKIT_PATCH_VERSION = 0
diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp
index 58729d2..3a4bdbc 100644
--- a/qmake/generators/symbian/symbiancommon.cpp
+++ b/qmake/generators/symbian/symbiancommon.cpp
@@ -433,9 +433,6 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
if (from.size() > 1 && from.at(1) == QLatin1Char(':'))
from = from.mid(2);
from.prepend(zDir);
- } else {
- if (from.size() > 1 && from.at(1) == QLatin1Char(':'))
- from = from.mid(2);
}
}
diff --git a/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp
index c2f1d1a..78f6f85 100644
--- a/qmake/generators/symbian/symmake_sbsv2.cpp
+++ b/qmake/generators/symbian/symmake_sbsv2.cpp
@@ -99,7 +99,9 @@ void SymbianSbsv2MakefileGenerator::writeSbsDeploymentList(const DeploymentList&
fromItem.replace("\\", "/");
toItem.replace("\\", "/");
#if defined(Q_OS_WIN)
- toItem.prepend(QDir::current().absolutePath().left(2)); // add drive
+ // add drive if it doesn't have one yet
+ if (toItem.size() > 1 && toItem[1] != QLatin1Char(':'))
+ toItem.prepend(QDir::current().absolutePath().left(2));
#endif
t << "OPTION DEPLOY_SOURCE " << fromItem << endl;
t << "OPTION DEPLOY_TARGET " << toItem << endl;
diff --git a/src/3rdparty/webkit/.tag b/src/3rdparty/webkit/.tag
index 125e175..07a02d7 100644
--- a/src/3rdparty/webkit/.tag
+++ b/src/3rdparty/webkit/.tag
@@ -1 +1 @@
-0f8941d0dd5f947530e1dc55b859d810bba14764
+40c2d6907ef75288b4f15e7fad334b9138acdbbf
diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION
index 6aaae4f..b648b94 100644
--- a/src/3rdparty/webkit/VERSION
+++ b/src/3rdparty/webkit/VERSION
@@ -4,4 +4,4 @@ This is a snapshot of the Qt port of WebKit from
and has the sha1 checksum
- f943ead2759537527faa7f3cb057d995291663b9
+ 40c2d6907ef75288b4f15e7fad334b9138acdbbf
diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog
index e04729d..6a7da30 100644
--- a/src/3rdparty/webkit/WebCore/ChangeLog
+++ b/src/3rdparty/webkit/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-06-15 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] The qt_webkit_version.pri file gets overwritten on install
+ https://bugs.webkit.org/show_bug.cgi?id=40487
+
+ Don't install qt_webkit_version.pri when building WebKit inside of Qt.
+ The import of WebKit into Qt will take care of providing the file
+ in mkspecs/modules and it'll be installed through projects.pro.
+
+ * WebCore.pro:
+
2010-06-13 Noam Rosenthal <noam.rosenthal@nokia.com>
Reviewed by Eric Seidel.
diff --git a/src/3rdparty/webkit/WebCore/WebCore.pri b/src/3rdparty/webkit/WebCore/WebCore.pri
index 9debd6a..97ae526 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.pri
+++ b/src/3rdparty/webkit/WebCore/WebCore.pri
@@ -107,7 +107,7 @@ greaterThan(QT_MINOR_VERSION, 5) {
!lessThan(QT_MINOR_VERSION, 7) {
DEFINES += ENABLE_QT_BEARER=1
} else {
- load(mobilityconfig)
+ load(mobilityconfig, true)
contains(MOBILITY_CONFIG, bearer) {
DEFINES += ENABLE_QT_BEARER=1
}
diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro
index 048fc93..07ef474 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.pro
+++ b/src/3rdparty/webkit/WebCore/WebCore.pro
@@ -2845,12 +2845,7 @@ contains(DEFINES, ENABLE_SYMBIAN_DIALOG_PROVIDERS) {
include($$PWD/../WebKit/qt/Api/headers.pri)
HEADERS += $$WEBKIT_API_HEADERS
-CONFIG(QTDIR_build) {
- modfile.files = $$moduleFile
- modfile.path = $$[QMAKE_MKSPECS]/modules
-
- INSTALLS += modfile
-} else {
+!CONFIG(QTDIR_build) {
exists($$OUTPUT_DIR/include/QtWebKit/classheaders.pri): include($$OUTPUT_DIR/include/QtWebKit/classheaders.pri)
WEBKIT_INSTALL_HEADERS = $$WEBKIT_API_HEADERS $$WEBKIT_CLASS_HEADERS
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 373c0b4..b31c83b 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -2503,6 +2503,19 @@ void qFatal(const char *msg, ...)
// getenv is declared as deprecated in VS2005. This function
// makes use of the new secure getenv function.
+/*!
+ \relates <QtGlobal>
+
+ Returns the value of the environment variable with name \a
+ varName. To get the variable string, use QByteArray::constData().
+
+ \note qgetenv() was introduced because getenv() from the standard
+ C library was deprecated in VC2005 (and later versions). qgetenv()
+ uses the new replacement function in VC, and calls the standard C
+ library's implementation on all other platforms.
+
+ \sa qputenv()
+*/
QByteArray qgetenv(const char *varName)
{
#if defined(_MSC_VER) && _MSC_VER >= 1400
@@ -2522,6 +2535,20 @@ QByteArray qgetenv(const char *varName)
#endif
}
+/*!
+ \relates <QtGlobal>
+
+ This function sets the \a value of the environment variable named
+ \a varName. It will create the variable if it does not exist. It
+ returns 0 if the variable could not be set.
+
+ \note qputenv() was introduced because putenv() from the standard
+ C library was deprecated in VC2005 (and later versions). qputenv()
+ uses the replacement function in VC, and calls the standard C
+ library's implementation on all other platforms.
+
+ \sa qgetenv()
+*/
bool qputenv(const char *varName, const QByteArray& value)
{
#if defined(_MSC_VER) && _MSC_VER >= 1400
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 4e6e6b9..0a5e06e 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -1073,7 +1073,7 @@ void QCoreApplication::exit(int returnCode)
The event must be allocated on the heap since the post event queue
will take ownership of the event and delete it once it has been
- posted. It is \e {not safe} to modify or delete the event after
+ posted. It is \e {not safe} to access the event after
it has been posted.
When control returns to the main event loop, all events that are
@@ -1104,7 +1104,7 @@ void QCoreApplication::postEvent(QObject *receiver, QEvent *event)
The event must be allocated on the heap since the post event queue
will take ownership of the event and delete it once it has been
- posted. It is \e {not safe} to modify or delete the event after
+ posted. It is \e {not safe} to access the event after
it has been posted.
When control returns to the main event loop, all events that are
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index dcf18af..48ac4a4 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -1936,6 +1936,8 @@ void QDeclarativeListView::setCacheBuffer(int b)
/*!
\qmlproperty string ListView::section.property
\qmlproperty enumeration ListView::section.criteria
+ \qmlproperty Component ListView::section.delegate
+
These properties hold the expression to be evaluated for the \l section attached property.
\c section.property hold the name of the property to use to determine
@@ -1949,6 +1951,8 @@ void QDeclarativeListView::setCacheBuffer(int b)
\o ViewSection.FirstCharacter - section is the first character of the property value.
\endlist
+ \c section.delegate holds the delegate component for each section.
+
Each item in the list has attached properties named \c ListView.section and
\c ListView.prevSection. These may be used to place a section header for
related items. The example below assumes that the model is sorted by size of
@@ -1985,7 +1989,7 @@ QString QDeclarativeListView::currentSection() const
These properties hold the move and resize animation speed of the highlight delegate.
- \c highlightFollowsCurrentItem must be true for these properties
+ \l highlightFollowsCurrentItem must be true for these properties
to have effect.
The default value for the speed properties is 400 pixels/second.
diff --git a/src/gui/image/qbmphandler.cpp b/src/gui/image/qbmphandler.cpp
index 42e19b8..074b8f0 100644
--- a/src/gui/image/qbmphandler.cpp
+++ b/src/gui/image/qbmphandler.cpp
@@ -674,13 +674,15 @@ bool QBmpHandler::readHeader()
bool QBmpHandler::canRead() const
{
- if (state == Ready) {
- if (!canRead(device()))
- return false;
+ if (state == Ready && !canRead(device()))
+ return false;
+
+ if (state != Error) {
setFormat("bmp");
return true;
}
- return state != Error;
+
+ return false;
}
bool QBmpHandler::canRead(QIODevice *device)
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index d89ffe6..adc2632 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -4210,6 +4210,7 @@ QImage QImage::createHeuristicMask(bool clipTight) const
int w = width();
int h = height();
QImage m(w, h, Format_MonoLSB);
+ QIMAGE_SANITYCHECK_MEMORY(m);
m.setColorCount(2);
m.setColor(0, QColor(Qt::color0).rgba());
m.setColor(1, QColor(Qt::color1).rgba());
@@ -4302,6 +4303,7 @@ QImage QImage::createMaskFromColor(QRgb color, Qt::MaskMode mode) const
if (!d)
return QImage();
QImage maskImage(size(), QImage::Format_MonoLSB);
+ QIMAGE_SANITYCHECK_MEMORY(maskImage);
maskImage.fill(0);
uchar *s = maskImage.bits();
@@ -4362,6 +4364,7 @@ QImage QImage::mirrored(bool horizontal, bool vertical) const
int h = d->height;
// Create result image, copy colormap
QImage result(d->width, d->height, d->format);
+ QIMAGE_SANITYCHECK_MEMORY(result);
// check if we ran out of of memory..
if (!result.d)
@@ -4499,6 +4502,7 @@ QImage QImage::rgbSwapped() const
case Format_ARGB32:
case Format_ARGB32_Premultiplied:
res = QImage(d->width, d->height, d->format);
+ QIMAGE_SANITYCHECK_MEMORY(res);
for (int i = 0; i < d->height; i++) {
uint *q = (uint*)res.scanLine(i);
uint *p = (uint*)scanLine(i);
@@ -4512,6 +4516,7 @@ QImage QImage::rgbSwapped() const
break;
case Format_RGB16:
res = QImage(d->width, d->height, d->format);
+ QIMAGE_SANITYCHECK_MEMORY(res);
for (int i = 0; i < d->height; i++) {
ushort *q = (ushort*)res.scanLine(i);
const ushort *p = (const ushort*)scanLine(i);
@@ -4525,6 +4530,7 @@ QImage QImage::rgbSwapped() const
break;
case Format_ARGB8565_Premultiplied:
res = QImage(d->width, d->height, d->format);
+ QIMAGE_SANITYCHECK_MEMORY(res);
for (int i = 0; i < d->height; i++) {
quint8 *p = (quint8*)scanLine(i);
const quint8 *end = p + d->width * sizeof(qargb8565);
@@ -4537,6 +4543,7 @@ QImage QImage::rgbSwapped() const
break;
case Format_RGB666:
res = QImage(d->width, d->height, d->format);
+ QIMAGE_SANITYCHECK_MEMORY(res);
for (int i = 0; i < d->height; i++) {
qrgb666 *q = reinterpret_cast<qrgb666*>(res.scanLine(i));
const qrgb666 *p = reinterpret_cast<const qrgb666*>(scanLine(i));
@@ -4549,6 +4556,7 @@ QImage QImage::rgbSwapped() const
break;
case Format_ARGB6666_Premultiplied:
res = QImage(d->width, d->height, d->format);
+ QIMAGE_SANITYCHECK_MEMORY(res);
for (int i = 0; i < d->height; i++) {
qargb6666 *q = reinterpret_cast<qargb6666*>(res.scanLine(i));
const qargb6666 *p = reinterpret_cast<const qargb6666*>(scanLine(i));
@@ -4561,6 +4569,7 @@ QImage QImage::rgbSwapped() const
break;
case Format_RGB555:
res = QImage(d->width, d->height, d->format);
+ QIMAGE_SANITYCHECK_MEMORY(res);
for (int i = 0; i < d->height; i++) {
ushort *q = (ushort*)res.scanLine(i);
const ushort *p = (const ushort*)scanLine(i);
@@ -4574,6 +4583,7 @@ QImage QImage::rgbSwapped() const
break;
case Format_ARGB8555_Premultiplied:
res = QImage(d->width, d->height, d->format);
+ QIMAGE_SANITYCHECK_MEMORY(res);
for (int i = 0; i < d->height; i++) {
quint8 *p = (quint8*)scanLine(i);
const quint8 *end = p + d->width * sizeof(qargb8555);
@@ -4586,6 +4596,7 @@ QImage QImage::rgbSwapped() const
break;
case Format_RGB888:
res = QImage(d->width, d->height, d->format);
+ QIMAGE_SANITYCHECK_MEMORY(res);
for (int i = 0; i < d->height; i++) {
quint8 *q = reinterpret_cast<quint8*>(res.scanLine(i));
const quint8 *p = reinterpret_cast<const quint8*>(scanLine(i));
@@ -4601,6 +4612,7 @@ QImage QImage::rgbSwapped() const
break;
case Format_RGB444:
res = QImage(d->width, d->height, d->format);
+ QIMAGE_SANITYCHECK_MEMORY(res);
for (int i = 0; i < d->height; i++) {
quint8 *q = reinterpret_cast<quint8*>(res.scanLine(i));
const quint8 *p = reinterpret_cast<const quint8*>(scanLine(i));
@@ -4615,6 +4627,7 @@ QImage QImage::rgbSwapped() const
break;
case Format_ARGB4444_Premultiplied:
res = QImage(d->width, d->height, d->format);
+ QIMAGE_SANITYCHECK_MEMORY(res);
for (int i = 0; i < d->height; i++) {
quint8 *q = reinterpret_cast<quint8*>(res.scanLine(i));
const quint8 *p = reinterpret_cast<const quint8*>(scanLine(i));
diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp
index dd31834..2cf8222 100644
--- a/src/gui/image/qpnghandler.cpp
+++ b/src/gui/image/qpnghandler.cpp
@@ -892,13 +892,15 @@ QPngHandler::~QPngHandler()
bool QPngHandler::canRead() const
{
- if (d->state == QPngHandlerPrivate::Ready) {
- if (!canRead(device()))
- return false;
+ if (d->state == QPngHandlerPrivate::Ready && !canRead(device()))
+ return false;
+
+ if (d->state != QPngHandlerPrivate::Error) {
setFormat("png");
return true;
}
- return d->state != QPngHandlerPrivate::Error;
+
+ return false;
}
bool QPngHandler::canRead(QIODevice *device)
diff --git a/src/gui/image/qppmhandler.cpp b/src/gui/image/qppmhandler.cpp
index cbbbef4..a9e796c 100644
--- a/src/gui/image/qppmhandler.cpp
+++ b/src/gui/image/qppmhandler.cpp
@@ -409,13 +409,15 @@ bool QPpmHandler::readHeader()
bool QPpmHandler::canRead() const
{
- if (state == Ready) {
- if (!canRead(device(), &subType))
- return false;
+ if (state == Ready && !canRead(device(), &subType))
+ return false;
+
+ if (state != Error) {
setFormat(subType);
return true;
}
- return state != Error;
+
+ return false;
}
bool QPpmHandler::canRead(QIODevice *device, QByteArray *subType)
diff --git a/src/gui/image/qxbmhandler.cpp b/src/gui/image/qxbmhandler.cpp
index 385340a..0dd4e99 100644
--- a/src/gui/image/qxbmhandler.cpp
+++ b/src/gui/image/qxbmhandler.cpp
@@ -261,13 +261,15 @@ bool QXbmHandler::readHeader()
bool QXbmHandler::canRead() const
{
- if (state == Ready) {
- if (!canRead(device()))
- return false;
+ if (state == Ready && !canRead(device()))
+ return false;
+
+ if (state != Error) {
setFormat("xbm");
return true;
}
- return state != Error;
+
+ return false;
}
bool QXbmHandler::canRead(QIODevice *device)
diff --git a/src/gui/image/qxpmhandler.cpp b/src/gui/image/qxpmhandler.cpp
index a475cd0..b97afd3 100644
--- a/src/gui/image/qxpmhandler.cpp
+++ b/src/gui/image/qxpmhandler.cpp
@@ -1225,11 +1225,15 @@ bool QXpmHandler::readImage(QImage *image)
bool QXpmHandler::canRead() const
{
- if (state == Ready && canRead(device())) {
+ if (state == Ready && !canRead(device()))
+ return false;
+
+ if (state != Error) {
setFormat("xpm");
return true;
}
- return state != Error;
+
+ return false;
}
bool QXpmHandler::canRead(QIODevice *device)
diff --git a/src/gui/itemviews/qtreewidget.cpp b/src/gui/itemviews/qtreewidget.cpp
index 0e06f34..8f55734 100644
--- a/src/gui/itemviews/qtreewidget.cpp
+++ b/src/gui/itemviews/qtreewidget.cpp
@@ -1472,6 +1472,10 @@ QTreeWidgetItem::QTreeWidgetItem(QTreeWidgetItem *parent, QTreeWidgetItem *after
/*!
Destroys this tree widget item.
+
+ The item will be removed from \l{QTreeWidget}s to which it has
+ been added. This makes it safe to delete an item at any time.
+
*/
QTreeWidgetItem::~QTreeWidgetItem()
diff --git a/src/gui/painting/qgrayraster.c b/src/gui/painting/qgrayraster.c
index ff2469c..5e7c67a 100644
--- a/src/gui/painting/qgrayraster.c
+++ b/src/gui/painting/qgrayraster.c
@@ -156,6 +156,7 @@
#define ErrRaster_Invalid_Outline -1
#define ErrRaster_Invalid_Argument -3
#define ErrRaster_Memory_Overflow -4
+#define ErrRaster_OutOfMemory -6
#define QT_FT_BEGIN_HEADER
#define QT_FT_END_HEADER
@@ -222,7 +223,6 @@
#define DOWNSCALE( x ) ( (x) << ( 6 - PIXEL_BITS ) )
#endif
-
/*************************************************************************/
/* */
/* TYPE DEFINITIONS */
@@ -1757,8 +1757,7 @@
#ifdef DEBUG_GRAYS
fprintf( stderr, "Rotten glyph!\n" );
#endif
- /* == Raster_Err_OutOfMemory in qblackraster.c */
- return -6;
+ return ErrRaster_OutOfMemory;
}
if ( bottom-top >= ras.band_size )
@@ -1784,7 +1783,7 @@
static int
- gray_raster_render( PRaster raster,
+ gray_raster_render( QT_FT_Raster raster,
const QT_FT_Raster_Params* params )
{
const QT_FT_Outline* outline = (const QT_FT_Outline*)params->source;
@@ -1795,6 +1794,12 @@
if ( !raster || !raster->buffer || !raster->buffer_size )
return ErrRaster_Invalid_Argument;
+ // If raster object and raster buffer are allocated, but
+ // raster size isn't of the minimum size, indicate out of
+ // memory.
+ if (raster && raster->buffer && raster->buffer_size < MINIMUM_POOL_SIZE )
+ return ErrRaster_OutOfMemory;
+
/* return immediately if the outline is empty */
if ( outline->n_points == 0 || outline->n_contours <= 0 )
return 0;
@@ -1874,19 +1879,15 @@
/**** a static object. *****/
static int
- gray_raster_new( void * memory,
- QT_FT_Raster* araster )
+ gray_raster_new( QT_FT_Raster* araster )
{
- if (memory)
- fprintf(stderr, "gray_raster_new(), memory ignored");
- memory = malloc(sizeof(TRaster));
- if (!memory) {
+ *araster = malloc(sizeof(TRaster));
+ if (!*araster) {
*araster = 0;
return ErrRaster_Memory_Overflow;
}
- QT_FT_MEM_ZERO(memory, sizeof(TRaster));
+ QT_FT_MEM_ZERO(*araster, sizeof(TRaster));
- *araster = (QT_FT_Raster) memory;
return 0;
}
@@ -1905,10 +1906,9 @@
{
PRaster rast = (PRaster)raster;
-
if ( raster )
{
- if ( pool_base && pool_size >= (long)sizeof ( TWorker ) + 2048 )
+ if ( pool_base && ( pool_size >= MINIMUM_POOL_SIZE ) )
{
PWorker worker = (PWorker)pool_base;
@@ -1923,6 +1923,13 @@
rast->band_size = (int)( rast->buffer_size /
( sizeof ( TCell ) * 8 ) );
}
+ else if ( pool_base)
+ { // Case when there is a raster pool allocated, but it
+ // doesn't have the minimum size (and so memory will be reallocated)
+ rast->buffer = pool_base;
+ rast->worker = NULL;
+ rast->buffer_size = pool_size;
+ }
else
{
rast->buffer = NULL;
diff --git a/src/gui/painting/qgrayraster_p.h b/src/gui/painting/qgrayraster_p.h
index 4463fc9..ad595b8 100644
--- a/src/gui/painting/qgrayraster_p.h
+++ b/src/gui/painting/qgrayraster_p.h
@@ -89,6 +89,10 @@
#define QT_FT_EXPORT_VAR( x ) extern x
#endif
+/* Minimum buffer size for raster object, that accounts
+ for TWorker and TCell sizes.*/
+#define MINIMUM_POOL_SIZE 4096
+
QT_FT_EXPORT_VAR( const QT_FT_Raster_Funcs ) qt_ft_grays_raster;
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 08e14fb..f10f12f 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -345,7 +345,7 @@ void QRasterPaintEngine::init()
// The antialiasing raster.
d->grayRaster.reset(new QT_FT_Raster);
Q_CHECK_PTR(d->grayRaster.data());
- if (qt_ft_grays_raster.raster_new(0, d->grayRaster.data()))
+ if (qt_ft_grays_raster.raster_new(d->grayRaster.data()))
QT_THROW(std::bad_alloc()); // an error creating the raster is caused by a bad malloc
@@ -3789,6 +3789,7 @@ void QRasterPaintEngine::drawEllipse(const QRectF &rect)
if (((qpen_style(s->lastPen) == Qt::SolidLine && s->flags.fast_pen)
|| (qpen_style(s->lastPen) == Qt::NoPen && !s->flags.antialiased))
&& qMax(rect.width(), rect.height()) < QT_RASTER_COORD_LIMIT
+ && !rect.isEmpty()
&& s->matrix.type() <= QTransform::TxScale) // no shear
{
ensureBrush();
@@ -4185,7 +4186,11 @@ void QRasterPaintEnginePrivate::rasterize(QT_FT_Outline *outline,
return;
}
- const int rasterPoolInitialSize = 8192;
+ // Initial size for raster pool is MINIMUM_POOL_SIZE so as to
+ // minimize memory reallocations. However if initial size for
+ // raster pool is changed for lower value, reallocations will
+ // occur normally.
+ const int rasterPoolInitialSize = MINIMUM_POOL_SIZE;
int rasterPoolSize = rasterPoolInitialSize;
unsigned char *rasterPoolBase;
#if defined(Q_WS_WIN64)
@@ -4229,7 +4234,7 @@ void QRasterPaintEnginePrivate::rasterize(QT_FT_Outline *outline,
error = qt_ft_grays_raster.raster_render(*grayRaster.data(), &rasterParams);
// Out of memory, reallocate some more and try again...
- if (error == -6) { // -6 is Result_err_OutOfMemory
+ if (error == -6) { // ErrRaster_OutOfMemory from qgrayraster.c
int new_size = rasterPoolSize * 2;
if (new_size > 1024 * 1024) {
qWarning("QPainter: Rasterization of primitive failed");
@@ -4255,7 +4260,7 @@ void QRasterPaintEnginePrivate::rasterize(QT_FT_Outline *outline,
Q_CHECK_PTR(rasterPoolBase); // note: we just freed the old rasterPoolBase. I hope it's not fatal.
qt_ft_grays_raster.raster_done(*grayRaster.data());
- qt_ft_grays_raster.raster_new(0, grayRaster.data());
+ qt_ft_grays_raster.raster_new(grayRaster.data());
qt_ft_grays_raster.raster_reset(*grayRaster.data(), rasterPoolBase, rasterPoolSize);
} else {
done = true;
diff --git a/src/gui/painting/qpaintengine_x11.cpp b/src/gui/painting/qpaintengine_x11.cpp
index b8ad9b3..910b2df 100644
--- a/src/gui/painting/qpaintengine_x11.cpp
+++ b/src/gui/painting/qpaintengine_x11.cpp
@@ -1453,6 +1453,11 @@ void QX11PaintEngine::drawEllipse(const QRectF &rect)
void QX11PaintEngine::drawEllipse(const QRect &rect)
{
+ if (rect.isEmpty()) {
+ drawRects(&rect, 1);
+ return;
+ }
+
Q_D(QX11PaintEngine);
QRect devclip(SHRT_MIN, SHRT_MIN, SHRT_MAX*2 - 1, SHRT_MAX*2 - 1);
QRect r(rect);
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index e8c4599..d17c711 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -4238,8 +4238,6 @@ void QPainter::drawEllipse(const QRectF &r)
return;
QRectF rect(r.normalized());
- if (rect.isEmpty())
- return;
if (d->extended) {
d->extended->drawEllipse(rect);
@@ -4281,8 +4279,6 @@ void QPainter::drawEllipse(const QRect &r)
return;
QRect rect(r.normalized());
- if (rect.isEmpty())
- return;
if (d->extended) {
d->extended->drawEllipse(rect);
diff --git a/src/gui/painting/qrasterdefs_p.h b/src/gui/painting/qrasterdefs_p.h
index c33fa57..19a0b16 100644
--- a/src/gui/painting/qrasterdefs_p.h
+++ b/src/gui/painting/qrasterdefs_p.h
@@ -81,7 +81,6 @@
QT_FT_BEGIN_HEADER
-
/*************************************************************************/
/* */
/* <Section> */
@@ -837,7 +836,7 @@ QT_FT_BEGIN_HEADER
/* A handle (pointer) to a raster object. Each object can be used */
/* independently to convert an outline into a bitmap or pixmap. */
/* */
- typedef struct QT_FT_RasterRec_* QT_FT_Raster;
+ typedef struct TRaster_ *QT_FT_Raster;
/*************************************************************************/
@@ -1118,8 +1117,7 @@ QT_FT_BEGIN_HEADER
/* ignored by a given raster implementation. */
/* */
typedef int
- (*QT_FT_Raster_NewFunc)( void* memory,
- QT_FT_Raster* raster );
+ (*QT_FT_Raster_NewFunc)( QT_FT_Raster* raster );
#define QT_FT_Raster_New_Func QT_FT_Raster_NewFunc
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index 91d3fa6..45bcc00 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -1762,40 +1762,65 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
if (!styleHint(SH_UnderlineShortcut, menuItem, widget))
text_flags |= Qt::TextHideMnemonic;
- const bool selected = (option->state & State_Selected) && (option->state & State_Enabled);
- if (selected)
- QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_ListHighlight, painter, option->rect, flags);
-
QRect iconRect = subElementRect(SE_ItemViewItemDecoration, &optionMenuItem, widget);
QRect textRect = subElementRect(SE_ItemViewItemText, &optionMenuItem, widget);
//todo: move the vertical spacing stuff into subElementRect
const int vSpacing = QS60StylePrivate::pixelMetric(PM_LayoutVerticalSpacing);
- if (checkable){
- const int hSpacing = QS60StylePrivate::pixelMetric(PM_LayoutHorizontalSpacing);
- QStyleOptionMenuItem optionCheckBox;
- optionCheckBox.QStyleOptionMenuItem::operator=(*menuItem);
- optionCheckBox.rect.setWidth(pixelMetric(PM_IndicatorWidth));
- optionCheckBox.rect.setHeight(pixelMetric(PM_IndicatorHeight));
- optionCheckBox.rect.moveCenter(QPoint(
- optionCheckBox.rect.center().x(),
- menuItem->rect.center().y()));
- const int moveByX = optionCheckBox.rect.width() + vSpacing;
- if (optionMenuItem.direction == Qt::LeftToRight) {
- textRect.translate(moveByX, 0);
+ QStyleOptionMenuItem optionCheckBox;
+
+ //Regardless of checkbox visibility, make room for it, this mirrors native implementation,
+ //where text and icon placement is static regardless of content of menu item.
+ const int hSpacing = QS60StylePrivate::pixelMetric(PM_LayoutHorizontalSpacing);
+ optionCheckBox.QStyleOptionMenuItem::operator=(*menuItem);
+ optionCheckBox.rect.setWidth(pixelMetric(PM_IndicatorWidth));
+ optionCheckBox.rect.setHeight(pixelMetric(PM_IndicatorHeight));
+ optionCheckBox.rect.moveCenter(QPoint(
+ optionCheckBox.rect.center().x(),
+ menuItem->rect.center().y()));
+ const int moveByX = optionCheckBox.rect.width() + vSpacing +
+ pixelMetric(PM_DefaultFrameWidth);
+ if (optionMenuItem.direction == Qt::LeftToRight) {
+ if (iconRect.isValid()) {
iconRect.translate(moveByX, 0);
iconRect.setWidth(iconRect.width() + vSpacing);
+ }
+ if (textRect.isValid()) {
+ textRect.translate(moveByX, 0);
textRect.setWidth(textRect.width() - moveByX - vSpacing);
- optionCheckBox.rect.translate(vSpacing >> 1, hSpacing >> 1);
- } else {
+ }
+ optionCheckBox.rect.translate(vSpacing + pixelMetric(PM_DefaultFrameWidth), hSpacing >> 1);
+ } else {
+ if (textRect.isValid())
textRect.setWidth(textRect.width() - moveByX);
+ if (iconRect.isValid()) {
iconRect.setWidth(iconRect.width() + vSpacing);
iconRect.translate(-optionCheckBox.rect.width() - vSpacing, 0);
- optionCheckBox.rect.translate(textRect.width() + iconRect.width(), 0);
}
- if (!ignoreCheckMark)
- drawPrimitive(PE_IndicatorMenuCheckMark, &optionCheckBox, painter, widget);
+ optionCheckBox.rect.translate(textRect.width() + iconRect.width(), 0);
}
+
+ const bool selected = (option->state & State_Selected) && (option->state & State_Enabled);
+ if (selected) {
+ const int spacing = pixelMetric(PM_DefaultFrameWidth) * 2;
+ int start; int end;
+ if (QApplication::layoutDirection() == Qt::LeftToRight) {
+ start = optionMenuItem.rect.left() + spacing;
+ end = qMax(textRect.right(), iconRect.right() + spacing);
+ } else {
+ start = qMax(spacing, qMin(textRect.left(), iconRect.left() - spacing));
+ end = optionMenuItem.rect.right() - spacing;
+ }
+ //-1 adjustment to avoid highlight being on top of possible separator item
+ const QRect highlightRect = QRect(
+ QPoint(start, option->rect.top()),
+ QPoint(end, option->rect.bottom() - 1));
+ QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_ListHighlight, painter, highlightRect, flags);
+ }
+
+ if (checkable && !ignoreCheckMark)
+ drawPrimitive(PE_IndicatorMenuCheckMark, &optionCheckBox, painter, widget);
+
//draw icon and/or checkState
QPixmap pix = menuItem->icon.pixmap(pixelMetric(PM_SmallIconSize),
enabled ? QIcon::Normal : QIcon::Disabled);
@@ -1806,7 +1831,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
textRect.translate(vSpacing, 0);
else
textRect.translate(-vSpacing, 0);
- textRect.setWidth(textRect.width()-vSpacing);
+ textRect.setWidth(textRect.width() - vSpacing);
}
//draw indicators
@@ -1844,6 +1869,24 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
QCommonStyle::drawItemText(painter, textRect, text_flags,
optionMenuItem.palette, enabled,
optionMenuItem.text, QPalette::Text);
+
+ //In Sym^3, native menu items have "lines" between them
+ if (QS60StylePrivate::isSingleClickUi()) {
+ const QColor lineColorAlpha = QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnLineColors, 15, 0);
+ const int spacing = QS60StylePrivate::pixelMetric(PM_FrameCornerWidth);
+ //native platform sets each color byte to same value for "line 16" which just defines alpha for
+ //menuitem lines; lets use first byte "red".
+ QColor lineColor = optionMenuItem.palette.text().color();
+ if (lineColorAlpha.isValid())
+ lineColor.setAlpha(lineColorAlpha.red());
+ painter->save();
+ painter->setPen(lineColor);
+
+ const int lineStartX = optionMenuItem.rect.left() + (QS60StylePrivate::pixelMetric(PM_FrameCornerWidth) - 2) + spacing;
+ const int lineEndX = optionMenuItem.rect.right() - (QS60StylePrivate::pixelMetric(PM_FrameCornerWidth) - 2) - spacing;
+ painter->drawLine(QPoint(lineStartX, optionMenuItem.rect.bottom()), QPoint(lineEndX, optionMenuItem.rect.bottom()));
+ painter->restore();
+ }
if (!enabled)
painter->restore();
}
@@ -2240,6 +2283,8 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
if (QS60StylePrivate::canDrawThemeBackground(option->palette.base(), widget) &&
option->palette.window().texture().cacheKey() ==
QS60StylePrivate::m_themePalette->window().texture().cacheKey())
+ //todo: for combobox listviews, the background should include area for menu scrollers,
+ //but this produces drawing issues as we need to turn clipping off.
QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_PopupBackground, painter, option->rect, flags);
else
commonStyleDraws = true;
@@ -2555,10 +2600,12 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt,
}
}
sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget);
+ //native items have small empty areas at the beginning and end of menu item
+ sz.setWidth(sz.width() + 2 * pixelMetric(PM_MenuHMargin) + 2 * QS60StylePrivate::pixelMetric(PM_FrameCornerWidth));
if (QS60StylePrivate::isTouchSupported())
//Make itemview easier to use in touch devices
//QCommonStyle does not adjust height with horizontal margin, it only adjusts width
- sz.setHeight(sz.height() + 2 * pixelMetric(PM_FocusFrameVMargin));
+ sz.setHeight(sz.height() + 2 * pixelMetric(PM_FocusFrameVMargin) - 8); //QCommonstyle adds 8 to height that this style handles through PM values
break;
#ifndef QT_NO_COMBOBOX
case CT_ComboBox: {
@@ -2823,16 +2870,7 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple
}
break;
case SC_ComboBoxListBoxPopup: {
- const QRect desktopContent = QApplication::desktop()->availableGeometry();
-
- // take the size of this and position bottom above available area
- QRect popupRect;
- const int width = desktopContent.width() - pixelMetric(PM_LayoutRightMargin) - pixelMetric(PM_LayoutLeftMargin);
- popupRect.setWidth(width);
- popupRect.setHeight(desktopContent.height()); //combobox resets height anyway based on content
- popupRect.setBottom(desktopContent.bottom());
- popupRect.translate(pixelMetric(PM_LayoutLeftMargin), 0);
- ret = popupRect;
+ ret = QApplication::desktop()->availableGeometry();
}
break;
default:
@@ -2996,7 +3034,6 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con
ret.setWidth(indicatorWidth);
}
} else {
- ret = menuItem->rect;
if (!menuItem->icon.isNull())
if (menuItem->direction == Qt::LeftToRight)
ret.adjust(indicatorWidth, 0, 0, 0);
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp
index e5c74ad..4bb2ea8 100644
--- a/src/gui/styles/qs60style_s60.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -1023,8 +1023,14 @@ TRect QS60StyleModeSpecifics::innerRectFromElement(QS60StylePrivate::SkinFrameEl
heightShrink = heightShrink >> 1;
break;
case QS60StylePrivate::SF_ListHighlight:
- widthShrink = widthShrink - 2;
- heightShrink = heightShrink - 2;
+ //In Sym^3 devices highlights are less blocky
+ if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0) {
+ widthShrink += 2;
+ heightShrink += 2;
+ } else {
+ widthShrink -= 2;
+ heightShrink -= 2;
+ }
break;
case QS60StylePrivate::SF_PopupBackground:
widthShrink = widthShrink + 5;
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp
index 9056012..2c4fbab 100644
--- a/src/gui/text/qfontengine_ft.cpp
+++ b/src/gui/text/qfontengine_ft.cpp
@@ -690,7 +690,7 @@ bool QFontEngineFT::init(FaceId faceId, bool antialias, GlyphFormat format)
if (fake_oblique)
transform = true;
// fake bold
- if ((fontDef.weight == QFont::Bold) && !(face->style_flags & FT_STYLE_FLAG_BOLD))
+ if ((fontDef.weight == QFont::Bold) && !(face->style_flags & FT_STYLE_FLAG_BOLD) && !FT_IS_FIXED_WIDTH(face))
embolden = true;
// underline metrics
line_thickness = QFixed::fromFixed(FT_MulFix(face->underline_thickness, face->size->metrics.y_scale));
diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp
index 10870aa..c742455 100644
--- a/src/gui/text/qstatictext.cpp
+++ b/src/gui/text/qstatictext.cpp
@@ -324,6 +324,26 @@ QStaticText::PerformanceHint QStaticText::performanceHint() const
}
/*!
+ Sets the text option structure that controls the layout process to the given \a textOption.
+
+ \sa textOption()
+*/
+void QStaticText::setTextOption(const QTextOption &textOption)
+{
+ detach();
+ data->textOption = textOption;
+ data->invalidate();
+}
+
+/*!
+ Returns the current text option used to control the layout process.
+*/
+QTextOption QStaticText::textOption() const
+{
+ return data->textOption;
+}
+
+/*!
Sets the preferred width for this QStaticText. If the text is wider than the specified width,
it will be broken into multiple lines and grow vertically. If the text cannot be split into
multiple lines, it will be larger than the specified \a textWidth.
@@ -580,6 +600,7 @@ void QStaticTextPrivate::paintText(const QPointF &topLeftPosition, QPainter *p)
QTextLayout textLayout;
textLayout.setText(text);
textLayout.setFont(font);
+ textLayout.setTextOption(textOption);
qreal leading = QFontMetricsF(font).leading();
qreal height = -leading;
@@ -610,21 +631,26 @@ void QStaticTextPrivate::paintText(const QPointF &topLeftPosition, QPainter *p)
.arg(QString::number(color.blue(), 16), 2, QLatin1Char('0')));
#endif
document.setDefaultFont(font);
- document.setDocumentMargin(0.0);
- if (textWidth >= 0.0)
- document.setTextWidth(textWidth);
+ document.setDocumentMargin(0.0);
#ifndef QT_NO_TEXTHTMLPARSER
document.setHtml(text);
#else
document.setPlainText(text);
#endif
+ if (textWidth >= 0.0)
+ document.setTextWidth(textWidth);
+ else
+ document.adjustSize();
+ document.setDefaultTextOption(textOption);
- document.adjustSize();
p->save();
p->translate(topLeftPosition);
document.drawContents(p);
p->restore();
+ if (textWidth >= 0.0)
+ document.adjustSize(); // Find optimal size
+
actualSize = document.size();
}
}
diff --git a/src/gui/text/qstatictext.h b/src/gui/text/qstatictext.h
index f3bef93..4febde2 100644
--- a/src/gui/text/qstatictext.h
+++ b/src/gui/text/qstatictext.h
@@ -48,7 +48,7 @@
#include <QtGui/qtransform.h>
#include <QtGui/qfont.h>
-
+#include <QtGui/qtextoption.h>
QT_BEGIN_HEADER
@@ -79,6 +79,9 @@ public:
void setTextWidth(qreal textWidth);
qreal textWidth() const;
+ void setTextOption(const QTextOption &textOption);
+ QTextOption textOption() const;
+
QSizeF size() const;
void prepare(const QTransform &matrix = QTransform(), const QFont &font = QFont());
diff --git a/src/gui/text/qstatictext_p.h b/src/gui/text/qstatictext_p.h
index 1a96291..cb60626 100644
--- a/src/gui/text/qstatictext_p.h
+++ b/src/gui/text/qstatictext_p.h
@@ -53,6 +53,8 @@
// We mean it.
//
+#include "qstatictext.h"
+
#include <private/qtextureglyphcache_p.h>
#include <QtGui/qcolor.h>
@@ -148,12 +150,14 @@ public:
QFixedPoint *positionPool; // 4 bytes per text
QChar *charPool; // 4 bytes per text
+ QTextOption textOption; // 28 bytes per text
+
unsigned char needsRelayout : 1; // 1 byte per text
unsigned char useBackendOptimizations : 1;
unsigned char textFormat : 2;
unsigned char untransformedCoordinates : 1;
// ================
- // 167 bytes per text
+ // 195 bytes per text
static QStaticTextPrivate *get(const QStaticText *q);
};
diff --git a/src/gui/widgets/qslider.cpp b/src/gui/widgets/qslider.cpp
index a5e62cf..5755202 100644
--- a/src/gui/widgets/qslider.cpp
+++ b/src/gui/widgets/qslider.cpp
@@ -621,7 +621,7 @@ QSlider::TickPosition QSlider::tickPosition() const
\brief the interval between tickmarks
This is a value interval, not a pixel interval. If it is 0, the
- slider will choose between lineStep() and pageStep().
+ slider will choose between singleStep() and pageStep().
The default value is 0.
diff --git a/src/plugins/imageformats/gif/qgifhandler.cpp b/src/plugins/imageformats/gif/qgifhandler.cpp
index 8abc2d1..5e2157e 100644
--- a/src/plugins/imageformats/gif/qgifhandler.cpp
+++ b/src/plugins/imageformats/gif/qgifhandler.cpp
@@ -1061,12 +1061,12 @@ bool QGifHandler::imageIsComing() const
bool QGifHandler::canRead() const
{
- if (!nextDelay && canRead(device())) {
+ if (!nextDelay && canRead(device()) || imageIsComing()) {
setFormat("gif");
return true;
}
- return imageIsComing();
+ return false;
}
bool QGifHandler::canRead(QIODevice *device)
diff --git a/src/plugins/imageformats/jpeg/qjpeghandler.cpp b/src/plugins/imageformats/jpeg/qjpeghandler.cpp
index 72dde15..60e7cce 100644
--- a/src/plugins/imageformats/jpeg/qjpeghandler.cpp
+++ b/src/plugins/imageformats/jpeg/qjpeghandler.cpp
@@ -802,13 +802,15 @@ QJpegHandler::~QJpegHandler()
bool QJpegHandler::canRead() const
{
- if(d->state == QJpegHandlerPrivate::Ready) {
- if (!canRead(device()))
- return false;
+ if(d->state == QJpegHandlerPrivate::Ready && !canRead(device()))
+ return false;
+
+ if (d->state != QJpegHandlerPrivate::Error) {
setFormat("jpeg");
return true;
}
- return d->state != QJpegHandlerPrivate::Error;
+
+ return false;
}
bool QJpegHandler::canRead(QIODevice *device)
diff --git a/src/plugins/imageformats/mng/qmnghandler.cpp b/src/plugins/imageformats/mng/qmnghandler.cpp
index d408e6c..c134fd6 100644
--- a/src/plugins/imageformats/mng/qmnghandler.cpp
+++ b/src/plugins/imageformats/mng/qmnghandler.cpp
@@ -381,10 +381,10 @@ QMngHandler::~QMngHandler()
bool QMngHandler::canRead() const
{
Q_D(const QMngHandler);
- if (!d->haveReadNone)
- return (!d->haveReadAll || (d->haveReadAll && (d->nextIndex < d->frameCount)));
-
- if (canRead(device())) {
+ if ((!d->haveReadNone
+ && (!d->haveReadAll || (d->haveReadAll && (d->nextIndex < d->frameCount))))
+ || canRead(device()))
+ {
setFormat("mng");
return true;
}
diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro
index d751134..ce0f4f1 100644
--- a/src/s60installs/s60installs.pro
+++ b/src/s60installs/s60installs.pro
@@ -16,8 +16,8 @@ symbian: {
# It is also expected that devices newer than those based on S60 5.0 all have sqlite3.dll.
contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
BLD_INF_RULES.prj_exports += \
- "sqlite3.sis $${EPOCROOT}epoc32/data/qt/sis/sqlite3.sis" \
- "sqlite3_selfsigned.sis $${EPOCROOT}epoc32/data/qt/sis/sqlite3_selfsigned.sis"
+ "sqlite3.sis /epoc32/data/qt/sis/sqlite3.sis" \
+ "sqlite3_selfsigned.sis /epoc32/data/qt/sis/sqlite3_selfsigned.sis"
symbian-abld|symbian-sbsv2 {
sqlitedeployment = \
"; Deploy sqlite onto phone that does not have it already" \
diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp
index aadee5b..7e57973 100644
--- a/tests/auto/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/qimagereader/tst_qimagereader.cpp
@@ -138,6 +138,9 @@ private slots:
void sizeBeforeRead_data();
void sizeBeforeRead();
+ void sizeBeforeFormat_data();
+ void sizeBeforeFormat();
+
void imageFormatBeforeRead_data();
void imageFormatBeforeRead();
@@ -706,6 +709,31 @@ void tst_QImageReader::sizeBeforeRead()
QCOMPARE(size, image.size());
}
+void tst_QImageReader::sizeBeforeFormat_data()
+{
+ imageFormat_data();
+}
+
+void tst_QImageReader::sizeBeforeFormat()
+{
+ QFETCH(QString, fileName);
+
+ QByteArray formatA, formatB;
+
+ {
+ QImageReader reader(prefix + fileName);
+ formatA = reader.format();
+ }
+
+ {
+ QImageReader reader(prefix + fileName);
+ QSize size = reader.size();
+ formatB = reader.format();
+ }
+
+ QCOMPARE(formatA, formatB);
+}
+
void tst_QImageReader::imageFormatBeforeRead_data()
{
imageFormat_data();
diff --git a/tools/shared/symbian/epocroot.cpp b/tools/shared/symbian/epocroot.cpp
index 064e056..ae1dcb1 100644
--- a/tools/shared/symbian/epocroot.cpp
+++ b/tools/shared/symbian/epocroot.cpp
@@ -105,10 +105,6 @@ static void fixEpocRoot(QString &path)
{
path.replace("\\", "/");
- if (path.size() > 1 && path[1] == QChar(':')) {
- path = path.mid(2);
- }
-
if (!path.size() || path[path.size()-1] != QChar('/')) {
path += QChar('/');
}