I'm using QSystemTrayIcon to display notification in Windows 10. Along with the notification, the application name is also displayed. The problem here is the app name is displayed along with the extension(.exe).
How can the extension(.exe) be removed from the notification?
Try adding this line to your
.pro
file:It should change the process name (both in the notifications and in the task manager) to "Whatever".
More variables like this can be found here: Qmake Variables Documentation
Note from the documentation:
Step-by-step instructions for creating a test application
Create Qt Widgets Application project, containing a
QWidget
based widgetCreate
images
directory in the project folder, put an icon file into it (for this example let it beicon.ico
)Add a resource file to the project
To that resource file add prefix
/
, then "Add Files", selecting./images/icon.ico
In
main.cpp
change the code to following:widget.cpp
change code to following:.pro
) file add following:Save, run qmake (Build -> Run qmake), rebuild project
Start the application. Now the window title should be "AppName", which came from APP_NAME define, both window and tray icon - icon.ico, and the process name in task manager and notifications - "Whatever". You can make the app display a notification by clicking on the tray icon. Notification should look like this: