Important: Please read the Qt Code of Conduct -

Implement of signals

  • In header file

        void findNext(const QString &text, Qt::CaseSensitivity cs);

    in cpp file, i try to implement this signal like this

    void FindDialog::findNext(const QString &text, Qt::CaseSensitivity cs)

    But the compiler note me: error LNK1169 redefine symbol
    So i delete the signal implement in the cpp file, the program compile succed.
    Does it mean that i don't need to implement the signals?
    if my understanding is wrong, how can i implement my own signals?

  • Lifetime Qt Champion

    @ozzy said:

    void findNext(const QString &text, Qt::CaseSensitivity cs);

    This defines the signal.
    You do not supply the body.

    To call it / use it.

    emit findNext( sometext, CaseInsensitive ); // signal the signal :) using real vars as parameters.

    Then somewhere else you
    connect findNext to someone's slot and it does the real work.

    in case you didnt see:

  • I have read the link before, i will carefully read it again.
    thank you ~

Log in to reply