Current location - Quotes Website - Signature design - Under qt, c++ language and connect are two different classes. These two classes are in different cpp files, so there is no such slot problem.
Under qt, c++ language and connect are two different classes. These two classes are in different cpp files, so there is no such slot problem.
1. Whether in C++ or any other object-oriented language, a class is just a data field and cannot be used as the execution object of a method (except runtime information). The access domain of C++ is not simply distinguished by files, and C++ also opposes the static declaration of class C files.

2. As long as it can be accessed, the slot/signal mechanism of Qt can work. So you must ensure that you can access an instance of class A (that is, the object you want to operate) and an instance of listview in the context of the domain where connect is located.

3. The way you instantiate is a bit strange. There should be a big problem with your Class A design. ..

4. Even after Qt5, the transfer mode of the connect parameter has changed, but it is essentially the same as Qt4. The sender must declare a method with the same signature in order to connect successfully.