Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Retrieve the text of a QML TextField when the editingFinished() signal is emitted
Forum Updated to NodeBB v4.3 + New Features

Retrieve the text of a QML TextField when the editingFinished() signal is emitted

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 249 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pantoufle
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved