Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick 2.7
- import QtQuick.Controls 2.0
- import QtQuick.Layouts 1.3
- ApplicationWindow {
- visible: true
- width: 640
- height: 480
- title: qsTr("Hello World")
- Rectangle {
- id: rec
- width: 250
- height: 250
- color: "gray"
- anchors.centerIn: parent
- }
- Button {
- id: oi
- text: "oi"
- anchors.right: rec.left // Direita do botão oi está ancorada a esquerda de rec
- anchors.bottom: rec.top // Base do botão oi está ancorada ao topo de rec
- }
- Button {
- id: oi2
- text: "oi2"
- anchors.right: rec.left // Direita do botão oi2 está ancorada a esquerda de rec
- anchors.verticalCenter: rec.verticalCenter // VerticalCenter do botão oi2 está ancorada a verticalCenter de rec
- }
- Button {
- id: oi3
- text: "oi3"
- anchors.right: rec.left
- anchors.top: rec.bottom
- }
- Button {
- id: oi4
- text: "oi4"
- anchors.top: rec.bottom // Topo do botão oi4 está ancorada a base de rec
- anchors.horizontalCenter: rec.horizontalCenter // horizontalCenter do botão oi4 está ancorada em horizontalCenter de rec
- }
- Button {
- id: oi5
- text: "oi5"
- anchors.left: rec.right
- anchors.top: rec.bottom
- }
- Button {
- id: oi6
- text: "oi6"
- anchors.left: rec.right
- anchors.verticalCenter: rec.verticalCenter
- }
- Button {
- id: oi7
- text: "oi7"
- anchors.left: rec.right
- anchors.bottom: rec.top
- }
- Button {
- id: oi8
- text: "oi8"
- anchors.bottom: rec.top
- anchors.horizontalCenter: rec.horizontalCenter
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement