Results 1 to 13 of 13

Thread: how to make decorated rich popup window instead the default QSystemTrayIcon popup win

  1. #1
    Join Date
    May 2009
    Posts
    83

    Default how to make decorated rich popup window instead the default QSystemTrayIcon popup win

    I have simple like notification application that sits in the tray every time massage comes
    I need it to popup windows , but I need it to be rich so I could color it and add pictures
    but all I have is the defulte popup massage box , how can I create new richer one ? that will allways popups above the tray icon?

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,709
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: how to make decorated rich popup window instead the default QSystemTrayIcon popup

    Well, you need to create the widget it self, and then overload QSystemTrayIcon::showMessage() to show your custom widget instead of the default one.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    May 2009
    Posts
    83

    Default Re: how to make decorated rich popup window instead the default QSystemTrayIcon popup

    where can i see example for this ? this is not so simple ...

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,709
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: how to make decorated rich popup window instead the default QSystemTrayIcon popup

    Example for what?
    For creating a custom widget?
    For overloading QSystemTrayIcon::showMessage()?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. #5
    Join Date
    May 2009
    Posts
    83

    Default Re: how to make decorated rich popup window instead the default QSystemTrayIcon popup

    For overloading QSystemTrayIcon::showMessage()

  6. #6
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,709
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: how to make decorated rich popup window instead the default QSystemTrayIcon popup

    You just subclass QSystemTrayIcon, and re implement showMessage().
    If you don't know how to do that, you should probably turn to basic C++ tutorial sites first, until you are comfortable with C++ sub classing, as this is off topic for this forum.
    But you can feel free to ask any Qt related questions any time.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  7. #7
    Join Date
    May 2009
    Posts
    83

    Default Re: how to make decorated rich popup window instead the default QSystemTrayIcon popup

    I know i know
    the main thing is with this popup window , is the calculation of the window to popup in the right place depend on the screen size / title bar place and such ...
    do i get it automatically when i subclass it ?

  8. #8
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,709
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: how to make decorated rich popup window instead the default QSystemTrayIcon popup

    I don't think so, but I don't know, I haven't subclasses QSystemTrayIcon.
    However, the original implementation must do the position calculation, so you can "steal" that part from the original implementation.
    Actually you can use all the original code, just replace the default widget with your custom one.
    So it will probably be just copy&paste, and a rather small change to replace the default info balloon with your custom widget.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  9. #9
    Join Date
    Jan 2006
    Location
    Minsk, Brest, Belarus
    Posts
    54
    Thanks
    3
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to make decorated rich popup window instead the default QSystemTrayIcon popup

    In russian with screenshots - osd class from Clementine http://slow-tone.blogspot.com/2011/0...retty-osd.html

  10. #10
    Join Date
    May 2009
    Posts
    83

    Default Re: how to make decorated rich popup window instead the default QSystemTrayIcon popup

    i tried to compile the example in visual studio 2008 but it gives me linking problems
    1>Linking...
    1>qtmaind.lib(qtmain_win.obj) : error LNK2019: unresolved external symbol _main referenced in function _WinMain@16
    1>debug\prettyosd.exe : fatal error LNK1120: 1 unresolved externals

  11. #11
    Join Date
    Jan 2006
    Location
    Minsk, Brest, Belarus
    Posts
    54
    Thanks
    3
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to make decorated rich popup window instead the default QSystemTrayIcon popup

    This is not a stand-alone application! It's a class that you can include in your app. There is an example

  12. #12
    Join Date
    May 2009
    Posts
    83

    Default Re: how to make decorated rich popup window instead the default QSystemTrayIcon popup

    ok thanks , now i see


    Added after 35 minutes:


    Hi , i compiled the source and this is not what i meant , yeah its nice custom tool tip
    but its not system tray implementation
    Last edited by umen; 1st May 2011 at 09:53.

  13. #13
    Join Date
    Jan 2006
    Location
    Minsk, Brest, Belarus
    Posts
    54
    Thanks
    3
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to make decorated rich popup window instead the default QSystemTrayIcon popup

    And what? Just adopt it for what you want. I showed only an example

Similar Threads

  1. Popup window explorer
    By dorians58 in forum Newbie
    Replies: 3
    Last Post: 23rd July 2010, 06:26
  2. How to make a popup widget that looks like a popup?
    By Olivier Berten in forum Qt Programming
    Replies: 9
    Last Post: 6th June 2010, 14:19
  3. default popup of menubar / mainwindow
    By navid in forum Qt Programming
    Replies: 4
    Last Post: 10th December 2009, 18:29
  4. Replies: 2
    Last Post: 10th December 2009, 08:01
  5. Replies: 3
    Last Post: 17th May 2009, 21:17

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.