20 #ifndef XGUI_SketchConstraintsBrowser_H
21 #define XGUI_SketchConstraintsBrowser_H
24 #include <ModuleBase_Definitions.h>
25 #include <ModelAPI_Object.h>
26 #include <ModelAPI_ResultPart.h>
27 #include <ModelAPI_Events.h>
28 #include <ModelAPI_Folder.h>
29 #include <XGUI_DataModel.h>
30 #include <ModelAPI_Attribute.h>
35 #include <QVBoxLayout>
36 #include <QHBoxLayout>
39 #include <QScrollArea>
40 #include <QTreeWidget>
42 class ModuleBase_IDocumentDataModel;
54 std::vector<AttributePtr> Attributes;
80 emit contextMenuRequested(theEvent);
83 void closeEditor(
QWidget* theEditor, QAbstractItemDelegate::EndEditHint theHint);
102 bool UpdateTree(
const std::vector<std::pair<FeaturePtr, std::vector<AttributePtr>>>& theList);
113 virtual void processEvent(
const std::shared_ptr<Events_Message>& theMessage);
117 QObjectPtrList selectedObjects(QModelIndexList* theIndexes = 0)
const;
121 QObjectPtrList selectedConstraints(QModelIndexList* theIndexes = 0)
const;
125 void setObjectsSelected(
const QObjectPtrList& theObjects);
130 if (myViewTree->selectionModel())
131 return myViewTree->selectionModel()->selectedIndexes();
133 return QModelIndexList();
142 void onSelectionChanged();
149 void onDeactivateItems();
152 void SelectStateChanged(
bool theState);
165 void deleteConstraints();
166 void deactivate(
bool, std::vector<FeaturePtr>);
170 void resizeEvent(QResizeEvent* theEvent);
175 void onContextMenuRequested(QContextMenuEvent* theEvent);
178 void onSelectionChanged(
const QItemSelection& theSelected,
const QItemSelection& theDeselected);
182 void onDoubleClick(
const QModelIndex& theIndex);
188 QVBoxLayout* myLayout;
189 QHBoxLayout* myButtons;
192 QCheckBox* myExtInfo;
195 std::map<std::string, std::vector<FeatStruct>> myConstrs;
Class that reads data model definition XML for further processing in the XGUI_DataModel.
Definition: Config_DataModelReader.h:36
Base interface for any event listener.
Definition: Events_Listener.h:37
Definition: ModuleBase_ITreeNode.h:44
Definition: XGUI_SketchConstraintsBrowser.cpp:184
Definition: XGUI_SketchConstraintsBrowser.h:59
void contextMenuRequested(QContextMenuEvent *theEvent)
Emitted on context menu request.
XGUI_ConstraintsViewTree(QWidget *theParent=0)
Constructor.
Definition: XGUI_SketchConstraintsBrowser.h:64
virtual void contextMenuEvent(QContextMenuEvent *theEvent)
Redefinition of virtual method.
Definition: XGUI_SketchConstraintsBrowser.h:78
XGUI_DataModel * dataModel() const
Returns current data model.
Definition: XGUI_SketchConstraintsBrowser.h:67
This is a data model for Object Browser (QTreeView).
Definition: XGUI_DataModel.h:46
Object browser window object.
Definition: XGUI_SketchConstraintsBrowser.h:92
XGUI_Workshop * workshop() const
Returns current workshop.
Definition: XGUI_SketchConstraintsBrowser.h:140
void selectionChanged()
Emitted when selection is changed.
QModelIndexList selectedIndexes() const
Returns currently selected indexes.
Definition: XGUI_SketchConstraintsBrowser.h:128
void sizeChanged()
An signal emitted on resize of the Object Browser.
void contextMenuRequested(QContextMenuEvent *theEvent)
Emitted on context menu request.
Class which defines a configuration of the application (Workshop) and launches it.
Definition: XGUI_Workshop.h:83
Definition: XGUI_SketchConstraintsBrowser.h:52