QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
qgsfocuskeeper.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsfocuskeeper.h
3  ---------------
4  Date : May 2020
5  Copyright : (C) 2020 Even Rouault
6  Email : even dot rouault at spatialys dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSFOCUSKEEPER_H
17 #define QGSFOCUSKEEPER_H
18 
19 #include "qgis_gui.h"
20 
21 #define SIP_NO_FILE
22 
23 #include <QObject>
24 
25 class QWidget;
26 
34 class GUI_EXPORT QgsFocusKeeper : public QObject
35 {
36  Q_OBJECT
37 
38  QWidget *mWidgetToKeepFocused = nullptr;
39 
40  public:
42  ~QgsFocusKeeper() override;
43 
44  protected:
45  bool eventFilter( QObject *obj, QEvent *event ) override;
46 };
47 
48 #endif // QGSFOCUSKEEPER_H
QgsFocusKeeper
Trick to keep a widget focused and avoid QT crashes.
Definition: qgsfocuskeeper.h:35