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 can i update a widget live
Forum Updated to NodeBB v4.3 + New Features

How can i update a widget live

Scheduled Pinned Locked Moved Unsolved Qt for Python
4 Posts 2 Posters 614 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.
  • D Offline
    D Offline
    deleted256
    wrote on last edited by
    #1
    This post is deleted!
    JonBJ 1 Reply Last reply
    0
    • D deleted256

      This post is deleted!

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

      @benyeyeye
      Hi there.

      I don't think anyone can answer this without clarifying the information you give. What widgets, how are they connected to the database, are you using model-view etc.? For example, QTableView is commonly used to display multiple rows & columns in a visual table from a database model, or QDataWidgetMapper can be used if you want to diaply information about just one row, with separate widgets for each of the columns.

      D 1 Reply Last reply
      0
      • JonBJ JonB

        @benyeyeye
        Hi there.

        I don't think anyone can answer this without clarifying the information you give. What widgets, how are they connected to the database, are you using model-view etc.? For example, QTableView is commonly used to display multiple rows & columns in a visual table from a database model, or QDataWidgetMapper can be used if you want to diaply information about just one row, with separate widgets for each of the columns.

        D Offline
        D Offline
        deleted256
        wrote on last edited by
        #3
        This post is deleted!
        JonBJ 1 Reply Last reply
        0
        • D deleted256

          This post is deleted!

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

          @benyeyeye said in How can i update a widget live:

          Is where i have a singular button in a frame. when pressed i want that button to be removed and 4 different buttons in its place

          You could do this in a number of ways:

          • To do it literally, you could use a layout's removeWidget() to remove the button and addWidget() to add a bunch of new ones.

          • You could use a button/widget's show/hide/setVisible() methods to hide the first button and show the other ones.

          • You could use a QStackedWidget to swap between one widget having just the first button and another widget having the three other buttons. A QStackedWidget shows only one widget at a time from a collection of widgets.

          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