Diferència entre revisions de la pàgina «Guia per a desenvolupar l'ex07 dels exercicis de QML»
Salta a la navegació
Salta a la cerca
m (→ex07a_02) |
|||
Línia 57: | Línia 57: | ||
= ex07a_02 = | = ex07a_02 = | ||
+ | |||
+ | Button { | ||
+ | id: btLedBlanc | ||
+ | x: 169 | ||
+ | text: qsTr("Encén led blanc") | ||
+ | anchors.top: btConnecta.bottom | ||
+ | anchors.horizontalCenterOffset: 0 | ||
+ | anchors.topMargin: 25 | ||
+ | anchors.horizontalCenter: btConnecta.horizontalCenter | ||
+ | enabled: false | ||
+ | } |
Revisió del 12:12, 8 feb 2021
ex07a_01
main.qml
import QtQuick 2.12 import QtQuick.Window 2.12 Window { width: 640 height: 480 visible: true title: qsTr("ex07a - v0.1") EstatMqtt{ anchors.centerIn: parent } }
EstatMqtt.qml
import QtQuick 2.4 EstatMqttForm { }
EstatMqttForm.ui.qml
import QtQuick 2.4 import QtQuick.Controls 2.15 Item { id: item1 width: 400 height: 400 property alias btConnecta: btConnecta property alias textInfo: textInfo Text { id: textInfo y: 56 height: 53 color: "#ee2222" text: qsTr("MQTT desconnectat") anchors.left: parent.left anchors.right: parent.right anchors.bottom: btConnecta.top font.pixelSize: 35 horizontalAlignment: Text.AlignHCenter anchors.bottomMargin: 25 anchors.rightMargin: 10 anchors.leftMargin: 10 font.bold: true } Button { id: btConnecta x: 164 y: 214 text: qsTr("&Connecta") anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter } }
ex07a_02
Button { id: btLedBlanc x: 169 text: qsTr("Encén led blanc") anchors.top: btConnecta.bottom anchors.horizontalCenterOffset: 0 anchors.topMargin: 25 anchors.horizontalCenter: btConnecta.horizontalCenter enabled: false }