Chatterino
BasePopup.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "common/FlagsEnum.hpp"
4 #include "widgets/BaseWindow.hpp"
5 
6 class QDialogButtonBox;
7 
8 namespace chatterino {
9 
10 class BasePopup : public BaseWindow
11 {
12 public:
14  QWidget *parent = nullptr);
15 
16 protected:
17  void keyPressEvent(QKeyEvent *e) override;
18 
19  // handleEscape is a helper function for clicking the "Reject" role button of a button box when the Escape button is pressed
20  bool handleEscape(QKeyEvent *e, QDialogButtonBox *buttonBox);
21 
22  // handleEnter is a helper function for clicking the "Accept" role button of a button box when Return or Enter is pressed
23  bool handleEnter(QKeyEvent *e, QDialogButtonBox *buttonBox);
24 };
25 
26 } // namespace chatterino
void keyPressEvent(QKeyEvent *e) override
Definition: BasePopup.cpp:14
bool handleEnter(QKeyEvent *e, QDialogButtonBox *buttonBox)
Definition: BasePopup.cpp:46
Definition: BaseWindow.hpp:20
Definition: Application.cpp:48
Definition: BasePopup.hpp:10
Definition: FlagsEnum.hpp:9
bool handleEscape(QKeyEvent *e, QDialogButtonBox *buttonBox)
Definition: BasePopup.cpp:25
BasePopup(FlagsEnum< BaseWindow::Flags > flags_=None, QWidget *parent=nullptr)
Definition: BasePopup.cpp:9
Definition: BaseWindow.hpp:26