Skip to content
Search

QSystemTrayIcon

lastmod 2014-02-16created 2014-02-163 edits

The QSystemTrayIcon class provides an icon for an application in the system tray.

Example

Add the following in the implementation of a class that inherits QMainWindow.

#include <QSystemTrayIcon>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QSystemTrayIcon *tray = new QSystemTrayIcon(QIcon(QPixmap(":/res/ic_tray.png")), this);
    tray->show();
}

Favorite site