VR-Vantage
Loading...
Searching...
No Matches
DtPage.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies, Inc.
3** All rights reserved.
4******************************************************************************/
5
9
10#pragma once
11
12#include <vrvCoreQt/vrvCoreQt.h>
14
15#include <QtWidgets/QWidget>
16#include <QtWidgets/QScrollArea>
17
18#include <QtGui/QIcon>
19
20namespace makVrv
21{
22 class DtDe;
23
27 {
28 public:
30 DtPageScrollArea(QWidget* content, QWidget* parent, bool isHorizontalScrollingEnabled, bool isVerticalScrollingEnabled);
31
34
35 virtual bool eventFilter(QObject* o, QEvent* e);
36
37 protected:
41 };
42
52 {
53
54 public:
56 {
57 None = 0x0000,
58 Switching = 0x0001,
59 Closing = 0x0010
60 };
61 public:
65 DtPage(DtDe& de,QWidget* parent = 0, Qt::WindowFlags f = 0);
66
68 virtual ~DtPage();
69
71 virtual QIcon icon() = 0;
72
76
78 virtual QString title() = 0;
79
81 virtual const std::string& pageClassName() const = 0;
82
85
87 virtual void setPageAction(PageAction action);
88
90 virtual void setActionFlag(int flag);
91
93 virtual int actionFlag();
94
96 virtual void setParentDialog(QWidget* paraentDialog);
97
100
102 virtual void activate() = 0;
103
105 virtual void deactivate() = 0;
106
109 virtual bool shouldAskBeforeAction(PageAction action);
110
114 virtual void askBeforeAction();
115
118 virtual void executeAfterAsk(bool revert);
119
121 virtual void resumeLastAction();
122
124 virtual void onCloseEvent();
125
127 virtual void onSwitchEvent();
128
129 protected:
130 // Helper to wrap a page in a scroll area if enabled
131 virtual QWidget* wrapPageWithScrollArea(QWidget* scrollableWidget,
132 bool isHorizontalScrollingEnabled = false, bool isVerticalScrollingEnabled = true);
133
135 virtual DtPageScrollArea* createScrollArea(QWidget* scrollableWidget, QWidget* parent,
136 bool isHorizontalScrollingEnabled = false, bool isVerticalScrollingEnabled = true);
137
138 protected:
142
143 //the flag that will ask before executing the action, may revert or continue depends on the user input
145 };
146
153 {
154 public:
157
159 virtual ~DtPageCreator();
160
164 virtual std::string pageClassName() const = 0;
165
167 virtual DtPage* create(QWidget* parent = 0, Qt::WindowFlags f = 0) = 0;
168
169 protected:
171 };
172
173
180 template <typename PageClass>
182 {
183 public:
184
187 : DtPageCreator(de)
188 {
189 }
190
193 {
194 }
195
198 virtual std::string pageClassName() const
199 {
200 return PageClass::thePageClassName();
201 }
202
204 virtual DtPage* create(QWidget* parent = 0, Qt::WindowFlags f = 0)
205 {
206 return new PageClass(myDe, parent, f);
207 }
208 };
209}
210
Contains makVrv::DtWidgetIconStyleManager class declaration.
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer,...
Definition DtDe.h:77
DtDe & myDe
Definition DtPage.h:170
DtPageCreator(DtDe &de)
CTOR takes a reference to the DtDe object.
virtual ~DtPageCreator()
Virtual DTOR allows subclasses to clean up resources.
virtual DtPage * create(QWidget *parent=0, Qt::WindowFlags f=0)=0
Abstract create call which makes a page.
virtual std::string pageClassName() const =0
Get the name of the page class this creator is creating. This page name should be unique....
virtual std::string pageClassName() const
get the name of the PageClass. PageClass must implement thePageClassName static function.
Definition DtPage.h:198
virtual DtPage * create(QWidget *parent=0, Qt::WindowFlags f=0)
Simple implementation of the create call to make a PageClass.
Definition DtPage.h:204
DtPageCreatorTemplate(DtDe &de)
CTOR takes a reference to the DtDe object.
Definition DtPage.h:186
virtual ~DtPageCreatorTemplate()
Virtual DTOR allows subclasses to clean up resources.
Definition DtPage.h:192
The page is a single widget component which is viewed in a page collection.
Definition DtPage.h:52
virtual void setParentDialog(QWidget *paraentDialog)
set the parent dialog that owns this page
virtual const std::string & pageClassName() const =0
Get the class name of the page.
virtual void setActionFlag(int flag)
set the action flag of the page
QWidget * myParentDialog
Definition DtPage.h:140
virtual ~DtPage()
DTOR for page.
virtual void askBeforeAction()
Called when the action flag is set and before the action is beind executed, default do nothing....
virtual void executeAfterAsk(bool revert)
Called after askBeforeAction(), whether user wants to revert the action or resume the action /param r...
virtual void deactivate()=0
Called when the page is hidden.
virtual QWidget * wrapPageWithScrollArea(QWidget *scrollableWidget, bool isHorizontalScrollingEnabled=false, bool isVerticalScrollingEnabled=true)
virtual QWidget * parentDialog()
return the parent dialog that own this page
virtual void setPageAction(PageAction action)
set the curret action on the page
DtPage(DtDe &de, QWidget *parent=0, Qt::WindowFlags f=0)
CTOR for page. The DtPage should not populate itself automatically. It should only do this when activ...
virtual bool shouldAskBeforeAction(PageAction action)
test the action flag with the action, return true if we should ask before executing the action /param...
DtDe & myDe
Definition DtPage.h:139
virtual QString title()=0
Get the title of the page.
virtual void resumeLastAction()
resume the last action of the page
virtual void onCloseEvent()
will be called when user hit the close button of this page, default do nothing.
virtual void onSwitchEvent()
will be called when user try switch to another page, default do nothing.
virtual int actionFlag()
return the action flag of the page
virtual void activate()=0
Called when the page is displayed.
virtual PageAction pageAction()
return the current action on the page
virtual QIcon icon()=0
Get the icon of the page.
virtual DtQIconConfigurations qIconConfigurations() const =0
Get the icon configurations for the page. This is used to style the page's icon based on application ...
int myActionFlag
Definition DtPage.h:144
PageAction myCurrentPageAction
Definition DtPage.h:141
virtual DtPageScrollArea * createScrollArea(QWidget *scrollableWidget, QWidget *parent, bool isHorizontalScrollingEnabled=false, bool isVerticalScrollingEnabled=true)
Creates a DtPageScrollArea for the given widget and parent.
PageAction
Definition DtPage.h:56
@ Closing
Definition DtPage.h:59
@ None
Definition DtPage.h:57
@ Switching
Definition DtPage.h:58
Helper class which implements a scroll area for pages. To override this class, override the DtPage::c...
Definition DtPage.h:27
DtPageScrollArea(QWidget *content, QWidget *parent, bool isHorizontalScrollingEnabled, bool isVerticalScrollingEnabled)
CTOR.
bool myIsVerticalScrollingEnabled
Definition DtPage.h:40
virtual bool eventFilter(QObject *o, QEvent *e)
virtual ~DtPageScrollArea()
Virtual DTOR.
bool myIsHorizontalScrollingEnabled
Definition DtPage.h:39
QWidget * myScrollAreaWidgetContents
Definition DtPage.h:38
A collection of icon configurations. The collection maintains flags indicating whether to generate ic...
Definition DtQIconConfiguration.h:132
Contains DtCreateSensorFieldOfViewCommand and DtCreateSensorFieldOfViewCommandCreator class declarati...
Definition DtGridLinesSettingsRecord.h:16
Contains DLL export macros.
#define DT_DLL_VRVCOREQT
Definition vrvCoreQt.h:20