调整登录界面

This commit is contained in:
yangjiaxuan 2022-12-31 14:18:08 +08:00
parent 3acb2e7960
commit a467f07dbd
2 changed files with 15 additions and 8 deletions

View File

@ -26,6 +26,13 @@ Dialog_logIn::Dialog_logIn(QWidget *parent) :
ui->label_title->setText(tr("LogIn"));
ui->lineEdit_password->setEchoMode(QLineEdit::EchoMode::Password);
QString ipStr = "\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b";
QString portStr = "[0-9]+$";
ui->lineEdit_dbHost->setValidator(new QRegExpValidator(QRegExp(ipStr)));
ui->lineEdit_ftpHost->setValidator(new QRegExpValidator(QRegExp(ipStr)));
ui->lineEdit_dbPort->setValidator(new QRegExpValidator(QRegExp(portStr)));
ui->lineEdit_ftpPort->setValidator(new QRegExpValidator(QRegExp(portStr)));
QString account("root");
QString dbHost("192.168.1.70");
QString dbPort("3306");
@ -33,7 +40,6 @@ Dialog_logIn::Dialog_logIn(QWidget *parent) :
QString ftpPort("21");
ui->lineEdit_account->setText(getCfgValue("login", "account", account));
ui->lineEdit_dbHost->setText(getCfgValue("login", "dbHost", dbHost));
ui->lineEdit_dbPort->setText(getCfgValue("login", "dbPort", dbPort));
ui->lineEdit_ftpHost->setText(getCfgValue("login", "ftpHost", ftpHost));
@ -161,7 +167,8 @@ QString Dialog_logIn::getCfgValue(const char *appName, const char *key, const QS
HGBase_GetConfigPath(cfgPath, 512);
strcat(cfgPath, "config.ini");
std::string def2 = getStdString(def);
HGChar value[512] = {0};
HGBase_GetProfileString(cfgPath, appName, key, getStdString(def).c_str(), value, 512);
HGBase_GetProfileString(cfgPath, appName, key, def2.c_str(), value, 512);
return StdStringToUtf8(value).c_str();
}

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>455</width>
<width>473</width>
<height>278</height>
</rect>
</property>
@ -146,7 +146,7 @@ QPushButton#pbtn_close::hover
<rect>
<x>40</x>
<y>40</y>
<width>381</width>
<width>411</width>
<height>141</height>
</rect>
</property>
@ -220,7 +220,7 @@ QPushButton#pbtn_close::hover
<rect>
<x>150</x>
<y>20</y>
<width>151</width>
<width>171</width>
<height>20</height>
</rect>
</property>
@ -243,7 +243,7 @@ QPushButton#pbtn_close::hover
<rect>
<x>150</x>
<y>50</y>
<width>151</width>
<width>171</width>
<height>20</height>
</rect>
</property>
@ -266,7 +266,7 @@ QPushButton#pbtn_close::hover
<rect>
<x>150</x>
<y>80</y>
<width>151</width>
<width>171</width>
<height>20</height>
</rect>
</property>
@ -289,7 +289,7 @@ QPushButton#pbtn_close::hover
<rect>
<x>150</x>
<y>110</y>
<width>151</width>
<width>171</width>
<height>20</height>
</rect>
</property>