summaryrefslogtreecommitdiff
path: root/ui/qt5/subnetbox.hh
diff options
context:
space:
mode:
authorKiyoshi Aman <adelie@aerdan.vulpine.house>2020-02-10 08:57:09 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2020-02-10 08:57:09 -0600
commit89934d31b65f070b1954ae2f6201841bfd90d3e2 (patch)
tree5019930dad6c28b4183a0aec74fbda6e3f408125 /ui/qt5/subnetbox.hh
parent423c4fd6e25cc9306b84abceb8f79e8c1a469a7b (diff)
downloadhorizon-89934d31b65f070b1954ae2f6201841bfd90d3e2.tar.gz
horizon-89934d31b65f070b1954ae2f6201841bfd90d3e2.tar.bz2
horizon-89934d31b65f070b1954ae2f6201841bfd90d3e2.tar.xz
horizon-89934d31b65f070b1954ae2f6201841bfd90d3e2.zip
Qt UI: Add subnet input widget
Diffstat (limited to 'ui/qt5/subnetbox.hh')
-rw-r--r--ui/qt5/subnetbox.hh40
1 files changed, 40 insertions, 0 deletions
diff --git a/ui/qt5/subnetbox.hh b/ui/qt5/subnetbox.hh
new file mode 100644
index 0000000..9f2edbf
--- /dev/null
+++ b/ui/qt5/subnetbox.hh
@@ -0,0 +1,40 @@
+/*
+ * subnetbox.hh - Definition of a widget for inputting an IPv4 subnet mask
+ * horizon-qt5, the Qt 5 user interface for
+ * Project Horizon
+ *
+ * Copyright (c) 2020 Adélie Linux and contributors. All rights reserved.
+ * This code is licensed under the AGPL 3.0 license, as noted in the
+ * LICENSE-code file in the root directory of this repository.
+ *
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+
+#ifndef SUBNETBOX_HH
+#define SUBNETBOX_HH
+
+#include <QWidget>
+#include <QHBoxLayout>
+#include <QLineEdit>
+#include <QSpinBox>
+#include <QString>
+
+class SubnetBox : public QWidget {
+ Q_OBJECT
+
+public:
+ SubnetBox(QWidget *parent = nullptr);
+ QString subnetMask() const;
+ int subnetCIDR() const;
+
+public slots:
+ void subnetEdited(const QString &text);
+ void cidrEdited(int value);
+
+private:
+ QHBoxLayout *layout;
+ QLineEdit *subnet;
+ QSpinBox *cidr;
+};
+
+#endif