28 bool sc_editor = item.
editorType() ==
"ScientificDouble";
31 QAction* scientificAction = menu.addAction(
"Scientific presentation");
32 scientificAction->setCheckable(
true);
33 auto doubleMenu = menu.addMenu(
"Double presentation");
36 scientificAction->setChecked(sc_editor);
37 connect(scientificAction, &QAction::triggered, [&]() {
38 if (scientificAction->isChecked())
45 const int nmaxdigits = 8;
46 for (
int i = 1; i <= nmaxdigits; ++i) {
47 auto action = doubleMenu->addAction(QString(
"%1 digits").arg(i));
48 if (!sc_editor && item.
decimals() == i)
49 action->setChecked(
true);
50 connect(action, &QAction::triggered, [i, &item] {
Defines class ComponentTreeActions.
Defines class SessionItem.
ComponentTreeActions(QObject *parent=nullptr)
void onCustomContextMenuRequested(const QPoint &point, SessionItem &item)
Creates right-mouse-click context menu on top of ComponentTreeView which will allow user to switch be...
SessionItem & setDecimals(int n)
SessionItem & setEditorType(const QString &editorType)
QString editorType() const