Solved Qtcreator load custom widget plugin failed
-
Hi:
I'm new to qt, I create a qt custom widget.In the slot function i init a QSerialPortInfo .
like this: QSerialPortInfo info(ui->serialPortInfoListBox->itemText(idx));
the qtcreator can't load this custom widget plugin if this code in any slot function . when i marked this line the qtcreator can load the plugin successfully.- when load the custom widget plugin, every slot function will be called?
- calss QSerialPortInfo can't be init in custom widget plugin?
Thanks!
-
Hi and welcome to devnet,
What platform are you developing on ?
What version of Qt Creator are you using ?
What version of Qt are you using for that plugin?
Did you build Qt Creator yourself ? -
- when load the custom widget plugin, every slot function will be called?
No. Creator/Desiner calls the QDesignerCustomWidgetInterface meta functions
bool isContainer() const override;
bool isInitialized() const override;
QIcon icon() const override;
QString domXml() const override;
QString group() const override;
QString includeFile() const override;
QString name() const override;
QString toolTip() const override;
but unless you hooked your slots up to some signals that triggers during load,
it wont call any slots as such.- class QSerialPortInfo can't be init in custom widget plugin?
You can use any class as you normally would.
No restriction as such.
- when load the custom widget plugin, every slot function will be called?