summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--demos/declarative/calculator/calculator.qml4
-rw-r--r--demos/declarative/flickr/content/ImageDetails.qml2
-rw-r--r--demos/declarative/flickr/flickr.qml2
-rw-r--r--demos/declarative/flickr/flickr2.qml2
-rw-r--r--demos/declarative/samegame/SameGame.qml2
-rw-r--r--demos/declarative/samegame/content/Button.qml2
-rw-r--r--demos/declarative/webbrowser/fieldtext/FieldText.qml28
-rw-r--r--demos/declarative/webbrowser/webbrowser.qml7
-rw-r--r--doc/src/declarative/basictypes.qdoc4
-rw-r--r--doc/src/declarative/effects.qdoc2
-rw-r--r--doc/src/declarative/elements.qdoc2
-rw-r--r--doc/src/declarative/qmlforcpp.qdoc2
-rw-r--r--doc/src/declarative/tutorial1.qdoc6
-rw-r--r--doc/src/declarative/tutorial2.qdoc2
-rw-r--r--doc/src/declarative/tutorial3.qdoc2
-rw-r--r--doc/src/snippets/declarative/rotation.qml8
-rw-r--r--examples/declarative/fillmode/fillmode.qml2
-rw-r--r--examples/declarative/fonts/fonts.qml10
-rw-r--r--examples/declarative/listview/recipes.qml6
-rw-r--r--examples/declarative/loader/Browser.qml2
-rw-r--r--examples/declarative/loader/Button.qml2
-rw-r--r--examples/declarative/minehunt/minehunt.qml2
-rw-r--r--examples/declarative/tutorials/helloworld/t1/tutorial1.qml2
-rw-r--r--examples/declarative/tutorials/helloworld/t2/tutorial2.qml2
-rw-r--r--examples/declarative/tutorials/helloworld/t3/tutorial3.qml2
-rw-r--r--examples/declarative/velocity/Day.qml4
-rw-r--r--examples/declarative/xmldata/yahoonews.qml2
-rw-r--r--src/declarative/extra/qfxanimatedimageitem_p.h4
-rw-r--r--src/declarative/extra/qfxparticles.cpp15
-rw-r--r--src/declarative/fx/fx.pri4
-rw-r--r--src/declarative/fx/qfxborderimage.cpp34
-rw-r--r--src/declarative/fx/qfximagebase.cpp52
-rw-r--r--src/declarative/fx/qfximagebase_p.h1
-rw-r--r--src/declarative/fx/qfxitem.cpp99
-rw-r--r--src/declarative/fx/qfxitem.h6
-rw-r--r--src/declarative/fx/qfxlineedit.cpp23
-rw-r--r--src/declarative/fx/qfxlineedit.h6
-rw-r--r--src/declarative/fx/qfxlineedit_p.h4
-rw-r--r--src/declarative/fx/qfxpixmapcache.cpp (renamed from src/declarative/fx/qfxpixmap.cpp)61
-rw-r--r--src/declarative/fx/qfxpixmapcache.h (renamed from src/declarative/fx/qfxpixmap.h)12
-rw-r--r--src/declarative/fx/qfxscalegrid_p.h2
-rw-r--r--src/declarative/fx/qfxtext.cpp38
-rw-r--r--src/declarative/fx/qfxtext.h11
-rw-r--r--src/declarative/fx/qfxtext_p.h23
-rw-r--r--src/declarative/fx/qfxtextedit.cpp44
-rw-r--r--src/declarative/fx/qfxtextedit.h9
-rw-r--r--src/declarative/fx/qfxtextedit_p.h4
-rw-r--r--src/declarative/fx/qfxwebview.cpp10
-rw-r--r--src/declarative/fx/qfxwebview.h1
-rw-r--r--src/declarative/qml/qmlcompiler.cpp6
-rw-r--r--src/declarative/util/qmlfont.cpp148
-rw-r--r--src/declarative/util/qmlfont.h93
-rw-r--r--src/declarative/util/qmlsetproperties.cpp6
-rw-r--r--src/declarative/util/qmlstate.h2
-rw-r--r--src/declarative/util/qmltransition.cpp4
-rw-r--r--src/declarative/util/util.pri2
-rw-r--r--tools/qmldebugger/engine.cpp16
-rw-r--r--tools/qmldebugger/engines.qml8
-rw-r--r--tools/qmldebugger/qmldebugger.pro3
-rw-r--r--tools/qmldebugger/qmldebugger.qrc7
-rw-r--r--tools/qmlviewer/qmlviewer.pro8
61 files changed, 355 insertions, 524 deletions
diff --git a/demos/declarative/calculator/calculator.qml b/demos/declarative/calculator/calculator.qml
index 42e1422..f766a30 100644
--- a/demos/declarative/calculator/calculator.qml
+++ b/demos/declarative/calculator/calculator.qml
@@ -17,7 +17,7 @@ Rect {
Text {
id: CurNum
- font.bold: true; font.size: 16
+ font.bold: true; font.pointSize: 16
color: Palette.text
anchors.right: Container.right
anchors.rightMargin: 5
@@ -27,7 +27,7 @@ Rect {
Text {
id: CurrentOperation
color: Palette.text
- font.bold: true; font.size: 16
+ font.bold: true; font.pointSize: 16
anchors.left: Container.left
anchors.leftMargin: 5
anchors.verticalCenter: Container.verticalCenter
diff --git a/demos/declarative/flickr/content/ImageDetails.qml b/demos/declarative/flickr/content/ImageDetails.qml
index 0182d48..09d8f03 100644
--- a/demos/declarative/flickr/content/ImageDetails.qml
+++ b/demos/declarative/flickr/content/ImageDetails.qml
@@ -44,7 +44,7 @@ Flipable {
}
Text { id: TitleText; style: "Raised"; styleColor: "black"; color: "white"; elide: "ElideRight"
- x: 220; y: 30; width: parent.width - 240; text: Container.photoTitle; font.size: 22 }
+ x: 220; y: 30; width: parent.width - 240; text: Container.photoTitle; font.pointSize: 22 }
LikeOMeter { x: 40; y: 250; rating: Container.rating }
diff --git a/demos/declarative/flickr/flickr.qml b/demos/declarative/flickr/flickr.qml
index 8e1e3e8..a8d18fb 100644
--- a/demos/declarative/flickr/flickr.qml
+++ b/demos/declarative/flickr/flickr.qml
@@ -206,6 +206,6 @@ Item {
id: CategoryText; anchors.horizontalCenter: parent.horizontalCenter; y: 15;
text: "Flickr - " +
(FeedModel.tags=="" ? "Uploads from everyone" : "Recent Uploads tagged " + FeedModel.tags)
- font.size: 20; font.bold: true; color: "white"; style: "Raised"; styleColor: "black"
+ font.pointSize: 20; font.bold: true; color: "white"; style: "Raised"; styleColor: "black"
}
}
diff --git a/demos/declarative/flickr/flickr2.qml b/demos/declarative/flickr/flickr2.qml
index f3b4244..5350a36 100644
--- a/demos/declarative/flickr/flickr2.qml
+++ b/demos/declarative/flickr/flickr2.qml
@@ -256,6 +256,6 @@ Item {
id: CategoryText; anchors.horizontalCenter: parent.horizontalCenter; y: 15;
text: "Flickr - " +
(FeedModel.tags=="" ? "Uploads from everyone" : "Recent Uploads tagged " + FeedModel.tags)
- font.size: 16; font.bold: true; color: "white"; style: "Raised"; styleColor: "black"
+ font.pointSize: 16; font.bold: true; color: "white"; style: "Raised"; styleColor: "black"
}
}
diff --git a/demos/declarative/samegame/SameGame.qml b/demos/declarative/samegame/SameGame.qml
index e74646d..42c313c 100644
--- a/demos/declarative/samegame/SameGame.qml
+++ b/demos/declarative/samegame/SameGame.qml
@@ -28,7 +28,7 @@ Rect {
anchors.top: gameCanvas.bottom; anchors.topMargin: 4; anchors.left: gameCanvas.left;
}
Text {
- text: "Score: " + gameCanvas.score; width:100; font.size:14
+ text: "Score: " + gameCanvas.score; width:100; font.pointSize:14
anchors.top: gameCanvas.bottom; anchors.topMargin: 4; anchors.right: gameCanvas.right;
}
}
diff --git a/demos/declarative/samegame/content/Button.qml b/demos/declarative/samegame/content/Button.qml
index c7a49f1..e3d0d30 100644
--- a/demos/declarative/samegame/content/Button.qml
+++ b/demos/declarative/samegame/content/Button.qml
@@ -13,6 +13,6 @@ Rect {
MouseRegion { id:mr; anchors.fill: parent; onClicked: page.clicked() }
Text {
id: txtItem; text: page.text; anchors.centerIn: page; color: activePalette.buttonText
- font.size: 14;
+ font.pointSize: 14;
}
}
diff --git a/demos/declarative/webbrowser/fieldtext/FieldText.qml b/demos/declarative/webbrowser/fieldtext/FieldText.qml
index d822d65..3a9abdf 100644
--- a/demos/declarative/webbrowser/fieldtext/FieldText.qml
+++ b/demos/declarative/webbrowser/fieldtext/FieldText.qml
@@ -17,7 +17,6 @@ Item {
if (!mouseGrabbed) {
fieldText.startEdit();
fieldText.state='editing';
- textEdit.selectAll();
mouseGrabbed=true;
}
}
@@ -61,7 +60,7 @@ Item {
opacity: 0
}
- TextEdit {
+ LineEdit {
id: textEdit
text: fieldText.text
focus: false
@@ -73,7 +72,9 @@ Item {
color: "black"
font.bold: true
readOnly: true
- wrap: false
+ Keys.onEnterPressed: confirm()
+ Keys.onReturnPressed: confirm()
+ Keys.onEscapePressed: reset()
}
Text {
@@ -95,20 +96,6 @@ Item {
}
}
- KeyProxy {
- id: proxy
- focus: false
- anchors.fill: parent
- targets: [keyActions,textEdit]
- }
-
- Item {
- id: keyActions
- Keys.onEnterPressed: confirm()
- Keys.onReturnPressed: confirm()
- Keys.onEscapePressed: reset()
- }
-
MouseRegion {
anchors.fill: cancelIcon
onClicked: { reset() }
@@ -140,6 +127,9 @@ Item {
target: textEdit
color: "black"
readOnly: false
+ focus: true
+ selectionStart: 0
+ selectionEnd: -1
}
SetProperties {
target: editRegion
@@ -153,10 +143,6 @@ Item {
target: textEdit.anchors
rightMargin: 34
}
- SetProperties {
- target: proxy
- focus: true
- }
}
]
diff --git a/demos/declarative/webbrowser/webbrowser.qml b/demos/declarative/webbrowser/webbrowser.qml
index efa8532..c1de69b 100644
--- a/demos/declarative/webbrowser/webbrowser.qml
+++ b/demos/declarative/webbrowser/webbrowser.qml
@@ -6,7 +6,7 @@ import "fieldtext"
Item {
id: WebBrowser
- property string urlString : "http://www.qtsoftware.com/"
+ property string urlString : "http://qt.nokia.com/"
state: "Normal"
@@ -80,7 +80,6 @@ Item {
id: HeaderText
text: MyWebView.title!='' || MyWebView.progress == 1.0 ? MyWebView.title : 'Loading...'
- //text: MyWebView.url
elide: "ElideRight"
color: "white"
@@ -88,7 +87,7 @@ Item {
style: "Raised"
font.family: "Helvetica"
- font.size: 10
+ font.pointSize: 10
font.bold: true
anchors.left: Header.left
@@ -137,7 +136,7 @@ Item {
/*<<<<<<< HEAD:demos/declarative/webbrowser/webbrowser.qml
text: MyWebView.url == '' ? ' ' : MyWebView.url
wrap: false
- font.size: 11
+ font.pointSize: 11
color: "#555555"
focusOnPress: true
=======*/
diff --git a/doc/src/declarative/basictypes.qdoc b/doc/src/declarative/basictypes.qdoc
index a22af0f..684fd0d 100644
--- a/doc/src/declarative/basictypes.qdoc
+++ b/doc/src/declarative/basictypes.qdoc
@@ -214,12 +214,12 @@
\o string font.family
\o bool font.bold
\o bool font.italic
- \o real font.size
+ \o real font.pointSize
\endlist
Setting a font looks like this:
\code
- Text { font.family: "Helvetica"; font.size: 13; font.bold: true }
+ Text { font.family: "Helvetica"; font.pointSize: 13; font.bold: true }
\endcode
\target basicqmlaction
diff --git a/doc/src/declarative/effects.qdoc b/doc/src/declarative/effects.qdoc
index 8350dc4..7879260 100644
--- a/doc/src/declarative/effects.qdoc
+++ b/doc/src/declarative/effects.qdoc
@@ -8,7 +8,7 @@
\list
\o Scaling (\l Item \bold scale property)
\o Opacity (\l Item \bold opacity property)
-\o Rotation (\l Item \bold rotation property, and Rotation3D)
+\o Rotation (\l Item \bold rotation property)
\o Affine Transforms (\l Squish)
\endlist
diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc
index b5dd2bb..3f74ff5 100644
--- a/doc/src/declarative/elements.qdoc
+++ b/doc/src/declarative/elements.qdoc
@@ -137,8 +137,6 @@ The following table lists the Qml elements provided by the Qt Declarative module
\list
\o \l Scale
\o \l Rotation
-\o \l Squish
-\o \l Rotation3D
\endlist
\o
diff --git a/doc/src/declarative/qmlforcpp.qdoc b/doc/src/declarative/qmlforcpp.qdoc
index 74357bb..53af252 100644
--- a/doc/src/declarative/qmlforcpp.qdoc
+++ b/doc/src/declarative/qmlforcpp.qdoc
@@ -161,7 +161,7 @@
\code
Text {
font.family: "helvetica"
- font.size: 12
+ font.pointSize: 12
font {
bold: true
italic: true
diff --git a/doc/src/declarative/tutorial1.qdoc b/doc/src/declarative/tutorial1.qdoc
index 5c11326..d38dc54 100644
--- a/doc/src/declarative/tutorial1.qdoc
+++ b/doc/src/declarative/tutorial1.qdoc
@@ -18,7 +18,7 @@ Rect {
Text {
id: HelloText
text: "Hello world!"
- font.size: 24
+ font.pointSize: 24
font.bold: true
y: 30
anchors.horizontalCenter: Page.horizontalCenter
@@ -49,7 +49,7 @@ The \l Rect element contains many other properties (such as \c x and \c y), but
Text {
id: HelloText
text: "Hello world!"
- font.size: 24
+ font.pointSize: 24
font.bold: true
y: 30
anchors.horizontalCenter: Page.horizontalCenter
@@ -60,7 +60,7 @@ We add a text element as a child of our root element to display the text 'Hello
The \c y property is used to position the text vertically at 30 pixels from the top of its parent.
-The \c font.size and \c font.bold properties are related to fonts and use the \e 'dot' notation.
+The \c font.pointSize and \c font.bold properties are related to fonts and use the \e 'dot' notation.
The \c anchors.horizontalCenter property refers to the horizontal center of an element. In this case, we specify that our text element should be horizontally centered in the \e Page element.
diff --git a/doc/src/declarative/tutorial2.qdoc b/doc/src/declarative/tutorial2.qdoc
index c22a01a..4be0702 100644
--- a/doc/src/declarative/tutorial2.qdoc
+++ b/doc/src/declarative/tutorial2.qdoc
@@ -41,7 +41,7 @@ Rect {
Text {
id: HelloText
text: "Hello world!"
- font.size: 24
+ font.pointSize: 24
font.bold: true
y: 30
anchors.horizontalCenter: Page.horizontalCenter
diff --git a/doc/src/declarative/tutorial3.qdoc b/doc/src/declarative/tutorial3.qdoc
index 9ae56c1..0f9dac2 100644
--- a/doc/src/declarative/tutorial3.qdoc
+++ b/doc/src/declarative/tutorial3.qdoc
@@ -20,7 +20,7 @@ Rect {
Text {
id: HelloText
text: "Hello world!"
- font.size: 24
+ font.pointSize: 24
font.bold: true
y: 30
anchors.horizontalCenter: Page.horizontalCenter
diff --git a/doc/src/snippets/declarative/rotation.qml b/doc/src/snippets/declarative/rotation.qml
index c7e184f..ab7d4ca 100644
--- a/doc/src/snippets/declarative/rotation.qml
+++ b/doc/src/snippets/declarative/rotation.qml
@@ -10,19 +10,19 @@ Rect {
Image { source: "pics/qt.png" }
Image {
source: "pics/qt.png"
- transform: Rotation3D { axis.startX: 30; axis.endX: 30; axis.endY: 60; angle: 18 }
+ transform: Rotation { origin.x: 30; axis.y: 60; axis.z: 0 angle: 18 }
}
Image {
source: "pics/qt.png"
- transform: Rotation3D { axis.startX: 30; axis.endX: 30; axis.endY: 60; angle: 36 }
+ transform: Rotation { origin.x: 30; axis.y: 60; axis.z: 0 angle: 36 }
}
Image {
source: "pics/qt.png"
- transform: Rotation3D { axis.startX: 30; axis.endX: 30; axis.endY: 60; angle: 54 }
+ transform: Rotation { origin.x: 30; axis.y: 60; axis.z: 0; angle: 54 }
}
Image {
source: "pics/qt.png"
- transform: Rotation3D { axis.startX: 30; axis.endX: 30; axis.endY: 60; angle: 72 }
+ transform: Rotation { origin.x: 30; axis.y: 60; axis.z: 0; angle: 72 }
}
}
//! [0]
diff --git a/examples/declarative/fillmode/fillmode.qml b/examples/declarative/fillmode/fillmode.qml
index f2a87c8..9e22885 100644
--- a/examples/declarative/fillmode/fillmode.qml
+++ b/examples/declarative/fillmode/fillmode.qml
@@ -28,7 +28,7 @@ Image {
}
Text {
id: Label
- font.size: 24
+ font.pointSize: 24
color: "blue"
style: "Outline"
styleColor: "white"
diff --git a/examples/declarative/fonts/fonts.qml b/examples/declarative/fonts/fonts.qml
index 9fd409a..578cffa 100644
--- a/examples/declarative/fonts/fonts.qml
+++ b/examples/declarative/fonts/fonts.qml
@@ -24,21 +24,21 @@ Rect {
color: Palette.windowText
width: parent.width; elide: "ElideRight"
font.family: "Times"
- font.size: 32
+ font.pointSize: 32
}
Text {
text: myText
color: Palette.windowText
width: parent.width; elide: "ElideRight"
font.family: FixedFont.name
- font.size: 32
+ font.pointSize: 32
}
Text {
text: myText
color: Palette.windowText
width: parent.width; elide: "ElideRight"
font.family: LocalFont.name
- font.size: 32
+ font.pointSize: 32
}
Text {
text: {
@@ -49,7 +49,7 @@ Rect {
color: Palette.windowText
width: parent.width; elide: "ElideRight"
font.family: WebFont.name
- font.size: 32
+ font.pointSize: 32
}
Text {
text: {
@@ -60,7 +60,7 @@ Rect {
color: Palette.windowText
width: parent.width; elide: "ElideRight"
font.family: WebFont2.name
- font.size: 32
+ font.pointSize: 32
}
}
}
diff --git a/examples/declarative/listview/recipes.qml b/examples/declarative/listview/recipes.qml
index 7abadd0..b2c17af 100644
--- a/examples/declarative/listview/recipes.qml
+++ b/examples/declarative/listview/recipes.qml
@@ -48,9 +48,9 @@ Rect {
VerticalPositioner {
height: recipePic.height; width: background.width-recipePic.width-20
spacing: 5
- Text { id: name; text: title; font.bold: true; font.size: 16 }
+ Text { id: name; text: title; font.bold: true; font.pointSize: 16 }
Text {
- text: "Ingredients"; font.size: 12; font.bold: true
+ text: "Ingredients"; font.pointSize: 12; font.bold: true
opacity: wrapper.detailsOpacity
}
Text {
@@ -67,7 +67,7 @@ Rect {
opacity: wrapper.detailsOpacity
Text {
id: methodTitle
- text: "Method"; font.size: 12; font.bold: true
+ text: "Method"; font.pointSize: 12; font.bold: true
anchors.top: parent.top
}
Flickable {
diff --git a/examples/declarative/loader/Browser.qml b/examples/declarative/loader/Browser.qml
index 96c2a76..1c849b8 100644
--- a/examples/declarative/loader/Browser.qml
+++ b/examples/declarative/loader/Browser.qml
@@ -36,7 +36,7 @@ Rect {
id: NameText
anchors.fill: parent; vAlign: "AlignVCenter"
text: fileName; anchors.leftMargin: 32
- font.size: 10
+ font.pointSize: 10
color: activePalette.windowText
}
MouseRegion {
diff --git a/examples/declarative/loader/Button.qml b/examples/declarative/loader/Button.qml
index 999e180..391a800 100644
--- a/examples/declarative/loader/Button.qml
+++ b/examples/declarative/loader/Button.qml
@@ -12,5 +12,5 @@ Rect {
radius: 4
color: "grey"
MouseRegion { anchors.fill: parent; onClicked: Container.clicked() }
- Text { id: Text; anchors.centerIn:parent; font.size: 10; text: parent.text }
+ Text { id: Text; anchors.centerIn:parent; font.pointSize: 10; text: parent.text }
}
diff --git a/examples/declarative/minehunt/minehunt.qml b/examples/declarative/minehunt/minehunt.qml
index 55cf3c2..b3bcaf3 100644
--- a/examples/declarative/minehunt/minehunt.qml
+++ b/examples/declarative/minehunt/minehunt.qml
@@ -148,7 +148,7 @@ Item {
y: 380
Text {
color: "white"
- font.size: 18
+ font.pointSize: 18
x: 20
y: 20
}
diff --git a/examples/declarative/tutorials/helloworld/t1/tutorial1.qml b/examples/declarative/tutorials/helloworld/t1/tutorial1.qml
index f067695..156655a 100644
--- a/examples/declarative/tutorials/helloworld/t1/tutorial1.qml
+++ b/examples/declarative/tutorials/helloworld/t1/tutorial1.qml
@@ -8,7 +8,7 @@ Rect {
Text {
id: HelloText
text: "Hello world!"
- font.size: 24
+ font.pointSize: 24
font.bold: true
y: 30
anchors.horizontalCenter: Page.horizontalCenter
diff --git a/examples/declarative/tutorials/helloworld/t2/tutorial2.qml b/examples/declarative/tutorials/helloworld/t2/tutorial2.qml
index efbdbf1..5619d04 100644
--- a/examples/declarative/tutorials/helloworld/t2/tutorial2.qml
+++ b/examples/declarative/tutorials/helloworld/t2/tutorial2.qml
@@ -8,7 +8,7 @@ Rect {
Text {
id: HelloText
text: "Hello world!"
- font.size: 24
+ font.pointSize: 24
font.bold: true
y: 30
anchors.horizontalCenter: Page.horizontalCenter
diff --git a/examples/declarative/tutorials/helloworld/t3/tutorial3.qml b/examples/declarative/tutorials/helloworld/t3/tutorial3.qml
index 3e93632..ca32709 100644
--- a/examples/declarative/tutorials/helloworld/t3/tutorial3.qml
+++ b/examples/declarative/tutorials/helloworld/t3/tutorial3.qml
@@ -8,7 +8,7 @@ Rect {
Text {
id: HelloText
text: "Hello world!"
- font.size: 24
+ font.pointSize: 24
font.bold: true
y: 30
anchors.horizontalCenter: Page.horizontalCenter
diff --git a/examples/declarative/velocity/Day.qml b/examples/declarative/velocity/Day.qml
index f7a5a47..59a31af 100644
--- a/examples/declarative/velocity/Day.qml
+++ b/examples/declarative/velocity/Day.qml
@@ -18,7 +18,7 @@ Rect {
x: 20
y: 20
height: 40
- font.size: 14
+ font.pointSize: 14
font.bold: true
width: 370
text: day
@@ -50,7 +50,7 @@ Rect {
TextEdit {
id: MyText
smooth: true
- font.size: 28
+ font.pointSize: 28
readOnly: false
x: -104
y: 36
diff --git a/examples/declarative/xmldata/yahoonews.qml b/examples/declarative/xmldata/yahoonews.qml
index c7f0b08..156eb31 100644
--- a/examples/declarative/xmldata/yahoonews.qml
+++ b/examples/declarative/xmldata/yahoonews.qml
@@ -49,7 +49,7 @@ Rect {
text: '<a href=\'' + link + '\'>' + title + '</a>'
font.bold: true
font.family: "Helvetica"
- font.size: 14
+ font.pointSize: 14
onLinkActivated: { print('link clicked: ' + link) }
}
Text {
diff --git a/src/declarative/extra/qfxanimatedimageitem_p.h b/src/declarative/extra/qfxanimatedimageitem_p.h
index 859f869..56252ca 100644
--- a/src/declarative/extra/qfxanimatedimageitem_p.h
+++ b/src/declarative/extra/qfxanimatedimageitem_p.h
@@ -58,6 +58,7 @@
QT_BEGIN_NAMESPACE
class QMovie;
+class QNetworkReply;
class QFxAnimatedImageItemPrivate : public QFxImagePrivate
{
@@ -65,13 +66,14 @@ class QFxAnimatedImageItemPrivate : public QFxImagePrivate
public:
QFxAnimatedImageItemPrivate()
- : playing(true), paused(false), _movie(0)
+ : playing(true), paused(false), _movie(0), reply(0)
{
}
bool playing;
bool paused;
QMovie *_movie;
+ QNetworkReply *reply;
};
QT_END_NAMESPACE
diff --git a/src/declarative/extra/qfxparticles.cpp b/src/declarative/extra/qfxparticles.cpp
index f05f233..2380655 100644
--- a/src/declarative/extra/qfxparticles.cpp
+++ b/src/declarative/extra/qfxparticles.cpp
@@ -50,7 +50,7 @@
#ifndef INT_MAX
#define INT_MAX 2147483647
#endif
-#include <qfxpixmap.h>
+#include <qfxpixmapcache.h>
#include <private/qfxperf_p.h>
#include <private/qmlanimation_p.h>
#include <QNetworkReply>
@@ -405,7 +405,6 @@ public:
bool emitting;
QFxParticleMotion *motion;
QFxParticlesPainter *paintItem;
- QPointer<QNetworkReply> reply;
QList<QFxParticle> particles;
QTickAnimationProxy<QFxParticlesPrivate, &QFxParticlesPrivate::tick> clock;
@@ -617,7 +616,7 @@ QFxParticles::~QFxParticles()
{
Q_D(QFxParticles);
if (!d->url.isEmpty())
- QFxPixmap::cancelGet(d->url, this);
+ QFxPixmapCache::cancelGet(d->url, this);
}
/*!
@@ -638,7 +637,7 @@ QUrl QFxParticles::source() const
void QFxParticles::imageLoaded()
{
Q_D(QFxParticles);
- QFxPixmap::find(d->url, &d->image);
+ QFxPixmapCache::find(d->url, &d->image);
d->paintItem->updateSize();
d->paintItem->update();
}
@@ -651,7 +650,7 @@ void QFxParticles::setSource(const QUrl &name)
return;
if (!d->url.isEmpty())
- QFxPixmap::cancelGet(d->url, this);
+ QFxPixmapCache::cancelGet(d->url, this);
if (name.isEmpty()) {
d->url = name;
d->image = QPixmap();
@@ -660,9 +659,9 @@ void QFxParticles::setSource(const QUrl &name)
} else {
d->url = name;
Q_ASSERT(!name.isRelative());
- d->reply = QFxPixmap::get(qmlEngine(this), d->url, &d->image);
- if (d->reply)
- connect(d->reply, SIGNAL(finished()), this, SLOT(imageLoaded()));
+ QNetworkReply *reply = QFxPixmapCache::get(qmlEngine(this), d->url, &d->image);
+ if (reply)
+ connect(reply, SIGNAL(finished()), this, SLOT(imageLoaded()));
else {
//### unify with imageLoaded
d->paintItem->updateSize();
diff --git a/src/declarative/fx/fx.pri b/src/declarative/fx/fx.pri
index 5f574cd..48af58e 100644
--- a/src/declarative/fx/fx.pri
+++ b/src/declarative/fx/fx.pri
@@ -41,7 +41,7 @@ HEADERS += \
fx/qfxtextedit_p.h \
fx/qfxtext.h \
fx/qfxtext_p.h \
- fx/qfxpixmap.cpp \
+ fx/qfxpixmapcache.h \
fx/qfxvisualitemmodel.h \
fx/qfxlistview.h \
fx/qfxgraphicsobjectcontainer.h \
@@ -72,7 +72,7 @@ SOURCES += \
fx/qfxlineedit.cpp \
fx/qfxtext.cpp \
fx/qfxtextedit.cpp \
- fx/qfxpixmap.cpp \
+ fx/qfxpixmapcache.cpp \
fx/qfxvisualitemmodel.cpp \
fx/qfxlistview.cpp \
fx/qfxgraphicsobjectcontainer.cpp \
diff --git a/src/declarative/fx/qfxborderimage.cpp b/src/declarative/fx/qfxborderimage.cpp
index adb70a3..f8c79a6 100644
--- a/src/declarative/fx/qfxborderimage.cpp
+++ b/src/declarative/fx/qfxborderimage.cpp
@@ -92,7 +92,7 @@ QFxBorderImage::~QFxBorderImage()
if (d->sciReply)
d->sciReply->deleteLater();
if (!d->sciurl.isEmpty())
- QFxPixmap::cancelGet(d->sciurl, this);
+ QFxPixmapCache::cancelGet(d->sciurl, this);
}
/*!
\qmlproperty enum BorderImage::status
@@ -166,9 +166,9 @@ void QFxBorderImage::setSource(const QUrl &url)
}
if (!d->url.isEmpty())
- QFxPixmap::cancelGet(d->url, this);
+ QFxPixmapCache::cancelGet(d->url, this);
if (!d->sciurl.isEmpty())
- QFxPixmap::cancelGet(d->sciurl, this);
+ QFxPixmapCache::cancelGet(d->sciurl, this);
d->url = url;
d->sciurl = QUrl();
@@ -205,10 +205,10 @@ void QFxBorderImage::setSource(const QUrl &url)
this, SLOT(sciRequestFinished()));
}
} else {
- d->reply = QFxPixmap::get(qmlEngine(this), d->url, &d->pix);
- if (d->reply) {
- connect(d->reply, SIGNAL(finished()), this, SLOT(requestFinished()));
- connect(d->reply, SIGNAL(downloadProgress(qint64,qint64)),
+ QNetworkReply *reply = QFxPixmapCache::get(qmlEngine(this), d->url, &d->pix);
+ if (reply) {
+ connect(reply, SIGNAL(finished()), this, SLOT(requestFinished()));
+ connect(reply, SIGNAL(downloadProgress(qint64,qint64)),
this, SLOT(requestProgress(qint64,qint64)));
} else {
//### should be unified with requestFinished
@@ -315,10 +315,10 @@ void QFxBorderImage::setGridScaledImage(const QFxGridScaledImage& sci)
d->verticalTileMode = sci.verticalTileRule();
d->sciurl = d->url.resolved(QUrl(sci.pixmapUrl()));
- d->reply = QFxPixmap::get(qmlEngine(this), d->sciurl, &d->pix);
- if (d->reply) {
- connect(d->reply, SIGNAL(finished()), this, SLOT(requestFinished()));
- connect(d->reply, SIGNAL(downloadProgress(qint64,qint64)),
+ QNetworkReply *reply = QFxPixmapCache::get(qmlEngine(this), d->sciurl, &d->pix);
+ if (reply) {
+ connect(reply, SIGNAL(finished()), this, SLOT(requestFinished()));
+ connect(reply, SIGNAL(downloadProgress(qint64,qint64)),
this, SLOT(requestProgress(qint64,qint64)));
} else {
//### should be unified with requestFinished
@@ -340,16 +340,10 @@ void QFxBorderImage::requestFinished()
{
Q_D(QFxBorderImage);
if (d->url.path().endsWith(QLatin1String(".sci"))) {
- QFxPixmap::find(d->sciurl, &d->pix);
+ QFxPixmapCache::find(d->sciurl, &d->pix);
} else {
- if (d->reply) {
- //###disconnect really needed?
- disconnect(d->reply, SIGNAL(downloadProgress(qint64,qint64)),
- this, SLOT(requestProgress(qint64,qint64)));
- if (d->reply->error() != QNetworkReply::NoError)
- d->status = Error;
- }
- QFxPixmap::find(d->url, &d->pix);
+ if (!QFxPixmapCache::find(d->url, &d->pix))
+ d->status = Error;
}
setImplicitWidth(d->pix.width());
setImplicitHeight(d->pix.height());
diff --git a/src/declarative/fx/qfximagebase.cpp b/src/declarative/fx/qfximagebase.cpp
index f96ff6f..e3760f3 100644
--- a/src/declarative/fx/qfximagebase.cpp
+++ b/src/declarative/fx/qfximagebase.cpp
@@ -45,7 +45,7 @@
#include <QNetworkReply>
#include <QFile>
#include <QtDeclarative/qmlengine.h>
-#include <QtDeclarative/qfxpixmap.h>
+#include <QtDeclarative/qfxpixmapcache.h>
QT_BEGIN_NAMESPACE
@@ -65,7 +65,7 @@ QFxImageBase::~QFxImageBase()
{
Q_D(QFxImageBase);
if (!d->url.isEmpty())
- QFxPixmap::cancelGet(d->url, this);
+ QFxPixmapCache::cancelGet(d->url, this);
}
QFxImageBase::Status QFxImageBase::status() const
@@ -103,7 +103,7 @@ void QFxImageBase::setSource(const QUrl &url)
return;
if (!d->url.isEmpty())
- QFxPixmap::cancelGet(d->url, this);
+ QFxPixmapCache::cancelGet(d->url, this);
d->url = url;
if (d->progress != 0.0) {
@@ -123,25 +123,25 @@ void QFxImageBase::setSource(const QUrl &url)
update();
} else {
d->status = Loading;
- d->reply = QFxPixmap::get(qmlEngine(this), d->url, &d->pix);
- if (d->reply) {
- connect(d->reply, SIGNAL(finished()), this, SLOT(requestFinished()));
- connect(d->reply, SIGNAL(downloadProgress(qint64,qint64)),
- this, SLOT(requestProgress(qint64,qint64)));
- } else {
- //### should be unified with requestFinished
- setImplicitWidth(d->pix.width());
- setImplicitHeight(d->pix.height());
-
- if (d->status == Loading)
- d->status = Ready;
- d->progress = 1.0;
- emit statusChanged(d->status);
- emit sourceChanged(d->url);
- emit progressChanged(1.0);
- update();
- }
+ QNetworkReply *reply = QFxPixmapCache::get(qmlEngine(this), d->url, &d->pix);
+ if (reply) {
+ connect(reply, SIGNAL(finished()), this, SLOT(requestFinished()));
+ connect(reply, SIGNAL(downloadProgress(qint64,qint64)),
+ this, SLOT(requestProgress(qint64,qint64)));
+ } else {
+ //### should be unified with requestFinished
+ setImplicitWidth(d->pix.width());
+ setImplicitHeight(d->pix.height());
+
+ if (d->status == Loading)
+ d->status = Ready;
+ d->progress = 1.0;
+ emit statusChanged(d->status);
+ emit sourceChanged(d->url);
+ emit progressChanged(1.0);
+ update();
}
+ }
emit statusChanged(d->status);
}
@@ -149,14 +149,8 @@ void QFxImageBase::setSource(const QUrl &url)
void QFxImageBase::requestFinished()
{
Q_D(QFxImageBase);
- if (d->reply) {
- //###disconnect really needed?
- disconnect(d->reply, SIGNAL(downloadProgress(qint64,qint64)),
- this, SLOT(requestProgress(qint64,qint64)));
- if (d->reply->error() != QNetworkReply::NoError)
- d->status = Error;
- }
- QFxPixmap::find(d->url, &d->pix);
+ if (!QFxPixmapCache::find(d->url, &d->pix))
+ d->status = Error;
setImplicitWidth(d->pix.width());
setImplicitHeight(d->pix.height());
diff --git a/src/declarative/fx/qfximagebase_p.h b/src/declarative/fx/qfximagebase_p.h
index b468b90..3f43f38 100644
--- a/src/declarative/fx/qfximagebase_p.h
+++ b/src/declarative/fx/qfximagebase_p.h
@@ -73,7 +73,6 @@ public:
QPixmap pix;
QFxImageBase::Status status;
QUrl url;
- QPointer<QNetworkReply> reply;
qreal progress;
};
diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp
index aba6bf1..0b86a54 100644
--- a/src/declarative/fx/qfxitem.cpp
+++ b/src/declarative/fx/qfxitem.cpp
@@ -77,6 +77,92 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Scale,QGraphicsScale)
QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Rotation,QGraphicsRotation)
/*!
+ \qmlclass Transform
+ \brief A transformation.
+*/
+
+/*!
+ \qmlclass Scale
+ \brief A Scale object provides a way to scale an Item.
+
+ The scale object gives more control over scaling than using Item's scale property. Specifically,
+ it allows a different scale for the x and y axes, and allows the scale to be relative to an
+ arbitrary point.
+
+ The following example scales the X axis of the Rect, relative to its interior point 25, 25:
+ \qml
+ Rect {
+ width: 100; height: 100
+ color: "blue"
+ transform: Scale { origin.x: 25; origin.y: 25; xScale: 3}
+ }
+ \endqml
+*/
+
+/*!
+ \qmlproperty real Scale::origin.x
+ \qmlproperty real Scale::origin.y
+
+ The origin point for the scale. The scale will be relative to this point.
+*/
+
+/*!
+ \qmlproperty real Scale::xScale
+
+ The scaling factor for the X axis.
+*/
+
+/*!
+ \qmlproperty real Scale::yScale
+
+ The scaling factor for the Y axis.
+*/
+
+/*!
+ \qmlclass Rotation
+ \brief A Rotation object provides a way to rotate an Item around a point using an axis in 3D space.
+
+ The following example rotates a Rect around its interior point 25, 25:
+ \qml
+ Rect {
+ width: 100; height: 100
+ color: "blue"
+ transform: Rotation { origin.x: 25; origin.y: 25; angle: 45}
+ }
+ \endqml
+
+ Here is an example of various rotations applied to an \l Image.
+ \snippet doc/src/snippets/declarative/rotation.qml 0
+
+ \image axisrotation.png
+*/
+
+/*!
+ \qmlproperty real Rotation::origin.x
+ \qmlproperty real Rotation::origin.y
+
+ The point to rotate around.
+*/
+
+/*!
+ \qmlproperty real Rotation::axis.x
+ \qmlproperty real Rotation::axis.y
+ \qmlproperty real Rotation::axis.z
+
+ A rotation axis is specified by a vector in 3D space By default the vector defines a rotation around the z-Axis.
+
+ \image 3d-rotation-axis.png
+
+*/
+
+/*!
+ \qmlproperty real Rotation::angle
+
+ The angle, in degrees, to rotate.
+*/
+
+
+/*!
\group group_animation
\title Animation
*/
@@ -876,13 +962,6 @@ QFxItem::QFxItem(QFxItemPrivate &dd, QFxItem *parent)
d->init(parent);
}
-/*! \internal
-*/
-void QFxItem::doUpdate()
-{
- update();
-}
-
/*!
Destroys the QFxItem.
*/
@@ -1822,8 +1901,10 @@ void QFxItem::activeFocusChanged(bool flag)
/*!
This function emits the \e focusChanged signal.
- \a flag is not used.
- */
+
+ Subclasses overriding this function should call up
+ to their base class.
+*/
void QFxItem::focusChanged(bool flag)
{
Q_UNUSED(flag);
diff --git a/src/declarative/fx/qfxitem.h b/src/declarative/fx/qfxitem.h
index f005d89..d8fb983 100644
--- a/src/declarative/fx/qfxitem.h
+++ b/src/declarative/fx/qfxitem.h
@@ -43,7 +43,6 @@
#define QFXITEM_H
#include <QtCore/QObject>
-#include <QtScript/qscriptvalue.h>
#include <QtCore/QList>
#include <QtDeclarative/qfxglobal.h>
#include <QtDeclarative/qml.h>
@@ -217,9 +216,6 @@ protected:
virtual void geometryChanged(const QRectF &newGeometry,
const QRectF &oldGeometry);
-private Q_SLOTS:
- void doUpdate();
-
protected:
QFxItem(QFxItemPrivate &dd, QFxItem *parent = 0);
@@ -235,8 +231,6 @@ private:
void setKeyHandler(QFxKeysAttached *);
- // ### move to d-pointer
- void init(QFxItem *parent);
friend class QmlStatePrivate;
friend class QFxAnchors;
friend class QFxKeysAttached;
diff --git a/src/declarative/fx/qfxlineedit.cpp b/src/declarative/fx/qfxlineedit.cpp
index e1d9f14..de850f8 100644
--- a/src/declarative/fx/qfxlineedit.cpp
+++ b/src/declarative/fx/qfxlineedit.cpp
@@ -101,26 +101,25 @@ void QFxLineEdit::setText(const QString &s)
Set the LineEdit's font attributes. \c font.size sets the font's point size.
*/
-QmlFont *QFxLineEdit::font()
+QFont QFxLineEdit::font() const
{
- Q_D(QFxLineEdit);
+ Q_D(const QFxLineEdit);
return d->font;
}
-/*!
-This signal is emitted when the font of the item changes.
-*/
-void QFxLineEdit::fontChanged()
+void QFxLineEdit::setFont(const QFont &font)
{
Q_D(QFxLineEdit);
- d->control->setFont(d->font->font());
+ d->font = font;
+
+ d->control->setFont(d->font);
if(d->cursorItem){
- d->cursorItem->setHeight(QFontMetrics(d->font->font()).height());
+ d->cursorItem->setHeight(QFontMetrics(d->font).height());
moveCursor();
}
//updateSize();
updateAll();//TODO: Only necessary updates
- emit update();
+ update();
}
/*!
@@ -467,6 +466,7 @@ void QFxLineEdit::focusChanged(bool hasFocus)
Q_D(QFxLineEdit);
d->focused = hasFocus;
setCursorVisible(hasFocus);
+ QFxItem::focusChanged(hasFocus);
}
void QFxLineEdit::keyPressEvent(QKeyEvent* ev)
@@ -563,9 +563,6 @@ void QFxLineEditPrivate::init()
q, SLOT(updateAll()));
q->connect(control, SIGNAL(selectionChanged()),
q, SLOT(updateAll()));
- if(!font)
- font = new QmlFont();
- q->connect(font, SIGNAL(updated()), q, SLOT(fontChanged()));
q->updateSize();
oldValidity = control->hasAcceptableInput();
lastSelectionStart = 0;
@@ -632,7 +629,7 @@ void QFxLineEdit::updateSize()
Q_D(QFxLineEdit);
setImplicitHeight(d->control->height());
//d->control->width() is max width, not current width
- QFontMetrics fm = QFontMetrics(d->font->font());
+ QFontMetrics fm = QFontMetrics(d->font);
setImplicitWidth(fm.boundingRect(d->control->text()).width()+1);
setContentsSize(QSize(width(), height()));
}
diff --git a/src/declarative/fx/qfxlineedit.h b/src/declarative/fx/qfxlineedit.h
index f78dbfc..0218fb0 100644
--- a/src/declarative/fx/qfxlineedit.h
+++ b/src/declarative/fx/qfxlineedit.h
@@ -64,7 +64,7 @@ class Q_DECLARATIVE_EXPORT QFxLineEdit : public QFxPaintedItem
Q_PROPERTY(QColor color READ color WRITE setColor)
Q_PROPERTY(QColor highlightColor READ highlightColor WRITE setHighlightColor)
Q_PROPERTY(QColor highlightedTextColor READ highlightedTextColor WRITE setHighlightedTextColor)
- Q_PROPERTY(QmlFont *font READ font CONSTANT)
+ Q_PROPERTY(QFont font READ font WRITE setFont)
Q_PROPERTY(HAlignment hAlign READ hAlign WRITE setHAlign)
Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly)
@@ -98,7 +98,8 @@ public:
QString text() const;
void setText(const QString &);
- QmlFont *font();
+ QFont font() const;
+ void setFont(const QFont &font);
QColor color() const;
void setColor(const QColor &c);
@@ -169,7 +170,6 @@ protected:
private Q_SLOTS:
void updateSize();
- void fontChanged();
void q_textChanged();
void selectionChanged();
void updateAll();
diff --git a/src/declarative/fx/qfxlineedit_p.h b/src/declarative/fx/qfxlineedit_p.h
index a087a32..369669f 100644
--- a/src/declarative/fx/qfxlineedit_p.h
+++ b/src/declarative/fx/qfxlineedit_p.h
@@ -64,7 +64,7 @@ class QFxLineEditPrivate : public QFxPaintedItemPrivate
Q_DECLARE_PUBLIC(QFxLineEdit);
public:
QFxLineEditPrivate() : control(new QLineControl(QString())),
- font(0), color((QRgb)0), style(QFxText::Normal),
+ color((QRgb)0), style(QFxText::Normal),
styleColor((QRgb)0), hAlign(QFxLineEdit::AlignLeft),
hscroll(0), oldScroll(0), focused(false), cursorVisible(false)
{
@@ -79,7 +79,7 @@ public:
QLineControl* control;
- QmlFont *font;
+ QFont font;
QColor color;
QColor highlightColor;
QColor highlightedTextColor;
diff --git a/src/declarative/fx/qfxpixmap.cpp b/src/declarative/fx/qfxpixmapcache.cpp
index 43e94e5..0ca77c3 100644
--- a/src/declarative/fx/qfxpixmap.cpp
+++ b/src/declarative/fx/qfxpixmapcache.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qfxpixmap.h"
+#include "qfxpixmapcache.h"
#include <QImageReader>
#include <QHash>
#include <QNetworkReply>
@@ -116,22 +116,28 @@ static bool readImage(QIODevice *dev, QPixmap *pixmap)
/*!
\internal
- \class QFxPixmap
- \ingroup group_utility
+ \class QFxPixmapCache
\brief Enacapsultes a pixmap for QFx items.
This class is NOT reentrant.
- The pixmap cache will grow indefinately.
*/
+/*!
+ Finds the cached pixmap corresponding to \a url.
+ A previous call to get() must have requested the URL,
+ and the QNetworkReply must have finished before calling
+ this function.
-bool QFxPixmap::find(const QUrl& url, QPixmap *pixmap)
+ Returns true if the image was loaded without error.
+*/
+bool QFxPixmapCache::find(const QUrl& url, QPixmap *pixmap)
{
#ifdef Q_ENABLE_PERFORMANCE_LOG
QFxPerfTimer<QFxPerf::PixmapLoad> perf;
#endif
QString key = url.toString();
+ bool ok = true;
if (!QPixmapCache::find(key,pixmap)) {
#ifndef QT_NO_LOCALFILE_OPTIMIZED_QML
if (url.scheme()==QLatin1String("file")) {
@@ -140,42 +146,51 @@ bool QFxPixmap::find(const QUrl& url, QPixmap *pixmap)
if (!readImage(&f, pixmap)) {
qWarning() << "Format error loading" << url;
*pixmap = QPixmap();
+ ok = false;
}
- } else
+ } else {
*pixmap = QPixmap();
+ ok = false;
+ }
} else
#endif
{
QFxSharedNetworkReplyHash::Iterator iter = qfxActiveNetworkReplies.find(key);
if (iter == qfxActiveNetworkReplies.end()) {
// API usage error
- qWarning() << "QFxPixmap: URL not loaded" << url;
+ qWarning() << "QFxPixmapCache: URL not loaded" << url;
+ ok = false;
} else {
if ((*iter)->reply->error()) {
qWarning() << "Network error loading" << url << (*iter)->reply->errorString();
*pixmap = QPixmap();
- } else
- if (!readImage((*iter)->reply, pixmap)) {
- qWarning() << "Format error loading" << url;
- *pixmap = QPixmap();
- }
+ ok = false;
+ } else if (!readImage((*iter)->reply, pixmap)) {
+ qWarning() << "Format error loading" << url;
+ *pixmap = QPixmap();
+ ok = false;
+ }
(*iter)->release();
}
}
QPixmapCache::insert(key, *pixmap);
+ } else {
+ ok = !pixmap->isNull();
}
- return true;
+ return ok;
}
/*!
- Starts a network request to load \a url. When the URL is loaded,
- the given slot is invoked. Note that if the image is already cached,
- the slot may be invoked immediately.
+ Starts a network request to load \a url.
Returns a QNetworkReply if the image is not immediately available, otherwise
- returns 0. The QNetworkReply must not be stored - it may be destroyed at any time.
+ returns 0. Caller should connect to QNetworkReply::finished() to then call
+ find() when the image is available.
+
+ The returned QNetworkReply will be deleted when all get() calls are
+ matched by a corresponding find() call.
*/
-QNetworkReply *QFxPixmap::get(QmlEngine *engine, const QUrl& url, QPixmap *pixmap)
+QNetworkReply *QFxPixmapCache::get(QmlEngine *engine, const QUrl& url, QPixmap *pixmap)
{
#ifndef QT_NO_LOCALFILE_OPTIMIZED_QML
if (url.scheme()==QLatin1String("file")) {
@@ -214,19 +229,21 @@ QNetworkReply *QFxPixmap::get(QmlEngine *engine, const QUrl& url, QPixmap *pixma
}
/*!
- Stops the given slot being invoked if the given url finishes loading.
+ Cancels a previous call to get().
+
May also cancel loading (eg. if no other pending request).
- Any connections to the QNetworkReply returned by get() will be
+ Any connections from the QNetworkReply returned by get() to \a obj will be
disconnected.
*/
-void QFxPixmap::cancelGet(const QUrl& url, QObject* obj)
+void QFxPixmapCache::cancelGet(const QUrl& url, QObject* obj)
{
QString key = url.toString();
QFxSharedNetworkReplyHash::Iterator iter = qfxActiveNetworkReplies.find(key);
if (iter == qfxActiveNetworkReplies.end())
return;
- QObject::disconnect((*iter)->reply, 0, obj, 0);
+ if (obj)
+ QObject::disconnect((*iter)->reply, 0, obj, 0);
(*iter)->release();
}
diff --git a/src/declarative/fx/qfxpixmap.h b/src/declarative/fx/qfxpixmapcache.h
index ec8d2be..ca5d47b 100644
--- a/src/declarative/fx/qfxpixmap.h
+++ b/src/declarative/fx/qfxpixmapcache.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QFXPIXMAP_H
-#define QFXPIXMAP_H
+#ifndef QFXPIXMAPCACHE_H
+#define QFXPIXMAPCACHE_H
#include <QtCore/QString>
#include <QtGui/QPixmap>
@@ -54,17 +54,17 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
class QmlEngine;
class QNetworkReply;
-class Q_DECLARATIVE_EXPORT QFxPixmap //### rename QFxPixmapCache
+class Q_DECLARATIVE_EXPORT QFxPixmapCache
{
public:
static QNetworkReply *get(QmlEngine *, const QUrl& url, QPixmap *pixmap);
static void cancelGet(const QUrl& url, QObject* obj);
- static bool find(const QUrl& url, QPixmap *pixmap); // url must have been passed to QFxPixmap::get, and finished. Or must be a local file.
+ static bool find(const QUrl& url, QPixmap *pixmap); // url must have been passed to QFxPixmapCache::get, and finished. Or must be a local file.
};
-
QT_END_NAMESPACE
QT_END_HEADER
-#endif // QFXPIXMAP_H
+
+#endif // QFXPIXMAPCACHE_H
diff --git a/src/declarative/fx/qfxscalegrid_p.h b/src/declarative/fx/qfxscalegrid_p.h
index 7df90f1..bae1436 100644
--- a/src/declarative/fx/qfxscalegrid_p.h
+++ b/src/declarative/fx/qfxscalegrid_p.h
@@ -45,7 +45,7 @@
#include <QtCore/QString>
#include <QtCore/QObject>
#include <QtDeclarative/qfxglobal.h>
-#include <QtDeclarative/qfxpixmap.h>
+#include <QtDeclarative/qfxpixmapcache.h>
#include <QtDeclarative/qml.h>
#include "qfxborderimage.h"
diff --git a/src/declarative/fx/qfxtext.cpp b/src/declarative/fx/qfxtext.cpp
index 0315a75..11fef69 100644
--- a/src/declarative/fx/qfxtext.cpp
+++ b/src/declarative/fx/qfxtext.cpp
@@ -108,7 +108,6 @@ QFxText::QFxText(QFxItem *parent)
: QFxItem(*(new QFxTextPrivate), parent)
{
Q_D(QFxText);
- d->init();
setAcceptedMouseButtons(Qt::LeftButton);
setFlag(QGraphicsItem::ItemHasNoContents, false);
}
@@ -117,7 +116,6 @@ QFxText::QFxText(QFxTextPrivate &dd, QFxItem *parent)
: QFxItem(dd, parent)
{
Q_D(QFxText);
- d->init();
setAcceptedMouseButtons(Qt::LeftButton);
setFlag(QGraphicsItem::ItemHasNoContents, false);
}
@@ -142,10 +140,20 @@ QFxText::~QFxText()
\brief the font used to display the text.
*/
-QmlFont *QFxText::font()
+QFont QFxText::font() const
+{
+ Q_D(const QFxText);
+ return d->font;
+}
+
+void QFxText::setFont(const QFont &font)
{
Q_D(QFxText);
- return d->font();
+ d->font = font;
+
+ d->imgDirty = true;
+ d->updateSize();
+ update();
}
void QFxText::setText(const QString &n)
@@ -492,15 +500,6 @@ void QFxText::geometryChanged(const QRectF &newGeometry,
QFxItem::geometryChanged(newGeometry, oldGeometry);
}
-
-void QFxText::fontChanged()
-{
- Q_D(QFxText);
- d->imgDirty = true;
- d->updateSize();
- emit update();
-}
-
void QFxTextPrivate::updateSize()
{
Q_Q(QFxText);
@@ -508,8 +507,7 @@ void QFxTextPrivate::updateSize()
if (text.isEmpty()) {
return;
}
- QFont f; if (_font) f = _font->font();
- QFontMetrics fm(f);
+ QFontMetrics fm(font);
int dy = q->height();
QString tmp;
@@ -524,14 +522,14 @@ void QFxTextPrivate::updateSize()
if (singleline && elideMode != Qt::ElideNone && q->widthValid())
tmp = fm.elidedText(tmp,elideMode,q->width()); // XXX still worth layout...?
layout.clearLayout();
- layout.setFont(f);
+ layout.setFont(font);
layout.setText(tmp);
size = setupTextLayout(&layout);
cachedLayoutSize = size;
}
if (richText) {
singleline = false; // richtext can't elide or be optimized for single-line case
- doc->setDefaultFont(f);
+ doc->setDefaultFont(font);
QTextOption option((Qt::Alignment)int(hAlign | vAlign));
if (wrap)
option.setWrapMode(QTextOption::WordWrap);
@@ -622,8 +620,7 @@ QSize QFxTextPrivate::setupTextLayout(QTextLayout *layout)
Q_Q(QFxText);
layout->setCacheEnabled(true);
- QFont f; if (_font) f = _font->font();
- QFontMetrics fm = QFontMetrics(f);
+ QFontMetrics fm = QFontMetrics(font);
int height = 0;
qreal widthUsed = 0;
@@ -657,7 +654,6 @@ QSize QFxTextPrivate::setupTextLayout(QTextLayout *layout)
QPixmap QFxTextPrivate::wrappedTextImage(bool drawStyle)
{
//do layout
- QFont f; if (_font) f = _font->font();
QSize size = cachedLayoutSize;
int x = 0;
@@ -682,7 +678,7 @@ QPixmap QFxTextPrivate::wrappedTextImage(bool drawStyle)
}
else
p.setPen(color);
- p.setFont(f);
+ p.setFont(font);
layout.draw(&p, QPointF(0, 0));
return img;
}
diff --git a/src/declarative/fx/qfxtext.h b/src/declarative/fx/qfxtext.h
index 3665ac6..edf6031 100644
--- a/src/declarative/fx/qfxtext.h
+++ b/src/declarative/fx/qfxtext.h
@@ -43,8 +43,6 @@
#define QFXTEXT_H
#include <QtDeclarative/qfxitem.h>
-#include <QtDeclarative/qmlfont.h>
-
QT_BEGIN_HEADER
@@ -61,7 +59,7 @@ class Q_DECLARATIVE_EXPORT QFxText : public QFxItem
Q_ENUMS(TextFormat)
Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)
- Q_PROPERTY(QmlFont *font READ font CONSTANT)
+ Q_PROPERTY(QFont font READ font WRITE setFont)
Q_PROPERTY(QColor color READ color WRITE setColor)
Q_PROPERTY(TextStyle style READ style WRITE setStyle)
Q_PROPERTY(QColor styleColor READ styleColor WRITE setStyleColor)
@@ -93,7 +91,8 @@ public:
QString text() const;
void setText(const QString &);
- QmlFont *font();
+ QFont font() const;
+ void setFont(const QFont &font);
QColor color() const;
void setColor(const QColor &c);
@@ -129,10 +128,6 @@ Q_SIGNALS:
void textChanged(const QString &text);
void linkActivated(const QString &link);
-private Q_SLOTS:
- //### should be in QFxTextPrivate?
- void fontChanged();
-
protected:
QFxText(QFxTextPrivate &dd, QFxItem *parent);
void mousePressEvent(QGraphicsSceneMouseEvent *event);
diff --git a/src/declarative/fx/qfxtext_p.h b/src/declarative/fx/qfxtext_p.h
index bbb54a3..95b566c 100644
--- a/src/declarative/fx/qfxtext_p.h
+++ b/src/declarative/fx/qfxtext_p.h
@@ -69,22 +69,13 @@ class QFxTextPrivate : public QFxItemPrivate
Q_DECLARE_PUBLIC(QFxText)
public:
QFxTextPrivate()
- : _font(0), color((QRgb)0), style(QFxText::Normal), imgDirty(true),
+ : color((QRgb)0), style(QFxText::Normal), imgDirty(true),
hAlign(QFxText::AlignLeft), vAlign(QFxText::AlignTop), elideMode(Qt::ElideNone),
dirty(false), wrap(false), richText(false), singleline(false), control(0), doc(0),
format(QFxText::AutoText)
{
}
- ~QFxTextPrivate()
- {
- delete _font;
- }
-
- void init()
- {
- }
-
void updateSize();
void checkImgCache();
@@ -96,17 +87,7 @@ public:
QSize setupTextLayout(QTextLayout *layout);
QString text;
- QmlFont *font()
- {
- if (!_font) {
- Q_Q(QFxText);
- _font = new QmlFont;
- QObject::connect(_font, SIGNAL(updated()), q, SLOT(fontChanged()));
- }
- return _font;
- }
-
- QmlFont *_font;
+ QFont font;
QColor color;
QFxText::TextStyle style;
QColor styleColor;
diff --git a/src/declarative/fx/qfxtextedit.cpp b/src/declarative/fx/qfxtextedit.cpp
index 3013ac2..628d49b 100644
--- a/src/declarative/fx/qfxtextedit.cpp
+++ b/src/declarative/fx/qfxtextedit.cpp
@@ -242,10 +242,25 @@ void QFxTextEdit::setTextFormat(TextFormat format)
\brief the text edit's default font
*/
-QmlFont *QFxTextEdit::font()
+QFont QFxTextEdit::font() const
+{
+ Q_D(const QFxTextEdit);
+ return d->font;
+}
+
+void QFxTextEdit::setFont(const QFont &font)
{
Q_D(QFxTextEdit);
- return &(d->font);
+ d->font = font;
+
+ clearCache();
+ d->document->setDefaultFont(d->font);
+ if(d->cursor){
+ d->cursor->setHeight(QFontMetrics(d->font).height());
+ moveCursorDelegate();
+ }
+ updateSize();
+ update();
}
/*!
@@ -532,7 +547,7 @@ void QFxTextEdit::loadCursorDelegate()
d->control->setCursorWidth(0);
dirtyCache(cursorRect());
d->cursor->setParentItem(this);
- d->cursor->setHeight(QFontMetrics(d->font.font()).height());
+ d->cursor->setHeight(QFontMetrics(d->font).height());
moveCursorDelegate();
}else{
qWarning() << QLatin1String("Error loading cursor delegate for TextEdit:") + objectName();
@@ -885,6 +900,7 @@ void QFxTextEdit::keyReleaseEvent(QKeyEvent *event)
void QFxTextEdit::focusChanged(bool hasFocus)
{
setCursorVisible(hasFocus);
+ QFxItem::focusChanged(hasFocus);
}
/*!
@@ -979,22 +995,6 @@ void QFxTextEdit::drawContents(QPainter *painter, const QRect &bounds)
d->control->drawContents(painter, bounds);
}
-/*!
-This signal is emitted when the font of the item changes.
-*/
-void QFxTextEdit::fontChanged()
-{
- Q_D(QFxTextEdit);
- clearCache();
- d->document->setDefaultFont(d->font.font());
- if(d->cursor){
- d->cursor->setHeight(QFontMetrics(d->font.font()).height());
- moveCursorDelegate();
- }
- updateSize();
- emit update();
-}
-
void QFxTextEdit::updateImgCache(const QRectF &r)
{
dirtyCache(r.toRect());
@@ -1023,8 +1023,6 @@ void QFxTextEditPrivate::init()
q->setFlag(QGraphicsItem::ItemHasNoContents, false);
q->setFlag(QGraphicsItem::ItemAcceptsInputMethod);
- QObject::connect(&font, SIGNAL(updated()), q, SLOT(fontChanged()));
-
control = new QTextControl(q);
QObject::connect(control, SIGNAL(updateRequest(QRectF)), q, SLOT(updateImgCache(QRectF)));
@@ -1036,7 +1034,7 @@ void QFxTextEditPrivate::init()
QObject::connect(control, SIGNAL(cursorPositionChanged()), q, SIGNAL(cursorPositionChanged()));
document = control->document();
- document->setDefaultFont(font.font());
+ document->setDefaultFont(font);
document->setDocumentMargin(textMargin);
document->setUndoRedoEnabled(false); // flush undo buffer.
document->setUndoRedoEnabled(true);
@@ -1101,7 +1099,7 @@ void QFxTextEdit::updateSize()
{
Q_D(QFxTextEdit);
if (isComponentComplete()) {
- QFontMetrics fm = QFontMetrics(d->font.font());
+ QFontMetrics fm = QFontMetrics(d->font);
int dy = height();
// ### assumes that if the width is set, the text will fill to edges
// ### (unless wrap is false, then clipping will occur)
diff --git a/src/declarative/fx/qfxtextedit.h b/src/declarative/fx/qfxtextedit.h
index 132b474..f2f163b 100644
--- a/src/declarative/fx/qfxtextedit.h
+++ b/src/declarative/fx/qfxtextedit.h
@@ -71,7 +71,7 @@ class Q_DECLARATIVE_EXPORT QFxTextEdit : public QFxPaintedItem
Q_PROPERTY(QColor color READ color WRITE setColor)
Q_PROPERTY(QColor highlightColor READ highlightColor WRITE setHighlightColor)
Q_PROPERTY(QColor highlightedTextColor READ highlightedTextColor WRITE setHighlightedTextColor)
- Q_PROPERTY(QmlFont * font READ font)
+ Q_PROPERTY(QFont font READ font WRITE setFont)
Q_PROPERTY(HAlignment hAlign READ hAlign WRITE setHAlign)
Q_PROPERTY(VAlignment vAlign READ vAlign WRITE setVAlign)
Q_PROPERTY(bool wrap READ wrap WRITE setWrap)
@@ -114,8 +114,8 @@ public:
TextFormat textFormat() const;
void setTextFormat(TextFormat format);
- // leave in, have affect the default text
- QmlFont *font();
+ QFont font() const;
+ void setFont(const QFont &font);
QColor color() const;
void setColor(const QColor &c);
@@ -192,7 +192,6 @@ public Q_SLOTS:
void selectAll();
private Q_SLOTS:
- void fontChanged();
void updateImgCache(const QRectF &rect);
void q_textChanged();
void updateSelectionMarkers();
@@ -223,8 +222,6 @@ protected:
void drawContents(QPainter *, const QRect &);
private:
-
- friend class QmlFont;
Q_DISABLE_COPY(QFxTextEdit)
Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr, QFxTextEdit)
};
diff --git a/src/declarative/fx/qfxtextedit_p.h b/src/declarative/fx/qfxtextedit_p.h
index 45a8a60..fb757de 100644
--- a/src/declarative/fx/qfxtextedit_p.h
+++ b/src/declarative/fx/qfxtextedit_p.h
@@ -68,7 +68,7 @@ class QFxTextEditPrivate : public QFxPaintedItemPrivate
public:
QFxTextEditPrivate()
- : font(0), color("black"), imgDirty(true), hAlign(QFxTextEdit::AlignLeft), vAlign(QFxTextEdit::AlignTop),
+ : color("black"), imgDirty(true), hAlign(QFxTextEdit::AlignLeft), vAlign(QFxTextEdit::AlignTop),
dirty(false), wrap(false), richText(false), cursorVisible(false), focusOnPress(false),
preserveSelection(true), textMargin(0.0), lastSelectionStart(0), lastSelectionEnd(0),
cursorComponent(0), cursor(0), format(QFxTextEdit::AutoText), document(0)
@@ -82,7 +82,7 @@ public:
void updateSelection();
QString text;
- QmlFont font;
+ QFont font;
QColor color;
QColor highlightColor;
QColor highlightedTextColor;
diff --git a/src/declarative/fx/qfxwebview.cpp b/src/declarative/fx/qfxwebview.cpp
index 868e009..a7d233f 100644
--- a/src/declarative/fx/qfxwebview.cpp
+++ b/src/declarative/fx/qfxwebview.cpp
@@ -410,6 +410,13 @@ QVariant QFxWebView::evaluateJavaScript(const QString &scriptSource)
return this->page()->mainFrame()->evaluateJavaScript(scriptSource);
}
+void QFxWebView::focusChanged(bool hasFocus)
+{
+ QFocusEvent e(hasFocus ? QEvent::FocusIn : QEvent::FocusOut);
+ page()->event(&e);
+ QFxItem::focusChanged(hasFocus);
+}
+
void QFxWebView::expandToWebPage()
{
Q_D(QFxWebView);
@@ -655,6 +662,7 @@ void QFxWebView::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QFxWebView);
if (d->interactive) {
+ setFocus (true);
QMouseEvent *me = sceneMouseEventToMouseEvent(event);
if (d->lastPress) delete d->lastPress;
d->lastPress = me;
@@ -662,7 +670,7 @@ void QFxWebView::mousePressEvent(QGraphicsSceneMouseEvent *event)
event->setAccepted(
/*
It is not correct to send the press event upwards, if it is not accepted by WebKit
- e.g. push button does not work, if done so as QGraohucsScene will not send the release event at all to WebKit
+ e.g. push button does not work, if done so as QGraphicsScene will not send the release event at all to WebKit
Might be a bug in WebKit, though
*/
#if 1 //QT_VERSION <= 0x040500 // XXX see bug 230835
diff --git a/src/declarative/fx/qfxwebview.h b/src/declarative/fx/qfxwebview.h
index ef5a395..d619e94 100644
--- a/src/declarative/fx/qfxwebview.h
+++ b/src/declarative/fx/qfxwebview.h
@@ -212,6 +212,7 @@ protected:
void timerEvent(QTimerEvent *event);
virtual void geometryChanged(const QRectF &newGeometry,
const QRectF &oldGeometry);
+ virtual void focusChanged(bool);
private:
void init();
diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp
index 75ed94b..caf78e8 100644
--- a/src/declarative/qml/qmlcompiler.cpp
+++ b/src/declarative/qml/qmlcompiler.cpp
@@ -194,7 +194,7 @@ bool QmlCompiler::testLiteralAssignment(const QMetaProperty &prop,
QString string = v->value.asScript();
if (!prop.isWritable())
- COMPILE_EXCEPTION(v, "Invalid property assignment: read-only property");
+ COMPILE_EXCEPTION(v, "Invalid property assignment:" << QLatin1String(prop.name()) << "is a read-only property");
if (prop.isEnumType()) {
int value;
@@ -1490,7 +1490,7 @@ bool QmlCompiler::buildValueTypeProperty(QObject *type,
foreach (Property *prop, obj->properties) {
int idx = type->metaObject()->indexOfProperty(prop->name.constData());
if (idx == -1)
- COMPILE_EXCEPTION(prop, "Cannot assign to non-existant property");
+ COMPILE_EXCEPTION(prop, "Cannot assign to non-existant property" << prop->name);
QMetaProperty p = type->metaObject()->property(idx);
prop->index = idx;
prop->type = p.userType();
@@ -2042,7 +2042,7 @@ bool QmlCompiler::buildBinding(QmlParser::Value *value,
QMetaProperty mp = prop->parent->metaObject()->property(prop->index);
if (!mp.isWritable() && !QmlMetaType::isList(prop->type))
- COMPILE_EXCEPTION(prop, "Invalid property assignment: read-only property");
+ COMPILE_EXCEPTION(prop, "Invalid property assignment:" << QString::fromLatin1(prop->name) << "is a read-only property");
BindingReference reference;
reference.expression = value->value;
diff --git a/src/declarative/util/qmlfont.cpp b/src/declarative/util/qmlfont.cpp
deleted file mode 100644
index 06e8769..0000000
--- a/src/declarative/util/qmlfont.cpp
+++ /dev/null
@@ -1,148 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "private/qobject_p.h"
-#include "qfont.h"
-#include "qmlfont.h"
-
-QT_BEGIN_NAMESPACE
-
-class QmlFontPrivate : public QObjectPrivate
-{
-public:
- QFont font;
-};
-
-QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Font,QmlFont)
-
-/*!
- \internal
- \class QmlFont
- \ingroup group_utility
- \brief The QmlFont class provides a font used for drawing text on a QFxView.
-*/
-QmlFont::QmlFont(QObject *parent)
- : QObject(*(new QmlFontPrivate), parent)
-{
-}
-
-QmlFont::~QmlFont()
-{
-}
-
-/*!
- \property QmlFont::family
- \brief the family of the font.
-*/
-QString QmlFont::family() const
-{
- Q_D(const QmlFont);
- return d->font.family();
-}
-
-void QmlFont::setFamily(const QString &family)
-{
- Q_D(QmlFont);
- d->font.setFamily(family);
- emit updated();
-}
-
-/*!
- \property QmlFont::bold
- \brief whether the font should be bold.
-*/
-bool QmlFont::bold() const
-{
- Q_D(const QmlFont);
- return d->font.bold();
-}
-
-void QmlFont::setBold(bool b)
-{
- Q_D(QmlFont);
- d->font.setBold(b);
- emit updated();
-}
-
-/*!
- \property QmlFont::italic
- \brief whether the font should be italic.
-*/
-bool QmlFont::italic() const
-{
- Q_D(const QmlFont);
- return d->font.italic();
-}
-
-void QmlFont::setItalic(bool b)
-{
- Q_D(QmlFont);
- d->font.setItalic(b);
- emit updated();
-}
-
-/*!
- \property QmlFont::size
- \brief the size of the font in points.
-*/
-qreal QmlFont::size() const
-{
- Q_D(const QmlFont);
- return d->font.pointSizeF();
-}
-
-void QmlFont::setSize(qreal size)
-{
- Q_D(QmlFont);
- d->font.setPointSizeF(size);
- emit updated();
-}
-
-/*!
- \brief Returns a QFont representation of the font.
-*/
-QFont QmlFont::font() const
-{
- Q_D(const QmlFont);
- return d->font;
-}
-
-QT_END_NAMESPACE
diff --git a/src/declarative/util/qmlfont.h b/src/declarative/util/qmlfont.h
deleted file mode 100644
index e85b8d3..0000000
--- a/src/declarative/util/qmlfont.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QMLFONT_H
-#define QMLFONT_H
-
-#include <QtCore/qobject.h>
-#include <QtDeclarative/qml.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
-
-class QmlFontPrivate;
-class Q_DECLARATIVE_EXPORT QmlFont : public QObject
-{
- Q_OBJECT
- Q_DECLARE_PRIVATE(QmlFont)
-
- Q_PROPERTY(QString family READ family WRITE setFamily)
- Q_PROPERTY(bool bold READ bold WRITE setBold)
- Q_PROPERTY(bool italic READ italic WRITE setItalic)
- Q_PROPERTY(qreal size READ size WRITE setSize)
-
-public:
- QmlFont(QObject *parent=0);
- ~QmlFont();
-
- QString family() const;
- void setFamily(const QString &);
-
- bool bold() const;
- void setBold(bool b);
-
- bool italic() const;
- void setItalic(bool b);
-
- qreal size() const;
- void setSize(qreal size);
-
- QFont font() const;
-
-Q_SIGNALS:
- void updated();
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QmlFont)
-
-QT_END_HEADER
-
-#endif // QMLFONT_H
diff --git a/src/declarative/util/qmlsetproperties.cpp b/src/declarative/util/qmlsetproperties.cpp
index 482405c..a08f4ba 100644
--- a/src/declarative/util/qmlsetproperties.cpp
+++ b/src/declarative/util/qmlsetproperties.cpp
@@ -48,6 +48,7 @@
#include <private/qmlparser_p.h>
#include <QtDeclarative/qmlexpression.h>
#include <QtDeclarative/qmlbinding.h>
+#include <QtDeclarative/qmlcontext.h>
QT_BEGIN_NAMESPACE
@@ -314,6 +315,11 @@ QmlSetProperties::ActionList QmlSetProperties::actions()
if (a.property.isValid()) {
a.restore = restoreEntryValues();
+
+ if (a.property.propertyType() == QVariant::Url &&
+ (a.toValue.type() == QVariant::String || a.toValue.type() == QVariant::ByteArray) && !a.toValue.isNull())
+ a.toValue.setValue(qmlContext(this)->resolvedUrl(QUrl(a.toValue.toString()))); //### d->object's context?
+
list << a;
}
}
diff --git a/src/declarative/util/qmlstate.h b/src/declarative/util/qmlstate.h
index 46659c6..1b35295 100644
--- a/src/declarative/util/qmlstate.h
+++ b/src/declarative/util/qmlstate.h
@@ -118,7 +118,6 @@ protected:
typedef QmlStateOperation::ActionList QmlStateActions;
class QmlTransition;
-class QmlTransitionPrivate;
class QmlStatePrivate;
class Q_DECLARATIVE_EXPORT QmlState : public QObject
{
@@ -161,7 +160,6 @@ Q_SIGNALS:
private:
Q_DECLARE_PRIVATE(QmlState)
Q_DISABLE_COPY(QmlState)
- friend class QmlTransitionPrivate;
};
QT_END_NAMESPACE
diff --git a/src/declarative/util/qmltransition.cpp b/src/declarative/util/qmltransition.cpp
index eb8bf53..a9b8cb3 100644
--- a/src/declarative/util/qmltransition.cpp
+++ b/src/declarative/util/qmltransition.cpp
@@ -128,7 +128,9 @@ void ParallelAnimationWrapper::updateState(QAbstractAnimation::State oldState, Q
{
QParallelAnimationGroup::updateState(oldState, newState);
//XXX not 100% guaranteed to be at end (if there are many zero duration animations at the end)?
- if (newState == Stopped && currentTime() == duration())
+ if (newState == Stopped &&
+ ((direction() == QAbstractAnimation::Forward && currentTime() == duration()) ||
+ (direction() == QAbstractAnimation::Backward && currentTime() == 0)))
{
trans->complete();
}
diff --git a/src/declarative/util/util.pri b/src/declarative/util/util.pri
index 59e3695..9374f00 100644
--- a/src/declarative/util/util.pri
+++ b/src/declarative/util/util.pri
@@ -6,7 +6,6 @@ SOURCES += \
util/qmlpackage.cpp \
util/qmlscript.cpp \
util/qmlanimation.cpp \
- util/qmlfont.cpp \
util/qmlpalette.cpp \
util/qmlfollow.cpp \
util/qmlstate.cpp\
@@ -32,7 +31,6 @@ HEADERS += \
util/qmlscript.h \
util/qmlanimation.h \
util/qmlanimation_p.h \
- util/qmlfont.h \
util/qmlpalette.h \
util/qmlfollow.h \
util/qmlstate.h\
diff --git a/tools/qmldebugger/engine.cpp b/tools/qmldebugger/engine.cpp
index 229cd3f..1f4bcc2 100644
--- a/tools/qmldebugger/engine.cpp
+++ b/tools/qmldebugger/engine.cpp
@@ -6,6 +6,7 @@
#include <QLineEdit>
#include <QTreeWidget>
#include <QTableWidget>
+#include <QFile>
#include <private/qmlenginedebug_p.h>
#include <QtDeclarative/qmlcomponent.h>
#include <QtDeclarative/qfxitem.h>
@@ -38,10 +39,14 @@ EnginePane::EnginePane(QmlDebugConnection *client, QWidget *parent)
setLayout(layout);
+ QFile enginesFile(":/engines.qml");
+ enginesFile.open(QFile::ReadOnly);
+ Q_ASSERT(enginesFile.isOpen());
+
m_engineView = new QFxView(this);
m_engineView->rootContext()->setContextProperty("engines", qVariantFromValue(&m_engineItems));
m_engineView->setContentResizable(true);
- m_engineView->setUrl(QUrl::fromLocalFile("engines.qml"));
+ m_engineView->setQml(enginesFile.readAll());
m_engineView->execute();
m_engineView->setFixedHeight(100);
QObject::connect(m_engineView->root(), SIGNAL(engineClicked(int)),
@@ -136,6 +141,8 @@ void EnginePane::queryContext(int id)
void EnginePane::contextChanged()
{
dump(m_context->rootContext(), 0);
+ foreach (const QmlDebugObjectReference &object, m_context->rootContext().objects())
+ fetchObject(object.debugId());
delete m_context; m_context = 0;
}
@@ -166,12 +173,19 @@ void EnginePane::dump(const QmlDebugObjectReference &obj, int ind)
void EnginePane::buildTree(const QmlDebugObjectReference &obj, QTreeWidgetItem *parent)
{
+ if (!parent)
+ m_objTree->clear();
+ m_objTree->expandAll();
+
QTreeWidgetItem *item = parent ? new QTreeWidgetItem(parent) : new QTreeWidgetItem(m_objTree);
item->setText(0, obj.className());
item->setData(0, Qt::UserRole, obj.debugId());
for (int ii = 0; ii < obj.children().count(); ++ii)
buildTree(obj.children().at(ii), item);
+
+ if (!parent)
+ m_objTree->expandAll();
}
void EnginePane::queryEngines()
diff --git a/tools/qmldebugger/engines.qml b/tools/qmldebugger/engines.qml
index eedba08..9a96c4b 100644
--- a/tools/qmldebugger/engines.qml
+++ b/tools/qmldebugger/engines.qml
@@ -6,15 +6,15 @@ Item {
signal engineClicked(int id)
signal refreshEngines()
- HorizontalLayout {
+ HorizontalPositioner {
anchors.fill: parent
Repeater {
dataSource: engines
Item {
- width: 100; height: 100;
+ width: 100; height: 100;
Image {
id: Image;
- source: "engine.png"
+ source: "qrc:/engine.png"
anchors.horizontalCenter: parent.horizontalCenter
}
Text {
@@ -33,7 +33,7 @@ Item {
Image {
y: 15
- source: "refresh.png";
+ source: "qrc:/refresh.png";
width: 75;
height: 63;
smooth: true
diff --git a/tools/qmldebugger/qmldebugger.pro b/tools/qmldebugger/qmldebugger.pro
index 532fd2a..3935351 100644
--- a/tools/qmldebugger/qmldebugger.pro
+++ b/tools/qmldebugger/qmldebugger.pro
@@ -5,6 +5,9 @@ contains(QT_CONFIG, opengles2)|contains(QT_CONFIG, opengles1): QT += opengl
# Input
HEADERS += canvasframerate.h engine.h
SOURCES += main.cpp canvasframerate.cpp engine.cpp
+RESOURCES += qmldebugger.qrc
+
+OTHER_FILES += engines.qml
target.path=$$[QT_INSTALL_BINS]
INSTALLS += target
diff --git a/tools/qmldebugger/qmldebugger.qrc b/tools/qmldebugger/qmldebugger.qrc
new file mode 100644
index 0000000..cb53ad5
--- /dev/null
+++ b/tools/qmldebugger/qmldebugger.qrc
@@ -0,0 +1,7 @@
+<RCC>
+ <qresource prefix="/">
+ <file>engines.qml</file>
+ <file>engine.png</file>
+ <file>refresh.png</file>
+ </qresource>
+</RCC>
diff --git a/tools/qmlviewer/qmlviewer.pro b/tools/qmlviewer/qmlviewer.pro
index 8b9a768..bcf361e 100644
--- a/tools/qmlviewer/qmlviewer.pro
+++ b/tools/qmlviewer/qmlviewer.pro
@@ -18,3 +18,11 @@ FORMS = recopts.ui \
include($$QT_SOURCE_TREE/tools/shared/deviceskin/deviceskin.pri)
target.path = $$[QT_INSTALL_BINS]
INSTALLS += target
+
+wince* {
+QT += scripttools \
+ xml \
+ xmlpatterns \
+ webkit \
+ phonon
+}