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. Adding a tab in Widget from a class
Forum Updated to NodeBB v4.3 + New Features

Adding a tab in Widget from a class

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 3 Posters 1.1k 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.
  • S Offline
    S Offline
    saad_saadi
    wrote on last edited by
    #1

    I have one tabwidget in which i am adding tab like this
    @ tabWidget = new QTabWidget;
    tabWidget->addTab(new First_Tab(), tr("Home"));
    tabWidget->addTab(new Second_Tab(), tr("Guest"));@

    In the First_Tab, i am doing some search and after searching i want to show the result in another tab. Can anyone please guide me that how i can add another tab from the first_tab class? means when some conditions are filled and if i press the button show, a new tab opens and it shows all the search results. I already made the search tab just wanted to integrate it into this.

    @First_Tab::shoe_tab()
    {
    tabWidget->addTab(new, Search_tab(),tr("Results"));
    }
    @

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dmcr
      wrote on last edited by
      #2

      you should perhaps make it visible by using setVisible(true) to your tab.

      dmcr

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dmcr
        wrote on last edited by
        #3

        by the way this is not some QML subject....

        dmcr

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi and welcome to devnet,

          After adding the tab you should use either setCurrentIndex of setCurrentWidget to switch to your new tab.

          As dmcr noted, please chose the sub forum more carefully

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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