Results 1 to 9 of 9

Thread: Add QToolBar to BottomArea stacked ontop

  1. #1
    Join Date
    Aug 2010
    Posts
    18
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    2

    Default Add QToolBar to BottomArea stacked ontop

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: Add QToolBar to BottomArea stacked ontop

    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.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Aug 2010
    Posts
    18
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    2

    Default Re: Add QToolBar to BottomArea stacked ontop

    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?

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: Add QToolBar to BottomArea stacked ontop

    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.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. #5
    Join Date
    Aug 2010
    Posts
    18
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    2

    Default Re: Add QToolBar to BottomArea stacked ontop

    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

  6. #6
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: Add QToolBar to BottomArea stacked ontop

    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.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  7. #7
    Join Date
    Aug 2010
    Posts
    18
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    2

    Default Re: Add QToolBar to BottomArea stacked ontop

    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...

  8. #8
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: Add QToolBar to BottomArea stacked ontop

    I think I understand now.
    Did you try insertToolBarBreak()?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  9. The following user says thank you to high_flyer for this useful post:

    dropkickz (27th July 2011)

  10. #9
    Join Date
    Aug 2010
    Posts
    18
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    2

    Default Re: Add QToolBar to BottomArea stacked ontop

    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!

Similar Threads

  1. problem in stacked widget
    By wagmare in forum Qt Programming
    Replies: 4
    Last Post: 24th February 2009, 09:28
  2. Stacked Widget Scroll
    By csvivek in forum Qt Programming
    Replies: 6
    Last Post: 27th May 2008, 12:36
  3. Stacked Layout. & Widget.
    By csvivek in forum Qt Programming
    Replies: 1
    Last Post: 13th May 2008, 09:56
  4. build a gui ontop of a console application
    By aegis in forum Qt Programming
    Replies: 3
    Last Post: 25th March 2007, 13:16
  5. Acces a stacked widget...?
    By ucomesdag in forum Qt Programming
    Replies: 5
    Last Post: 25th November 2006, 15:05

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.