Avec bouton

flags
Francois DELOBEL 4 weeks ago
parent 393838be71
commit cf870a6cb9

@ -1,10 +1,12 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
Row {
property alias name: name.text
property alias address: address.text
spacing: 40
Text {
id: name
@ -16,4 +18,10 @@ Row {
font.pointSize: 36
anchors.verticalCenter: parent.verticalCenter
}
Button {
text: "Shutdown"
onClicked: { netint.shutdown() }
anchors.verticalCenter: parent.verticalCenter
}
}

@ -7,10 +7,11 @@ Window {
visible: true
title: qsTr("Hello World")
NetIf {
name: netint.name
address: netint.address
}
}

@ -33,3 +33,8 @@ void NetworkInterface::setAddress(const QString &newAddress)
m_address = newAddress;
emit addressChanged();
}
void NetworkInterface::shutdown()
{
qWarning() << "Shutting down interface";
}

@ -18,7 +18,7 @@ public:
QString address() const;
void setAddress(const QString &newAddress);
Q_INVOKABLE void shutdown();
signals:
void nameChanged();
void addressChanged();

Loading…
Cancel
Save