I'm using Qt Creator 2.0.1 and I have a custom slot my QMainWindow. Now I have a pushbutton, which on clicked should call the custom slot on the main window. Can do in code yes, but can't do this with the signal-slot editor. When I open the signal-slot editor, I see the custom slot on the right but the entire set of slots are disabled.
Overview
This program demonstrates how QML and C++ can be connected through Qt signalsand slots. It does this through embedding C++ code as a context property in QMLrather than explicitly connecting signals and slots.
Signal And Slot In Qt
When the program is started, the C++ part send a signal to QML, including aparameter. This signal is only sent once. When the user clicks on the windowarea, a signal is sent from QML to a C++ slot.
Watch the console output to see if it works.
Installation
This program requires a working Qt5 installation. It was tested with version 5.3 and 5.4.
In order to compile and run the program, execute the following commands.
Alternatively, the project can be loaded into Qt Creator and started from there.
More Documentation
This source code belongs to an article on our website.