neborak_a Posted October 4, 2018 Share Posted October 4, 2018 (edited) I have no idea, how to implement custom Widget element. In Qt i can do something like this: #include <QWidget> #include <QToolButton> #include <QLineEdit> #include <QSpacerItem> class CustomEditor : public QWidget { public: CustomEditor(QWidget *_parent = nullptr): QWidget(_parent) { m_btn = new QToolButton(this); m_btn->setText("Btn"); m_edit = new QLineEdit(this); QHBoxLayout *lt = new QHBoxLayout(this); setLayout(lt); lt->addWidget(m_edit); lt->addWidget(m_btn); } private: QToolButton *m_btn; QLineEdit *m_edit; }; And then use CustomEditor with layout manager or set for QTreeWidget, QTableWidget, QListWidget. But in Unigine i can't derive CustomEditor from Widget, in this case i must implement all of virtual functions. How i can implement complex ui element? Edited October 4, 2018 by neborak_a Link to comment
alexander Posted October 4, 2018 Share Posted October 4, 2018 Hi, You can't use inheritance. You can only use aggregation. Best regards, Alexander Link to comment
Recommended Posts