Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
ProjectWidget.h
Go to the documentation of this file.
1#pragma once
2#include <QWidget>
6#include <ipj/iface/global.h>
7
8namespace sf
9{
10class ListModel;
11
12namespace Ui
13{
14class ProjectWidget;
15}
16
20class _IPJ_CLASS ProjectWidget final : public QWidget
21{
22 Q_OBJECT
23
24 public:
28 explicit ProjectWidget(QWidget* parent);
29
33 ~ProjectWidget() override;
34
38 void storeState(bool rd);
39
44
49
53 void setAreaViewerParent(QWidget* widget);
54
58 QWidget* getAreaViewerParent() const;
59
64
69
104
109
114 bool isProjectActive() const;
115
120
127
133 void manageProjectData(bool create);
134
141 QColor getStateColor(bool background, int state);
142
148 void updateIndex(int index = -2, bool make_visible = false);
149
154
159
163 void setSelectedIndex(int index);
164
165 private:
167 using ImageInfo = QPair<QString, QColor>;
169 void paintProgress(QWidget* widget, const QPaintEvent* event);
171 QString getFieldText(int row, EColumnField cf);
173 ImageInfo getFieldImageResource(int row, EColumnField cf);
175 void createColumns();
177 void getListData(const QModelIndex& index, int role, QVariant& data);
179 void setListData(const QModelIndex& index, int role, const QVariant& data);
180 // Handler for when the selection in the tree view changes.
181 void selectionListChange(int current, int previous);
183 void editSystemProperties();
185 void editProjectProperties();
187 void editScanProperties();
188
190 Ui::ProjectWidget* ui;
192 ProjectData* _projectData;
194 StoreProject _storeProject;
196 ListModel* _listModel;
198 QList<EColumnField> _columFields;
200 QWidget* _areaViewerParent;
202 ModelViewerWidget* _modelViewer;
203};
204
205}// namespace sf
Definition ListModel.h:14
Placeholder for the OpenGL widget showing the 3D model of the system and object.
Definition ModelViewerWidget.h:12
Keeps the project and all scan areas to inspect.
Definition ProjectData.h:25
Manages all inspection project data.
Definition ProjectWidget.h:21
bool store(StoreProject::EAction action)
Action to take on the project file.
QWidget * getAreaViewerParent() const
Gets the parent for scan area viewer instances.
~ProjectWidget() override
Overridden destructor.
void updateAreaViewerTitle()
Sets the title on the area viewer parent reflecting the current selected area.
ProjectWidget(QWidget *parent)
Default Qt constructor.
void updateCount()
Updates the entry count in the list.
EColumnField
Enumeration of displayable scan-area information in the table.
Definition ProjectWidget.h:74
@ cfInspectionState
State of the inspection.
Definition ProjectWidget.h:84
@ cfMaterial
Type of inspected material.
Definition ProjectWidget.h:82
@ cfMethod
Selected scan method.
Definition ProjectWidget.h:92
@ cfCalibrationSet
Calibration-set selection. For ultrasonic type it depends on the inspection angle....
Definition ProjectWidget.h:86
@ cfSettings
Settings selection.
Definition ProjectWidget.h:88
@ cfFilterConfig
Configuration of analysis filters.
Definition ProjectWidget.h:90
@ cfCommand
Command currently executed.
Definition ProjectWidget.h:94
@ cfElement
Ultrasonic or eddy-current element.
Definition ProjectWidget.h:80
@ cfScanState
State of the scan.
Definition ProjectWidget.h:96
@ cfUsername
User performing the scan. This can change during a long inspection.
Definition ProjectWidget.h:98
@ cfDateTime
Date and time of the inspected area.
Definition ProjectWidget.h:100
@ cfTool
Tool extension on the element.
Definition ProjectWidget.h:78
ProjectData * getProjectData() const
Gets the project data associated with this widget.
QColor getStateColor(bool background, int state)
Gets the color associated with the project state.
void setAreaViewerParent(QWidget *widget)
Sets the parent for scan area viewer instances.
void storeState(bool rd)
Stores and restores the state of the widget.
ModelViewerWidget * getModelViewer() const
Gets the parent for the model viewer instance.
void updateTitle()
Updates the title of the widget to represent the selected project and inspection.
void setSelectedIndex(int index)
Sets the selected row index.
void setModelViewer(ModelViewerWidget *widget)
Sets the model viewer instance.
void updateIndex(int index=-2, bool make_visible=false)
Updates information of an entry in the scan area tree view and the status bar.
int getSelectedIndex()
Gets the current selected row index.
void updateModelViewerTitle()
Sets the title on the model viewer parent reflecting the current selected area.
void manageProjectData(bool create)
Creates or destroys the project data instance. When created it sets some required information.
bool isProjectActive() const
Gets the active status of the project.
Class to manage the storing of a part project.
Definition StoreProject.h:14
EAction
Requested actions.
Definition StoreProject.h:22
#define _IPJ_CLASS
Definition ipj/iface/global.h:35
Definition ApplicationPropertyPage.h:7
Definition Application.h:10