Hi, I want to find all the QwtPlot widgets in my ui. I (a newbie) am currently translating some Python/PyQt code that works well into C++/Qt code. In the Python version these two lines work:
self.combo_list = self.ui.tabs.findChildren(QtGui.QComboBox)
self.plot_list = self.ui.tabs.findChildren(Qwt.QwtPlot)
In C++ this works:
QList<QComboBox *> combo_list = findChildren<QComboBox *>();
but this doesn't:
QList<QwtPlot *> plot_list = findChildren<QwtPlot *>();
and neither does:
QwtPlot *qwp = qFindChild<QwtPlot *>(this, "qwtPlot_DC_LIFETIME");
both giving this error:
unresolved external symbol "public: static struct QMetaObject const QwtPlot::staticMetaObject" ...
This works:
QwtPlot *qwp = (QwtPlot *)qFindChild<QObject *>(this, "qwtPlot_DC_LIFETIME");
but I don't want to have to specify the names of all my QwtPlot objects.
Since what I want to do is possible in PyQt, I'm assuming that I just need to tweak my C++ code.
Bookmarks