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

import QtStudio3D.OpenGL 2.6 "QML Module Not Found"



  • I'm trying to run a Qt Quick project with a 3D Studio project that was created. When I try a quick example in Qt Creator it is not able to import the OpenGL module. The version of QT Create I am running is below. Along with this the version of Qt 3DStudio is below.

    2f32d634-904a-488d-bd36-3b44f882ec00-image.png

    1284a227-71f1-43e9-bd99-7dcea17f2a30-image.png

    My project file settings are below.

    dd4cf9c4-90d2-439f-a29c-929f9406b9b4-image.png

    And here is the simple QML code I am trying to implement.

    import QtQuick 2.12
    import QtQuick.Window 2.12
    import QtStudio3D.OpenGL 2.6

    Window {
    visible: true
    width: 640
    height: 480
    title: qsTr("Hello World")

    Studio3D {
        id: studio3D
        width: parent.width
        height: parent.height
        anchors.fill: parent
    
        ViewerSettings {
            showRenderStats: true
            scaleMode: ViewerSettings.ScaleModeFit
        }
    
        Presentation {
            id: truck
            source: "qrc:/SampleTruck/SampleTruck.uia"
    

    // Element {
    // id: textLabel
    // elementPath: ""
    // }
    }

    }
    

    }

    Is there a simple solution or something I am missing for using the Qt3Studio.OpenGL Module?

    Thank you,

    Mike



  • I was able to run the project as the Qt3DStudio OpenGL module was located in a different path. I had to add the following line of code to my project to define the path for the OpenGL module.

    QML_IMPORT_PATH = C:\Qt\Tools\Qt3DStudio\qml\



  • I try follow your ans but result is not work as below
    ↓↓↓↓↓↓
    Project ERROR: Unknown module(s) in QT: 3dstudioruntime2

    How I should to do next?

    My qml
    ↓↓↓↓↓↓
    import QtQuick 2.12
    import QtQuick.Window 2.12
    import QtStudio3D.OpenGL 2.6

    Window {
    visible: true
    width: 640
    height: 480
    title: qsTr("Hello World")

    Studio3D {
        id: studio3D
        width: parent.width
        height: parent.height
        anchors.fill: parent
    
    }
    

    }

    My project
    ↓↓↓↓↓↓
    QT += quick

    CONFIG += c++11

    The following define makes your compiler emit warnings if you use

    any Qt feature that has been marked deprecated (the exact warnings

    depend on your compiler). Refer to the documentation for the

    deprecated API to know how to port your code away from it.

    DEFINES += QT_DEPRECATED_WARNINGS

    You can also make your code fail to compile if it uses deprecated APIs.

    In order to do so, uncomment the following line.

    You can also select to disable deprecated APIs only up to a certain version of Qt.

    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

    SOURCES +=
    main.cpp

    RESOURCES += qml.qrc

    Additional import path used to resolve QML modules in Qt Creator's code model

    QML_IMPORT_PATH = D:\Qt\Tools\Qt3DStudio\qml

    Additional import path used to resolve QML modules just for Qt Quick Designer

    QML_DESIGNER_IMPORT_PATH =

    Default rules for deployment.

    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target


Log in to reply