25 #include <QPushButton>
26 #include <QScrollArea>
30 , m_currentMultiLayerWidget(nullptr)
31 , m_undoAction(nullptr)
32 , m_redoAction(nullptr)
33 , m_showInlineEditButtonsAction(nullptr)
34 , m_asAngstromAction(nullptr)
35 , m_currentMultiLayerItem(nullptr)
36 , m_document(document)
38 setAttribute(Qt::WA_StyledBackground,
true);
39 setProperty(
"stylable",
true);
46 m_toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
48 auto* mainLayout =
new QVBoxLayout(
this);
49 mainLayout->setContentsMargins(0, 0, 0, 0);
50 mainLayout->setSpacing(0);
68 auto* asNanometerAction =
new QAction(
this);
69 asNanometerAction->setIcon(QIcon(
":/images/unit_nm.svg"));
70 asNanometerAction->setToolTip(
"Use nanometer as unit (where applicable)");
71 connect(asNanometerAction, &QAction::toggled,
this,
73 asNanometerAction->setCheckable(
true);
75 auto* ag =
new QActionGroup(
this);
76 ag->addAction(asNanometerAction);
81 asNanometerAction->setChecked(
true);
124 m_undoAction->setIcon(QIcon(
":/images/undo-variant.svg"));
170 if (l->color().isValid())
182 auto* emptyWidget =
new QWidget(
this);
183 emptyWidget->setProperty(
"stylable",
true);
185 auto* btn =
new QPushButton(
"Create sample", emptyWidget);
188 auto* layout =
new QHBoxLayout(emptyWidget);
189 layout->setContentsMargins(10, 20, 10, 20);
190 layout->addStretch();
191 layout->addWidget(btn);
192 layout->addStretch();
193 layout->setAlignment(Qt::AlignTop);
ApplicationSettings * appSettings
global pointer to the instance
Defines class ApplicationSettings.
Defines class LayerEditorUtils.
Defines class LayerOrientedSampleEditor.
Defines class MultiLayerItem.
Defines class ProjectDocument.
Defines class SampleEditorController.
bool defaultUnitIsAngstrom() const
void onUnitActionToggled()
QAction * m_asAngstromAction
void setCurrentSample(MultiLayerItem *sampleItem)
QScrollArea * m_scrollArea
MultiLayerForm * m_currentMultiLayerWidget
~LayerOrientedSampleEditor() override
void aboutToRemoveItem(SampleItem item)
QAction * m_showInlineEditButtonsAction
QMap< MultiLayerItem *, SampleEditorController * > m_editControllers
void requestCreateNewSample()
LayerOrientedSampleEditor(QWidget *parent, ProjectDocument *document)
void onShowInlineEditButtonsToggled(bool checked)
MultiLayerItem * m_currentMultiLayerItem
void updateActionEnabling()
void requestViewInRealSpace(SampleItem itemToShow)
ProjectDocument * m_document
QWidget * createEmptyWidget()
Create empty widget with a button for sample creation.
QVector< LayerItem * > layers() const
Project document class handles all data related to the opened project (sample, job,...
Class to modify a sample from the layer oriented sample editor.
void requestViewInRealSpace(SampleItem item)
void aboutToRemoveItem(SampleItem item)
QList< QColor > predefinedLayerColors()