OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
CentralWidgetManager.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
9#include "OTCore/Flags.h"
13
14// Qt header
15#include <QtGui/qmovie.h>
16#include <QtWidgets/qwidget.h>
17
18class QLabel;
19
20namespace ot {
21
22 class MainWindow;
23
26 public:
27
30 CentralWidgetManager(MainWindow* _window = (MainWindow*)nullptr);
31 virtual ~CentralWidgetManager();
32
36 std::unique_ptr<QWidget> replaceCurrentCentralWidget(QWidget* _widget);
37
40 QWidget* getCurrentCentralWidget(void) { return m_currentCentral; };
41
44 const QWidget* getCurrentCentralWidget(void) const { return m_currentCentral; };
45
46 void setOverlayAnimation(std::shared_ptr<QMovie> _animation);
47
48 std::shared_ptr<QMovie> getCurrentOverlayAnimation(void) const { return m_animation; };
49
50 void setOverlayAnimationVisible(bool _visible, bool _noDelay = false);
51
52 void setOverlayAnimatioShowDelay(int _delay);
53 int getOverlayAnimatioShowDelay(void) const;
54
55 void setOverlayAnimatioHideDelay(int _delay);
56 int getOverlayAnimatioHideDelay(void) const;
57
58 protected:
59 virtual void resizeEvent(QResizeEvent* _event) override;
60
61 private Q_SLOTS:
62 void slotShowAnimation(void);
63 void slotHideAnimation(void);
64
65 private:
66 void applyWaitingAnimationVisible(bool _visible);
67
68 QWidget* m_currentCentral;
69
70 DelayedShowHideHandler m_animationShowHideHandler;
71 std::shared_ptr<QMovie> m_animation;
72 QLabel* m_animationLabel;
73 bool m_animationVisible;
74 };
75
76}
This file contains defines that may be used simplyfy class creation.
#define OT_DECL_NOCOPY(___class)
Removes the default copy constructor and assignment operator.
Definition OTClassHelper.h:14
#define OT_WIDGETS_API_EXPORT
Definition OTWidgetsAPIExport.h:12
Definition CentralWidgetManager.h:24
QWidget * getCurrentCentralWidget(void)
Returns writeable pointer to the currently set central widget. The CentralWidgetManager keeps ownersh...
Definition CentralWidgetManager.h:40
const QWidget * getCurrentCentralWidget(void) const
Returns read-only pointer to the currently set central widget. The CentralWidgetManager keeps ownersh...
Definition CentralWidgetManager.h:44
std::shared_ptr< QMovie > getCurrentOverlayAnimation(void) const
Definition CentralWidgetManager.h:48
Definition DelayedShowHideHandler.h:13
Definition MainWindow.h:17
Definition Connector.h:8