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. EGLFS: OpenGL windows cannot be mixed with others.
Forum Updated to NodeBB v4.3 + New Features

EGLFS: OpenGL windows cannot be mixed with others.

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 2 Posters 4.8k Views 1 Watching
  • 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.
  • R Offline
    R Offline
    Rohn
    wrote on last edited by
    #1

    I am using below code to launch my window application(qml file loading) using PyQt5.QQuickView
    @test.py
    import os
    import sys

    from PyQt5.QtCore import QUrl
    from PyQt5.QtGui import QGuiApplication
    from PyQt5.QtQuick import QQuickView
    from PyQt5.QtWebEngine import QtWebEngine

    if name == 'main':
    sys.argv.extend(['-platform', 'eglfs'])
    app = QGuiApplication(sys.argv)
    app.setApplicationName("Hello World")

    QtWebEngine.initialize()
    view = QQuickView()
    view.setResizeMode(QQuickView.SizeRootObjectToView)
    view.setSource(
        QUrl.fromLocalFile(os.path.join(os.path.dirname(__file__), 'myScrollView.qml'))
    
    )
    
    view.show()
    
    sys.exit(app.exec_())
    

    But I am getting an error as below

    @error


    QQuickView does not support using windows as a root item.

    If you wish to create your root window from QML, consider using QQmlApplicationEngine instead.

    EGLFS: OpenGL windows cannot be mixed with others.
    sh: line 1: 10864 Aborted env "PYTHONUNBUFFERED"="1" "PYTHONPATH"="/home/root/.pycharm_helpers/pycharm_matplotlib_backend:/otis:/otis/protocols/generated" "PYCHARM_HOSTED"="1" "JETBRAINS_REMOTE_RUN"="1" "PYCHARM_MATPLOTLIB_PORT"="64833" "PYTHONIOENCODING"="UTF-8" /usr/bin/python3.5 -u /otis/temp/pyqt_file.py

    Process finished with exit code 134


    How to overcome this issue, please help me to resolve this issue.......I am using following in qml file

    @qml file
    import QtQuick 2.0
    import QtQuick.Window 2.1
    import QtQuick.Controls 2.0

    Window{

    }


    Please let me know how to overcome those errors

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Either follow the suggestion made:
      @Rohn said in EGLFS: OpenGL windows cannot be mixed with others.:

      If you wish to create your root window from QML, consider using QQmlApplicationEngine instead.

      Or take a look at this example. It's C++ but you can translate it pretty easily in Python.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      R 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Either follow the suggestion made:
        @Rohn said in EGLFS: OpenGL windows cannot be mixed with others.:

        If you wish to create your root window from QML, consider using QQmlApplicationEngine instead.

        Or take a look at this example. It's C++ but you can translate it pretty easily in Python.

        R Offline
        R Offline
        Rohn
        wrote on last edited by
        #3

        @SGaist No , there is nothing related to my issue....please let me know the way to load the QML file(running application) using mentioned @test.py file using PyQt5 binding

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Yes it does since it's showing how to handle a QML file using a Window component.

          Anyway here's how to load properly your Window based QML file:

          engine =  QQmlApplicationEngine()
          engine.load(QUrl.fromLocalFile(os.path.join(os.path.dirname(__file__), 'myScrollView.qml')));
          

          And here's an improved version of your QML object to ensure there's something to show:

           Window{
               visible: true
               width: 512
               height: 300
           
               Text {
                   anchors.centerIn: parent
                   text: "Hello World!"
               }
           }
          

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1

          • Login

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