MuseScore  3.4
Music composition and notation
enableplayforwidget.h
Go to the documentation of this file.
1 
2 #ifndef __ENABLEPLAYWIDGET__
3 #define __ENABLEPLAYWIDGET__
4 
5 /*
6  This class was created for keyboard accessibility purposes.
7  It should be used by widgets that want to allow score playback if they have focus, but not their children.
8  Additionally, if one of its children widgets has focus and Escape is pressed the target widget will gain focus.
9  The shortcut for this target widget's play action will always be the same as the global one ( getAction("play") )
10 
11  NOTE: The client is responsible for setting the appropriate Focus Policies for its controllers and forwards the
12  calls of showEvent and eventFilter to their reference of EnablePlayForWidget object.
13 
14 */
15 namespace Ms {
16 
18  QAction* _localPlayAction;
19  QWidget* _target;
20 
21 public:
22  void showEvent(QShowEvent *);
23  bool eventFilter(QObject* obj, QEvent* e);
24  EnablePlayForWidget(QWidget* target);
25  void connectLocalPlayToDifferentSlot(QObject* obj, const char* id);
26 };
27 
28 }
29 
30 #endif
EnablePlayForWidget(QWidget *target)
Definition: enableplayforwidget.cpp:7
void showEvent(QShowEvent *)
Definition: enableplayforwidget.cpp:22
bool eventFilter(QObject *obj, QEvent *e)
Definition: enableplayforwidget.cpp:34
QWidget * _target
Definition: enableplayforwidget.h:19
void connectLocalPlayToDifferentSlot(QObject *obj, const char *id)
Definition: enableplayforwidget.cpp:61
Definition: enableplayforwidget.h:17
QAction * _localPlayAction
Definition: enableplayforwidget.h:18
Definition: aeolus.cpp:26