code format

This commit is contained in:
2022-12-14 14:14:33 +03:00
parent 09e5342956
commit cdb02fc9be
278 changed files with 15371 additions and 12176 deletions

View File

@@ -1,9 +1,11 @@
#include "qipedit.h"
#include "qalgorithms.h"
#include <QLabel>
#include <QLineEdit>
#include <QBoxLayout>
#include <QIntValidator>
#include <QLabel>
#include <QLineEdit>
QIPEdit::QIPEdit(QWidget * parent, const QString & ip): QWidget(parent) {
@@ -44,10 +46,10 @@ void QIPEdit::setIP(const QString & text) {
s = str.left(str.indexOf('.'));
edits[0]->setText(s == "" ? "0" : s);
str = str.right(str.length() - s.length() - 1);
s = str.left(str.indexOf('.'));
s = str.left(str.indexOf('.'));
edits[1]->setText(s == "" ? "0" : s);
str = str.right(str.length() - s.length() - 1);
s = str.left(str.indexOf('.'));
s = str.left(str.indexOf('.'));
edits[2]->setText(s == "" ? "0" : s);
str = str.right(str.length() - s.length() - 1);
edits[3]->setText(str == "" ? "0" : str);
@@ -56,14 +58,22 @@ void QIPEdit::setIP(const QString & text) {
QString QIPEdit::IP() {
QString s;
if (edits[0]->text() == "") s = "0.";
else s = edits[0]->text() + ".";
if (edits[1]->text() == "") s += "0.";
else s += edits[1]->text() + ".";
if (edits[2]->text() == "") s += "0.";
else s += edits[2]->text() + ".";
if (edits[3]->text() == "") s += "0";
else s += edits[3]->text();
if (edits[0]->text() == "")
s = "0.";
else
s = edits[0]->text() + ".";
if (edits[1]->text() == "")
s += "0.";
else
s += edits[1]->text() + ".";
if (edits[2]->text() == "")
s += "0.";
else
s += edits[2]->text() + ".";
if (edits[3]->text() == "")
s += "0";
else
s += edits[3]->text();
return s;
}
@@ -76,7 +86,7 @@ void QIPEdit::returnPress(int index) {
}
inline void QIPEdit::textChange(int index, const QString &text) {
inline void QIPEdit::textChange(int index, const QString & text) {
if (text.length() == 3 && isVisible()) {
returnPress(index);
}