I managed to get a QSystemTrayIcon view similar to this:

using the following line of code (with working signal slots):
#include "dialog.h" #include "ui_dialog.h" #include <QMessageBox> #include <form.h> Dialog::Dialog(QWidget *parent) : QDialog(parent), ui(new Ui::Dialog) { ui->setupUi(this); QIcon icon("/Users/JohnnyAppleseed/IMAGE.png"); m_ptrTrayIcon = new QSystemTrayIcon(icon ); m_ptrTrayIcon->setToolTip( tr( "Bubble Message" ) ); // m_ptrTrayIcon->setContextMenu(m_trayIconMenu); connect(m_ptrTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason))); } Dialog::~Dialog() { delete ui; }
However, when I try to implement the code to show a QWidget / QWindow next to the QSystemTrayIcon that I created, it does not appear next to it. It also appears and disappears quickly (even if I don't want it to be next to the QSystemTrayIcon) using this code:
void Dialog::iconActivated(QSystemTrayIcon::ActivationReason reason) { form fr; fr.setWindowFlags(Qt::Popup); fr.show(); }
For clarity, I would like to show my QWidget / QWindow in the same way as the VMWare Fusion approach (or the clock found in Microsoft Windows Vista or later ... )
Mac OS X / Linux 
Microsoft Windows 
Can someone point out what I'm doing wrong? Thanks!
To make things a lot easier, download the project: http://zipshare.net/sv
UPDATE # 1
Regarding the QWidget / QWindow release issue, vahancho recommended I move form fr; from the void Dialog::iconActivated(QSystemTrayIcon::ActivationReason reason) function to the title bar of the working window. And it worked successfully thanks to vahancho . A window will appear, but not yet next to the QSystemTrayIcon: (
source share