Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to add application logo to QMenuBar
Forum Updated to NodeBB v4.3 + New Features

How to add application logo to QMenuBar

Scheduled Pinned Locked Moved General and Desktop
7 Posts 4 Posters 4.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    engdarkman89
    wrote on last edited by
    #1

    Hi Professionals,

    I wonder if i can add a small logo picture to QMenuBar, like in the picture.
    !http://dl.dropbox.com/u/7750653/QMenuBar_Logo.bmp(MySql Workbench Oracle Logo)!

    I tried to set icons for QMenu & QAction, but the logo picture looks very very small, like in the picture.
    !http://dl.dropbox.com/u/7750653/QMenuBar_Logo_Icon.bmp(QMenu QAction Icons)!

    Thanks.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      Easiest way, I think, is to simply subclass QMenuBar, and reimplement the paint() method. First let the baseclass do the hard work, and then render the image over the bar on the right-hand side. Of course, you will need to take care that it does not overlap the menu items themselves, but perhaps you can use the stylesheet padding-right property to ensure there is space left over for the image.

      1 Reply Last reply
      0
      • B Offline
        B Offline
        broadpeak
        wrote on last edited by
        #3

        You have to cut your text with opacity, after this, probably your pic will be shown in a right way.

        1 Reply Last reply
        0
        • E Offline
          E Offline
          engdarkman89
          wrote on last edited by
          #4

          bq. You have to cut your text with opacity, after this, probably your pic will be shown in a right way.

          Can you give more details on how to achieve this.

          Thanks Andre, i will try with your solutions and post back.

          1 Reply Last reply
          0
          • G Offline
            G Offline
            giesbert
            wrote on last edited by
            #5

            [quote author="Anas Al-Taji" date="1347288686"]Hi Professionals,

            I wonder if i can add a small logo picture to QMenuBar, like in the picture.
            !http://dl.dropbox.com/u/7750653/QMenuBar_Logo.bmp(MySql Workbench Oracle Logo)!

            I tried to set icons for QMenu & QAction, but the logo picture looks very very small, like in the picture.
            !http://dl.dropbox.com/u/7750653/QMenuBar_Logo_Icon.bmp(QMenu QAction Icons)!
            [/quote]

            But it seems, the logo is in a tab bar and the menu bar is part of the tab widget, right?

            Nokia Certified Qt Specialist.
            Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

            1 Reply Last reply
            0
            • B Offline
              B Offline
              broadpeak
              wrote on last edited by
              #6

              [quote author="Anas Al-Taji" date="1347346824"]bq. You have to cut your text with opacity, after this, probably your pic will be shown in a right way.

              Can you give more details on how to achieve this.
              [/quote]

              Use GIMP or Photoshop. Save your pic in png format. Png can be made as transparent.

              1 Reply Last reply
              0
              • E Offline
                E Offline
                engdarkman89
                wrote on last edited by
                #7

                bq. Use GIMP or Photoshop. Save your pic in png format. Png can be made as transparent.

                Unfortunately i used Gimp and PNG format with transparent with no luck. i think the problem is the default icon size for QMenu and QAction, but what if we can add QLabel to QMenuBar in some way.!!

                bq. But it seems, the logo is in a tab bar and the menu bar is part of the tab widget, right?

                You are right Gerolf, it seems like tab bar, but what if we want to do it with QMenuBar?

                Gerolf, i learned too much from you already, but this is the first time i talk to you directly, so please accept my regards.

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved