diff --git a/source/connectionDialog.cpp b/source/connectionDialog.cpp index 88581b3..750e024 100644 --- a/source/connectionDialog.cpp +++ b/source/connectionDialog.cpp @@ -149,6 +149,7 @@ void ConnectionDialog::removeConnListItem(int row) ui->lineEdit_port->setText("5432"); ui->lineEdit_userName->setText(""); ui->lineEdit_password->setText(""); + ui->lineEdit_dbName->setText(""); ui->comboBox_dbType->setCurrentText("PostgreSQL"); ui->plainTextEdit->setPlainText(""); } @@ -178,6 +179,7 @@ void ConnectionDialog::loadConnInfo(const QString& connID) ui->lineEdit_port->setText(QString::number(config.nPort)); ui->lineEdit_userName->setText(config.strUserName); ui->lineEdit_password->setText(config.strPassword); + ui->lineEdit_dbName->setText(config.strDBName); if(config.strDBType == "QPSQL") ui->comboBox_dbType->setCurrentText("PostgreSQL"); else if(config.strDBType == "QMYSQL") @@ -253,6 +255,7 @@ void ConnectionDialog::onBtnClicked_open() config.nPort = ui->lineEdit_port->text().toInt(); config.strUserName = ui->lineEdit_userName->text(); config.strPassword = ui->lineEdit_password->text(); + config.strDBName = ui->lineEdit_dbName->text(); if(ui->comboBox_dbType->currentText() == "PostgreSQL") config.strDBType = "QPSQL"; else if(ui->comboBox_dbType->currentText() == "MySQL") @@ -294,6 +297,7 @@ void ConnectionDialog::onBtnClicked_save() config.nPort = ui->lineEdit_port->text().toInt(); config.strUserName = ui->lineEdit_userName->text(); config.strPassword = ui->lineEdit_password->text(); + config.strDBName = ui->lineEdit_dbName->text(); if(ui->comboBox_dbType->currentText() == "PostgreSQL") config.strDBType = "QPSQL"; else if(ui->comboBox_dbType->currentText() == "MySQL") diff --git a/ui/connectionDialog.ui b/ui/connectionDialog.ui index 1734176..95bb0c4 100644 --- a/ui/connectionDialog.ui +++ b/ui/connectionDialog.ui @@ -51,6 +51,12 @@ + + Qt::ScrollBarPolicy::ScrollBarAsNeeded + + + Qt::ScrollBarPolicy::ScrollBarAlwaysOff + false @@ -183,42 +189,8 @@ 10 - - - - - 0 - 26 - - - - - 16777215 - 26 - - - - - PostgreSQL - - - - :/img/images/icon_postgresql.png:/img/images/icon_postgresql.png - - - - - MySQL - - - - :/img/images/icon_mysql.png:/img/images/icon_mysql.png - - - - - - + + 0 @@ -236,8 +208,8 @@ - - + + 91 @@ -251,11 +223,11 @@ - 主机名/IP地址: + 用户名: - + @@ -274,8 +246,8 @@ - - + + 0 @@ -293,7 +265,7 @@ - + @@ -315,128 +287,7 @@ - - - - - 91 - 21 - - - - - 91 - 21 - - - - 用户名: - - - - - - - - 91 - 21 - - - - - 91 - 21 - - - - 数据库类型: - - - - - - - - 0 - 21 - - - - - 16777215 - 21 - - - - 30 - - - - - - - - 91 - 21 - - - - - 91 - 21 - - - - 链接名称: - - - - - - - - 91 - 21 - - - - - 91 - 21 - - - - 密码: - - - - - - - - 91 - 21 - - - - - 91 - 21 - - - - 备注: - - - - - - - - - - - + @@ -486,6 +337,199 @@ + + + + + 91 + 21 + + + + + 91 + 21 + + + + 备注: + + + + + + + + 91 + 21 + + + + + 91 + 21 + + + + 主机名/IP地址: + + + + + + + + 91 + 21 + + + + + 91 + 21 + + + + 链接名称: + + + + + + + + 91 + 21 + + + + + 91 + 21 + + + + 密码: + + + + + + + + + + + + + + + 0 + 21 + + + + + 16777215 + 21 + + + + 30 + + + + + + + + 91 + 21 + + + + + 91 + 21 + + + + 数据库类型: + + + + + + + + 0 + 26 + + + + + 16777215 + 26 + + + + + PostgreSQL + + + + :/img/images/icon_postgresql.png:/img/images/icon_postgresql.png + + + + + MySQL + + + + :/img/images/icon_mysql.png:/img/images/icon_mysql.png + + + + + + + + + 91 + 21 + + + + + 91 + 21 + + + + 数据库名称: + + + + + + + + 0 + 21 + + + + + 16777215 + 21 + + + + 30 + + +