VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
20 namespace makVrv
21 {
22  class DtDe;
23 
27  {
28  public:
30  DtPageScrollArea(QWidget* content, QWidget* parent, bool isHorizontalScrollingEnabled, bool isVerticalScrollingEnabled);
31 
33  virtual ~DtPageScrollArea();
34 
35  virtual bool eventFilter(QObject* o, QEvent* e);
36 
37  protected:
41  };
42 
51  class DT_DLL_VRVCOREQT DtPage : public QWidget
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 
75  virtual DtQIconConfigurations qIconConfigurations() const = 0;
76 
78  virtual QString title() = 0;
79 
81  virtual const std::string& pageClassName() const = 0;
82 
84  virtual PageAction pageAction();
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 
99  virtual QWidget* parentDialog();
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:
140  QWidget* myParentDialog;
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:
156  DtPageCreator(DtDe& de);
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 
DtDe & myDe
Definition: DtPage.h:139
virtual bool eventFilter(QObject *o, QEvent *e)
PageAction myCurrentPageAction
Definition: DtPage.h:141
DtDe & myDe
Definition: DtPage.h:170
QWidget * myParentDialog
Definition: DtPage.h:140
virtual DtPage * create(QWidget *parent=0, Qt::WindowFlags f=0)
Simple implementation of the create call to make a PageClass.
Definition: DtPage.h:204
The page creator. This class should be extended by all page classes.
Definition: DtPage.h:152
Contains makVrv::DtWidgetIconStyleManager class declaration.
#define DT_DLL_VRVCOREQT
Definition: vrvCoreQt.h:20
Contains DLL export macros.
Definition: DtPage.h:181
virtual std::string pageClassName() const
get the name of the PageClass. PageClass must implement thePageClassName static function.
Definition: DtPage.h:198
Helper class which implements a scroll area for pages. To override this class, override the DtPage::c...
Definition: DtPage.h:26
virtual ~DtPageCreatorTemplate()
Virtual DTOR allows subclasses to clean up resources.
Definition: DtPage.h:192
bool myIsHorizontalScrollingEnabled
Definition: DtPage.h:39
int myActionFlag
Definition: DtPage.h:144
The page is a single widget component which is viewed in a page collection.
Definition: DtPage.h:51
DtPageCreatorTemplate(DtDe &de)
CTOR takes a reference to the DtDe object.
Definition: DtPage.h:186
virtual ~DtPageScrollArea()
Virtual DTOR.
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
DtPageScrollArea(QWidget *content, QWidget *parent, bool isHorizontalScrollingEnabled, bool isVerticalScrollingEnabled)
CTOR.
A collection of icon configurations. The collection maintains flags indicating whether to generate ic...
Definition: DtQIconConfiguration.h:131
QWidget * myScrollAreaWidgetContents
Definition: DtPage.h:38
PageAction
Definition: DtPage.h:55
bool myIsVerticalScrollingEnabled
Definition: DtPage.h:40

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)