Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Delete and create central widgets from the bar menu



  • 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 :-)



  • 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


  • Lifetime Qt Champion

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



  • @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 ;)


Log in to reply