Qml: MouseRegion got renamed to MouseArea

Reviewed-by: Christian Kamm
This commit is contained in:
Kai Koehne
2010-03-05 10:19:38 +01:00
parent 5c568a68d3
commit f20c2095c4
15 changed files with 58 additions and 58 deletions

View File

@@ -76150,14 +76150,14 @@
<contents name="qt-for-embedded-linux" title="Qt for Embedded Linux" level="1"/> <contents name="qt-for-embedded-linux" title="Qt for Embedded Linux" level="1"/>
</page> </page>
<function access="public" threadsafety="unspecified" status="commendable" name="QWIDGETSIZE_MAX" href="qwidget.html#QWIDGETSIZE_MAX" location="qwidget.cpp" virtual="non" meta="macrowithoutparams" const="false" static="false" overload="false" relates="QWidget" type="" signature="QWIDGETSIZE_MAX()"/> <function access="public" threadsafety="unspecified" status="commendable" name="QWIDGETSIZE_MAX" href="qwidget.html#QWIDGETSIZE_MAX" location="qwidget.cpp" virtual="non" meta="macrowithoutparams" const="false" static="false" overload="false" relates="QWidget" type="" signature="QWIDGETSIZE_MAX()"/>
<page access="public" status="commendable" name="MouseRegion" href="qml-mouseregion.html" title="QML MouseRegion Element Reference" fulltitle="QML MouseRegion Element Reference" subtitle="" location="qfxmouseregion.cpp"> <page access="public" status="commendable" name="MouseArea" href="qml-mousearea.html" title="QML MouseArea Element Reference" fulltitle="QML MouseArea Element Reference" subtitle="" location="qfxmousearea.cpp">
<page access="public" status="commendable" name="mouseX" href="mousex.html" title="" fulltitle="" subtitle="" location="qfxmouseregion.cpp"/> <page access="public" status="commendable" name="mouseX" href="mousex.html" title="" fulltitle="" subtitle="" location="qfxmousearea.cpp"/>
<page access="public" status="commendable" name="enabled" href="enabled.html" title="" fulltitle="" subtitle="" location="qfxmouseregion.cpp"/> <page access="public" status="commendable" name="enabled" href="enabled.html" title="" fulltitle="" subtitle="" location="qfxmousearea.cpp"/>
<page access="public" status="commendable" name="hoverEnabled" href="hoverenabled.html" title="" fulltitle="" subtitle="" location="qfxmouseregion.cpp"/> <page access="public" status="commendable" name="hoverEnabled" href="hoverenabled.html" title="" fulltitle="" subtitle="" location="qfxmousearea.cpp"/>
<page access="public" status="commendable" name="containsMouse" href="containsmouse.html" title="" fulltitle="" subtitle="" location="qfxmouseregion.cpp"/> <page access="public" status="commendable" name="containsMouse" href="containsmouse.html" title="" fulltitle="" subtitle="" location="qfxmousearea.cpp"/>
<page access="public" status="commendable" name="pressed" href="pressed.html" title="" fulltitle="" subtitle="" location="qfxmouseregion.cpp"/> <page access="public" status="commendable" name="pressed" href="pressed.html" title="" fulltitle="" subtitle="" location="qfxmousearea.cpp"/>
<page access="public" status="commendable" name="acceptedButtons" href="acceptedbuttons.html" title="" fulltitle="" subtitle="" location="qfxmouseregion.cpp"/> <page access="public" status="commendable" name="acceptedButtons" href="acceptedbuttons.html" title="" fulltitle="" subtitle="" location="qfxmousearea.cpp"/>
<page access="public" status="commendable" name="drag.target" href="drag-target.html" title="" fulltitle="" subtitle="" location="qfxmouseregion.cpp"/> <page access="public" status="commendable" name="drag.target" href="drag-target.html" title="" fulltitle="" subtitle="" location="qfxmousearea.cpp"/>
</page> </page>
<page access="public" status="commendable" name="http://www.freedesktop.org/" href="http-www-freedesktop-org.html" subtype="externalpage" title="freedesktop.org" fulltitle="freedesktop.org" subtitle="" location="external-resources.qdoc"/> <page access="public" status="commendable" name="http://www.freedesktop.org/" href="http-www-freedesktop-org.html" subtype="externalpage" title="freedesktop.org" fulltitle="freedesktop.org" subtitle="" location="external-resources.qdoc"/>
<page access="public" status="commendable" name="http://www.freedesktop.org/Standards/xembed-spec" href="http-www-freedesktop-org-standards-xembed-spec.html" subtype="externalpage" title="XEmbed Specification" fulltitle="XEmbed Specification" subtitle="" location="external-resources.qdoc"/> <page access="public" status="commendable" name="http://www.freedesktop.org/Standards/xembed-spec" href="http-www-freedesktop-org-standards-xembed-spec.html" subtype="externalpage" title="XEmbed Specification" fulltitle="XEmbed Specification" subtitle="" location="external-resources.qdoc"/>

