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. Adapt a QML part to OpenGL abilities
Forum Updated to NodeBB v4.3 + New Features

Adapt a QML part to OpenGL abilities

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qml opengl
4 Posts 2 Posters 489 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.
  • Y Offline
    Y Offline
    YvesB
    wrote on last edited by
    #1

    Hello,
    I'm working on an application intended to be used only in Linux platform, but without specification about graphical configuration.
    A user reported me a stop of the application because its graphical card is Intel 82852/855GM, thus without OpenGL 2 abilities. The error reported is:
    QOpenGLShader: could not create shader
    I presume this is because I use LinearGradient.
    What I want to try is to detect if the platform is OpenGL2 able or not, and if not don't use LinearGradient.
    I tried some log in Qml:
    console.log(GraphicsInfo.majorVersion, GraphicsInfo.minorVersion)
    but which reports me "undefined undefined"
    Documentation about GraphicsInfo says: "If the item to which the properties are attached is not currently associated with any window, the properties are set to default values. "
    I don't understand to which item and properties it is referred to.

    Thanks

    1 Reply Last reply
    0
    • N Offline
      N Offline
      Nifiro
      wrote on last edited by
      #2
      import QtQuick 2.12
      import QtQuick.Controls 2.12
      
      ApplicationWindow {
          visible: true
      
          MouseArea {
              anchors.fill: parent
              onClicked: console.log(GraphicsInfo.majorVersion, GraphicsInfo.minorVersion)
          }
      }
      
      Y 1 Reply Last reply
      1
      • N Nifiro
        import QtQuick 2.12
        import QtQuick.Controls 2.12
        
        ApplicationWindow {
            visible: true
        
            MouseArea {
                anchors.fill: parent
                onClicked: console.log(GraphicsInfo.majorVersion, GraphicsInfo.minorVersion)
            }
        }
        
        Y Offline
        Y Offline
        YvesB
        wrote on last edited by
        #3

        @Nifiro
        Thanks,
        Indeed, this is working with qmlscene.
        Thus I have to find why this is not working for my application.
        I have Qt 5.9, but I don't think this could be a problem.
        I don't have QtQuick 2.12, but tried with QtQuick 2.8 and this works.
        I tried also QtQuick.Controls 1.4 with no problem.
        My application is launched from Python 3 using PyQt, QGuiApplication and QQuickView. When I replace the QML file with the one you provided and I replace ApplicationWindow with Rectangle, this works too. I get 3 and 0 respectively.
        I have now included outputs for GraphicsInfo.majorVersion and minor, what I get is variable :/
        One time, I get 3.0, another time, I get 2.0 (same application)
        Why is this changing ? Is not this information about system ability?

        Y 1 Reply Last reply
        0
        • Y YvesB

          @Nifiro
          Thanks,
          Indeed, this is working with qmlscene.
          Thus I have to find why this is not working for my application.
          I have Qt 5.9, but I don't think this could be a problem.
          I don't have QtQuick 2.12, but tried with QtQuick 2.8 and this works.
          I tried also QtQuick.Controls 1.4 with no problem.
          My application is launched from Python 3 using PyQt, QGuiApplication and QQuickView. When I replace the QML file with the one you provided and I replace ApplicationWindow with Rectangle, this works too. I get 3 and 0 respectively.
          I have now included outputs for GraphicsInfo.majorVersion and minor, what I get is variable :/
          One time, I get 3.0, another time, I get 2.0 (same application)
          Why is this changing ? Is not this information about system ability?

          Y Offline
          Y Offline
          YvesB
          wrote on last edited by
          #4

          I continue my investigations.
          I passed the test example from Nifiro to the guy who got the problems.
          He got now:

          QT_LOGGING_RULES=qml=true qmlscene test.qml
          QOpenGLShader: could not create shader
          Segmentation fault (core dumped)
          

          Thus I presume that the error occurs before I can test the version (at import or at ApplicationWindow?), which is useless.
          This says also that my first plan to adapt instructions in QML is void :/

          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