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. QML attributes in C++
Forum Updated to NodeBB v4.3 + New Features

QML attributes in C++

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 824 Views 2 Watching
  • 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.
  • D Offline
    D Offline
    DanBoSlice
    wrote on last edited by
    #1

    Hello,

    maybe I'm just too tired to find my mistake, but I wasn´t able to find a solution for my problem, so well...

    In QML I made TextInput. If now onAccepted is called I want to integrate the TextInput´s text in C++, so for example that a file can be created that has the user input as its name.

    Can anybody help?

    Thanks.

    p3c0P 1 Reply Last reply
    0
    • D DanBoSlice

      Hello,

      maybe I'm just too tired to find my mistake, but I wasn´t able to find a solution for my problem, so well...

      In QML I made TextInput. If now onAccepted is called I want to integrate the TextInput´s text in C++, so for example that a file can be created that has the user input as its name.

      Can anybody help?

      Thanks.

      p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi @DanBoSlice, it can be done as follows:

      • On C++ side, use findChild to get the TextInput object. You can find example here
      • Since TextInput has accepted signal you can connect to it and call your slot.
      • The in slot you can access the TextInput's text by the object found using findChild.

      157

      1 Reply Last reply
      1

      • Login

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