summaryrefslogtreecommitdiffstats
path: root/src/declarative/fx
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/fx')
-rw-r--r--src/declarative/fx/qfxanchors.cpp4
-rw-r--r--src/declarative/fx/qfxanimatedimageitem.cpp4
-rw-r--r--src/declarative/fx/qfxblurfilter.cpp35
-rw-r--r--src/declarative/fx/qfxcomponentinstance.cpp6
-rw-r--r--src/declarative/fx/qfxcontentwrapper.cpp41
-rw-r--r--src/declarative/fx/qfxevents.cpp33
-rw-r--r--src/declarative/fx/qfxflickable.cpp2
-rw-r--r--src/declarative/fx/qfxflipable.cpp58
-rw-r--r--src/declarative/fx/qfxfocuspanel.cpp4
-rw-r--r--src/declarative/fx/qfxfocusrealm.cpp2
-rw-r--r--src/declarative/fx/qfxgridview.cpp4
-rw-r--r--src/declarative/fx/qfxhighlightfilter.cpp32
-rw-r--r--src/declarative/fx/qfximage.cpp28
-rw-r--r--src/declarative/fx/qfxitem.cpp57
-rw-r--r--src/declarative/fx/qfxkeyactions.cpp34
-rw-r--r--src/declarative/fx/qfxkeyproxy.cpp4
-rw-r--r--src/declarative/fx/qfxwebview.cpp52
17 files changed, 229 insertions, 171 deletions
diff --git a/src/declarative/fx/qfxanchors.cpp b/src/declarative/fx/qfxanchors.cpp
index f537da9..540e1cb 100644
--- a/src/declarative/fx/qfxanchors.cpp
+++ b/src/declarative/fx/qfxanchors.cpp
@@ -151,7 +151,7 @@ void QFxAnchors::fillChanged()
/*!
\property QFxAnchors::fill
- \brief what item the item should fill.
+ \brief which item the item should fill.
This is a convenience property. It is the same as anchoring the left, right, top, and bottom
to another item's left, right, top, and bottom.
@@ -200,7 +200,7 @@ void QFxAnchors::setFill(QFxItem *f)
/*!
\property QFxAnchors::centeredIn
- \brief what item the item should stay centered in the middle of.
+ \brief which item the item should stay centered in.
This is a convenience property. It is the same as anchoring the horizontalCenter
and verticalCenter to another item's horizontalCenter and verticalCenter.
diff --git a/src/declarative/fx/qfxanimatedimageitem.cpp b/src/declarative/fx/qfxanimatedimageitem.cpp
index 5a495e9..7a1cb7f 100644
--- a/src/declarative/fx/qfxanimatedimageitem.cpp
+++ b/src/declarative/fx/qfxanimatedimageitem.cpp
@@ -66,7 +66,7 @@ QT_BEGIN_NAMESPACE
\row
\o \image animatedimageitem.gif
\o
- \code
+ \qml
Item {
width: anim.width; height: anim.height+8
AnimatedImage { id: anim; source: "pics/games-anim.gif" }
@@ -74,7 +74,7 @@ Item {
x: (anim.width-width)*anim.currentFrame/(anim.frameCount-1)
}
}
- \endcode
+ \endqml
\endtable
*/
QML_DEFINE_TYPE(QFxAnimatedImageItem, AnimatedImage);
diff --git a/src/declarative/fx/qfxblurfilter.cpp b/src/declarative/fx/qfxblurfilter.cpp
index ad3eebc..2bad18c 100644
--- a/src/declarative/fx/qfxblurfilter.cpp
+++ b/src/declarative/fx/qfxblurfilter.cpp
@@ -64,25 +64,28 @@ public:
\brief The Blur filter blurs an item and its contents.
\inherits Filter
- Blurring reduces the clarity of a visual element. The following example
+ Blurring reduces the clarity of a visual item. The following example
shows an icon at a blur radius of 0, 5 and 10.
\table
\row
\o
- \code
- <HorizontalLayout>
- <Image src="icon.png">
- <filter><Blur radius="0" /></filter>
- </Image>
- <Image src="icon.png">
- <filter><Blur radius="5" /></filter>
- </Image>
- <Image src="icon.png">
- <filter><Blur radius="10" /></filter>
- </Image>
- </HorizontalLayout>
- \endcode
+ \qml
+HorizontalLayout {
+ Image {
+ src: "icon.png"
+ filter: Blur { radius: 0 }
+ }
+ Image {
+ src: "icon.png"
+ filter: Blur { radius: 5 }
+ }
+ Image {
+ src: "icon.png"
+ filter: Blur { radius: 10 }
+ }
+}
+ \endqml
\row
\o \image blur_example.png
\endtable
@@ -110,7 +113,9 @@ QFxBlurFilter::~QFxBlurFilter()
/*!
\qmlproperty real Blur::radius
- Sets the blur kernel radius. The larger the radius the more blurry the item will appear. A radius of 0 (or less) is equivalent to no blur.
+ Sets the blur kernel radius.
+ The larger the radius the more blurry the item will appear.
+ A radius of 0 (or less) is equivalent to no blur.
*/
/*!
diff --git a/src/declarative/fx/qfxcomponentinstance.cpp b/src/declarative/fx/qfxcomponentinstance.cpp
index 5fb5466..9645e77 100644
--- a/src/declarative/fx/qfxcomponentinstance.cpp
+++ b/src/declarative/fx/qfxcomponentinstance.cpp
@@ -58,9 +58,9 @@ QML_DEFINE_TYPE(QFxComponentInstance,ComponentInstance);
/*!
\qmlclass ComponentInstance QFxComponentInstance
- \brief The ComponentInstance element allows you to instantiate a \l{qml-component.html} {Component}.
+ \brief The ComponentInstance item allows you to instantiate a \l{qml-component.html} {Component}.
- \code
+ \qml
Item {
Component {
id: RedSquare
@@ -69,7 +69,7 @@ QML_DEFINE_TYPE(QFxComponentInstance,ComponentInstance);
ComponentInstance { component: RedSquare }
}
- \endcode
+ \endqml
*/
QFxComponentInstance::QFxComponentInstance(QFxItem *parent)
: QFxItem(*(new QFxComponentInstancePrivate), parent)
diff --git a/src/declarative/fx/qfxcontentwrapper.cpp b/src/declarative/fx/qfxcontentwrapper.cpp
index a155d2b..2b95ff6 100644
--- a/src/declarative/fx/qfxcontentwrapper.cpp
+++ b/src/declarative/fx/qfxcontentwrapper.cpp
@@ -108,22 +108,31 @@ QML_DEFINE_TYPE(QFxContent,Content);
specified by Content.
Example:
- \code
- <!--GroupBox component definition-->
- <Rect width="{parent.width}" color="white" pen.width="2" pen.color="#adaeb0" radius="10" clip="false" height="{contents.height}">
- <VerticalLayout id="layout" width="{parent.width}">
- <Content/>
- </VerticalLayout>
- </Rect>
-
- <!--component use-->
- <GroupBox>
- <content>
- <Text text="First Item"/>
- ...
- </content>
- </GroupBox>
- \endcode
+ \qml
+// GroupBox component definition
+Rect {
+ width: parent.width
+ color: "white"
+ pen.width: 2
+ pen.color: "#adaeb0"
+ radius: 10
+ clip: false
+ height: contents.height
+ VerticalLayout {
+ id: layout
+ width: parent.width
+ Content { } // content property will go here
+ }
+}
+
+// component use
+GroupBox {
+ content: Text {
+ text: "First Item"
+ ...
+ }
+}
+ \endqml
*/
QT_END_NAMESPACE
diff --git a/src/declarative/fx/qfxevents.cpp b/src/declarative/fx/qfxevents.cpp
index 7d04f5d..195d1e5 100644
--- a/src/declarative/fx/qfxevents.cpp
+++ b/src/declarative/fx/qfxevents.cpp
@@ -44,17 +44,18 @@
QT_BEGIN_NAMESPACE
/*!
\qmlclass KeyEvent QFxKeyEvent
- \brief The KeyEvent element provides information about a key event.
+ \brief The KeyEvent object provides information about a key event.
For example, the following changes the Item's state property when the Enter
key is pressed:
- \code
- <Item focus="true">
- <onKeyPress>if (event.key == Qt.Key_Enter) state = 'ShowDetails';</onKeyPress>
- </Item>
- \endcode
-
- The \l KeyActions element could also be used to achieve the above with
+ \qml
+Item {
+ focus: true
+ onKeyPress: { if (event.key == Qt.Key_Enter) state = 'ShowDetails'; }
+}
+ \endqml
+
+ The \l KeyActions object could also be used to achieve the above with
a clearer syntax.
\sa KeyActions
@@ -106,7 +107,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmlclass MouseEvent QFxMouseEvent
- \brief The MouseEvent element provides information about a mouse event.
+ \brief The MouseEvent object provides information about a mouse event.
The position of the mouse can be found via the x and y properties.
The button that caused the event is available via the button property.
@@ -168,15 +169,11 @@ QT_BEGIN_NAMESPACE
\endlist
For example, to react to a Shift key + Left mouse button click:
- \code
- <MouseRegion>
- <onClick>
- <![CDATA[
- if (mouse.button == Qt.LeftButton && mouse.modifiers & Qt.ShiftModifier) doSomething();
- ]]>
- </onclick>
- </MouseRegion>
- \endcode
+ \qml
+MouseRegion {
+ onClick: { if (mouse.button == Qt.LeftButton && mouse.modifiers & Qt.ShiftModifier) doSomething(); }
+}
+ \endqml
*/
QML_DEFINE_NOCREATE_TYPE(QFxKeyEvent);
diff --git a/src/declarative/fx/qfxflickable.cpp b/src/declarative/fx/qfxflickable.cpp
index 17e44e1..52b142b 100644
--- a/src/declarative/fx/qfxflickable.cpp
+++ b/src/declarative/fx/qfxflickable.cpp
@@ -226,7 +226,7 @@ QML_DEFINE_TYPE(QFxFlickable,Flickable);
/*!
\qmlclass Flickable
- \brief The Flickable element provides a surface that can be "flicked".
+ \brief The Flickable item provides a surface that can be "flicked".
\inherits Item
Flickable places its children on a surface that can be dragged and flicked.
diff --git a/src/declarative/fx/qfxflipable.cpp b/src/declarative/fx/qfxflipable.cpp
index 81ed750..db390d2 100644
--- a/src/declarative/fx/qfxflipable.cpp
+++ b/src/declarative/fx/qfxflipable.cpp
@@ -64,34 +64,44 @@ public:
/*!
\qmlclass Flipable QFxFlipable
- \brief The Flipable element provides a surface that can be flipped.
+ \brief The Flipable item provides a surface that can be flipped.
\inherits Item
Flipable allows you to specify a front and a back and then flip between those sides.
- \code
- <Flipable id="flipable" width="40" height="40">
- <axis>
- <Axis startX="20" startY="0" endX="20" endY="40" />
- </axis>
- <front>
- <Image src="front.png"/>
- </front>
- <back>
- <Image src="back.png"/>
- </back>
- <states>
- <State name="back">
- <SetProperty target="{flipable}" property="rotation" value="180" />
- </State>
- </states>
- <transitions>
- <Transition>
- <NumericAnimation easing="easeInOutQuad" properties="rotation"/>
- </Transition>
- </transitions>
- </Flipable>
- \endcode
+ \qml
+Flipable {
+ id: flipable
+ width: 40
+ height: 40
+ axis: Axis {
+ startX: 20
+ startY: 0
+ endX: 20
+ endY: 40
+ }
+ front: Image { src: "front.png" }
+ back: Image { src: "back.png" }
+ states: [
+ State {
+ name: "back"
+ SetProperty {
+ target: flipable
+ property: "rotation"
+ value: 180
+ }
+ }
+ ]
+ transitions: [
+ Transition {
+ NumericAnimation {
+ easing: "easeInOutQuad"
+ properties: "rotation"
+ }
+ }
+ ]
+}
+ \endqml
\image flipable.gif
*/
diff --git a/src/declarative/fx/qfxfocuspanel.cpp b/src/declarative/fx/qfxfocuspanel.cpp
index 67c456e..5d62e66 100644
--- a/src/declarative/fx/qfxfocuspanel.cpp
+++ b/src/declarative/fx/qfxfocuspanel.cpp
@@ -47,7 +47,7 @@ QML_DEFINE_TYPE(QFxFocusPanel,FocusPanel);
/*!
\qmlclass FocusPanel
- \brief The FocusPanel element explicitly creates a focus panel.
+ \brief The FocusPanel object explicitly creates a focus panel.
\inherits Item
Focus panels assist in keyboard focus handling when building QML
@@ -73,7 +73,7 @@ QFxFocusPanel::~QFxFocusPanel()
/*!
\qmlproperty bool FocusPanel::active
- Sets whether the element is the active focus panel.
+ Sets whether the object is the active focus panel.
*/
bool QFxFocusPanel::isActive() const
diff --git a/src/declarative/fx/qfxfocusrealm.cpp b/src/declarative/fx/qfxfocusrealm.cpp
index da3f1b2..07849fa 100644
--- a/src/declarative/fx/qfxfocusrealm.cpp
+++ b/src/declarative/fx/qfxfocusrealm.cpp
@@ -47,7 +47,7 @@ QML_DEFINE_TYPE(QFxFocusRealm,FocusRealm);
/*!
\qmlclass FocusRealm
- \brief The FocusRealm element explicitly creates a focus realm.
+ \brief The FocusRealm object explicitly creates a focus realm.
\inherits Item
Focus realms assist in keyboard focus handling when building reusable QML
diff --git a/src/declarative/fx/qfxgridview.cpp b/src/declarative/fx/qfxgridview.cpp
index b8acea2..8416234 100644
--- a/src/declarative/fx/qfxgridview.cpp
+++ b/src/declarative/fx/qfxgridview.cpp
@@ -647,7 +647,7 @@ void QFxGridViewPrivate::updateCurrent(int modelIndex)
/*!
\qmlclass GridView
\inherits Flickable
- \brief The GridView element provides a grid view of items provided by a model.
+ \brief The GridView item provides a grid view of items provided by a model.
The model is typically provided by a QAbstractListModel "C++ model object",
but can also be created directly in QML.
@@ -706,7 +706,7 @@ QFxGridView::~QFxGridView()
The C++ model object must be a \l QListModelInterface subclass, a \l VisualModel,
or a simple list.
- Models can also be created directly in QML, using the \l ListModel element. For example:
+ Models can also be created directly in QML, using the \l ListModel object. For example:
\code
<ListModel id="contactModel">
<Contact>
diff --git a/src/declarative/fx/qfxhighlightfilter.cpp b/src/declarative/fx/qfxhighlightfilter.cpp
index 70b50cd..862a698 100644
--- a/src/declarative/fx/qfxhighlightfilter.cpp
+++ b/src/declarative/fx/qfxhighlightfilter.cpp
@@ -73,18 +73,24 @@ public:
\brief The Highlight filter adds a highlight to an item.
\inherits Filter
- \code
-<Text id="highlighttext" color="red" font.size="32" text="Highlight">
- <filter>
- <Highlight src="pics/highlight.png">
- <xOffset>
- <NumericAnimation running="true" repeat="true"
- from="320" to="-320" duration="2000"/>
- </xOffset>
- </Highlight>
- </filter>
-</Text>
- \endcode
+ \qml
+Text {
+ id: highlighttext
+ color: "red"
+ font.size: 32
+ text: "Highlight"
+ filter: Highlight {
+ source: "pics/highlight.png"
+ xOffset: NumericAnimation {
+ running: true
+ repeat: true
+ from: 320
+ to: -320
+ duration: 2000
+ }
+ }
+}
+ \endqml
\image highlight.gif
Highlighting is only supported when Qt Declarative is compiled for OpenGL ES 2.0.
@@ -114,7 +120,7 @@ QFxHighlightFilter::~QFxHighlightFilter()
}
/*!
- \qmlproperty string Highlight::src
+ \qmlproperty string Highlight::source
This property holds the URL of the image to be used as the highlight.
*/
diff --git a/src/declarative/fx/qfximage.cpp b/src/declarative/fx/qfximage.cpp
index 1361d68..53c6137 100644
--- a/src/declarative/fx/qfximage.cpp
+++ b/src/declarative/fx/qfximage.cpp
@@ -60,36 +60,38 @@ QML_DEFINE_TYPE(QFxImage,Image);
\brief The Image element allows you to add bitmaps to a scene.
\inherits Item
- The Image element supports untransformed, stretched, grid-scaled and tiled images. For an explanation of grid-scaling see the scaleGrid property description or the QFxScaleGrid class description.
+ The Image element supports untransformed, stretched, grid-scaled and tiled images.
+ For an explanation of grid-scaling see the scaleGrid property description
+ or the QFxScaleGrid class description.
Examples:
\table
\row
\o \image declarative-qtlogo1.png
\o Untransformed
- \code
+ \qml
Image { source: "pics/qtlogo.png" }
- \endcode
+ \endqml
\row
\o \image declarative-qtlogo2.png
\o Stretched
- \code
+ \qml
Image { width: 160; height: 160; source: "pics/qtlogo.png" }
- \endcode
+ \endqml
\row
\o \image declarative-qtlogo4.png
\o Grid-scaled
- \code
+ \qml
Image { scaleGrid.left: 20; scaleGrid.right: 10
scaleGrid.top: 14; scaleGrid.bottom: 14
width: 160; height: 160; source: "pics/qtlogo.png" }
- \endcode
+ \endqml
\row
\o \image declarative-qtlogo3.png
\o Tiled
- \code
+ \qml
Image { tile: true; width: 160; height: 160; source: "pics/qtlogo.png" }
- \endcode
+ \endqml
\endtable
*/
@@ -101,9 +103,9 @@ QML_DEFINE_TYPE(QFxImage,Image);
\ingroup group_coreitems
Example:
- \code
+ \qml
Image { source: "pics/star.png" }
- \endcode
+ \endqml
A QFxImage object can be instantiated in Qml using the tag \l Image.
*/
@@ -198,13 +200,13 @@ QFxScaleGrid *QFxImage::scaleGrid()
bitmap file to its size. If tiling is enabled, the bitmap is repeated as a set
of unscaled tiles, clipped to the size of the Image.
- \code
+ \qml
Item {
Image { source: "tile.png" }
Image { x: 80; width: 100; height: 100; src: "tile.png" }
Image { x: 190; width: 100; height: 100; tile: true; src: "tile.png" }
}
- \endcode
+ \endqml
\image declarative-image_tile.png
If both tiling and the scaleGrid are set, tiling takes precedence.
diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp
index 38b5713..53e198f 100644
--- a/src/declarative/fx/qfxitem.cpp
+++ b/src/declarative/fx/qfxitem.cpp
@@ -206,7 +206,7 @@ void QFxContents::setItem(QFxItem *item)
/*!
\qmlclass Item QFxItem
- \brief The Item element is the most basic of all visual canvas members.
+ \brief The Item is the most basic of all visual items in QML.
*/
/*!
@@ -214,19 +214,32 @@ void QFxContents::setItem(QFxItem *item)
\brief The QFxItem class is a generic QFxView item. It is the base class for all other view items.
\qmltext
- All visual elements in Qt Declarative inherit from QFxItem. Although QFxItem
+ All visual items in Qt Declarative inherit from QFxItem. Although QFxItem
has no visual appearance, it defines all the properties that are
- common across visual elements - like the x and y position, and the
+ common across visual items - like the x and y position, and the
width and height.
- QFxItem is also useful for grouping elements together.
+ QFxItem is also useful for grouping items together.
\qml
- <Item>
- <Image file="tile.png" />
- <Image x="80" width="100" height="100" file="tile.png" />
- <Image x="190" width="100" height="100" tile="true" file="tile.png" />
- </Item>
+ Item {
+ Image {
+ file: "tile.png"
+ }
+ Image {
+ x: 80
+ width: 100
+ height: 100
+ file: "tile.png"
+ }
+ Image {
+ x: 190
+ width: 100
+ height: 100
+ tile: true
+ file: "tile.png"
+ }
+ }
\endqml
\endqmltext
@@ -260,7 +273,7 @@ void QFxContents::setItem(QFxItem *item)
via the baselineOffset property.
The baseline corresponds to the baseline of the text contained in
- the element. It is useful for aligning the text in items placed
+ the item. It is useful for aligning the text in items placed
beside each other. The default baseline is positioned at
2/3 of the height of the item.
*/
@@ -335,7 +348,9 @@ void QFxContents::setItem(QFxItem *item)
The key event is available via the KeyEvent \a event.
\qml
- <Item onKeyPress="if (event.key == Qt.Key_Enter) state='Enter'"/>
+ Item {
+ onKeyPress: { if (event.key == Qt.Key_Enter) state='Enter' }
+ }
\endqml
*/
@@ -347,7 +362,9 @@ void QFxContents::setItem(QFxItem *item)
The key event is available in via the KeyEvent \a event.
\qml
- <Item onKeyRelease="if (event.key == Qt.Key_Enter) state='Enter'"/>
+ Item {
+ onKeyRelease: { if (event.key == Qt.Key_Enter) state='Enter' }
+ }
\endqml
*/
@@ -429,9 +446,13 @@ QFxItem::~QFxItem()
\image declarative-transformorigin.png
This example scales an image about its center.
- \code
- <Image src="myimage.png" transformOrigin="Center" scale="4" />
- \endcode
+ \qml
+ Image {
+ src: "myimage.png"
+ transformOrigin: "Center"
+ scale: 4
+ }
+ \endqml
The default transform origin is \c TopLeft.
*/
@@ -522,7 +543,7 @@ QFxItem *QFxItem::itemParent() const
\qmlproperty list<Item> Item::children
\qmlproperty list<Object> Item::resources
- The children property contains the list of visual children of this element.
+ The children property contains the list of visual children of this item.
The resources property contains non-visual resources that you want to
reference by name.
@@ -702,7 +723,7 @@ void QFxItemPrivate::children_clear()
\default
The data property is allows you to freely mix visual children and resources
- of an element. If you assign a visual element to the data list it becomes
+ of an item. If you assign a visual item to the data list it becomes
a child and if you assign any other object type, it is added as a resource.
So you can write:
@@ -1926,7 +1947,7 @@ void QFxItem::classComplete()
}
/*!
- componentComplete() is called when all elements in the component
+ componentComplete() is called when all items in the component
have been constructed. It is often desireable to delay some
processing until the component is complete an all bindings in the
component have been resolved.
diff --git a/src/declarative/fx/qfxkeyactions.cpp b/src/declarative/fx/qfxkeyactions.cpp
index 52a013a..a07f047 100644
--- a/src/declarative/fx/qfxkeyactions.cpp
+++ b/src/declarative/fx/qfxkeyactions.cpp
@@ -169,22 +169,22 @@ void QFxKeyActionsPrivate::setBit(int b, bool v)
/*!
\qmlclass KeyActions
- \brief The KeyActions element enables simple key handling.
+ \brief The KeyActions item enables simple key handling.
\inherits Item
KeyActions is typically used in basic key handling scenarios where writing
JavaScript key handling routines would be unnecessarily complicated. The
- KeyActions element has a collection of properties that correspond to a
- selection of common keys. When a given key is pressed, the element executes
+ KeyActions item has a collection of properties that correspond to a
+ selection of common keys. When a given key is pressed, the item executes
the action script assigned to the matching property. If no action has
- been set the KeyActions element does nothing.
+ been set the KeyActions item does nothing.
To receive (and susequently respond to) key presses, the KeyActions class
- must be in the current focus chain, just like any other element.
+ must be in the current focus chain, just like any other item.
For basic mouse handling, see \l MouseRegion.
- KeyActions is an invisible element: it is never painted.
+ KeyActions is an invisible item: it is never painted.
*/
QFxKeyActions::QFxKeyActions(QFxItem *parent)
: QFxItem(parent), d(new QFxKeyActionsPrivate)
@@ -221,7 +221,7 @@ void QFxKeyActionsPrivate::setKeyExpr(Qt::Key k, const QString &expr)
\qmlproperty bool KeyActions::enabled
Enables or disables KeyActions' key handling. When not enabled, the
- KeyActions instance does not respond to any key presses. The element is
+ KeyActions instance does not respond to any key presses. The item is
enabled by default.
*/
bool QFxKeyActions::enabled() const
@@ -244,9 +244,9 @@ void QFxKeyActions::setEnabled(bool e)
The action to take for the given letter.
The following example sets actions for the 'c' and 'x' keys.
- \code
+ \qml
KeyActions { keyC: "print('c is for cookie')"; keyX: "print('I like cookies')" }
- \endcode
+ \endqml
*/
QString QFxKeyActions::key_A() const
{
@@ -518,9 +518,9 @@ void QFxKeyActions::setKey_Z(const QString &s)
The action to take for the given arrow key.
The following example sets actions for the left and right arrow keys.
- \code
+ \qml
KeyActions { leftArrow: "print('You pressed left')"; rightArrow: "print('You pressed right')" }
- \endcode
+ \endqml
*/
QString QFxKeyActions::key_Left() const
@@ -569,9 +569,9 @@ void QFxKeyActions::setKey_Down(const QString &s)
The action to take for the given number key.
The following example sets actions for the '5' and '6' keys.
- \code
+ \qml
KeyActions { digit5: "print('5 is a prime number')"; digit6: "print('6 is a composite number')"; focus: true }
- \endcode
+ \endqml
*/
QString QFxKeyActions::key_0() const
@@ -744,9 +744,9 @@ void QFxKeyActions::setKey_Space(const QString &s)
The action to take for the given utility key.
The following example sets an action for the space key.
- \code
+ \qml
KeyActions { space: "print('Space pressed')" }
- \endcode
+ \endqml
*/
/*!
@@ -765,9 +765,9 @@ void QFxKeyActions::setKey_Space(const QString &s)
The action to take for the given device key.
The following example sets an action for the hangup key.
- \code
+ \qml
KeyActions { hangup: "print('Go away now')" }
- \endcode
+ \endqml
*/
QString QFxKeyActions::key_Back() const
diff --git a/src/declarative/fx/qfxkeyproxy.cpp b/src/declarative/fx/qfxkeyproxy.cpp
index 6d92441..6d9c6ab 100644
--- a/src/declarative/fx/qfxkeyproxy.cpp
+++ b/src/declarative/fx/qfxkeyproxy.cpp
@@ -47,7 +47,7 @@ QML_DEFINE_TYPE(QFxKeyProxy,KeyProxy);
/*!
\qmlclass KeyProxy
- \brief The KeyProxy element proxies key presses to a number of other elements.
+ \brief The KeyProxy item proxies key presses to a number of other items.
\inherits Item
*/
@@ -55,7 +55,7 @@ QML_DEFINE_TYPE(QFxKeyProxy,KeyProxy);
/*!
\internal
\class QFxKeyProxy
- \brief The QFxKeyProxy class proxies key presses to a number of other elements.
+ \brief The QFxKeyProxy class proxies key presses to a number of other items.
\ingroup group_utility
*/
diff --git a/src/declarative/fx/qfxwebview.cpp b/src/declarative/fx/qfxwebview.cpp
index eb2f7d2..dac8ced 100644
--- a/src/declarative/fx/qfxwebview.cpp
+++ b/src/declarative/fx/qfxwebview.cpp
@@ -106,8 +106,6 @@ class QFxWebSettings : public QObject {
Q_PROPERTY(bool offlineWebApplicationCacheEnabled READ offlineWebApplicationCacheEnabled WRITE setOfflineWebApplicationCacheEnabled)
Q_PROPERTY(bool localStorageDatabaseEnabled READ localStorageDatabaseEnabled WRITE setLocalStorageDatabaseEnabled)
- Q_PROPERTY(QString userStyleSheetUrl READ userStyleSheetUrl WRITE setUserStyleSheetUrl)
-
public:
QFxWebSettings() {}
@@ -140,9 +138,6 @@ public:
bool localStorageDatabaseEnabled() const { return s->testAttribute(QWebSettings::LocalStorageDatabaseEnabled); }
void setLocalStorageDatabaseEnabled(bool on) { s->setAttribute(QWebSettings::LocalStorageDatabaseEnabled, on); }
- QString userStyleSheetUrl() const { return s->userStyleSheetUrl(); }
- void setUserStyleSheetUrl(const QString& url) { s->setUserStyleSheetUrl(url); }
-
QWebSettings *s;
};
@@ -209,12 +204,12 @@ public:
/*!
\qmlclass WebView
- \brief The WebView element allows you to add web content to a canvas.
+ \brief The WebView item allows you to add web content to a canvas.
\inherits Item
A WebView renders web content based on a URL.
- If the width and height of the element is not set, they will
+ If the width and height of the item is not set, they will
dynamically adjust to a size appropriate for the content.
This width may be large (eg. 980) for typical online web pages.
@@ -225,7 +220,7 @@ public:
Due to WebKit limitations, the height may be more than necessary
if the idealHeight is changed after the content is loaded.
- \code
+ \qml
WebView {
url: "http://www.nokia.com"
width: 490
@@ -233,11 +228,11 @@ public:
scale: 0.5
smooth: true
}
- \endcode
+ \endqml
\image webview.png
- The element includes no scrolling, scaling,
+ The item includes no scrolling, scaling,
toolbars, etc., those must be implemented around WebView. See the WebBrowser example
for a demonstration of this.
*/
@@ -251,7 +246,7 @@ public:
\image webview.png
- The element includes no scrolling, scaling,
+ The item includes no scrolling, scaling,
toolbars, etc., those must be implemented around WebView. See the WebBrowser example
for a demonstration of this.
@@ -939,7 +934,7 @@ QWebPage *QFxWebView::page() const
QFxWebView *self = const_cast<QFxWebView*>(this);
QWebPage *wp = new QFxWebPage(self);
- // QML elements don't default to having a background,
+ // QML items don't default to having a background,
// even though most we pages will set one anyway.
QPalette pal = QApplication::palette();
pal.setBrush(QPalette::Base, QColor::fromRgbF(0, 0, 0, 0));
@@ -955,21 +950,34 @@ QWebPage *QFxWebView::page() const
return d->page;
}
+
// The QObject interface to settings().
/*!
- \qmlproperty QWebSettings WebView::settings
-
- This property gives access to the settings controlling the web view.
+ \qmlproperty bool WebView::settings::autoLoadImages
+ \qmlproperty bool WebView::settings::javascriptEnabled
+ \qmlproperty bool WebView::settings::javaEnabled
+ \qmlproperty bool WebView::settings::pluginsEnabled
+ \qmlproperty bool WebView::settings::privateBrowsingEnabled
+ \qmlproperty bool WebView::settings::javascriptCanOpenWindows
+ \qmlproperty bool WebView::settings::javascriptCanAccessClipboard
+ \qmlproperty bool WebView::settings::developerExtrasEnabled
+ \qmlproperty bool WebView::settings::linksIncludedInFocusChain
+ \qmlproperty bool WebView::settings::zoomTextOnly
+ \qmlproperty bool WebView::settings::printElementBackgrounds
+ \qmlproperty bool WebView::settings::offlineStorageDatabaseEnabled
+ \qmlproperty bool WebView::settings::offlineWebApplicationCacheEnabled
+ \qmlproperty bool WebView::settings::localStorageDatabaseEnabled
+
+ These properties give access to the settings controlling the web view.
See QWebSettings for the list of sub-properties.
- \code
+ \qml
WebView {
settings.pluginsEnabled: true
- settings.userStyleSheetUrl: "mystyle.css"
...
}
- \endcode
+ \endqml
*/
QObject *QFxWebView::settingsObject() const
{
@@ -1026,11 +1034,11 @@ QString QFxWebView::html() const
The html property can be set as a string.
- \code
+ \qml
WebView {
html: "<p>This is <b>HTML</b>."
}
- \endcode
+ \endqml
*/
void QFxWebView::setHtml(const QString &html, const QUrl &baseUrl)
{
@@ -1039,7 +1047,7 @@ void QFxWebView::setHtml(const QString &html, const QUrl &baseUrl)
d->idealwidth>0 ? d->idealwidth : width(),
d->idealheight>0 ? d->idealheight : height()));
if (isComponentComplete())
- page()->mainFrame()->setHtml(html, baseUrl);
+ page()->mainFrame()->setHtml(html, qmlContext(this)->resolvedUrl(baseUrl));
else {
d->pending = d->PendingHtml;
d->pending_url = baseUrl;
@@ -1055,7 +1063,7 @@ void QFxWebView::setContent(const QByteArray &data, const QString &mimeType, con
d->idealheight>0 ? d->idealheight : height()));
if (isComponentComplete())
- page()->mainFrame()->setContent(data,mimeType,baseUrl);
+ page()->mainFrame()->setContent(data,mimeType,qmlContext(this)->resolvedUrl(baseUrl));
else {
d->pending = d->PendingContent;
d->pending_url = baseUrl;