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. Delete and create central widgets from the bar menu
Qt 6.11 is out! See what's new in the release blog

Delete and create central widgets from the bar menu

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 672 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.
  • R Offline
    R Offline
    R3dp1ll
    wrote on last edited by
    #1

    hello everybody,

    I just started with Qt.

    I know this is probably not the best way to go but:
    I created a menubar, and I would like it to serve me as "tab" ! it's as if "file menu" was my mainpage = "file page", and that "edit menu" changes the pages for "edition page"... So I have my button "edit" on the menubar, but I do not know how to erase my current page (file page), to replace it by the other page (edit page) when i click on it. Do you know how to do it ?

    infos:
    I can not suppress the layout, or any layout element : I have not layout on my "file page". So do not offer me solutions with these methods please.

    I created my main page (file page) WITHOUT layout, to successfully position my QWidgets. I needed to create an empty header because my background image contains my image header and I did not know how to do empty header with a grip layout. The mastery of layouts will be the goal of my next GUI

    My file page contains QLabels, QComboBox, QPushButton ...

    Thank you for your help :-)

    1 Reply Last reply
    0
    • KillerSmathK Offline
      KillerSmathK Offline
      KillerSmath
      wrote on last edited by
      #2

      Hi @R3dp1ll and welcome to Qt Forum.
      The QTabWidget class provides features to work with multiple tab pages.
      You can find more informations about this class in Qt Documentation Page:
      http://doc.qt.io/qt-5/qtabwidget.html#details

      @Computer Science Student - Brazil
      Web Developer and Researcher
      “Sometimes it’s the people no one imagines anything of who do the things that no one can imagine.” - Alan Turing

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

        Hi
        For such page concept, the stackedwidget can be handy.
        http://doc.qt.io/qt-5/qstackedwidget.html

        1 Reply Last reply
        2
        • R Offline
          R Offline
          R3dp1ll
          wrote on last edited by
          #4

          @KillerSmath I knew QTabWidget, but for this project, I did not want to use it because graphically it's not what I wanted. But thanks for the answer and the tips ;)

          @mrjj I took a look, it seems to be exactly what I'm looking for, thank you very much ;)

          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