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. Deploy a Qt qml package and remove .qml dependencis

Deploy a Qt qml package and remove .qml dependencis

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
5 Posts 3 Posters 575 Views
  • 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.
  • J Offline
    J Offline
    Joe47
    wrote on 9 Nov 2020, 13:54 last edited by Joe47 11 Sept 2020, 13:57
    #1

    I have created a test application in Qt5.9.4. Where i have use DropShadow by importing QtGraphicalEffects 1.0. While creating an .exe for windows, i have copied all the required dll from the C:\Qt\Qt5.9.4\5.9.4\msvc2015\qml folder to the release folder. Where in there is DropShadow.qml present in it. If i remove the .qml the .exe does not launch. Below is the code in the main.qml. How do i remove the .qml dependency?

    Window {

    id: window1
    visible: true
    width: 800
    height: 480
    title: qsTr("Transics")
    Rectangle {
    
        id: background
        anchors.fill: parent
        color: "white"
        DropShadow {
    
            id: _dropShadow
            visible: true
            anchors.fill: whiteBox
            horizontalOffset: 0
            verticalOffset: 4
            radius: 10
            samples: 20
            color: "#26000000"
            source: whiteBox
        }
        Rectangle{
            id: whiteBox
            anchors.fill: parent
            color: "white"
            anchors.margins: 100
        }
    }
    

    }

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sebastienc
      wrote on 9 Nov 2020, 14:00 last edited by
      #2

      If you want to include your QML file in the executable, you can use the Qt resource system to manage your QML file as a resource: https://doc.qt.io/qt-5/resources.html.

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Joe47
        wrote on 10 Nov 2020, 04:25 last edited by
        #3

        The application is working fine in Qt compiler, i need an executable to be shared over there devices.

        1 Reply Last reply
        0
        • K Offline
          K Offline
          KH-219Design
          wrote on 10 Nov 2020, 17:32 last edited by
          #4

          @sebastienc it is true that for "my qml file" (or in this case, @Joe47 's qml file), the resource system can take all the custom qml files in a project and compile them into a binary, so that when we "ship" our binary to another machine for use by other users, there aren't "loose" qml files that need to be present in the proper locations in order for the app to launch.

          However, I think @Joe47 is referring to a qml file that is part of the Qt framework itself. (@Joe47 feel free to clarify). I think that in this case, DropShadow.qml is not a file that Joe wrote, but rather part of https://doc.qt.io/qt-5/qml-qtgraphicaleffects-dropshadow.html

          I have not needed to package a Windows QML for distribution recently, so I'm not sure what options there are.

          It seems that even windeployqt will leave the qml files "loose", but will make sure to copy them to the right place.

          If a directory is passed with the --qmldir argument, windeployqt uses the qmlimportscanner tool to scan QML files inside the directory for QML import dependencies. Identified dependencies are then copied to the executable's directory.

          Is there a way to take qml files that are internal to Qt (like those below) and have them be compiled into a DLL or EXE instead of "just sitting in a folder" on a required path?

          ./qtgraphicaleffects/src/effects/FastBlur.qml
          ./qtgraphicaleffects/src/effects/GammaAdjust.qml
          ./qtgraphicaleffects/src/effects/ColorOverlay.qml
          ./qtgraphicaleffects/src/effects/DirectionalBlur.qml
          ./qtgraphicaleffects/src/effects/LevelAdjust.qml
          ./qtgraphicaleffects/src/effects/DropShadow.qml
          ./qtgraphicaleffects/src/effects/Blend.qml
          ./qtgraphicaleffects/src/effects/HueSaturation.qml
          

          I don't know the answer. My aim here is to clarify the question. @Joe47 please correct me if my attempted clarification is unwanted and/or going in a wrong direction.

          www.219design.com
          Software | Electrical | Mechanical | Product Design

          J 1 Reply Last reply 25 Mar 2021, 06:33
          2
          • K KH-219Design
            10 Nov 2020, 17:32

            @sebastienc it is true that for "my qml file" (or in this case, @Joe47 's qml file), the resource system can take all the custom qml files in a project and compile them into a binary, so that when we "ship" our binary to another machine for use by other users, there aren't "loose" qml files that need to be present in the proper locations in order for the app to launch.

            However, I think @Joe47 is referring to a qml file that is part of the Qt framework itself. (@Joe47 feel free to clarify). I think that in this case, DropShadow.qml is not a file that Joe wrote, but rather part of https://doc.qt.io/qt-5/qml-qtgraphicaleffects-dropshadow.html

            I have not needed to package a Windows QML for distribution recently, so I'm not sure what options there are.

            It seems that even windeployqt will leave the qml files "loose", but will make sure to copy them to the right place.

            If a directory is passed with the --qmldir argument, windeployqt uses the qmlimportscanner tool to scan QML files inside the directory for QML import dependencies. Identified dependencies are then copied to the executable's directory.

            Is there a way to take qml files that are internal to Qt (like those below) and have them be compiled into a DLL or EXE instead of "just sitting in a folder" on a required path?

            ./qtgraphicaleffects/src/effects/FastBlur.qml
            ./qtgraphicaleffects/src/effects/GammaAdjust.qml
            ./qtgraphicaleffects/src/effects/ColorOverlay.qml
            ./qtgraphicaleffects/src/effects/DirectionalBlur.qml
            ./qtgraphicaleffects/src/effects/LevelAdjust.qml
            ./qtgraphicaleffects/src/effects/DropShadow.qml
            ./qtgraphicaleffects/src/effects/Blend.qml
            ./qtgraphicaleffects/src/effects/HueSaturation.qml
            

            I don't know the answer. My aim here is to clarify the question. @Joe47 please correct me if my attempted clarification is unwanted and/or going in a wrong direction.

            J Offline
            J Offline
            Joe47
            wrote on 25 Mar 2021, 06:33 last edited by
            #5

            @KH-219Design Yes it is correct.

            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