From 8f528ffcdb4ce2f27a015fe7f0867e71a444d614 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Mon, 10 Feb 2020 09:06:26 -0600 Subject: Qt 5: Small tweaks to SubnetBox * Add setSubnetCIDR, to programmatically change the value. * Add signal for when the value changes. * Ensure the proper amount of .0 octets are appended when the spinbox changes. --- ui/qt5/subnetbox.hh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ui/qt5/subnetbox.hh') diff --git a/ui/qt5/subnetbox.hh b/ui/qt5/subnetbox.hh index 9f2edbf..8104a6b 100644 --- a/ui/qt5/subnetbox.hh +++ b/ui/qt5/subnetbox.hh @@ -26,11 +26,15 @@ public: SubnetBox(QWidget *parent = nullptr); QString subnetMask() const; int subnetCIDR() const; + void setSubnetCIDR(int value); public slots: void subnetEdited(const QString &text); void cidrEdited(int value); +signals: + void valueChanged(int value); + private: QHBoxLayout *layout; QLineEdit *subnet; -- cgit v1.2.3-60-g2f50