How can I automatically resize a QML widget?
I have a manually created QWidget. A QML component has been created in this widget.
But when I resize the QWidget, the QML component does not change.
Some codes ...
I have a class MyCustomQWidget
Title:
Class MyCustomQWidget : public QWidget { Q_OBJECT public: QDeclarativeView* view; private: QWidget* m_GUI; public: QWidget* getGUI() {return m_GUI;}; }
A source:
MyCustomQWidget:: MyCustomQWidget (QWidget *parent) :QWidget(parent) { m_GUI = new QWidget(); view = new QDeclarativeView(m_GUI); view->setSource(QUrl("qrc:/qml/gui.qml"));
In the main gui frame widgets
QWidget* pCustomGUI = new MyCustomQWidget(β¦) pVLayoutLeft->addWidget(pCustomGUI->getGUI);
source share