Thank you for reply, Jens.
I’m sorry for vague example. It is too primitive to express the meaning.
What I’m trying to achieve is a program for drawing circles/ellipses with different algorithms.
Sorry for Russian language (Yes, I’m from Russia. People from Russia speak English badly mostly as you can see. :) I’m very sorry for mistakes, I’m trying my best). But I think screenshot is quite understandable even with Russian captions.
Screenshot (it is blurred because of compression):
Explanation of marks:
1. I want margins there. Labels and buttons are too close to borders.
2. I want those buttons to fill width (Their captions in English: “Choose black color”, “Choose background color”. This buttons are responsible for pen color). Unfortunately this code works as you see at screenshot:
GroupBox
{
title: "Цвет рисования"
Layout.fillWidth: true
ColumnLayout
{
spacing: 8
RowLayout
{
spacing: 8
Label
{
id: lblColor
text: "Текущий цвет:"
}
Rectangle
{
height: lblColor.height
width: height
color: penColor
border.color: invert(penColor)
border.width: 1
function invert(color)
{
return Qt.rgba(1 - color.r, 1 - color.g, 1 - color.b, 1);
}
MouseArea
{
anchors.fill: parent
onClicked: colorDialog.open();
}
}
}
Button
{
text: "Выбрать чёрный цвет"
Layout.fillWidth: true
onClicked: penColor = penColorDefault;
}
Button
{
text: "Выбрать цвет фона"
Layout.fillWidth: true
onClicked: penColor = backgroundColor;
}
}
}
3. I want to have something like “form layout” from Qt Widgets. I’ve tried GridLayout but qml analyzer shows me that property “columns” is not defined. This can probably happen because of outdated Qt 5.1 version from openSUSE KDE repositories (I cannot spend 2 days of compile Qt 5.1 from Git :)). So I decided to forget about it and wait for updates. Now I’m using Grid.
↧