Display window full screen on secondary monitor using Qt

前端 未结 5 425
灰色年华
灰色年华 2020-12-14 03:07

Seems to be possible with native controls (see here and here) so now I\'m looking for some Qt code to do it.

5条回答
  •  自闭症患者
    2020-12-14 03:43

    My take on this:

      auto const desktop(QApplication::desktop());
    
      setGeometry(desktop->screenGeometry(1));
    
    #ifndef Q_OS_WIN
      setWindowState(Qt::WindowState(Qt::WindowFullScreen | windowState()));
    #endif // Q_OS_WIN
    

提交回复
热议问题