Originally Posted by
d_stranz
Come on, quit screwing around here. Your original post asked how to connect a signal and slot between two QListWidget instances. The final code I posted would do that, using a lambda function instead of an actual slot. Now you say, I didn't want to connect to another list widget after all, I wanted to connect the list widget to a QPlainTextEdit.
You need to remember some basic C++. Signals and slots are no different from ordinary methods of C++ classes. They are labeled with "signals:" and "slots:" keywords in Qt so that the MOC compiler can recognize them and create the code in the moc_*.cpp file that implements them and makes the first style of connect() work at runtime. A lambda function is just a fancy way to write a nameless C++ function that gets compiled in place.
All the rules of C++ apply to signals, slots, and lambdas: If you want to call one of these functions, you have to supply the correct number and types of arguments to it. You can't call a function that expects one type of pointer using an argument that is a different type. It's basic C++, pure and simple.