Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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!

  • Lifetime Qt Champion

    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 ?


  • Lifetime Qt Champion

    @Anqi
    Adding to @SGaist

    • 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.

Log in to reply