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. Icon on the menu of Qaction not showing up. [ Solved ]
Forum Updated to NodeBB v4.3 + New Features

Icon on the menu of Qaction not showing up. [ Solved ]

Scheduled Pinned Locked Moved General and Desktop
16 Posts 4 Posters 11.1k 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.
  • G Offline
    G Offline
    goetz
    wrote on 23 Feb 2011, 13:19 last edited by
    #6

    Did you add the icons to the resource file of the project?

    http://www.catb.org/~esr/faqs/smart-questions.html

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on 23 Feb 2011, 13:19 last edited by
      #7

      Doesn't it depend on the style if you can have an icon for a complete menu, not just for actions in a menu?

      1 Reply Last reply
      0
      • L Offline
        L Offline
        Leon
        wrote on 23 Feb 2011, 13:31 last edited by
        #8

        See clementine screenshot.
        !http://oi54.tinypic.com/i3cvpu.jpg(Screen)!

        So Andre what i want, is used in other programs.. ( + Clementine is a qt app )

        Volker yes the icons are on the resource file..
        Again If you want download example project-> http://dl.dropbox.com/u/11379868/example.zip

        1 Reply Last reply
        0
        • F Offline
          F Offline
          Franzk
          wrote on 23 Feb 2011, 13:37 last edited by
          #9

          [quote author="Leon Vytanos" date="1298466699"]The same with this
          ui>menuHere_no_icon_is_been_shown>setIcon(QIcon(":/icons/Icons/button_blue_fastforward.png"));
          [/quote]Dude, reread my post and then fix to this:
          @ui->menuHere_no_icon_is_been_shown->menuAction()->setIcon(QIcon(":/icons/Icons/button_blue_fastforward.png"));@

          "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • L Offline
            L Offline
            Leon
            wrote on 23 Feb 2011, 13:51 last edited by
            #10

            This is how to set the icon to be visible

            @ ui->menuHere_no_icon_is_been_shown->menuAction()->setIconVisibleInMenu(1);
            @

            Problem Solved. Thanks Franzk..

            1 Reply Last reply
            0
            • G Offline
              G Offline
              goetz
              wrote on 23 Feb 2011, 14:04 last edited by
              #11

              This is kind-of wrong:

              @
              ui->menuHere_no_icon_is_been_shown->menuAction()->setIconVisibleInMenu(1);
              @

              this is better:

              @
              ui->menuHere_no_icon_is_been_shown->menuAction()->setIconVisibleInMenu(true);
              @

              http://www.catb.org/~esr/faqs/smart-questions.html

              1 Reply Last reply
              0
              • L Offline
                L Offline
                Leon
                wrote on 23 Feb 2011, 14:10 last edited by
                #12

                Volker why is it wrong? Doesn't 1 mean true and 0 false? It does..

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  goetz
                  wrote on 23 Feb 2011, 14:22 last edited by
                  #13

                  1 and 0 are of type int
                  true and false are of type bool

                  It is casted the right way, yes, but it is considered bad style in C++ (in C you do not have a type bool, so 0/1 is ok there).

                  http://www.catb.org/~esr/faqs/smart-questions.html

                  1 Reply Last reply
                  0
                  • L Offline
                    L Offline
                    Leon
                    wrote on 23 Feb 2011, 14:38 last edited by
                    #14

                    Ok thank you Volker.. I didn't know it.

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      andre
                      wrote on 23 Feb 2011, 15:45 last edited by
                      #15

                      Besides, it is much easier to read true and false than 1 and 0, IMHO.

                      1 Reply Last reply
                      0
                      • L Offline
                        L Offline
                        Leon
                        wrote on 23 Feb 2011, 15:47 last edited by
                        #16

                        I agree!

                        1 Reply Last reply
                        0

                        15/16

                        23 Feb 2011, 15:45

                        • Login

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