+ Reply to Thread
Results 1 to 5 of 5

Thread: Widget on desktop

  1. #1
    Join Date
    Jun 2007
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Widget on desktop

    Hi, I programmed my own widget (inherits from QWidget) but I can't get it to display as I want. This widget has no parent.

    Here is what I want:
    - It should be displayed on the desktop (always if possible). This is the opposite of the "Always Stays On top" Property
    - It shouldn't have an entry in the taskbar
    - It shouldn't have a window frame (this is OK using self.setWindowFlags(QtCore.Qt.FramelessWindowHint) )

    I tried to tweak the widget properties and the window properties, here are my tests:
    - self.setWindowFlags(Qt.FramelessWindowHint|Qt.Tool )
    This has a taskbar entry...
    - self.setWindowFlags(Qt.FramelessWindowHint|Qt.Tool |Qt.X11BypassWindowManagerHint)
    This has not taskbar entry but it always displays on top... If I call "self.lower()" to put it at the background, it just disapears and calling "self.show()" doesn't help...
    - self.setWindowFlags(Qt.FramelessWindowHint|Qt.Tool Tip)
    Same as the previous one... This has not taskbar entry but it always displays on top... If I call "self.lower()" to put it at the background, it just disapears and calling "self.show()" doesn't help...

    I spent a lot of time trying to get the behaviour I want but I kinda stuck now... If anyone has an idea, please tell me

    Note: I'm using Qt4 on KDE (pyQt4 in fact but it doesn't really matter).
    Last edited by hydr0g3n; 22nd June 2007 at 22:29. Reason: reformatted to look better

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    30,863
    Thanks
    3
    Thanked 4,622 Times in 4,427 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Blog Entries
    4
    Wiki edits
    10

    Default Re: Widget on desktop

    KDE has a flag that allows a window to be "on bottom" of the window stack, but I don't think Qt has a flag to set it, so you have to use the native X11 API for that. I'm sure you can find detailed instructions on how to do it on freedesktop.org.

  3. #3
    Join Date
    Aug 2007
    Location
    Fresno - Colombia
    Posts
    26
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Widget on desktop

    Hi!! I have the same problem, what i need is exactly as this post suggest or ask, to dissable my app to be placed on the taskbar, cause does not use minimize fuction.

    The idea is that the app could have the look of an Applet, like superkaramba does.

  4. #4
    Join Date
    Jan 2007
    Posts
    177
    Thanks
    8
    Thanked 10 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Widget on desktop

    setWindowFlags(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::SubWindow);

  5. #5
    Join Date
    Feb 2008
    Posts
    51
    Thanks
    3
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Widget on desktop

    Hi,

    I am facing a problem when using setWindowFlags(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::SubWindow);

    Whenever I pressed Alt + F4 (Application close operation), my widget disappeared but the process is still running. I am killing my process using task manager on windows.

    If Qt::SubWindow flag is not used then application terminates otherwise not. I have seen this problem only under Qt 4.3.0 to Qt 4.3.3. It works fine under Qt 4.2.1 and Qt 4.4.0 (preview release).

    Can you tell me what is reason?



    Thanks in advance.

+ Reply to Thread

Similar Threads

  1. transparent background of the main widget
    By nagpalma in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2007, 17:52
  2. How to send message to Desktop Widget
    By shyam prasad in forum Qt Programming
    Replies: 18
    Last Post: 18th April 2007, 11:00
  3. Controlling which widget on top layer?
    By JonathanForQT4 in forum Qt Programming
    Replies: 6
    Last Post: 22nd March 2007, 14:27
  4. Pin/Unpin Dock Widget
    By charlesD in forum Newbie
    Replies: 1
    Last Post: 21st June 2006, 06:57
  5. [Qt 4.1.0] Split a widget on demand
    By Townk in forum Qt Programming
    Replies: 3
    Last Post: 17th February 2006, 14:16

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