PDA

View Full Version : Add QToolBar to BottomArea stacked ontop



dropkickz
20th July 2011, 12:37
Hi,

quick question. Is it possible to add a qtoolbar to a mainwindow bottom area stacked on top of each other it there is already an existing toolbar? i could not find any hints in the docu.

Thank,
Marcus

high_flyer
21st July 2011, 13:17
Not out of the box.
But no one is preventing you from using a QStackedWidget with QToolBars in it, and place it instead of the regular toolbar.

dropkickz
27th July 2011, 08:38
Thanks for your quick reply. I think I used the wrong words in my question. I did not mean stacked on top instead i meant placed on top of each other. If I use moveable toolbars i can place them on top of each other but if I initial add a one to a mainwindows toolbar area the toolbars are placed next to each other. So my question now, is it possible to place them directly on top e.g. in bottom area?

high_flyer
27th July 2011, 09:43
I did not mean stacked on top instead i meant placed on top of each other.
I fail to see the difference.
However, it seems to me you are trying to do something the wrong way.
Maybe if you explain what it is you want to achieve, we can help you find a better way.

dropkickz
27th July 2011, 12:23
Ok, I try to explain it more detailed.
I have two QToolBars that I want to add at the bottom of my QMainWindow. Therefore I use the addToolBar( Qt::ToolBarArea area, QToolBar * toolbar ) function from QMainWindow with area Qt::BottomToolBarArea. The result is that the two toolbars are next to each other. What I want is that one of the toolbars is above the other one but still in the bottom area.
I can drag the toolbar to that position in my application but I want to get it directly from code.
I hope I could clarify the problem.

Best regards,
Marcus

high_flyer
27th July 2011, 12:49
No, I asked what you are trying to achieve, not how.
Why do you need two tool bars at the same location? this usually makes no sense.

dropkickz
27th July 2011, 14:25
In my application I am using a timeline to control animations. This timeline should always be displayed at the bottom of my application. Additionally I have another toolbar which shall also be permanently displayed at the bottom of my application beneath the timeline. So I thought adding two toolbars at the bottom could be a good idea except of the problem that the two toolbars are initially placed next to each other...

high_flyer
27th July 2011, 14:45
I think I understand now.
Did you try insertToolBarBreak()?

dropkickz
27th July 2011, 17:31
Exactly what I was looking for. I guess I have not seen the wood for the trees. Thanks a lot, I feel a little bit ashamed for that simple solution!