Results 1 to 7 of 7

Thread: QMenuBar or QToolBar Logo

  1. #1
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default QMenuBar or QToolBar Logo

    Hi,

    I need to insert my application Logo into a QMenuBar or QToolBar but I don't find anyway to perform this.

    Thanks,
    Òscar Llarch i Galán

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

    Default Re: QMenuBar or QToolBar Logo

    You can add a dummy menu, with an icon with out text, that will do nothing.
    ==========================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
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QMenuBar or QToolBar Logo

    Hi,

    And, if I want the logo to be shown on the right? I don't want the icon to be shown next to the other actions.

    Thanks,
    Òscar Llarch i Galán

  4. #4
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QMenuBar or QToolBar Logo

    How about reversing the layout

  5. #5
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QMenuBar or QToolBar Logo

    Hi,

    How about reversing the layout
    Reversing the QToolBar layoutDirection layouts all icons to the right.
    I just want the actions on the left side and the logo(QLabel) to the right side.
    Will try adding a QSpacer.
    Òscar Llarch i Galán

  6. #6
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QMenuBar or QToolBar Logo

    Hi,

    It's not possible to add a QSpacerItem because it not inherit from QWidget.

    Any other idea?

    Thanks,
    Òscar Llarch i Galán

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

    Default Re: QMenuBar or QToolBar Logo

    It's not possible to add a QSpacerItem because it not inherit from QWidget.
    But QMenuBar does inherit QWidget, so you can add a spacer item to its layout.
    OR
    You can create a custom widget derived from QMenuBar, and override the painEevnt().
    ==========================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.

Similar Threads

  1. MacOS and QToolBar?
    By Dale in forum Qt Programming
    Replies: 4
    Last Post: 26th May 2009, 06:45
  2. Question about "delete" on QMenuBar instance..
    By tgreaves in forum Qt Programming
    Replies: 4
    Last Post: 30th March 2009, 22:10
  3. Hide Qmenubar
    By user_mail07 in forum Qt Programming
    Replies: 5
    Last Post: 10th December 2008, 22:16
  4. How Do I Float a QToolBar?
    By dvmorris in forum Qt Programming
    Replies: 7
    Last Post: 29th April 2007, 19:01
  5. Insert separate QToolBar into QMainWindow
    By YuriyRusinov in forum Qt Programming
    Replies: 3
    Last Post: 24th April 2006, 10:37

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.