PIVX Core  5.6.99
P2P Digital Currency
focuseddialog.h
Go to the documentation of this file.
1 // Copyright (c) 2020 The PIVX Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef PIVX_QT_FOCUSEDDIALOG_H
6 #define PIVX_QT_FOCUSEDDIALOG_H
7 
8 #include <QDialog>
9 
10 class FocusedDialog : public QDialog
11 {
12  Q_OBJECT
13 
14 public:
15  explicit FocusedDialog(QWidget *parent = nullptr);
17 
18  // Sets focus on show
19  void showEvent(QShowEvent *event);
20 
21 protected:
22  // Detects a key press and calls accept() on ENTER and reject() on ESC
23  void keyPressEvent(QKeyEvent *e);
24 };
25 
26 #endif // PIVX_QT_FOCUSEDDIALOG_H
void keyPressEvent(QKeyEvent *e)
void showEvent(QShowEvent *event)
FocusedDialog(QWidget *parent=nullptr)