jeudi 28 juin 2018

Manually place a toolbar Qt c++

My QMainWindow contains three different windows. I would like to display three different toolbars. One for each window. For now I display a toolbar but I can not place it just above my windows. I wanted to know if it was possible?

MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent) {
    //here I declared a widget and my three windows.
    QToolBar *toolBar= addToolBar("window");
    addLine=new QAction("Add Line",this);
    removeLine=new QAction("Remove line",this);
    removeAll=new QAction("Remove all",this);
    toolBar->addAction(addLine);
    toolBar->addAction(removeLine);
    toolBar->addAction(removeAll);
}

Aucun commentaire:

Enregistrer un commentaire