lundi 20 avril 2015

Re-dock two QToolbars back in the same QToolbarArea

I'm working on a Qt project, where I need to get the toolbar positions at run-time. I used QMainWindow::toolBarArea(QToolBar *toolbar) to get the current docked area of the toolbar. And then I can use that later with QMainWindow::addToolBar ( Qt::ToolBarArea area, QToolBar * toolbar ).

Let's assume I dock two toolbars in a single area (i.e. Bottom area), as below.

-----------------------------------
| Toolbar 1                       |
-----------------------------------
| Toolbar 2                       |
-----------------------------------

Then I save the area obtained from QMainWindow::toolBarArea, using QSettings and then load them back with QMainWindow::addToolBar , it loads as below.

-----------------------------------
| Toolbar 1      | Toolbar 2      |
-----------------------------------

Is there any way to re-dock them the original form?

Aucun commentaire:

Enregistrer un commentaire