Results 1 to 2 of 2

Thread: Show QPixmap into QMenuBar

  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 Show QPixmap into QMenuBar

    Hi,

    Is there anyway to show a QPixmap into the QMenuBar? I want to show a Logo on the top right of it.

    Thanks,
    Òscar Llarch i Galán

  2. #2
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Show QPixmap into QMenuBar

    Quote Originally Posted by ^NyAw^ View Post
    Hi,

    Is there anyway to show a QPixmap into the QMenuBar? I want to show a Logo on the top right of it.

    Thanks,
    You can try to use addMenu or addAction methods.

    addMenu ( const QIcon & icon, const QString & title ). When you create a QIcon object you can specify a QPixmap in its constructor.

    or

    addAction ( QAction * action )
    The constructor of QAction (this one QAction ( const QIcon & icon, const QString & text, QObject * parent ) )receives QIcon again.... just put your QPixmap into QIcon constructor and it should work.

  3. The following user says thank you to lyuts for this useful post:

    ^NyAw^ (28th May 2008)

Similar Threads

  1. [B]How to show Pixmap on QMenuBar??[/B]
    By bigbigmoon in forum Newbie
    Replies: 2
    Last Post: 17th April 2007, 06:55
  2. where could QPopupMenu show besides QMenuBar !
    By bigbigmoon in forum Newbie
    Replies: 4
    Last Post: 2nd November 2006, 01:03
  3. QPixmap and HBITMAP
    By ToddAtWSU in forum Qt Programming
    Replies: 1
    Last Post: 21st June 2006, 16:24

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.