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. Qt5.3.0 QSystemTrayIcon transparency problem

Qt5.3.0 QSystemTrayIcon transparency problem

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 1.6k 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.
  • W Offline
    W Offline
    wardex
    wrote on last edited by
    #1

    Hi,

    I have a cross-platform application that uses a QSystemTrayIcon.
    On Ubuntu 12.04 with Gnome3 the trayicon's transparency is replaced by a black background. But this only happens with Qt5.3.
    When I build the same code with Qt4.8 the transparency is shown properly.

    @#include "mainwindow.h"
    #include <QMenu>
    #include <QMenuBar>

    static const char* iconFiles[] =
    {
    ":/disconnected.png",
    ":/connected.png"
    };

    MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent),
    m_pTrayIcon(NULL)
    {
    createTrayIcon();
    }

    MainWindow::~MainWindow()
    {

    }

    void MainWindow::setIcon(qState state)
    {
    QIcon icon;
    icon.addFile(iconFiles[state]);

        if (m_pTrayIcon) {
                m_pTrayIcon->setIcon(icon);
        }
    

    }

    void MainWindow::createTrayIcon()
    {
    m_pTrayIcon = new QSystemTrayIcon(this);
    setIcon(connected);
    m_pTrayIcon->show();
    }
    @

    Ideas anyone?

    1 Reply Last reply
    0
    • J Offline
      J Offline
      JvdGlind
      wrote on last edited by
      #2

      Hi Wardex,

      I used your code to see the results on Linux Mint 16, however, the icon is transparent using 5.3. Hope this helps narrowing down the problem.

      Jeffrey VAN DE GLIND
      Principle Consultant @ Nalys
      www.nalys-group.com

      1 Reply Last reply
      0
      • D Offline
        D Offline
        DBoosalis
        wrote on last edited by
        #3

        Hey I tried it with Qt5.3 on Ubuntu 14.04 and it worked as well

        1 Reply Last reply
        0
        • W Offline
          W Offline
          wardex
          wrote on last edited by
          #4

          Thanks for the effort!

          Then It'll have to be something gnome-install related on my system!

          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