Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. How do I make connections between a text box, push button, and table
Forum Updated to NodeBB v4.3 + New Features

How do I make connections between a text box, push button, and table

Scheduled Pinned Locked Moved Unsolved Qt for Python
3 Posts 3 Posters 1.6k Views 1 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.
  • J Offline
    J Offline
    Jbrangiforte
    wrote on last edited by
    #1

    Ok so I am creating this application in QT designer and I want to fill in a text box then, confirm that information with a push button and that confirmed information to be populated into a table. I assumed that I use signals and slots but I am lost after that point.

    JonBJ 1 Reply Last reply
    0
    • J Jbrangiforte

      Ok so I am creating this application in QT designer and I want to fill in a text box then, confirm that information with a push button and that confirmed information to be populated into a table. I assumed that I use signals and slots but I am lost after that point.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @Jbrangiforte
      Yes you will use signals and slots. You should read https://doc.qt.io/qt-5/signalsandslots.html if you have not done so already.

      This situation is actually very simple. From your description, all you have to do is attach a slot to the pushbutton's click signal. There you look at what is in the text edit and copy it to wherever in your table.

      Designer allows you hook up signals to slots in a limited fashion. Most of us do not bother to use it, if you are tempted to do so, and write explicit connect()s in our code.

      Your "table" may actually be a model. Again, read https://doc.qt.io/qt-5/model-view-programming.html & https://doc.qt.io/qt-5/modelview.html. You might decide you want to use an editable model/view to directly edit items in the table. Depends on your usage.

      1 Reply Last reply
      2
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #3

        hehe JonB. waay faster than me :)

        To add to jonb. You could consider using a View with a QStringList as model.
        That way it's very easy to get the text from the text box into the table.

        But that is only if each list goes directly to one line in the table (Listbox type/ ONE col.)

        If you mean a real table with multiple cols then forget this.

        1 Reply Last reply
        2

        • Login

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