View File

@@ -57,8 +57,8 @@ Rectangle {
verticalAlignment: "AlignVCenter"; verticalAlignment: "AlignVCenter";
} }
MouseRegion { MouseArea {
id: mouseRegion id: mouseArea
anchors.fill: parent anchors.fill: parent
onReleased: { parent.clicked.emit(); } onReleased: { parent.clicked.emit(); }
} }
@@ -66,7 +66,7 @@ Rectangle {
states: [ states: [
State { State {
name: "released" name: "released"
when: !mouseRegion.pressed when: !mouseArea.pressed
PropertyChanges { PropertyChanges {
target: buttonGradientRectangle target: buttonGradientRectangle
@@ -75,7 +75,7 @@ Rectangle {
}, },
State { State {
name: "pressed" name: "pressed"
when: mouseRegion.pressed when: mouseArea.pressed
PropertyChanges { PropertyChanges {
target: buttonGradientRectangle target: buttonGradientRectangle

View File

@@ -110,7 +110,7 @@ Image {
text: name text: name
} }
MouseRegion { MouseArea {
anchors.top: fileDelegateText.top anchors.top: fileDelegateText.top
anchors.left: fileDelegateText.left anchors.left: fileDelegateText.left
anchors.right: fileDelegateText.right anchors.right: fileDelegateText.right

View File

@@ -111,8 +111,8 @@ Item {
color: style.itemNameTextColor color: style.itemNameTextColor
} }
MouseRegion { MouseArea {
id: mouseRegion id: mouseArea
anchors.fill: parent anchors.fill: parent
property bool reallyPressed: false property bool reallyPressed: false

View File

@@ -59,7 +59,7 @@ Rectangle {
/* workaround: without this, a completed drag and drop operation would /* workaround: without this, a completed drag and drop operation would
result in the drag being continued when QmlView re-gains result in the drag being continued when QmlView re-gains
focus */ focus */
MouseRegion { MouseArea {
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
onEntered: if (!pressed) itemsView.stopDragAndDrop onEntered: if (!pressed) itemsView.stopDragAndDrop

View File

@@ -87,7 +87,7 @@ Item {
onHeightChanged: updateHandle() onHeightChanged: updateHandle()
MouseRegion { MouseArea {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top anchors.top: parent.top
@@ -125,7 +125,7 @@ Item {
} }
} }
MouseRegion { MouseArea {
anchors.fill: parent anchors.fill: parent
drag.target: parent drag.target: parent
drag.axis: "YAxis" drag.axis: "YAxis"
@@ -134,7 +134,7 @@ Item {
} }
} }
MouseRegion { MouseArea {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.top: handle.bottom anchors.top: handle.bottom

View File

@@ -107,7 +107,7 @@ Column {
text: sectionName text: sectionName
color: style.sectionTitleTextColor color: style.sectionTitleTextColor
} }
MouseRegion { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
if (itemHighlight.visible && if (itemHighlight.visible &&

View File

@@ -28,7 +28,7 @@ Rectangle {
// TextInputs don't loose focus automatically when user clicks away, have to be done explicitly // TextInputs don't loose focus automatically when user clicks away, have to be done explicitly
signal unFocus signal unFocus
MouseRegion { MouseArea {
anchors.fill:parent anchors.fill:parent
hoverEnabled:true hoverEnabled:true
onExited: root.unFocus(); onExited: root.unFocus();
@@ -201,7 +201,7 @@ Rectangle {
} }
} }
MouseRegion { MouseArea {
id: itemRegion id: itemRegion
anchors.fill: container anchors.fill: container
onClicked: { onClicked: {
@@ -286,7 +286,7 @@ Rectangle {
} }
} }
MouseRegion { MouseArea {
anchors.fill:parent anchors.fill:parent
onClicked: { onClicked: {
root.unFocus(); root.unFocus();
@@ -325,7 +325,7 @@ Rectangle {
elide:Qt.ElideMiddle elide:Qt.ElideMiddle
horizontalAlignment:Qt.AlignHCenter horizontalAlignment:Qt.AlignHCenter
} }
MouseRegion { MouseArea {
id: txtRegion id: txtRegion
anchors.fill:parent anchors.fill:parent
onClicked: { onClicked: {
@@ -489,7 +489,7 @@ Rectangle {
anchors.centerIn:parent anchors.centerIn:parent
} }
} }
MouseRegion { MouseArea {
anchors.fill:parent anchors.fill:parent
onClicked: { onClicked: {
// force close textinput // force close textinput
@@ -557,7 +557,7 @@ Rectangle {
} }
} }
MouseRegion { MouseArea {
anchors.fill:parent anchors.fill:parent
property int dragging:0; property int dragging:0;
property int originalX:0; property int originalX:0;

View File

@@ -41,9 +41,9 @@
<property name="text" type="QString" value="textInput"/> <property name="text" type="QString" value="textInput"/>
</itemlibraryrepresentation> </itemlibraryrepresentation>
</node> </node>
<node name="Qt/MouseRegion" showInItemLibrary="true" category="Qt - Interaction" icon=":/fxplugin/images/mouse-region-icon.png"> <node name="Qt/MouseArea" showInItemLibrary="true" category="Qt - Interaction" icon=":/fxplugin/images/mouse-area-icon.png">
<inherits name="Item" /> <inherits name="Item" />
<itemlibraryrepresentation name="Mouse Region" icon=":/fxplugin/images/mouse-region-icon.png"> <itemlibraryrepresentation name="Mouse Area" icon=":/fxplugin/images/mouse-area-icon.png">
<property name="width" type="int" value="100"/> <property name="width" type="int" value="100"/>
<property name="height" type="int" value="100"/> <property name="height" type="int" value="100"/>
</itemlibraryrepresentation> </itemlibraryrepresentation>

View File

@@ -3,7 +3,7 @@
<file>images/blended-image-icon.png</file> <file>images/blended-image-icon.png</file>
<file>images/image-icon.png</file> <file>images/image-icon.png</file>
<file>images/item-icon.png</file> <file>images/item-icon.png</file>
<file>images/mouse-region-icon.png</file> <file>images/mouse-area-icon.png</file>
<file>images/rect-icon.png</file> <file>images/rect-icon.png</file>
<file>images/text-edit-icon.png</file> <file>images/text-edit-icon.png</file>
<file>images/text-icon.png</file> <file>images/text-icon.png</file>

View File

Before

Width:  |  Height:  |  Size: 511 B

After

Width:  |  Height:  |  Size: 511 B

View File

@@ -22,7 +22,7 @@ Item {
text: modelData.name + "(" + modelData.engineId + ")" text: modelData.name + "(" + modelData.engineId + ")"
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
} }
MouseRegion { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: root.engineClicked(modelData.engineId); onClicked: root.engineClicked(modelData.engineId);
} }
@@ -38,7 +38,7 @@ Item {
height: 63; height: 63;
smooth: true smooth: true
anchors.right: parent.right anchors.right: parent.right
MouseRegion { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: Root.refreshEngines() onClicked: Root.refreshEngines()
} }

View File

@@ -8,7 +8,7 @@ Item {
} }
If you delete the name maybe the 'id:' should be deleted as well. If you delete the name maybe the 'id:' should be deleted as well.
This is fine for most other QML elements such as Rectangle and MouseRegion This is fine for most other QML elements such as Rectangle and MouseArea
---------------- ----------------

View File

@@ -823,12 +823,12 @@ void TestCore::testModelNodeListProperty()
QVERIFY(rootChildren.isNodeListProperty()); QVERIFY(rootChildren.isNodeListProperty());
QVERIFY(!rootChildren.isEmpty()); QVERIFY(!rootChildren.isEmpty());
ModelNode mouseRegionNode = view->createModelNode("Qt/Item", 4, 6); ModelNode mouseAreaNode = view->createModelNode("Qt/Item", 4, 6);
NodeListProperty rectChildren = rectNode.nodeListProperty("children"); NodeListProperty rectChildren = rectNode.nodeListProperty("children");
rectChildren.reparentHere(mouseRegionNode); rectChildren.reparentHere(mouseAreaNode);
// //
// Item { children: [ Rectangle { children : [ MouseRegion {} ] } ] } // Item { children: [ Rectangle { children : [ MouseArea {} ] } ] }
// //
QVERIFY(rectNode.hasProperty("children")); QVERIFY(rectNode.hasProperty("children"));
QVERIFY(rectChildren.isValid()); QVERIFY(rectChildren.isValid());
@@ -841,7 +841,7 @@ void TestCore::testModelNodeListProperty()
// Item { } // Item { }
// //
QVERIFY(!rectNode.isValid()); QVERIFY(!rectNode.isValid());
QVERIFY(!mouseRegionNode.isValid()); QVERIFY(!mouseAreaNode.isValid());
QVERIFY(!rootNode.hasProperty("children")); QVERIFY(!rootNode.hasProperty("children"));
QVERIFY(rootChildren.isValid()); QVERIFY(rootChildren.isValid());
QVERIFY(!rootChildren.isNodeListProperty()); QVERIFY(!rootChildren.isNodeListProperty());
@@ -5286,12 +5286,12 @@ void TestCore::testRewriterAddObjectDefinition()
QVERIFY(rootNode.isValid()); QVERIFY(rootNode.isValid());
QCOMPARE(rootNode.type(), QString("Qt/Rectangle")); QCOMPARE(rootNode.type(), QString("Qt/Rectangle"));
ModelNode childNode = view->createModelNode("Qt/MouseRegion", 4, 6); ModelNode childNode = view->createModelNode("Qt/MouseArea", 4, 6);
rootNode.nodeAbstractProperty(QLatin1String("data")).reparentHere(childNode); rootNode.nodeAbstractProperty(QLatin1String("data")).reparentHere(childNode);
QCOMPARE(rootNode.nodeProperty(QLatin1String("data")).toNodeListProperty().toModelNodeList().size(), 1); QCOMPARE(rootNode.nodeProperty(QLatin1String("data")).toNodeListProperty().toModelNodeList().size(), 1);
childNode = rootNode.nodeProperty(QLatin1String("data")).toNodeListProperty().toModelNodeList().at(0); childNode = rootNode.nodeProperty(QLatin1String("data")).toNodeListProperty().toModelNodeList().at(0);
QCOMPARE(childNode.type(), QString(QLatin1String("Qt/MouseRegion"))); QCOMPARE(childNode.type(), QString(QLatin1String("Qt/MouseArea")));
} }
void TestCore::testRewriterAddStatesArray() void TestCore::testRewriterAddStatesArray()
@@ -5416,9 +5416,9 @@ void TestCore::testRewriterRemoveObjectDefinition()
"import Qt 4.6\n" "import Qt 4.6\n"
"\n" "\n"
"Rectangle {\n" "Rectangle {\n"
" MouseRegion {\n" " MouseArea {\n"
" }\n" " }\n"
" MouseRegion {\n" " MouseArea {\n"
" } // some comment here\n" " } // some comment here\n"
"}"); "}");
QPlainTextEdit textEdit; QPlainTextEdit textEdit;
@@ -5442,13 +5442,13 @@ void TestCore::testRewriterRemoveObjectDefinition()
QCOMPARE(rootNode.nodeProperty(QLatin1String("data")).toNodeListProperty().toModelNodeList().size(), 2); QCOMPARE(rootNode.nodeProperty(QLatin1String("data")).toNodeListProperty().toModelNodeList().size(), 2);
ModelNode childNode = rootNode.nodeProperty(QLatin1String("data")).toNodeListProperty().toModelNodeList().at(1); ModelNode childNode = rootNode.nodeProperty(QLatin1String("data")).toNodeListProperty().toModelNodeList().at(1);
QCOMPARE(childNode.type(), QString(QLatin1String("Qt/MouseRegion"))); QCOMPARE(childNode.type(), QString(QLatin1String("Qt/MouseArea")));
childNode.destroy(); childNode.destroy();
QCOMPARE(rootNode.nodeProperty(QLatin1String("data")).toNodeListProperty().toModelNodeList().size(), 1); QCOMPARE(rootNode.nodeProperty(QLatin1String("data")).toNodeListProperty().toModelNodeList().size(), 1);
childNode = rootNode.nodeProperty(QLatin1String("data")).toNodeListProperty().toModelNodeList().at(0); childNode = rootNode.nodeProperty(QLatin1String("data")).toNodeListProperty().toModelNodeList().at(0);
QCOMPARE(childNode.type(), QString(QLatin1String("Qt/MouseRegion"))); QCOMPARE(childNode.type(), QString(QLatin1String("Qt/MouseArea")));
childNode.destroy(); childNode.destroy();
@@ -5529,7 +5529,7 @@ void TestCore::testRewriterNodeReparenting()
"\n" "\n"
"Rectangle {\n" "Rectangle {\n"
" Item {\n" " Item {\n"
" MouseRegion {\n" " MouseArea {\n"
" }\n" " }\n"
" }\n" " }\n"
"}"); "}");
@@ -5556,13 +5556,13 @@ void TestCore::testRewriterNodeReparenting()
QVERIFY(itemNode.isValid()); QVERIFY(itemNode.isValid());
QCOMPARE(itemNode.type(), QLatin1String("Qt/Item")); QCOMPARE(itemNode.type(), QLatin1String("Qt/Item"));
ModelNode mouseRegion = itemNode.nodeListProperty("data").toModelNodeList().at(0); ModelNode mouseArea = itemNode.nodeListProperty("data").toModelNodeList().at(0);
QVERIFY(mouseRegion.isValid()); QVERIFY(mouseArea.isValid());
QCOMPARE(mouseRegion.type(), QLatin1String("Qt/MouseRegion")); QCOMPARE(mouseArea.type(), QLatin1String("Qt/MouseArea"));
rootNode.nodeListProperty("data").reparentHere(mouseRegion); rootNode.nodeListProperty("data").reparentHere(mouseArea);
QVERIFY(mouseRegion.isValid()); QVERIFY(mouseArea.isValid());
QCOMPARE(rootNode.nodeListProperty("data").toModelNodeList().size(), 2); QCOMPARE(rootNode.nodeListProperty("data").toModelNodeList().size(), 2);
QString expected = "\n" QString expected = "\n"
@@ -5572,7 +5572,7 @@ void TestCore::testRewriterNodeReparenting()
" Item {\n" " Item {\n"
" }\n" " }\n"
"\n" "\n"
"MouseRegion {\n" "MouseArea {\n"
" }\n" " }\n"
"}"; "}";
QCOMPARE(textEdit.toPlainText(), expected); QCOMPARE(textEdit.toPlainText(), expected);
@@ -5594,7 +5594,7 @@ void TestCore::testRewriterNodeReparenting()
" Item {\n" " Item {\n"
" }\n" " }\n"
"\n" "\n"
"MouseRegion {\n" "MouseArea {\n"
" }\n" " }\n"
"\n" "\n"
" Rectangle {\n" " Rectangle {\n"
@@ -5618,7 +5618,7 @@ void TestCore::testRewriterNodeReparenting()
" Item {\n" " Item {\n"
" }\n" " }\n"
"\n" "\n"
"MouseRegion {\n" "MouseArea {\n"
" }\n" " }\n"
"}"; "}";
@@ -5721,14 +5721,14 @@ void TestCore::testRewriterMovingInOut()
QVERIFY(rootNode.isValid()); QVERIFY(rootNode.isValid());
QCOMPARE(rootNode.type(), QString("Qt/Rectangle")); QCOMPARE(rootNode.type(), QString("Qt/Rectangle"));
ModelNode newNode = view->createModelNode("Qt/MouseRegion", 4, 6); ModelNode newNode = view->createModelNode("Qt/MouseArea", 4, 6);
rootNode.nodeListProperty(QLatin1String("data")).reparentHere(newNode); rootNode.nodeListProperty(QLatin1String("data")).reparentHere(newNode);
const QLatin1String expected1("\n" const QLatin1String expected1("\n"
"import Qt 4.6\n" "import Qt 4.6\n"
"\n" "\n"
"Rectangle {\n" "Rectangle {\n"
"MouseRegion {\n" "MouseArea {\n"
"}\n" "}\n"
"}"); "}");
QCOMPARE(textEdit.toPlainText(), expected1); QCOMPARE(textEdit.toPlainText(), expected1);
@@ -5779,7 +5779,7 @@ void TestCore::testRewriterMovingInOutWithTransaction()
RewriterTransaction transaction = view->beginRewriterTransaction(); RewriterTransaction transaction = view->beginRewriterTransaction();
ModelNode newNode = view->createModelNode("Qt/MouseRegion", 4, 6); ModelNode newNode = view->createModelNode("Qt/MouseArea", 4, 6);
rootNode.nodeListProperty(QLatin1String("data")).reparentHere(newNode); rootNode.nodeListProperty(QLatin1String("data")).reparentHere(newNode);
#define move(node, x, y) {\ #define move(node, x, y) {\
@@ -5831,7 +5831,7 @@ void TestCore::testRewriterComplexMovingInOut()
QCOMPARE(rootNode.type(), QString("Qt/Rectangle")); QCOMPARE(rootNode.type(), QString("Qt/Rectangle"));
ModelNode itemNode = rootNode.nodeListProperty(QLatin1String("data")).toModelNodeList().at(0); ModelNode itemNode = rootNode.nodeListProperty(QLatin1String("data")).toModelNodeList().at(0);
ModelNode newNode = view->createModelNode("Qt/MouseRegion", 4, 6); ModelNode newNode = view->createModelNode("Qt/MouseArea", 4, 6);
rootNode.nodeListProperty(QLatin1String("data")).reparentHere(newNode); rootNode.nodeListProperty(QLatin1String("data")).reparentHere(newNode);
const QLatin1String expected1("\n" const QLatin1String expected1("\n"
@@ -5841,7 +5841,7 @@ void TestCore::testRewriterComplexMovingInOut()
" Item {\n" " Item {\n"
" }\n" " }\n"
"\n" "\n"
" MouseRegion {\n" " MouseArea {\n"
" }\n" " }\n"
"}"); "}");
QCOMPARE(textEdit.toPlainText(), expected1); QCOMPARE(textEdit.toPlainText(), expected1);
@@ -5861,7 +5861,7 @@ void TestCore::testRewriterComplexMovingInOut()
" Item {\n" " Item {\n"
" }\n" " }\n"
"\n" "\n"
" MouseRegion {\n" " MouseArea {\n"
" x: 3\n" " x: 3\n"
" y: 3\n" " y: 3\n"
" }\n" " }\n"
@@ -5875,7 +5875,7 @@ void TestCore::testRewriterComplexMovingInOut()
"\n" "\n"
"Rectangle {\n" "Rectangle {\n"
" Item {\n" " Item {\n"
"MouseRegion {\n" "MouseArea {\n"
" x: 3\n" " x: 3\n"
" y: 3\n" " y: 3\n"
" }\n" " }\n"