Vertical QToolBar from MainWindow
问题 What I want: http://puu.sh/3oUjh.jpg What I have: http://puu.sh/3oUnI.png The toolbar is made in mainwindow.ui, ive tried ui->_toolbar->setLayoutDirection(Qt::LeftToolBarArea); But I get this error: no matching function for call to 'QToolBar::setLayoutDirection(Qt::ToolBarArea)' 回答1: You can use QToolBar::orientation property: ui->myToolbar->setOrientation(Qt::Vertical); You can also use QMainWindow::addToolBar : addToolBar(Qt::LeftToolBarArea, ui->myToolbar); Note that by default the user is