Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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)'

like image 303
throwaway2013 Avatar asked Sep 01 '26 02:09

throwaway2013


1 Answers

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 able to drag toolbars and attach them to any side of the main window.

like image 54
Pavel Strakhov Avatar answered Sep 05 '26 17:09

Pavel Strakhov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!