How can I get rid a a part menubar ?



  • !http://upic.me/i/4x/2help.png(help)!

    I want to place a push button in the blue circle area
    but I can't. because it have the part of menu bar (like the red circle)
    How can I get rid of the red circle?

    Sorry for bad English,
    Thank you



  • hiii..
    Try to use stylesheet(CSS)



  • I've try it .
    but doesn't work



  • I assume that you use widgets and QMainWindow as a main window of your application.
    You will need to set menu widget in your mainWindow initialization instead of QMenuBar
    @QMainWindow::setMenuWidget(QWidget*)@

    In that widget you can add QMenuBar and QToolBar in a horizontal layout with splitter or without.

    Something like this
    @
    widgetCentral = new QWidget(this);
    setCentralWidget(widgetCentral);

    widgetMenuToolBar = new QWidget(this);
    setMenuWidget(widgetMenuToolBar);
    
    layoutMenuToolBar = new QHBoxLayout(widgetMenuToolBar);
    spacerLayoutMenuToolBar = new QSpacerItem(20, 20, QSizePolicy::Expanding);
    
    mainMenuBar = new QMenuBar(widgetMenuToolBar);
    mainToolBar = new QToolBar(widgetMenuToolBar);
    layoutMenuToolBar->addWidget(mainMenuBar);
    layoutMenuToolBar->addItem(spacerLayoutMenuToolBar);
    layoutMenuToolBar->addWidget(mainToolBar);
    

    @

    All other UI items will belong to centralWidget.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.