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. How to switch on and off tab pages in runtime
Qt 6.11 is out! See what's new in the release blog

How to switch on and off tab pages in runtime

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 610 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.
  • V Offline
    V Offline
    Vittorio
    wrote on last edited by
    #1

    Hi, all!

    in my application I have a tabWidget with some tabs, created in qtcreator. In a settings dialog the user can select the tabs he wants to be visible in various situations. I write this values with QSettings and read them each time, when the application starts. To remove the tabs is not such a big task with, for example

    @ui->tabWidget_ItemDetails->removeTab(3);@

    but I fail when I try to add this tab in another situation...

    I tried first to store the removed tab in a QWidget and after that to add this widget to the parent tab, but nothing happened, so obviously I did something wrong...

    @ QWidget *removedTab = ui->tab_Dimensions; // store the tab that will be removed
    ui->tabWidget_ItemDetails->removeTab(3); // remove the tab
    ui->tabWidget->addTab(removedTab,"TestWidget"); // here I try to add the tab...@

    Can someone show me the right direction to solve this task?

    thanks in advance,
    vittorio

    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