NDEVR
API Documentation
IPWidget.h
1#pragma once
2#include <QFrame>
3#include <NDEVR/BaseValues.h>
4class QLineEdit;
5namespace NDEVR
6{
7 class QCustomLineEdit;
8 class String;
9 class StringView;
14 class IPWidget : public QFrame
15 {
16 Q_OBJECT
17 public:
22 IPWidget(QWidget* parent = nullptr);
23 ~IPWidget();
28 String address() const;
32 void clear();
39 {
40 return m_edit[index];
41 }
42
51 QSize sizeHint() const;
56 bool checkIfValid() const;
57 public slots:
62 void slotTextChanged(QLineEdit* pEdit);
63 signals:
68 void editedSignal(QLineEdit* pEdit);
69 private:
70 QCustomLineEdit* m_edit[4];
75 void MoveNextLineEdit(int i);
80 void MovePrevLineEdit(int i);
81 };
82}
void editedSignal(QLineEdit *pEdit)
Signal emitted when an edit field has been modified by the user.
void slotTextChanged(QLineEdit *pEdit)
Slot invoked when the text in an edit field changes, handling auto-advance between octets.
String address() const
Returns the full IP address string assembled from the four edit fields.
QSize sizeHint() const
Returns the recommended size for this widget.
IPWidget(QWidget *parent=nullptr)
Constructs an IPWidget with four edit fields for each octet of an IPv4 address.
QCustomLineEdit * editBox(uint04 index) const
Returns the QCustomLineEdit for the given octet index.
Definition IPWidget.h:38
void clear()
Clears all four octet edit fields.
void setAddress(const StringView &address)
Sets the IP address by parsing a dot-separated string into the four edit fields.
bool checkIfValid() const
Checks whether all four octet fields contain valid values.
A line edit allows users to enter and edit a single line of plain text with useful editing functions,...
The core String View class for the NDEVR API.
Definition StringView.h:58
The core String class for the NDEVR API.
Definition String.h:95
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...