Results 1 to 5 of 5

Thread: QDockWidget showFullScreen() only works on Windows

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Feb 2013
    Posts
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Android

    Default Re: QDockWidget showFullScreen() only works on Windows

    What exactly do you mean by:
    Move the widget content out of the dock widget and then make it full screen
    I'm unsure how to do this. Maybe you could be more precise or provide a simple example how to move the content of a floated dockwidget out of it and make it full screen (and vice versa).

    Nevertheless i found a quick work around using style sheets. Actually it's all right for my purpose but it's not really a solution to the problem:

    Qt Code:
    1. // Set full screen:
    2. dockflags = dw->windowFlags();
    3. styleSheet = dw->styleSheet();
    4. geometry = dw->geometry();
    5.  
    6. dw->setWindowFlags( Qt::Window );
    7.  
    8. dw->setStyleSheet(
    9. QString("QDockWidget{ border: 0px; color: #000099; background-color: black; margin: 0px; padding: 0px }") +
    10. QString("QDockWidget::title{ text-align: center; background-color: black; padding: 0px; margin: 0px; }") +
    11. QString("QDockWidget::close-button, QDockWidget::float-button { border: 0px solid black; background: black; padding: 0px; }") +
    12. QString("QDockWidget::close-button:hover, QDockWidget::float-button:hover { background: gray; }") +
    13. QString("QDockWidget::close-button:pressed, QDockWidget::float-button:pressed { padding: 1px -1px -1px 1px; }") );
    14.  
    15. dw->showFullScreen();
    16. ...
    17. // Reset from fullscreen:
    18. dw->setWindowFlags( dockflags );
    19. dw->setStyleSheet( styleSheet );
    20. dw->setGeometry(geometry);
    21.  
    22. dw->show();
    To copy to clipboard, switch view to plain text mode 
    The title bar of the dock widget is still there but it's simply "hidden"; colored black.

    Finally this is not the full screen behaviour i'm happy with, but it kinda works for now. (I'm displaying video and/or 3D models within the window). Furthermore i'm still searching for a better/real solution wich is not a hack like this. Maybe i have to think about not using QDockWidgets at all, due to the lack of identic behaviour at different OSs (especially in that case of the showFullScreen method). Actually i am just a little "satisfied" - so i'm still searching for a more convenient solution. Any more hints are welcome, thnx so far...
    Last edited by xam; 23rd April 2013 at 00:14.

Similar Threads

  1. Replies: 5
    Last Post: 8th June 2012, 13:14
  2. Setting fonts on Windows works, but not on Mac
    By mtnbiker66 in forum Qt Programming
    Replies: 0
    Last Post: 17th January 2012, 21:06
  3. Replies: 4
    Last Post: 10th November 2011, 15:49
  4. Does anyone have works with qoauth in windows?
    By MorrisLiang in forum Qt Programming
    Replies: 1
    Last Post: 11th December 2010, 10:02
  5. Works well on Windows but fails on Linux
    By utkuaydin in forum Qt Programming
    Replies: 3
    Last Post: 11th January 2010, 13:22

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
  •  
Qt is a trademark of The Qt Company.