Retrieve the text of a QML TextField when the editingFinished() signal is emitted
Moved
Unsolved
QML and Qt Quick
-
Hello,
I would like to know how to retrieve my text from QML TextField when it emits the signal editingFinished().
First a sample of my qml file :
/* IP text field*/ TextField { id: ipTextField objectName: "ipTextField" anchors.horizontalCenter: background.horizontalCenter anchors.verticalCenter: background.verticalCenter placeholderText: qsTr("Enter IP address") }
The code that connect signal:
QObject *object = view.rootObject(); QObject *ipTextField = object->findChild<QObject*>("ipTextField"); TcpServer server; QObject::connect(ipTextField, SIGNAL(editingFinished()), &server, SLOT(ipEntryIncoming()));
The class TcpServer is a basic class that does nothing right now. Currently I'm able to catch the SIGNAL and print a little "OK" in the SLOT ipEntryIncoming(). My question is how do i get the text from ipTextField when this signal is emitted?
Thank you for your help, have a nice day.