Virtual Qt signal ?



  • 2 Answer(s)

    The Virtual Qt signal:

    Declare a signal in a base class .

    class MyBase : public QObject
    {
        Q_OBJECT
    // ...
    signals:
        void somethingHappened();
    };
     
    class MyDerived : public MyBase
    {
        Q_OBJECT
    // ...
         void doSomething();
    };
     
    void MyDerived::doSomething()
    {
        // ....
        emit somethingHappened();
    }
    
    Answered on January 11, 2019.
    Add Comment

    The alternative answer is:

       They normally edit the c++ given signal is  macro for protected and Q_UNUSED  to void. The  running moc  are  build the application  of the methods   and signals.

    Answered on January 11, 2019.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.