モジュール
QtQuick 2.0
クラス継承
QQuickScriptAction → QQuickAbstractAnimation (internal) → QObject
プロパティー
script: QQmlScriptString = QQmlScriptString()
scriptName: QString = ""
QtQuick 2.0
QQuickScriptAction → QQuickAbstractAnimation (internal) → QObject
script: QQmlScriptString = QQmlScriptString()
scriptName: QString = ""
QtQml.Models 2.1
QQmlDelegateModelGroup → QObject
count: int = 0 readonly
name: QString = ""
includeByDefault: bool = false
changed(QQmlV4Handle removed, QQmlV4Handle inserted)
countChanged()
defaultIncludeChanged()
nameChanged()
QQmlV4Handle get(int index)
void addGroups(QQmlV4Function*)
void create(QQmlV4Function*)
void insert(QQmlV4Function*)
void move(QQmlV4Function*)
void resolve(QQmlV4Function*)
void remove(QQmlV4Function*)
void removeGroups(QQmlV4Function*)
void setGroups(QQmlV4Function*)
QtQuick 2.0
QQuickParentChange → QQuickStateOperation (internal) → QObject
target: Item = null
parent: Item = null
x: QQmlScriptString = ""
y: QQmlScriptString = ""
width: QQmlScriptString = ""
height: QQmlScriptString = ""
scale: QQmlScriptString = ""
rotation: QQmlScriptString = ""
QtQuick 2.0
QQuickParentAnimation → QQuickAnimationGroup (internal) → QQuickAbstractAnimation (internal) → QObject
target: Item = null
newParent: Item = null
via: Item = null
targetChanged()
newParentChanged()
viaChanged()
switchparent.qml:
import QtQuick 2.10
import QtQuick.Window 2.10
import QtQuick.Layouts 1.3
Window {
id: window
visible: true
minimumWidth: 300
minimumHeight: 300
RowLayout {
id: topLayout
anchors.fill: parent
anchors.margins: spacing
Rectangle {
id: leftRect
Layout.fillWidth: true
Layout.fillHeight: true
objectName: "leftRect"
color: "red"
Rectangle {
id: innerRect
x: 10; y: 10
width: (minimumWidth - 3*topLayout.spacing)/2 - 2*10
height: width
color: "blue"
Text {
anchors.centerIn: parent
text: "%1\n%2, %3\n%4x%5".arg(innerRect.parent.objectName)
.arg(parent.x).arg(parent.y)
.arg(parent.width).arg(parent.height)
color: "white"
}
}
}
Rectangle {
id: rightRect
Layout.fillWidth: true
Layout.fillHeight: true
objectName: "rightRect"
color: "green"
}
}
contentItem.states: State {
name: "switchToRight"
ParentChange {
target: innerRect
parent: rightRect
x: rightRect.width - innerRect.width - 10
y: rightRect.height - innerRect.height - 10
}
PropertyChanges {
target: innerRect
color: "darkblue"
}
}
contentItem.transitions: Transition {
ParentAnimation {
via: contentItem
NumberAnimation {
properties: "x, y"
duration: 3000
}
ColorAnimation {
duration: 3000
}
}
}
MouseArea {
anchors.fill: parent
onClicked: {
if (contentItem.state === "") {
contentItem.state = "switchToRight";
} else {
contentItem.state = "";
}
}
}
}