submitTextField
, which will pass a string as an argument to any connecting slots (if they choose to receive it).Window
. I will emit the signal when the button is pressed, passing the value of the text field. Here is the full QML document.HandleTextField
, and it will have a slot called handleSubmitTextField
. The header file looks like this.handleSubmitTextField
.QObject::connect
. Add the following to main.cpp
.HandleTextField
, and the QML Window object. Then we can connect the windows submitTextField
signal to the handleSubmitTextField
slot. Running the application now and you should get a debug message showing the text being passed to C++.handleSubmitTextField
function to emit this signal with the upper-cased text.QVariant
. This is important, for the reasons well described in this Stack Overflow answer.Window
.QObject::connect
to make the connection.