File Metadata

Author
gvgeo
Created
Feb 19 2020, 11:03 AM

test.qml

import QtQuick 2.0
import QtQuick.Layouts 1.2
import QtQuick.Controls 1.2
import QtQuick.Layouts 1.2
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.extras 2.0 as PlasmaExtras
PlasmaCore.ColorScope
{
id: root
width: 750
height: 250
property bool invertedColors: false
default property alias children: container.children
colorGroup: invertedColors ? PlasmaCore.Theme.ComplementaryColorGroup : PlasmaCore.Theme.NormalColorGroup
Rectangle {
anchors.fill: parent
color: PlasmaCore.ColorScope.backgroundColor
}
Label {
id: label
text: root.invertedColors ? "Invert" : "Normal"
MouseArea {
anchors.fill: parent
onClicked: root.invertedColors = !root.invertedColors
}
}
Item {
id: container
anchors.top: label.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
}
Column {
anchors.fill: parent
anchors.margins: 20
spacing: 4
Grid {
spacing: 4
columns: 3
Label {
text: "Label"
}
Label {
text: "Checkbox"
}
Label {
text: "Checkbox x position"
}
PlasmaComponents.Label {
text: "Dummy Label"
}
PlasmaComponents3.CheckBox {
id: pc3
text: "Plasma Components 3.0 checkbox"
checked: true
}
Label {
text: pc3.x
}
PlasmaComponents.Label {
text: "Dummy Label"
}
PlasmaComponents.CheckBox {
id: pc2
text: "Plasma Components 2.0 checkbox"
checked: true
}
Label {
text: pc2.x
}
PlasmaComponents.Label {
text: "Dummy Label"
}
CheckBox {
id: qtqc
text: "QtQuick.Controls 1.2 checkbox"
checked: true
}
Label {
text: qtqc.x
}
}
Label {
text: "\nThe problem is in cotrols, there are more with the same problem, but there are not so obvious,like radiobutton.\nLayout gives label's real width hiding the problem.\nAll Dummy Labels are PC2."
opacity: 0.7
}
}
}