Plugins, signals and slots



  • why Qt doesn't allow declaring methodes as signals or slots in the plugin interface?

    so i did the following
    i declared pure virtual functions ,but in the implementation ,i reimplamented them as signals and slots,
    then used the QPluginLoader to load the plugin,then used connect, and they worked fine when i tested them, so is this method recommanded and won't cause bugs or maybe there are other appropriate methods?

    @interface.h
    ...
    virtual void send(int)=0;
    ...@

    @interfaceplugin.h
    ....
    signals:
    void send(int);
    ....@

    then connect the plugin when i load it



  • You need just declare signals and not need
    @virtual void send(int)=0;@
    and should be declared once, in interface.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.