|
@yafeilinux 我怎样在这个基础上,在 Login界面上增加一个设置按钮,以此再弹一个Login的子窗口来优先设置一些参数,如连接数据库的服务器IP地址。
若在logindilalog 类中:- #ifndef LOGINDIALOG_H
- #define LOGINDIALOG_H
- #include <QDialog>
- #include "settingdialog.h"
- namespace Ui {
- class LoginDialog;
- }
- class LoginDialog : public QDialog
- {
- Q_OBJECT
-
- public:
- explicit LoginDialog(QWidget *parent = 0);
- ~LoginDialog();
-
- private slots:
- void on_loginBtn_clicked();
- void on_settingLinkButton_clicked();
- private:
- Ui::LoginDialog *ui;
- settingDialog settingForm; //就是这儿了
- };
- #####接着通过QSS 设置信号槽来显示###
- void LoginDialog::on_loginBtn_clicked()
- {
- if(ui->usrLineEdit->text().trimmed() == tr("yafeilinux")
- && ui->pwdLineEdit->text() == tr("123456"))
- {
- accept();
- } else {
- QMessageBox::warning(this, tr("Waring"),
- tr("user name or password error!"),
- QMessageBox::Yes);
- ui->usrLineEdit->clear();
- ui->pwdLineEdit->clear();
- ui->usrLineEdit->setFocus();
- }
- }
- void LoginDialog::on_settingLinkButton_clicked()
- {
- settingForm.show(); ///就是这儿了
- }
- #endif // LOGINDIALOG_H
复制代码 接着怎样将SettingForm 设为锁定窗口优先处理呀? |
|