Results 1 to 6 of 6

Thread: dialog box as a system tray popup

  1. #1
    Join Date
    Nov 2012
    Posts
    21
    Thanks
    7
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default dialog box as a system tray popup

    Hi All,

    How to display my dialog box as a system tray popup. Does qt provides any specific api's to make dialog as a popup of SystemTray?

    Thanks.

  2. #2
    Join Date
    Dec 2012
    Posts
    197
    Thanks
    25
    Thanked 41 Times in 33 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: dialog box as a system tray popup

    Hey there,
    im not sure what do you mean by dialog box as a system tray popup, if you want your dialog Ui to appear on a specific event ,
    just connect the dialog's open or exec slot (depending on your need ) to whatever signal your waiting for to invoke the dialog, you can set the model to true to prevent interactions with other windows.
    if you want to just show a warning or information or anything like a small message , you can use QMessageBox , it has some really nice features.
    you can also look at this link , it might be helpful http://qt-project.org/forums/viewthread/6785
    Hope this helps.
    Last edited by toufic.dbouk; 22nd September 2013 at 18:05.

  3. #3
    Join Date
    Nov 2012
    Posts
    21
    Thanks
    7
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: dialog box as a system tray popup

    For instance, there is an app called "abc". It has system tray icon. "abc" application has to show notifications in some scenarios. There notifications are like tooltip windows on windows. But, for "abc" application, it has to show rich gui window as a system tray notification. I cannot use QMessageBox for this purpose. This rich gui window should be prompted at notification position.

    If I run through my application, the position is always center of desktop. The position should change to default system notification position.

    This is what I am looking for. Thanks toufic.

  4. #4
    Join Date
    Dec 2012
    Posts
    197
    Thanks
    25
    Thanked 41 Times in 33 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: dialog box as a system tray popup

    I am not sure that i know what your exactly talking about.
    But if you mean that you want your application to show a notification at the system tray and then by pressing the information message or box it will open the your rich GUI window take a look at this : System Tray Icon Example.
    implement your rich GUI window and a dialog add all your GUI interfaces and accessibility and then connect it with the system tray information message.( maybe on click message show your window ).
    some pics would explain it more if you still want to clarify your idea.

    Quote Originally Posted by dpn
    This rich gui window should be prompted at notification position.
    cant you just create and show the dialog when the notification is needed ? and try to change the position as needed, then when your function is done clean it up
    example :
    Qt Code:
    1. connect(this,SIGNAL(emitNotification(/*implement it*/)),mDialog,SLOT(showDialog(/*implement it*/)));
    To copy to clipboard, switch view to plain text mode 
    Good Luck.

  5. #5
    Join Date
    Nov 2012
    Posts
    21
    Thanks
    7
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: dialog box as a system tray popup

    Yes. QSystemTrayIcon::showMessage(). I want to replace this default notification with my own dialog. I need showMessage() geometry in overridden function.
    Last edited by dpn; 23rd September 2013 at 06:27.

  6. #6
    Join Date
    Dec 2012
    Posts
    197
    Thanks
    25
    Thanked 41 Times in 33 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: dialog box as a system tray popup

    Quote Originally Posted by dpn View Post
    Yes. QSystemTrayIcon::showMessage(). I want to replace this default notification with my own dialog. I need showMessage() geometry in overridden function.
    i guess you answered your self here.
    you have to create your own pop up widget and center it as you want.
    Also try to catch the event that is causing the balloon information message to show , and instead of showing the balloon , directly show your GUI Window.

    i am not sure of the logic behind what you want , i wouldn't say it is flexible and at ease to pop out a whole rich GUI window out of a sudden for the user.
    i would have showed the balloon message and then upon clicking it, show the window you want.

    i hope this helps , you can always wait for responses from more experienced developers. we both can learn something new every minute.

Similar Threads

  1. how to create its own tray(system tray) in QT application
    By Soumya Somasekhar Ram in forum Newbie
    Replies: 12
    Last Post: 6th September 2013, 13:23
  2. Minimize to system tray
    By aLiNuSh in forum Newbie
    Replies: 17
    Last Post: 4th March 2010, 12:51
  3. How to keep System tray icons
    By mkkguru in forum Qt Programming
    Replies: 10
    Last Post: 24th February 2010, 16:19
  4. Replies: 6
    Last Post: 12th September 2008, 12:11
  5. system tray problem
    By vvdounai in forum Qt Programming
    Replies: 5
    Last Post: 14th November 2007, 08:25

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.