Static Build and Qml



  • I’m trying to create a simple circular gauge following the example in the documentation
    https://doc.qt.io/qt-5/qml-qtquick-controls-styles-circulargaugestyle.html
    There is a circular gauge style that I get an invalid component warning on in the editor. If I look into the static qt build directory I see that some of the files that are there in the non static build aren’t in the static build. How can I use that style with a static built at?



  • Hi @hansob3
    Can you provide the error log ?
    And have you included the imports needed for style ?

    import QtQuick.Controls.Styles 1.4
    

    if not included the Qt will show the warning like below

    0_1559268981021_c7e53c02-8031-4b90-82f5-99c94611df20-image.png



  • I have included the import statement. I have my project being built two ways. I have it setup as using shared libs while debugging so I have a kit that is set up for that using the default qt install. I then have a static kit that I use for release.

    When I run the debug it loads fine, I get no errors. When I switch to the release kit I then get the error that you posted about an unknown component.

    Here is my qml file

    import QtQuick 2.12
    import QtQuick.Window 2.12
    import QtQuick.Extras 1.4
    import QtQuick.Controls.Styles 1.4
    
    Window {
        visible: true
        width: 640
        height: 480
        title: qsTr("Hello World")
    
        CircularGauge {
            id: gauge
            width: 400
            height: 400
            antialiasing: true
            tickmarksVisible: true
    
            anchors.horizontalCenter: parent.horizontalCenter
            anchors.verticalCenter: parent.verticalCenter
            value: 0
            minimumValue: -100
            maximumValue: 100
            style: CircularGaugeStyle {
                minorTickmarkCount: 0
                needle: Rectangle {
                    y: outerRadius * 0.15
                    implicitWidth: outerRadius * 0.03
                    implicitHeight: outerRadius * 0.9
                    antialiasing: true
                    color: Qt.rgba(0.66, 0.3, 0, 1)
                }
            }
    
        }
    }
    

    I just used the basic Qt Quick Application - Empty template for the project and only added

    CONFIG += static
    

    to the .pro file

    For some reason it's not finding the Controls.Styles using the static build. If I mouse over the import statement it reads 'Library at C:/Qt/Static/5.12.3/qml/QtQuick/Controls/Styles'.