Warning, /frameworks/kirigami/examples/scenepotitionattached.qml is written in an unsupported language. File is not indexed.
0001 import QtQuick 2.15 0002 import QtQuick.Layouts 1.15 0003 import QtQuick.Controls 2.15 as QQC2 0004 import org.kde.kirigami 2.20 as Kirigami 0005 0006 Kirigami.ApplicationWindow { 0007 id: root 0008 pageStack.initialPage: Kirigami.Page { 0009 GridLayout { 0010 anchors.top: parent.top 0011 anchors.left: parent.left 0012 anchors.right: parent.right 0013 ColumnLayout { 0014 Layout.column: 0 0015 Kirigami.Heading { 0016 text: "scene position" 0017 Layout.minimumHeight: Kirigami.Units.gridUnit * 2 0018 } 0019 ColumnLayout { 0020 QQC2.Label { 0021 // This will be 99 because it is the distance between the top of the window and this Item 0022 text: "Sublayout 1: " + Kirigami.ScenePosition.y 0023 } 0024 QQC2.Label { 0025 text: "Sublayout 2: " + Kirigami.ScenePosition.y 0026 } 0027 QQC2.Label { 0028 text: "Sublayout 3: " + Kirigami.ScenePosition.y 0029 } 0030 } 0031 Item { 0032 Layout.minimumHeight: 100 0033 } 0034 QQC2.Label { 0035 text: "Layout 1: " + Kirigami.ScenePosition.y 0036 } 0037 QQC2.Label { 0038 text: "Layout 2: " + Kirigami.ScenePosition.y 0039 } 0040 QQC2.Label { 0041 text: "Layout 3: " + Kirigami.ScenePosition.y 0042 } 0043 } 0044 ColumnLayout { 0045 Layout.column: 1 0046 Kirigami.Heading { 0047 text: "non scene position" 0048 Layout.minimumHeight: Kirigami.Units.gridUnit * 2 0049 } 0050 ColumnLayout { 0051 ColumnLayout { 0052 QQC2.Label { 0053 // This will be 0 because the X and Y properties are relative to the first Item 0054 text: "Sublayout 1: " + y 0055 } 0056 QQC2.Label { 0057 text: "Sublayout 2: " + y 0058 } 0059 QQC2.Label { 0060 text: "Sublayout 3: " + y 0061 } 0062 } 0063 Item { 0064 Layout.minimumHeight: 100 0065 } 0066 QQC2.Label { 0067 text: "Layout 1: " + y 0068 } 0069 QQC2.Label { 0070 text: "Layout 2: " + y 0071 } 0072 QQC2.Label { 0073 text: "Layout 3: " + y 0074 } 0075 } 0076 } 0077 } 0078 } 0079 } 0080