PDA

View Full Version : Rectangle with Round corner in qml



ravandi
6th December 2015, 09:07
I want to make the following image in the qml:
11560

anda_skoa
6th December 2015, 09:53
Rectangle has a radius property.

Cheers,
_

ravandi
6th December 2015, 11:51
how is this?
11561

anda_skoa
6th December 2015, 12:14
What do you mean?

Cheers,
_

ravandi
6th December 2015, 16:03
I want to make this shap:
http://www.qtcentre.org/attachment.php?attachmentid=11561&d=1449402720

anda_skoa
6th December 2015, 16:23
A rounded rect plus a non rounded rect overlapping the first rect's bottom part.

Cheers,
_

ravandi
6th December 2015, 18:08
my code:


import QtQuick 2.3
import QtQuick.Window 2.1
Window {
visible: true
width: 625
height: 420

Rectangle {
id: aval
width: 325
height: 200
color: "#7483f2"
border.width: 1
border.color: "red"
radius:20
anchors.centerIn: parent

Rectangle {
id: doo
width: 323
height: 20
color: "#7483f2"
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: 2
}
}
}

11562

anda_skoa
6th December 2015, 21:44
Ah, ok, your other image didn't have that partial overlap at the bottom, so I assumed you wanted the bottom corners to be classic rectangle corners.

Cheers,
_