Version: 9.15.0
QtGuiContext.hxx
Go to the documentation of this file.
1 // Copyright (C) 2006-2025 CEA, EDF
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 #ifndef _QTGUICONTEXT_HXX_
21 #define _QTGUICONTEXT_HXX_
22 
23 #include "GenericGuiExport.hxx"
24 #include "guiContext.hxx"
25 #include "SchemaModel.hxx"
26 #include "SchemaItem.hxx"
27 #include "SceneItem.hxx"
28 #include "ItemEdition.hxx"
29 #include "GenericGui.hxx"
30 #include "FormEditTree.hxx"
31 #include "GraphicsView.hxx"
32 #include "GuiExecutor.hxx"
33 #include <QGraphicsScene>
34 #include <QItemSelectionModel>
35 #include <QStackedWidget>
36 #include <QWidget>
37 #include <QString>
38 #include <set>
39 
40 #include <SuitWrapper.hxx>
41 
42 class counters;
43 
44 namespace YACS
45 {
46  namespace HMI
47  {
49  {
50  public:
52  virtual ~QtGuiContext();
53  virtual void setProc(YACS::ENGINE::Proc* proc);
54 
55  inline YACS::HMI::GenericGui* getGMain() {return _gmain; };
56 
57  inline YACS::HMI::SchemaModel* getSchemaModel() {return _schemaModel; };
58  inline FormEditTree* getEditTree() {return _editTree; };
59  inline QGraphicsScene* getScene() {return _scene; };
60  inline YACS::HMI::GraphicsView* getView() {return _view; };
61  inline YACS::HMI::ItemEditionRoot* getEditionRoot() {return _rootEdit; };
62  inline QWidget* getWindow() {return _window; };
63  inline QItemSelectionModel* getSelectionModel() {return _selectionModel; };
64  inline QStackedWidget* getStackedWidget() {return _stackedWidget; };
65  inline QString getFileName() {return _fileName; };
66  inline YACS::HMI::GuiExecutor* getGuiExecutor() {return _guiExecutor; };
67  inline bool isEdition() {return _isEdition; };
68  inline bool isLoadingPresentation() {return _isLoadingPresentation; };
69 
70  YACS::HMI::Subject* getSubjectToPaste(bool &isCut);
71 
72  YACS::HMI::Subject* getSelectedSubject() {return _selectedSubject; };
73 
74  inline void setSchemaModel(YACS::HMI::SchemaModel* model) {_schemaModel = model; };
75  inline void setEditTree(FormEditTree* editTree) {_editTree = editTree; };
76  inline void setScene(QGraphicsScene *scene) {_scene = scene; };
77  inline void setView(YACS::HMI::GraphicsView *view) {_view = view; };
78  inline void setEditionRoot(YACS::HMI::ItemEditionRoot* re) {_rootEdit = re; };
79  inline void setWindow(QWidget* window) {_window = window; };
80  inline void setSelectionModel(QItemSelectionModel* selmod) {_selectionModel = selmod; };
81  inline void setStackedWidget(QStackedWidget* sw) {_stackedWidget = sw; };
82  inline void setFileName(const QString& fileName) {_fileName = fileName; };
83  inline void setGuiExecutor(YACS::HMI::GuiExecutor* guiEx) {_guiExecutor = guiEx; };
84  inline void setEdition(bool isEdition) {_isEdition = isEdition; };
85  inline void setLoadingPresentation(bool isLoadpres) {_isLoadingPresentation = isLoadpres; };
86 
87  void setSubjectToCut(YACS::HMI::Subject* sub);
88  void setSubjectToCopy(YACS::HMI::Subject* sub);
89 
90  inline void setSelectedSubject(YACS::HMI::Subject* sub) {_selectedSubject = sub; };
91 
92  inline static QtGuiContext* getQtCurrent() {return _QtCurrent; };
93  inline static void setQtCurrent(QtGuiContext* context) { _QtCurrent=context; _current=context; };
94 
95  std::map<YACS::HMI::Subject*, YACS::HMI::SchemaItem*> _mapOfSchemaItem;
96  std::map<YACS::HMI::Subject*, YACS::HMI::SceneItem*> _mapOfSceneItem;
97  std::map<YACS::HMI::Subject*, QWidget*> _mapOfEditionItem;
98  std::set<YACS::HMI::Subject*> _setOfModifiedSubjects;
99 
100  static std::set<QtGuiContext*> _setOfContext;
102  static bool _delayCalc;
103 
104  protected:
109  QItemSelectionModel* _selectionModel;
114  QStackedWidget * _stackedWidget;
115  QString _fileName;
121  };
122 
123  }
124 }
125 #endif
#define GENERICGUI_EXPORT
Base class for all schema objects.
Definition: Proc.hxx:44
static QtGuiContext * _QtCurrent
void setEditionRoot(YACS::HMI::ItemEditionRoot *re)
YACS::HMI::GuiExecutor * _guiExecutor
void setSelectionModel(QItemSelectionModel *selmod)
void setView(YACS::HMI::GraphicsView *view)
YACS::HMI::Subject * _selectedSubject
std::map< YACS::HMI::Subject *, YACS::HMI::SchemaItem * > _mapOfSchemaItem
void setSelectedSubject(YACS::HMI::Subject *sub)
void setEditTree(FormEditTree *editTree)
std::set< YACS::HMI::Subject * > _setOfModifiedSubjects
QItemSelectionModel * getSelectionModel()
QItemSelectionModel * _selectionModel
void setStackedWidget(QStackedWidget *sw)
QGraphicsScene * getScene()
void setWindow(QWidget *window)
YACS::HMI::ItemEditionRoot * getEditionRoot()
YACS::HMI::GraphicsView * _view
YACS::HMI::SchemaModel * getSchemaModel()
static QtGuiContext * getQtCurrent()
std::map< YACS::HMI::Subject *, QWidget * > _mapOfEditionItem
FormEditTree * _editTree
void setGuiExecutor(YACS::HMI::GuiExecutor *guiEx)
YACS::HMI::GraphicsView * getView()
void setFileName(const QString &fileName)
void setScene(QGraphicsScene *scene)
void setLoadingPresentation(bool isLoadpres)
FormEditTree * getEditTree()
YACS::HMI::GenericGui * _gmain
QStackedWidget * getStackedWidget()
void setEdition(bool isEdition)
YACS::HMI::GenericGui * getGMain()
void setSchemaModel(YACS::HMI::SchemaModel *model)
std::map< YACS::HMI::Subject *, YACS::HMI::SceneItem * > _mapOfSceneItem
static counters * _counters
QGraphicsScene * _scene
YACS::HMI::Subject * getSelectedSubject()
static std::set< QtGuiContext * > _setOfContext
static void setQtCurrent(QtGuiContext *context)
YACS::HMI::GuiExecutor * getGuiExecutor()
YACS::HMI::ItemEditionRoot * _rootEdit
QStackedWidget * _stackedWidget
YACS::HMI::SchemaModel * _schemaModel
viewer QGraphicsScene: deriver SUIT_ViewModel comme QxGraph_Viewer
Definition: SuitWrapper.hxx:43