Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4022070
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:25:46+00:00 2026-05-20T10:25:46+00:00

I have a Qt application with a system tray icon and a menu that

  • 0

I have a Qt application with a system tray icon and a menu that shows up when right-clicking the icon. For some reason, the menu items work fine in debug mode but not in release mode.

QAction* closeAction = new QAction("Close", this);

QMenu* trayIconMenu = new QMenu(this);
trayIconMenu->addAction(closeAction);

QSystemTrayIcon* trayIcon = new QSystemTrayIcon(this);
trayIcon->setContextMenu(trayIconMenu);
QIcon trayIconIcon("Application.png");
trayIcon->setIcon(trayIconIcon);
trayIcon->show();

QObject::connect(closeAction, SIGNAL(triggered()), this, SLOT(trayIconCloseAction_triggered()));


void MainWindow::trayIconCloseAction_triggered() {
  MessageBoxes::info("Close item clicked");
}

When I right-click on the icon, the menu shows up but clicking on “Close” does nothing – trayIconCloseAction_triggered() is not called at all. It does this only in release mode. Does anybody know what could be the reason?

I am using Windows 7 and Qt Creator, building with an MSV-2010 static build of Qt.

Edit: The icon does not react to click events (“activated” signals) either. Again in debug mode it works, but not release.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T10:25:47+00:00Added an answer on May 20, 2026 at 10:25 am

    In situations like this there is a general recommendation:

    1. Erase “release” and “debug” folders in your build directory,
    2. Use “clean all” action from “build” menu in Qt creator,
    3. Switch to release mode and then use “Run qmake”, “rebuild all” actions,
    4. Press Ctrl+R and check needed functionality.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an AIR application with a system tray icon. When clicked it shows
I'm using NotifyIcon (System tray icon) in my WinForms application. I also have a
I have a Windows Application that I have created that utilizes the system tray
I'm creating a System-Tray only application. It's somewhat complicated to have the icon without
I have a application that is based out of the system tray. I have
We have C# application that crawling and executing code. But some time system stolp
I have an Electronic Workforce (EWF) application that records the caller speaking. The system
I have an application in java swing which runs in the system tray most
I have a Windows form application which exit to a system tray Notifyicon and
I have an application that start System.Threading.Timer, then this timer every 5 seconds read

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.