📄 logondialog.cpp
字号:
#include "LogonDialog.h"#include "app_mysql.h"#include <qpushbutton.h>#include <qlayout.h>#include <qlabel.h>LogonDialog::LogonDialog( QWidget *parent, const char *name): QDialog(parent, name){ QGridLayout *grid = new QGridLayout(this, 3, 2, 10, 5,"grid"); grid->addWidget(new QLabel("Username", this, "usernamelabel"), 0, 0, 0); grid->addWidget(new QLabel("Password", this, "passwordlabel"), 1, 0, 0); username_entry = new QLineEdit( this, "username_entry"); password_entry = new QLineEdit( this, "password_entry"); password_entry->setEchoMode(QLineEdit::Password); grid->addWidget(username_entry, 0, 1, 0); grid->addWidget(password_entry, 1, 1, 0); QPushButton *button = new QPushButton ("Ok", this, "button"); grid->addWidget(button, 2, 1,Qt::AlignRight); connect (button, SIGNAL(clicked()), this, SLOT(accept()));}QString LogonDialog::getUsername(){ if (username_entry == NULL) return NULL; return username_entry->text();}QString LogonDialog::getPassword(){ if (password_entry == NULL) return NULL; return password_entry->text();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -