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. [SOLVED] Icons at the menubar not visible in Ubuntu 11.04 ( Unity ) ...
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved General and Desktop
20 Posts 6 Posters 12.3k 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.
  • L Offline
    L Offline
    Leon
    wrote on last edited by
    #11

    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
    0
    • T Offline
      T Offline
      tobias.hunger
      wrote on last edited by
      #12

      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
      0
      • L Offline
        L Offline
        Leon
        wrote on last edited by
        #13

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

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tobias.hunger
          wrote on last edited by
          #14

          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
          0
          • L Offline
            L Offline
            Leon
            wrote on last edited by
            #15

            Hmm, ok i will ask at IRC.

            1 Reply Last reply
            0
            • L Offline
              L Offline
              lucho2013
              wrote on last edited by
              #16

              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
              0
              • L Offline
                L Offline
                Leon
                wrote on last edited by
                #17

                [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
                0
                • L Offline
                  L Offline
                  lucho2013
                  wrote on last edited by
                  #18

                  Sorry Leon; already solved the problem

                  Thanks a lot

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    avmg
                    wrote on last edited by
                    #19

                    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
                    0
                    • A Offline
                      A Offline
                      avmg
                      wrote on last edited by
                      #20

                      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
                      0

                      • Login

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