Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Adding indexed widgets ?

Adding indexed widgets ?

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 415 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by Anonymous_Banned275
    #1

    Adding same , multiple objects in QTDesigner they are "numbered" - see attached - page , button.

    I like to have them added "indexed" so they can be accessed as indexed (array) of same widgets.
    ( I am not sure about terminology I am using...)

    I have been looking at "stackedwidgets" as possible solution.

    Any other idea ??

    d55a2203-777e-4a51-82ac-527f54b8ef3a-image.png

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      This is not possible automatically. You have to add the widgets you want in an array/vector by yourself.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Anonymous_Banned275
        wrote on last edited by
        #3

        OK , I plead ignorancee483d080-53b7-42f7-b680-69cd7e0bd2fc-image.png ...
        what is the correct way to add widget to an array ?

        1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          You want to store a pointer in an array of objects --> ui->pushButton is a pointer, not an object. Use an array of pointers instead.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          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