26 #include <QFormLayout>
35 setWindowTitle(
"Properties");
36 setAttribute(Qt::WA_StyledBackground,
true);
37 setProperty(
"stylable",
true);
70 auto* xGroup =
new QGroupBox(
"X axis",
this);
71 auto* xFormLayout =
new QFormLayout(xGroup);
72 xFormLayout->setContentsMargins(0, 0, 0, 0);
73 xFormLayout->setSpacing(5);
82 auto* yGroup =
new QGroupBox(
"Y axis",
this);
83 auto* yFormLayout =
new QFormLayout(yGroup);
84 yFormLayout->setContentsMargins(0, 0, 0, 0);
85 yFormLayout->setSpacing(5);
94 auto* zGroup =
new QGroupBox(
"Color legend",
this);
95 auto* zFormLayout =
new QFormLayout(zGroup);
96 zFormLayout->setContentsMargins(0, 0, 0, 0);
97 zFormLayout->setSpacing(5);
133 if (!sessionItemWidget)
142 spinBox->setToolTip(d.
tooltip);
144 [=](
double newValue) { d.
set(newValue); });
146 m_updaters << [=]() { spinBox->updateValue(); };
153 auto* edit =
new QLineEdit(
this);
154 connect(edit, &QLineEdit::textEdited, [=](
const QString& t) { item->
setValue(t); });
164 title, [=]() {
return item->
value().toBool(); }, [=](
bool b) { item->
setValue(b); });
168 function<
void(
bool)> setter)
170 auto* checkBox =
new QCheckBox(title,
this);
171 connect(checkBox, &QCheckBox::stateChanged, [=]() { setter(checkBox->isChecked()); });
174 QSignalBlocker b(checkBox);
175 checkBox->setChecked(getter());
183 auto* combo =
new QComboBox(
this);
185 combo->setMaxCount(d.
options.size());
187 connect(combo, qOverload<int>(&QComboBox::currentIndexChanged),
191 QSignalBlocker b(combo);
Defines various axis items.
Defines class ComboProperty.
Defines class DoubleSpinBox.
Defines class IntensityDataItem.
Defines namespace GUI::Util::Layout.
SessionItem * logScaleItem() const
DoubleDescriptor min(const QString &unit=QString()) const
SessionItem * visibilityItem() const
SessionItem * titleItem() const
DoubleDescriptor max(const QString &unit=QString()) const
static void updateAxesUnits(SessionItem *item, const QString &name, InstrumentItem *instrumentItem)
SelectionDescriptor< QString > axesUnits() const
Describes properties of a double value which are necessary to allow GUI representation,...
function< void(double)> set
function to set the value
QString tooltip
Tooltip text.
SpinBox for DoubleDescriptors, supporting units.
void baseValueChanged(double newBaseValue)
Emitted whenever the value changes.
const AmplitudeAxisItem * zAxisItem() const
SelectionDescriptor< QString > gradient() const
const BasicAxisItem * yAxisItem() const
void setInterpolated(bool interp)
const BasicAxisItem * xAxisItem() const
bool isInterpolated() const
void unsubscribe(const void *caller)
Cancels all subscriptions of given caller.
void setOnItemDestroy(std::function< void(SessionItem *)> f, const void *caller=nullptr)
void setOnPropertyChange(std::function< void(QString)> f, const void *caller=nullptr)
void setOnChildPropertyChange(std::function< void(SessionItem *, QString)> f, const void *caller=nullptr)
Calls back on child property change, report childItem and property name.
Describes a selection (various possibilities and the current one).
int currentIndex() const override
Get currently selected option.
QStringList options
List of options, usually presented as combo entries.
void setCurrentIndex(int newIndex) const override
Set currently selected option.
Base class for a GUI data item.
QVariant value() const
Get value.
bool setValue(QVariant value)
Set value, ensure that variant types match.
ModelMapper * mapper()
Returns the current model mapper of this item. Creates new one if necessary.
QString const & name(EShape k)
void clearLayout(QLayout *layout, bool deleteWidgets=true)
Removes content from box layout.