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"/>
</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()"/>
<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="mouseX" href="mousex.html" title="" fulltitle="" subtitle="" location="qfxmouseregion.cpp"/>
<page access="public" status="commendable" name="enabled" href="enabled.html" title="" fulltitle="" subtitle="" location="qfxmouseregion.cpp"/>
<page access="public" status="commendable" name="hoverEnabled" href="hoverenabled.html" title="" fulltitle="" subtitle="" location="qfxmouseregion.cpp"/>
<page access="public" status="commendable" name="containsMouse" href="containsmouse.html" title="" fulltitle="" subtitle="" location="qfxmouseregion.cpp"/>
<page access="public" status="commendable" name="pressed" href="pressed.html" title="" fulltitle="" subtitle="" location="qfxmouseregion.cpp"/>
<page access="public" status="commendable" name="acceptedButtons" href="acceptedbuttons.html" title="" fulltitle="" subtitle="" location="qfxmouseregion.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="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="qfxmousearea.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="qfxmousearea.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="qfxmousearea.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="qfxmousearea.cpp"/>
</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/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";
}
MouseRegion {
id: mouseRegion
MouseArea {
id: mouseArea
anchors.fill: parent
onReleased: { parent.clicked.emit(); }
}
@@ -66,7 +66,7 @@ Rectangle {
states: [
State {
name: "released"
when: !mouseRegion.pressed
when: !mouseArea.pressed
PropertyChanges {
target: buttonGradientRectangle
@@ -75,7 +75,7 @@ Rectangle {
},
State {
name: "pressed"
when: mouseRegion.pressed
when: mouseArea.pressed
PropertyChanges {
target: buttonGradientRectangle

View File

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

View File

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

View File

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

View File

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

View File

@@ -107,7 +107,7 @@ Column {
text: sectionName
color: style.sectionTitleTextColor
}
MouseRegion {
MouseArea {
anchors.fill: parent
onClicked: {
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
signal unFocus
MouseRegion {
MouseArea {
anchors.fill:parent
hoverEnabled:true
onExited: root.unFocus();
@@ -201,7 +201,7 @@ Rectangle {
}
}
MouseRegion {
MouseArea {
id: itemRegion
anchors.fill: container
onClicked: {
@@ -286,7 +286,7 @@ Rectangle {
}
}
MouseRegion {
MouseArea {
anchors.fill:parent
onClicked: {
root.unFocus();
@@ -325,7 +325,7 @@ Rectangle {
elide:Qt.ElideMiddle
horizontalAlignment:Qt.AlignHCenter
}
MouseRegion {
MouseArea {
id: txtRegion
anchors.fill:parent
onClicked: {
@@ -489,7 +489,7 @@ Rectangle {
anchors.centerIn:parent
}
}
MouseRegion {
MouseArea {
anchors.fill:parent
onClicked: {
// force close textinput
@@ -557,7 +557,7 @@ Rectangle {
}
}
MouseRegion {
MouseArea {
anchors.fill:parent
property int dragging:0;
property int originalX:0;

View File

@@ -41,9 +41,9 @@
<property name="text" type="QString" value="textInput"/>
</itemlibraryrepresentation>
</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" />
<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="height" type="int" value="100"/>
</itemlibraryrepresentation>

View File

@@ -3,7 +3,7 @@
<file>images/blended-image-icon.png</file>
<file>images/image-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/text-edit-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 + ")"
anchors.horizontalCenter: parent.horizontalCenter
}
MouseRegion {
MouseArea {
anchors.fill: parent
onClicked: root.engineClicked(modelData.engineId);
}
@@ -38,7 +38,7 @@ Item {
height: 63;
smooth: true
anchors.right: parent.right
MouseRegion {
MouseArea {
anchors.fill: parent
onClicked: Root.refreshEngines()
}

View File

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