Results 1 to 10 of 10

Thread: Hide taskbar button

  1. #1
    Join Date
    Dec 2007
    Location
    Groningen Netherlands
    Posts
    182
    Thanks
    16
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Hide taskbar button

    I have an app which displays animations. It has a trayicon and it has no show() in main so it starts hidden.

    Once in a while (QTimer) this app displays animations, therefore it does a show() on that window. This window has attributes Qt::FramelessWindowHint and Qt::WindowStaysOnTopHint.

    Now I would like to get rid of the taskbar button from this window. From googling I tried the trick with QTimer::singleShot(0, this, SLOT(show())) and I tried making the window a dialog but I still have the taksbar while the window is visible.

    Is it possible to get rid of it completely?

    Thanks again.

  2. #2
    Join Date
    Aug 2006
    Posts
    250
    Thanks
    19
    Thanked 49 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Hide taskbar button

    You might try setting the window flags to something like Qt::SplashScreen (setWindowFlags)

  3. #3
    Join Date
    Dec 2007
    Location
    Groningen Netherlands
    Posts
    182
    Thanks
    16
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Hide taskbar button

    Thank you.

    Yes this works. Unfortunately there are some side effects. The window stays centered on the screen and ignores move(), and such a window closes on mousePressEvent() in stead of executing the function.

    But it was worth the try!

  4. #4
    Join Date
    Mar 2007
    Location
    Ukraine, Odessa
    Posts
    140
    Thanks
    15
    Thanked 11 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Hide taskbar button

    Try Qt::FramelessWindowHint
    C++ & AMD forever

  5. #5
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Hide taskbar button

    As for closing of window on mousepress event.... u can subclass and catch that event.
    Also u can try for tooltip window.
    Hope it helps

  6. #6
    Join Date
    Dec 2007
    Location
    Groningen Netherlands
    Posts
    182
    Thanks
    16
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Hide taskbar button

    Thanks folks,

    Qt::FramelessWindowHint was already in there, I tried several combo's as flags.
    And that event was already subclassed, but got ignored on setting the Splashscreen flag.

    I'm afraid this one is not so easy.

    Greets, Jean.

  7. #7
    Join Date
    Aug 2006
    Posts
    250
    Thanks
    19
    Thanked 49 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Hide taskbar button

    As aamer4yu mentioned, try using Qt::ToolTip instead of SplashScreen. Basically, some combination of window flags will almost certainly do what you want..

  8. #8
    Join Date
    Dec 2007
    Location
    Groningen Netherlands
    Posts
    182
    Thanks
    16
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Hide taskbar button

    Well I couldn't find one.
    hide() hides it but show() brings it back.

    Quote Originally Posted by pherthyl View Post
    As aamer4yu mentioned, try using Qt::ToolTip instead of SplashScreen. Basically, some combination of window flags will almost certainly do what you want..

  9. #9
    Join Date
    Aug 2006
    Posts
    250
    Thanks
    19
    Thanked 49 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Hide taskbar button

    Do you need this window to be focusable by the user? In other words, do they need to interact with it in some way or is it just a window to display animations?

    If interaction is not necessary, you can use WS_EX_NOACTIVATE (on Windows at least). I use the following function for my stuff.

    Qt Code:
    1. /**
    2.  * Set the window to never receive the keyboard focus.
    3.  */
    4. void MyQWidget::setNoActivate() {
    5. long exStyle = GetWindowLong(winId(), GWL_EXSTYLE) | WS_EX_NOACTIVATE;
    6. SetWindowLong(winId(), GWL_EXSTYLE, exStyle);
    7. }
    To copy to clipboard, switch view to plain text mode 

    You will have to include the windows headers.

  10. The following user says thank you to pherthyl for this useful post:

    JeanC (12th March 2008)

  11. #10
    Join Date
    Dec 2007
    Location
    Groningen Netherlands
    Posts
    182
    Thanks
    16
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Hide taskbar button

    Hi pherthyl,

    Well I am on ubuntu linux since some time, in windows borland cbuilder I have this program working fine. But I seldom use windows anymore, that's why I Qt.

    No taksbar would have prioritiy over window interaction though.

    Well never mind, I can live with it for the time being.

    Thanks,
    Jean.
    Last edited by JeanC; 12th March 2008 at 10:18.

Similar Threads

  1. question about button
    By narumi in forum Newbie
    Replies: 2
    Last Post: 21st January 2008, 05:44
  2. How to hide application button on the task bar?
    By QCasper in forum Qt Programming
    Replies: 1
    Last Post: 16th January 2008, 23:10
  3. Hide the Tab-Button
    By sabeesh in forum Qt Programming
    Replies: 2
    Last Post: 29th October 2007, 07:20

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.