Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Forum Updated on Feb 6th

    [SOLVED] Icons at the menubar not visible in Ubuntu 11.04 ( Unity ) ...

    General and Desktop
    6
    20
    10727
    Loading More Posts
    • 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.
    • L
      Leon last edited by

      My app has a menubar and some actions in it.. The actions has icons which they are not visible in Ubuntu 11.04 ( Unity ) while at 10.10 they were visible.

      P.S Clementine ( Music Player ) uses Qt and the icons are visible so there is a way to have the icons visible.

      P.S 2 @ui->action_Preferences->setIconVisibleInMenu(true);
      @
      Doesn't make any difference ( Icon still not visible )

      1 Reply Last reply Reply Quote 0
      • T
        tobias.hunger last edited by

        Maybe ubuntu changed its theme to not show icons anymore?

        Try running your application with a different style. Does that make the icons reappear?

        1 Reply Last reply Reply Quote 0
        • A
          agarny last edited by

          Strange, my Qt application works fine using Ubuntu 11.04 with either Unity or Ubuntu Classic.

          1 Reply Last reply Reply Quote 0
          • L
            Leon last edited by

            Could you upload it? Just to see what am i doing wrong..

            1 Reply Last reply Reply Quote 0
            • A
              agarny last edited by

              I have just uploaded a binary version at "http://www.opencor.ws/OpenCOR-0.0.0-Linux.tar.gz":http://www.opencor.ws/OpenCOR-0.0.0-Linux.tar.gz. I started that project relatively recently, so don't expect much. Still, it works fine on Ubuntu 11.04 with Unity.

              PS: I will be deleting that binary within 24 hours or when you have downloaded it.

              [EDIT: fixed link, Volker]

              1 Reply Last reply Reply Quote 0
              • L
                Leon last edited by

                It says link not found. You could just create a qt project from scratch ( witch will have a menubar and an action with icon that is visible ) and upload it to megaupload/rapidshare/dropbox or something..

                1 Reply Last reply Reply Quote 0
                • A
                  agarny last edited by

                  That's because of the website not rendering the URL properly, try this:

                  http://www.opencor.ws/OpenCOR-0.0.0-Linux.tar.gz

                  There was a full stop at the end of the previous URL.

                  1 Reply Last reply Reply Quote 0
                  • G
                    goetz last edited by

                    [quote author="DocOx" date="1304762587"]That's because of the website not rendering the URL properly, try this:

                    http://www.opencor.ws/OpenCOR-0.0.0-Linux.tar.gz

                    There was a full stop at the end of the previous URL.[/quote]

                    You can always edit your posts, there is an edit link below your avatar on the right side of ever post/comment you wrote. Regarding URLs, it's always good practice to check them with the preview button below the text box for the comment.

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

                    1 Reply Last reply Reply Quote 0
                    • L
                      Leon last edited by

                      This is not Unity's style menubar. I meen this ->

                      !http://i55.tinypic.com/2e51dvo.jpg!

                      [EDIT: changed image link to inline image, Volker]

                      1 Reply Last reply Reply Quote 0
                      • A
                        agarny last edited by

                        [quote author="Volker" date="1304764811"]Regarding URLs, it's always good practice to check them with the preview button below the text box for the comment.[/quote]Well, I did check that the URL was correct, but not using the preview button. I just assumed (wrongly though, clearly!) that the rendering on the URL would be correct...

                        [quote author="Leon" date="1304765188"]This is not Unity's style menubar. I meen this -> http://i55.tinypic.com/2e51dvo.jpg[/quote]Ok, I now see what you mean. Well, you should have been a bit more precise, I guess. :) Anyway, like you, my application doesn't work in the way you describe. I imagine that it is something that Qt will have to support as I would expect it to be very specific to Unity.

                        1 Reply Last reply Reply Quote 0
                        • L
                          Leon last edited by

                          Vlc ( uses Qt ) neither have icons visible.. But Clementine have.. I checked it's source and see:

                          @ui_->action_clear_playlist->setIcon(IconLoader::Load("edit-clear-list"));@

                          And at iconLoader.cpp:

                          @#include <QFile>
                          #include <QtDebug>

                          QList<int> IconLoader::sizes_;

                          void IconLoader::Init() {
                          sizes_.clear();
                          sizes_ << 22 << 32 << 48;
                          }

                          QIcon IconLoader::Load(const QString &name) {
                          QIcon ret;

                          if (name.isEmpty())
                          return ret;

                          #if QT_VERSION >= 0x040600
                          // Try to load it from the theme initially
                          ret = QIcon::fromTheme(name);
                          if (!ret.isNull())
                          return ret;
                          #endif

                          // Otherwise use our fallback theme
                          const QString path(":/icons/%1x%2/%3.png");
                          foreach (int size, sizes_) {
                          QString filename(path.arg(size).arg(size).arg(name));

                          if (QFile::exists(filename))
                            ret.addFile&#40;filename, QSize(size, size&#41;);
                          

                          }

                          if (ret.isNull())
                          qWarning() << "Couldn't load icon" << name;
                          return ret;
                          }@

                          But i do not now how can i also implement this to my app...

                          1 Reply Last reply Reply Quote 0
                          • T
                            tobias.hunger last edited by

                            The unity menubar-in-the-panel thing is a DBus service the canonical developers came up with. Seems their integration into Qt does not work properly.

                            There is a "bug report against Qt Creator in launchpad":https://bugs.launchpad.net/bugs/770367 that its menu is not moved into the panel either. Looks like the dbus magic necessary to move the menu into the panel does not work properly for Creator either.

                            1 Reply Last reply Reply Quote 0
                            • L
                              Leon last edited by

                              So for now i can't do anything for the icon thing?

                              1 Reply Last reply Reply Quote 0
                              • T
                                tobias.hunger last edited by

                                I have not looked into the problem, so I might be wrong. Does this work in a more normal setup (e.g. kubuntu or a traditional gnome desktop)?

                                Maybe filing a bug report in ubuntu might help. I personally gave up on reporting things to ubuntu, I find launchpad to be just too horrible to use and my reports were rarely acted upon in a timely manner.

                                Asking on the #kubuntu-devel irc channel on freenode might get you some results, too:)

                                1 Reply Last reply Reply Quote 0
                                • L
                                  Leon last edited by

                                  Hmm, ok i will ask at IRC.

                                  1 Reply Last reply Reply Quote 0
                                  • L
                                    lucho2013 last edited by

                                    Hi Leon:
                                    Have you solved the problem?
                                    I can't show the icons on menu. I work on Xubuntu.
                                    If you solved, can you tell me how?

                                    1 Reply Last reply Reply Quote 0
                                    • L
                                      Leon last edited by

                                      [quote author="lucho2013" date="1377889749"]Hi Leon:
                                      Have you solved the problem?
                                      I can't show the icons on menu. I work on Xubuntu.
                                      If you solved, can you tell me how?[/quote]

                                      I am on Ubuntu 13.10 now ( 2 years have passed )

                                      everything seems pretty much working if i change the icon from the qt designer and set an icon from my resource file

                                      what exactly are you doing and the icon is not visible?

                                      1 Reply Last reply Reply Quote 0
                                      • L
                                        lucho2013 last edited by

                                        Sorry Leon; already solved the problem

                                        Thanks a lot

                                        1 Reply Last reply Reply Quote 0
                                        • A
                                          avmg last edited by

                                          Hi,

                                          I have the same problem...i searched in forums withouts results. I tried all what you said, I add the icon in the "graphic" menu and also activate the property "iconVisibleInMenu" but the icon doesn't show.

                                          I'm under Qt Creator 3.0.0 Based on Qt 5.2.0 (GCC 4.6.1, 64 bit).
                                          Ubuntu 13.04 64 bit with Gnome.

                                          Thanks

                                          1 Reply Last reply Reply Quote 0
                                          • A
                                            avmg last edited by

                                            Solved. The problem was that the specified path was not correct. Anyway i tried also with the "graphic" method, icon and then choose file... But this didn't work.

                                            Thanks

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post