Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Cannot remove fullscreen window border



  • Hello,

    I'm using qt 4.8.7 and trying to create a borderless fullscreen window on linux (ubuntu) and also on embedded. I use the following code:

    ```
    MainWidget widget;
    widget.window()->setFixedSize(QSize(SCENE_WIDTH, SCENE_HEIGHT));
    widget.setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint);
    
    // add QGraphicsScene
    
    widget.showFullScreen();
    
    The result is this:
    
    ![0_1559559476329_borderedWindow.png](https://ddgobkiprc33d.cloudfront.net/61c2c6d5-6ed9-40ec-bea1-3cf89181b325.png)
    
    As you can see there is a grey border. How do  I remove it?


  • The solution to this on qt 4.8.7 is to call setFrameStyle on the qgraphicsview like so:

    QGraphicsView view;
    view.setFrameStyle(QFrame::NoFrame);


  • Qt Champions 2019

    @Boofish Why do you set fixed window size if you want to show as full-screen?



  • @jsulm Is that related? The code uses a fixed size because I run the application on both the target board (embedded) that uses resolution 800x480 as well as on ubuntu dev machine that uses 1920x1080. The SCENE_WIDTH is 800, and SCENE_HEIGHT is 480. There is a border on both.



  • The solution to this on qt 4.8.7 is to call setFrameStyle on the qgraphicsview like so:

    QGraphicsView view;
    view.setFrameStyle(QFrame::NoFrame);


Log in to reply