Results 1 to 4 of 4

Thread: Full Screen window with separate window widget on top

  1. #1
    Join Date
    Nov 2016
    Location
    Florida, US
    Posts
    26
    Thanks
    7
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Full Screen window with separate window widget on top

    In linux (only place I care at the moment) I have an application that runs in full screen (showFullScreen() used in MainWindow) and works fine.

    I want to add, to one aspect of its run time, a floating window that is a control. I am creating it as a regular QWidget class, owned by the parent MainWindow, then in that widget's constructor doing:

    this->setWindowFlags(Qt::Window);

    to force it to a separate window.

    When I am not using full screen, this works fine -- the new widget opens in its own window, with border (I use the "X" on it), and it stays on top of it's parent.

    But when the MainWindow is full screen, it opens behind it, where it is inaccessible.

    I am not even sure if what I want is possible -- can I have a window that is full screen, AND have another window open on top of it?

    If so, suggestions which combination of flags?

    I've tried quite a few without success, the only one that works is Qt::X11BypassWindowManagerHint, but that leaves it without a border or controls so it is stuck in one place -- I need it to be movable. The best analogy is something like a FIND window that stays in front and you can reposition over a full screen document.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,546 Times in 1,496 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Full Screen window with separate window widget on top

    Have you tried using a QDialog instead of QWidget?

    Cheers,
    _

  3. The following user says thank you to anda_skoa for this useful post:

    Linwood (14th January 2017)

  4. #3
    Join Date
    Nov 2016
    Location
    Florida, US
    Posts
    26
    Thanks
    7
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: Full Screen window with separate window widget on top

    Hmmm, in a quick try it does seem to work (I just OR'd it into the window flags).

    I did not try that originally as I thought it locked in the behavior as a accept/reject type screen, but so far I have not seen any (other) differences. Maybe because I set the flag instead of using the class, but thank you, this seems to solve the problem.

  5. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,546 Times in 1,496 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Full Screen window with separate window widget on top

    QDialog can be used as an accept/reject type window. This mode is called "modal".
    But it can also be just used as a normal sub window.

    Setting the dialog flag on a normal window is fine as well, in both cases it is a hint to the windowing system that the window should be kept on top of its parent.

    Cheers,
    _

  6. The following user says thank you to anda_skoa for this useful post:

    Linwood (15th January 2017)

Similar Threads

  1. Replies: 5
    Last Post: 24th October 2016, 17:23
  2. Help - 1 Separate Window to Rule them all, Ideas please
    By 2lights in forum Qt Programming
    Replies: 1
    Last Post: 11th July 2013, 10:30
  3. How to maximize window to full screen ?
    By vsthakur1 in forum Newbie
    Replies: 4
    Last Post: 11th December 2012, 12:54
  4. Resizing and full screening of window.
    By Rewo in forum Newbie
    Replies: 6
    Last Post: 8th July 2010, 19:18
  5. how to display a window full screen??
    By Seema Rao in forum Qt Programming
    Replies: 1
    Last Post: 8th May 2006, 12:07

Tags for this Thread

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.