44 octave::interpreter& interp,
45 const graphics_object& go, QAction *action)
46 :
Object (oct_qobj, interp, go, action), m_separator (nullptr)
51 action->setVisible (tp.is_visible ());
56 if (img.width () == 0)
59 std::string name = tp.get___named_icon__ ();
61 ico = get_icon (name);
63 action->setIcon (ico);
66 action->setIcon (QIcon (QPixmap::fromImage (img)));
68 if (tp.is_separator ())
70 m_separator =
new QAction (action);
71 m_separator->setSeparator (
true);
72 m_separator->setVisible (tp.is_visible ());
74 action->setEnabled (tp.is_enable ());
76 QWidget *
w = qobject_cast<QWidget *> (action->parent ());
78 w->insertAction (
w->actions ().back (), action);
80 w->insertAction (action, m_separator);
92 QAction *action = qWidget<QAction> ();
96 case base_properties::ID_VISIBLE:
97 action->setVisible (tp.is_visible ());
99 m_separator->setVisible (tp.is_visible ());
102 case T::properties::ID_TOOLTIPSTRING:
106 case T::properties::ID_CDATA:
111 if (img.width () == 0)
114 std::string name = tp.get___named_icon__ ();
116 ico = get_icon (name);
118 action->setIcon (ico);
121 action->setIcon (QIcon (QPixmap::fromImage (img)));
125 case T::properties::ID_SEPARATOR:
126 if (tp.is_separator ())
130 m_separator =
new QAction (action);
131 m_separator->setSeparator (
true);
132 m_separator->setVisible (tp.is_visible ());
134 QWidget *
w = qobject_cast<QWidget *> (action->parent ());
136 w->insertAction (action, m_separator);
143 m_separator =
nullptr;
147 case T::properties::ID_ENABLE:
148 action->setEnabled (tp.is_enable ());
157 template <
typename T>
virtual void update(int pId)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
const QStringList global_icon_paths
std::complex< double > w(std::complex< double > z, double relerr=0)
QString fromStdString(const std::string &s)
T::properties & properties(graphics_object obj)
QImage makeImageFromCData(const octave_value &v, int width, int height)