1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Add quit (CTRL+Q) shortcut to login screen

This commit is contained in:
tux3 2015-06-05 15:45:43 +02:00
parent ac0beffd0c
commit 0923e2b733
No known key found for this signature in database
GPG Key ID: 7E086DD661263264
2 changed files with 5 additions and 1 deletions

View File

@ -10,10 +10,12 @@
LoginScreen::LoginScreen(QWidget *parent) : LoginScreen::LoginScreen(QWidget *parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::LoginScreen) ui(new Ui::LoginScreen),
quitShortcut{QKeySequence(Qt::CTRL + Qt::Key_Q), this}
{ {
ui->setupUi(this); ui->setupUi(this);
connect(&quitShortcut, &QShortcut::activated, this, &LoginScreen::close);
connect(ui->newProfilePgbtn, &QPushButton::clicked, this, &LoginScreen::onNewProfilePageClicked); connect(ui->newProfilePgbtn, &QPushButton::clicked, this, &LoginScreen::onNewProfilePageClicked);
connect(ui->loginPgbtn, &QPushButton::clicked, this, &LoginScreen::onLoginPageClicked); connect(ui->loginPgbtn, &QPushButton::clicked, this, &LoginScreen::onLoginPageClicked);
connect(ui->createAccountButton, &QPushButton::clicked, this, &LoginScreen::onCreateNewProfile); connect(ui->createAccountButton, &QPushButton::clicked, this, &LoginScreen::onCreateNewProfile);

View File

@ -2,6 +2,7 @@
#define LOGINSCREEN_H #define LOGINSCREEN_H
#include <QWidget> #include <QWidget>
#include <QShortcut>
namespace Ui { namespace Ui {
class LoginScreen; class LoginScreen;
@ -29,6 +30,7 @@ private slots:
private: private:
Ui::LoginScreen *ui; Ui::LoginScreen *ui;
QShortcut quitShortcut;
}; };
#endif // LOGINSCREEN_H #endif // LOGINSCREEN_H