Results 1 to 6 of 6

Thread: Setting QWidget full screen problem with 2 monitos

  1. #1
    Join Date
    Dec 2006
    Posts
    426
    Thanks
    8
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Setting QWidget full screen problem with 2 monitos

    Hi,

    My machine has 2 monitors, I use QWidget::showFullScreen, but it only covers one monitor. I use setGeometry( QRectF( 0, 0, 3840, 1200 ) ), it still shows up in one screen. I have to manually resize the widget to cover both screens.

    The QDesktopWidget::availableGeometry return QRect( 0, 0, 1920, 1200 ) and QRect( 1920, 0, 1920, 1200 ).

    Is there a way to set QWidget to fully cover both screens inside the code?

    Thanks.

  2. #2
    Join Date
    Dec 2006
    Posts
    426
    Thanks
    8
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Setting QWidget full screen problem with 2 monitos

    Anyone please?

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Setting QWidget full screen problem with 2 monitos

    Have you tried setGeometry() or separate move() and resize() calls after the window is shown?

  4. #4
    Join Date
    Dec 2006
    Posts
    426
    Thanks
    8
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Setting QWidget full screen problem with 2 monitos

    I did both, as in the following codes, both w1 & w2 are only showing in one screen. Any ideas? Thanks

    Qt Code:
    1. #include <QApplication>
    2. #include <QWidget>
    3.  
    4. int main( int argc, char** argv )
    5. {
    6. QApplication app( argc, argv );
    7.  
    8. QWidget w1;
    9. w1.setWindowTitle( "w1" );
    10. w1.setGeometry( QRect( 0, 0, 3840, 1200 ) );
    11. w1.show();
    12.  
    13. QWidget w2;
    14. w2.setWindowTitle( "w2" );
    15. w2.resize( 3840, 1200 );
    16. w2.move( 0, 0 );
    17. w2.show();
    18.  
    19. return app.exec();
    20. }
    To copy to clipboard, switch view to plain text mode 

  5. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Setting QWidget full screen problem with 2 monitos

    You are not calling setGeometry(), resize(), or move() after the window is shown. Try this:
    Qt Code:
    1. #include <QApplication>
    2. #include <QWidget>
    3. #include <QTimer>
    4.  
    5. class Widget: public QWidget
    6. {
    7. Q_OBJECT
    8. public:
    9. explicit Widget(QWidget *p = 0): QWidget(p) {
    10. QTimer::singleShot(0, this, SLOT(afterShow()));
    11. }
    12. private slots:
    13. void afterShow() {
    14. setGeometry( QRect( 0, 0, 3840, 1200 ) );
    15. // or
    16. // move(0, 0);
    17. // resize(3840, 1200);
    18. }
    19. };
    20.  
    21. int main( int argc, char** argv )
    22. {
    23. QApplication app( argc, argv );
    24. Widget w;
    25. w.show();
    26. return app.exec();
    27. }
    28. #include "main.moc"
    To copy to clipboard, switch view to plain text mode 
    I don't have a dual screen setup to test.

  6. #6
    Join Date
    Dec 2006
    Posts
    426
    Thanks
    8
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Setting QWidget full screen problem with 2 monitos

    Still same problem...showing in one screen only.

Similar Threads

  1. Set full screen a dialog box
    By fantom in forum Qt Programming
    Replies: 3
    Last Post: 8th March 2011, 11:54
  2. How to set my mobile app as full screen
    By dineshkumar in forum Qt for Embedded and Mobile
    Replies: 7
    Last Post: 3rd February 2011, 16:40
  3. full screen on specified monitor
    By mgb_qt in forum Qt Programming
    Replies: 2
    Last Post: 3rd August 2010, 18:35
  4. Replies: 0
    Last Post: 16th July 2008, 13:15
  5. how to display a window full screen??
    By Seema Rao in forum Qt Programming
    Replies: 1
    Last Post: 8th May 2006, 12:07

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.