26 #include <QFormLayout>
30 #include <QScrollArea>
35 , m_document(document)
37 setAttribute(Qt::WA_StyledBackground,
true);
38 setProperty(
"stylable",
true);
40 auto* horizontalLayout =
new QHBoxLayout;
46 m_scrollArea->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
50 toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
53 auto* mainLayout =
new QVBoxLayout(
this);
54 mainLayout->setMargin(0);
55 mainLayout->setSpacing(0);
56 mainLayout->addWidget(toolbar);
57 mainLayout->addLayout(horizontalLayout);
90 if (!currentInstrument) {
96 auto* layout =
new QVBoxLayout(w);
98 w->setAttribute(Qt::WA_StyledBackground,
true);
99 w->setProperty(
"stylable",
true);
102 g->setTitle(QString(
"Information (%1 instrument)").arg(currentInstrument->instrumentType()));
104 auto* formLayout =
new QFormLayout(g);
105 formLayout->setMargin(17);
106 formLayout->setSpacing(8);
107 layout->addWidget(g);
109 auto* nameEdit =
new QLineEdit(g);
110 formLayout->addRow(
"Name:", nameEdit);
111 nameEdit->setText(currentInstrument->instrumentName());
114 auto* descriptionEdit =
new QTextEdit(g);
115 descriptionEdit->setMinimumWidth(300);
116 descriptionEdit->setMaximumHeight(100);
117 descriptionEdit->setAcceptRichText(
false);
118 descriptionEdit->setTabChangesFocus(
true);
119 descriptionEdit->setPlainText(currentInstrument->description());
120 formLayout->addRow(
"Description:", descriptionEdit);
121 connect(descriptionEdit, &QTextEdit::textChanged,
131 layout->addWidget(editor);
136 layout->addWidget(editor);
141 layout->addWidget(editor);
146 layout->addWidget(editor);
156 if (currentInstrument && currentInstrument->instrumentName() != newName)
163 if (currentInstrument && currentInstrument->description() != t) {
Defines class DepthProbeInstrumentEditor.
Defines class GISASInstrumentEditor.
Defines class GroupBoxCollapser.
Defines class InstrumentItem and all its children.
Defines class InstrumentListView.
Defines class InstrumentView.
Defines class OffspecInstrumentEditor.
Defines class ProjectDocument.
Defines class SpecularInstrumentEditor.
Editor for GISAS instruments.
static GroupBoxCollapser * installIntoGroupBox(QGroupBox *groupBox, bool expanded=true)
Abstract base class for instrument-specific item classes.
void setDescription(const QString &description)
Instrument selector on the left side of InstrumentView.
InstrumentItem * currentInstrument() const
void instrumentSelected(InstrumentItem *instrument)
QList< QAction * > toolbarActions() const
void onInstrumentdescriptionEdited(const QString &t)
void onInstrumentNameEdited(const QString &newName)
void hideEvent(QHideEvent *) override
void createWidgetsForCurrentInstrument()
QScrollArea * m_scrollArea
void onInstrumentChangedByEditor()
InstrumentListView * m_instrumentListView
InstrumentView(QWidget *parent, ProjectDocument *document)
ProjectDocument * m_document
void onInstrumentChangedFromExternal(const InstrumentItem *instrument)
void updateSingleInstrumentMode()
void showEvent(QShowEvent *) override
void instrumentChanged(const InstrumentItem *instrument)
Signals any change in the settings of the given instrument.
void notifyInstrumentChanged(InstrumentItem *instrument)
Simply emits the instrumentChanged signal. Call this whenever you change an instrument's data without...
void setInstrumentName(InstrumentItem *instrument, const QString &name)
Set an instrument's name and emit the respective signal.
Project document class handles all data related to the opened project (sample, job,...
void singleInstrumentModeChanged()
Emitted when single instrument mode has changed.
bool singleInstrumentMode() const
InstrumentsEditController * instrumentsEditController()
The edit controller for the instruments in this project document.