Multiple definitions error: one in my file and one in the moc file.

前端 未结 1 2147
北荒
北荒 2021-02-20 07:43

I have a class called FindAndReplaceBar, whose implementation is this:

#include \"FindAndReplaceBar.h\"
#include 
#include 
#inc         


        
1条回答
  •  情话喂你
    2021-02-20 08:13

    Judging by your connect calls (signal to signal), I assume if we look at your header file, you will have declared findNext(), findPrevious(), replace(), replaceAll() as signals, but you must not implement signals - they just need to be declared in the header.

    From the Qt docs on signals

    Signals are automatically generated by the moc and must not be implemented in the .cpp file. They can never have return types (i.e. use void).

    0 讨论(0)
提交回复
热议问题