Results 1 to 9 of 9

Thread: Top widget

  1. #1
    Join Date
    Feb 2008
    Posts
    60
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Top widget

    I need to do a sample Qt application in which the widget should always stay on top (that is always visible to user) and also this widget's space shouldn't occupied by any other application.

    say if Qt widget position stats from top left of the screen (0,0) and occupies 1/4 th of the screen, and other applications should be placed in 3/4 th of the screen. can this be achieved in Qt?.

    I have tried with Qt::WindowStaysOnTopHint, in this case all other widgets goes below this top widget.

    if any one tried like this before help me.

    I am using Qt4.4.0 in windows.

  2. #2
    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: Top widget

    I need to do a sample Qt application in which the widget should always stay on top (that is always visible to user) and also this widget's space shouldn't occupied by any other application.
    I dont think that will be possible in Qt. You are not windows manager, and you cant restrict other windows from occupying desktop space

  3. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Top widget

    Well you can generate a stand alone QWidget with Qt::WindowStaysOnTopHint and sync it with your app geometry.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Top widget

    Quote Originally Posted by Lykurg View Post
    Well you can generate a stand alone QWidget with Qt::WindowStaysOnTopHint and sync it with your app geometry.
    But this won't prevent the desktop manager from placing a window underneath the top-level window.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Top widget

    Quote Originally Posted by wysota View Post
    But this won't prevent the desktop manager from placing a window underneath the top-level window.
    Ah, right. Misread the question...

  6. #6
    Join Date
    Feb 2008
    Posts
    60
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Top widget

    Thank you very much for all your answers.

    QDesktopWidget helps in any way for doing this?

  7. #7
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Top widget

    QDesktopWidget again can only provide you with the screen geometry. You can use it to place your widget on the desried location on the screen. BUT It cant help you to acquire the screen area for good. other windows will be able to use that area and they should be. I dont understand your fascination with that area though i mean u can always keep it on top, that should be enough. Why do you need to not allow other windows to acquire that area?

  8. #8
    Join Date
    Feb 2008
    Posts
    60
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Top widget

    The GUI having many control buttons. It is flexible for us if we have this as a separate one instead of showing on top of other windows.

  9. #9
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Top widget

    even if it has many buttons, if it stays on top always, i believe your issue must be resolved. Also i think you'd be wasting a lot of your time trying to find a solution to this and if it exists, implementing it(i dont think there is any "Qt way" to do it). Providing Qt::WindowStaysOnTopHint works for you on every operating system, you shouldnt be bothered about other applications/widgets taking your area.

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

    jay (31st March 2009)

Similar Threads

  1. QDockWidget inside another widget in the center?
    By Antebios in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2010, 07:06
  2. Widget Focus
    By navi1084 in forum Qt Programming
    Replies: 6
    Last Post: 29th September 2008, 10:22
  3. Playbutton functionality
    By uchennaanyanwu in forum Qt Programming
    Replies: 5
    Last Post: 31st July 2008, 22:29
  4. How to Open & Close a Widget ?!!
    By Fatla in forum Qt Programming
    Replies: 6
    Last Post: 13th June 2008, 20:39
  5. Tricky problem with ARGB widget / UpdateLayeredWindow
    By nooky59 in forum Qt Programming
    Replies: 3
    Last Post: 21st February 2008, 10:35

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.