44 :
Object (oct_qobj, interp, go, action), m_separator (nullptr)
49 action->setVisible (tp.is_visible ());
54 if (img.width () == 0)
57 std::string
name = tp.get___named_icon__ ();
61 action->setIcon (ico);
64 action->setIcon (QIcon (QPixmap::fromImage (img)));
66 if (tp.is_separator ())
72 action->setEnabled (tp.is_enable ());
74 QWidget *
w = qobject_cast<QWidget *> (action->parent ());
76 w->insertAction (
w->actions ().back (), action);
90 QAction *action = qWidget<QAction> ();
94 case base_properties::ID_VISIBLE:
95 action->setVisible (tp.is_visible ());
97 m_separator->setVisible (tp.is_visible ());
100 case T::properties::ID_TOOLTIPSTRING:
104 case T::properties::ID_CDATA:
109 if (img.width () == 0)
112 std::string
name = tp.get___named_icon__ ();
114 ico = get_icon (
name);
116 action->setIcon (ico);
119 action->setIcon (QIcon (QPixmap::fromImage (img)));
123 case T::properties::ID_SEPARATOR:
124 if (tp.is_separator ())
128 m_separator =
new QAction (action);
129 m_separator->setSeparator (
true);
130 m_separator->setVisible (tp.is_visible ());
132 QWidget *
w = qobject_cast<QWidget *> (action->parent ());
134 w->insertAction (action, m_separator);
141 m_separator =
nullptr;
145 case T::properties::ID_ENABLE:
146 action->setEnabled (tp.is_enable ());
155 template <
typename T>
virtual void update(int pId)
Base class for Octave interfaces that use Qt.
QIcon icon(const QString &icon_name, bool fallback=true)
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)