Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Screen blink when App go out from full screen in OpenGL

Screen blink when App go out from full screen in OpenGL

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 1.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • mmonlabM Offline
    mmonlabM Offline
    mmonlab
    wrote on last edited by mmonlab
    #1

    Hello.

    I am having trouble when my application goes to full screen and goes out.
    I have 3 displays and I am trying to use OpenGL in my application.
    For doing this I am using QApplication::setAttribute(Qt::AA_UseOpenGLES, false);
    Drivers in my system supports OpenGL ES 2.0 and every thing looks good except when app goes to full screen.

    If I use QApplication::setAttribute(Qt::AA_UseOpenGLES, true), it works propertly.
    When I select 'false' or comment this line, three of screen suffer of a awful blink when app goes to fulscreen and more than one blinks when app goes out from full screen.

    I thought it was a problem of my app, so I have created a small example to prove it:

    C++:
    #include <QQmlApplicationEngine>
    #include <QtWidgets/QApplication>
    #include <QQuickView>

    #define QtQuickControlsApplication QApplication
    #define qApp (static_cast<QtQuickControlsApplication *>(QtQuickControlsApplication::instance()));

    int main(int argc, char *argv[])
    {
    QtQuickControlsApplication app(argc, argv);
    app.setQuitOnLastWindowClosed(true);

    //CHANGE THIS BOOLEAN TO 'FALSE' TO REPRODUCE BLINK WHEN GO OUT FROM FULLSCREEN
    bool bANGLE_Active = true;
    QtQuickControlsApplication::setAttribute(Qt::AA_UseOpenGLES, bANGLE_Active);
    
    //show QML
    QQmlApplicationEngine* pEngine = new QQmlApplicationEngine();
    pEngine->load(QUrl(QStringLiteral("qrc:/resources/ExampleFullScreen.qml")));
    
    return app.exec();
    

    }

    QML:
    import QtQuick 2.0
    import QtQuick.Controls 1.4
    import QtQuick.Window 2.2 // Window.FullScreen
    import QtQuick.Controls.Styles 1.3
    import QtGraphicalEffects 1.0

    ApplicationWindow
    {
    id: root
    objectName: "callToolBar"

    visible: true
    
    color: "yellow"
    height: 140
    width: 400
    
    Rectangle
    {
        anchors.fill: parent
        color: "red"
    }
    
    // Centered buttons
    Row
    {
        id: buttons
    
        anchors { bottom: parent.bottom; bottomMargin: 25; horizontalCenter: parent.horizontalCenter }
    
        visible: true
        width: childrenRect.width
        height: 50
        spacing: 10
        Button
        {
            id: button2
            text: "Button change visibility"
            onClicked:
            {
                if(root.visibility !== Window.FullScreen)
                    root.visibility = Window.FullScreen;
                else
                    root.visibility  = Window.Windowed;
            }
        }
    }
    

    }

    If bANGLE_Active = true, it works.
    if bANGLE_Active = false it blinks.

    Any ideas??

    mmonlabM 1 Reply Last reply
    0
    • mmonlabM mmonlab

      Hello.

      I am having trouble when my application goes to full screen and goes out.
      I have 3 displays and I am trying to use OpenGL in my application.
      For doing this I am using QApplication::setAttribute(Qt::AA_UseOpenGLES, false);
      Drivers in my system supports OpenGL ES 2.0 and every thing looks good except when app goes to full screen.

      If I use QApplication::setAttribute(Qt::AA_UseOpenGLES, true), it works propertly.
      When I select 'false' or comment this line, three of screen suffer of a awful blink when app goes to fulscreen and more than one blinks when app goes out from full screen.

      I thought it was a problem of my app, so I have created a small example to prove it:

      C++:
      #include <QQmlApplicationEngine>
      #include <QtWidgets/QApplication>
      #include <QQuickView>

      #define QtQuickControlsApplication QApplication
      #define qApp (static_cast<QtQuickControlsApplication *>(QtQuickControlsApplication::instance()));

      int main(int argc, char *argv[])
      {
      QtQuickControlsApplication app(argc, argv);
      app.setQuitOnLastWindowClosed(true);

      //CHANGE THIS BOOLEAN TO 'FALSE' TO REPRODUCE BLINK WHEN GO OUT FROM FULLSCREEN
      bool bANGLE_Active = true;
      QtQuickControlsApplication::setAttribute(Qt::AA_UseOpenGLES, bANGLE_Active);
      
      //show QML
      QQmlApplicationEngine* pEngine = new QQmlApplicationEngine();
      pEngine->load(QUrl(QStringLiteral("qrc:/resources/ExampleFullScreen.qml")));
      
      return app.exec();
      

      }

      QML:
      import QtQuick 2.0
      import QtQuick.Controls 1.4
      import QtQuick.Window 2.2 // Window.FullScreen
      import QtQuick.Controls.Styles 1.3
      import QtGraphicalEffects 1.0

      ApplicationWindow
      {
      id: root
      objectName: "callToolBar"

      visible: true
      
      color: "yellow"
      height: 140
      width: 400
      
      Rectangle
      {
          anchors.fill: parent
          color: "red"
      }
      
      // Centered buttons
      Row
      {
          id: buttons
      
          anchors { bottom: parent.bottom; bottomMargin: 25; horizontalCenter: parent.horizontalCenter }
      
          visible: true
          width: childrenRect.width
          height: 50
          spacing: 10
          Button
          {
              id: button2
              text: "Button change visibility"
              onClicked:
              {
                  if(root.visibility !== Window.FullScreen)
                      root.visibility = Window.FullScreen;
                  else
                      root.visibility  = Window.Windowed;
              }
          }
      }
      

      }

      If bANGLE_Active = true, it works.
      if bANGLE_Active = false it blinks.

      Any ideas??

      mmonlabM Offline
      mmonlabM Offline
      mmonlab
      wrote on last edited by
      #2

      @mmonlab :
      I have reported this issue to QT:
      https://bugreports.qt.io/browse/QTBUG-61838

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved