Qt5.3.0 QSystemTrayIcon transparency problem
-
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?
-
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.
-
Hey I tried it with Qt5.3 on Ubuntu 14.04 and it worked as well
-
Thanks for the effort!
Then It'll have to be something gnome-install related on my system!