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>
5#include <ipj/iface/global.h>
6
7namespace sf
8{
9class ListModel;
10
11namespace Ui
12{
13class ProjectWidget;
14}
15
19class _IPJ_CLASS ProjectWidget final : public QWidget
20{
21 Q_OBJECT
22
23 public:
27 explicit ProjectWidget(QWidget* parent);
28
32 ~ProjectWidget() override;
33
37 void storeState(bool rd);
38
42 void setViewerParent(QWidget* widget);
43
48
52 QWidget* getViewerParent();
53
88
93
98 bool isProjectActive() const;
99
104
111
117 void manageProjectData(bool create);
118
125 QColor getStateColor(bool background, int state);
126
132 void updateIndex(int index = -2, bool make_visible = false);
133
138
143
147 void setSelectedIndex(int index);
148
149 private:
151 using ImageInfo = QPair<QString, QColor>;
153 void paintProgress(QWidget* widget, const QPaintEvent* event);
155 QString getFieldText(int row, EColumnField cf);
157 ImageInfo getFieldImageResource(int row, EColumnField cf);
159 void createColumns();
161 void getListData(const QModelIndex& index, int role, QVariant& data);
163 void setListData(const QModelIndex& index, int role, const QVariant& data);
164 // Handler for when the selection in the tree view changes.
165 void selectionListChange(int current, int previous);
167 void editSystemProperties();
169 void editProjectProperties();
171 void editScanProperties();
172
174 Ui::ProjectWidget* ui;
176 ProjectData* _projectData;
178 StoreProject _storeProject;
180 ListModel* _listModel;
182 QList<EColumnField> _columFields;
184 QWidget* _viewerParent;
185};
186
187}// namespace sf
Definition ListModel.h:14
Keeps the project and all scan areas to inspect.
Definition ProjectData.h:25
Manages all inspection project data.
Definition ProjectWidget.h:20
bool store(StoreProject::EAction action)
Action to take on the project file.
~ProjectWidget() override
Overridden destructor.
void setViewerParent(QWidget *widget)
Sets the parent for scan method viewer instances.
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:58
@ cfInspectionState
State of the inspection.
Definition ProjectWidget.h:68
@ cfMaterial
Type of inspected material.
Definition ProjectWidget.h:66
@ cfMethod
Selected scan method.
Definition ProjectWidget.h:76
@ cfCalibrationSet
Calibration-set selection. For ultrasonic type it depends on the inspection angle....
Definition ProjectWidget.h:70
@ cfSettings
Settings selection.
Definition ProjectWidget.h:72
@ cfFilterConfig
Configuration of analysis filters.
Definition ProjectWidget.h:74
@ cfCommand
Command currently executed.
Definition ProjectWidget.h:78
@ cfElement
Ultrasonic or eddy-current element.
Definition ProjectWidget.h:64
@ cfScanState
State of the scan.
Definition ProjectWidget.h:80
@ cfUsername
User performing the scan. This can change during a long inspection.
Definition ProjectWidget.h:82
@ cfDateTime
Date and time of the inspected area.
Definition ProjectWidget.h:84
@ cfTool
Tool extension on the element.
Definition ProjectWidget.h:62
QColor getStateColor(bool background, int state)
Gets the color associated with the project state.
void storeState(bool rd)
Stores and restores the state of the widget.
void updateViewerTitle()
Sets the title on the viewer parent reflecting the current selected area.
void updateTitle()
Updates the title of the widget to represent the selected project and inspection.
void setSelectedIndex(int index)
Sets the selected row index.
ProjectData * getProjectData()
Gets the project data associated with this widget.
QWidget * getViewerParent()
Gets the parent for scan method viewer instances.
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 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