33#include <NDEVR/QTDesignObject.h>
34#include <NDEVR/GridlinesDialog.h>
35#if NDEVR_CROSS_SECTION
36#include <NDEVR/QTTools.h>
37#include <NDEVR/Button.h>
38#include <NDEVR/Translator.h>
39#include <QWidgetAction>
43 class GridButton :
public QObject
47 GridButton(Button* combo)
53 GridButton(
const DynamicPointer<QTDesignObject>& target, Button* combo)
60 void setTargets(
const Buffer<DynamicPointer<QTDesignObject>>& targets)
63 if (!m_dialog.isNull())
64 m_dialog->setTargets(targets);
66 void setTarget(
const DynamicPointer<QTDesignObject>& target)
69 m_targets.add(target);
70 if (!m_dialog.isNull())
71 m_dialog->setTarget(target);
76 m_combo->setup(
_t(
"Gridlines"),
"grid", [
this](Button*)
78 if (m_dialog.isNull())
80 m_dialog =
new GridlinesDialog();
81 m_dialog->setTargets(m_targets);
83 PopupInfo info(m_combo);
84 info.make_call_widget_dialog =
true;
86 if(!m_dialog->isVisible())
87 QTTools::ShowDialog(m_dialog, info);
89 QTTools::HideDialog(m_dialog);
98 void requestSettingsSignal();
100 Buffer<DynamicPointer<QTDesignObject>> m_targets;
101 Button* m_combo =
nullptr;
102 QPointer<GridlinesDialog> m_dialog;
#define _t(english_string)
Definition Translator.h:90