AGX Dynamics  2.35.0.1
DockWidgetWithCloseSignal.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #ifndef AGXQT_DOCKWIDGETCLOSESIGNAL_H
18 #define AGXQT_DOCKWIDGETCLOSESIGNAL_H
19 
20 #include <agxQt/export.h>
21 
22 #include <agx/PushDisableWarnings.h> // Disabling warnings. Include agx/PopDisableWarnings.h below!
23 #include <QMainWindow>
24 #include <QWidget>
25 #include <QDockWidget>
26 #include <QCloseEvent>
27 #include <QObject>
28 #include <agx/PopDisableWarnings.h> // End of disabled warnings.
29 
30 namespace agxQt
31 {
32  class AGXQT_EXPORT DockWidgetWithCloseSignal : public QDockWidget
33  {
34  Q_OBJECT
35  public:
36  explicit DockWidgetWithCloseSignal(const QString &title, QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags() )
37  : QDockWidget( title, parent, flags )
38  {
39 
40  }
41 
42  explicit DockWidgetWithCloseSignal(QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags() )
43  : QDockWidget( parent, flags )
44  {
45 
46  }
47 
48  signals:
49  void signalDockWidgetVisible(bool visible);
50 
51  protected:
52  void closeEvent(QCloseEvent *event)
53  {
54  event->ignore();
55  signalDockWidgetVisible(false);
56  }
57  };
58 }
59 
60 #endif
#define AGXQT_EXPORT
DockWidgetWithCloseSignal(const QString &title, QWidget *parent=0, Qt::WindowFlags flags=Qt::WindowFlags())
DockWidgetWithCloseSignal(QWidget *parent=0, Qt::WindowFlags flags=Qt::WindowFlags())
void signalDockWidgetVisible(bool visible)
Contains classes/utility functions for connecting AGX to QT with OSG.