Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Static Build and Qml
Forum Updated to NodeBB v4.3 + New Features

Static Build and Qml

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
qmlstatic librarycirculargauge
3 Posts 2 Posters 921 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.
  • H Offline
    H Offline
    hansob3
    wrote on 31 May 2019, 01:18 last edited by
    #1

    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?

    1 Reply Last reply
    0
    • P Offline
      P Offline
      Pradeep P N
      wrote on 31 May 2019, 02:17 last edited by
      #2

      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

      Pradeep Nimbalkar.
      Upvote the answer(s) that helped you to solve the issue...
      Keep code clean.

      1 Reply Last reply
      2
      • H Offline
        H Offline
        hansob3
        wrote on 31 May 2019, 11:08 last edited by
        #3

        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'.

        1 Reply Last reply
        0

        1/3

        31 May 2019, 01:18

        • Login

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