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. How to release software which includes QtGraphicalEffects module and QtCharts module
Forum Updated to NodeBB v4.3 + New Features

How to release software which includes QtGraphicalEffects module and QtCharts module

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
18 Posts 2 Posters 5.9k 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.
  • F Offline
    F Offline
    Fly Fan
    wrote on last edited by Fly Fan
    #1

    I want to release my software which includes QtGraphicalEffects module and QtCharts module by static and dynamic compilation, but it runs on other computers only if I disable the two modules.

    Here is the project file source code:

    QT += qml quick widgets
    QT += charts
    
    CONFIG += c++11
    
    SOURCES += main.cpp
    
    RESOURCES += qml.qrc
    
    # Additional import path used to resolve QML modules in Qt Creator's code model
    QML_IMPORT_PATH =
    
    # Additional import path used to resolve QML modules just for Qt Quick Designer
    QML_DESIGNER_IMPORT_PATH =
    
    # The following define makes your compiler emit warnings if you use
    # any feature of Qt which as been marked deprecated (the exact warnings
    # depend on your compiler). Please consult the documentation of the
    # deprecated API in order to know how to port your code away from it.
    DEFINES += QT_DEPRECATED_WARNINGS
    
    # You can also make your code fail to compile if you use 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
    
    # Default rules for deployment.
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target//your code here
    

    the main file source code:

    #include <QQmlApplicationEngine>
    #include <QApplication>
    
    int main(int argc, char *argv[])
    {
        QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
        QApplication app(argc, argv);
    
        QQmlApplicationEngine engine;
        engine.load(QUrl(QLatin1String("qrc:/main.qml")));
    
        return app.exec();
    }
    

    the main.qml file source code:

    import QtQuick 2.5
    import QtQuick.Controls 2.1
    import QtQuick.Layouts 1.3
    //import QtCharts 2.2
    import QtGraphicalEffects 1.0
    
    ApplicationWindow {
        visible: true
        width: 640
        height: 480
        title: qsTr("Static Test")
    
        SwipeView {
            id: swipeView
            anchors.fill: parent
            currentIndex: tabBar.currentIndex
    
            Page {
                Button{
                    anchors.centerIn: parent
                    text:"First page"
    
                    layer.enabled: hovered
                    layer.smooth: true
                    layer.effect: DropShadow {
                        color: activeFocus ? "#330066ff" : "#aaaaaa"
                        verticalOffset: 3
                        horizontalOffset: 3
                        radius: 6
                        samples: 12
                        spread: 0.7
                    }
                }
    
            }
    
            Page {
    //            ChartView {
    //                title: "Line"
    //                anchors.fill: parent
    //                antialiasing: true
    
    //                LineSeries {
    //                    name: "LineSeries"
     //                   XYPoint { x: 0; y: 0 }
    //                    XYPoint { x: 1.1; y: 2.1 }
     //                   XYPoint { x: 1.9; y: 3.3 }
    //                    XYPoint { x: 2.1; y: 2.1 }
    //                    XYPoint { x: 2.9; y: 4.9 }
     //                   XYPoint { x: 3.4; y: 3.0 }
    //                    XYPoint { x: 4.1; y: 3.3 }
     //               }
    //            }
            }
        }
    
        footer: TabBar {
            id: tabBar
            currentIndex: swipeView.currentIndex
            TabButton {
                text: qsTr("First")
            }
            TabButton {
                text: qsTr("Second")
            }
        }
    }
    

    This problem has confused me a long time. Help me, please!

    The version of Qt is qt-opensource-windows-x86-mingw530-5.8.0. And the static configure command is "configure -confirm-license -opensource -platform win32-g++ -debug-and-release -static -ltcg -prefix "C:\Qt\5.8.0_Static" -plugin-sql-sqlite -plugin-sql-odbc -qt-zlib -qt-libpng -qt-libjpeg -opengl desktop -qt-freetype -gui -widgets -no-qml-debug -nomake tests -nomake examples -skip qtwebkit -skip qtwebview -qt-pcre -no-compile-examples"

    Update in 1st, Mar, 2017: It seems that I have found the problem failed to release my program. The module, QtChart, leads to failing to release my software. Also I have updated my code.

    I find that even the official example -qml axes, cannot release and run on other computer without installing Qt. So the problem is how to release a software with QtCharts Module?

    Update in 2nd, Mar, 2017: A part of my problem has been solved releasing a software contained QtCharts module by dynamical version. Qt5Charts.dll located in "C:\Qt\Qt5.8.0\5.8\mingw53_32\bin" and QtCharts folder located in "C:\Qt\Qt5.8.0\5.8\mingw53_32\qml" should be added to the folder containing the executable manually. There are still a doubt that the line, QT += charts, has been added to the qmake project file to link against the Qt Charts module, but Qt5Charts.dll and QtCharts folder need to be added manually.

    Finally, I still have no idea about releasing a software with QtCharts module by static version. A message, module "QtCharts" plugin "qtchartsqml2" not found, is shown in debug window when I tried to release static version. Help me ,please.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You should also add which version of Qt you are using, which platform you are targeting.

      Also, don't forget the license implications of using a static build of Qt.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • F Offline
        F Offline
        Fly Fan
        wrote on last edited by Fly Fan
        #3

        Thanks for your atentation. I have updated my question, the version of Qt and the static configure command are given in the last passage. I'm looking forward your reply again.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Did you check that these two modules were built also ?

          One thing, I'd recommend just building the release version, that will save you time and space.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • F Offline
            F Offline
            Fly Fan
            wrote on last edited by
            #5

            The two modules do work since the debug and release versions can run on my machine stably. The problem is that these versions cannot run on another computers which don't install Qt.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              What exact error are you getting ?
              Also how did you install your application on that other machine ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • F Offline
                F Offline
                Fly Fan
                wrote on last edited by Fly Fan
                #7

                For dynamical releasing version, I use command line,windeployqt, to deploy my program.

                For static version, the .exe file is what I wan.

                In other machines which don't install Qt, interface cannot be displayed while the process of the software can be seen in Explorer.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Are you shipping the QML modules you are using with your application like explained here ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  F 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    Are you shipping the QML modules you are using with your application like explained here ?

                    F Offline
                    F Offline
                    Fly Fan
                    wrote on last edited by
                    #9

                    @SGaist I‘m not sure. So I pasted the source code of my program’

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      If you are only giving your executable then no, you are not shipping them. Are you using windeployqt on your application before distributing it ?

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      F 1 Reply Last reply
                      0
                      • SGaistS SGaist

                        If you are only giving your executable then no, you are not shipping them. Are you using windeployqt on your application before distributing it ?

                        F Offline
                        F Offline
                        Fly Fan
                        wrote on last edited by
                        #11

                        @SGaist For dynamical version, I use command line "windeployqt --qmldir C:\Qt\Qt5.8.0\5.8\mingw53_32\qml" while Qt installed in the path -"C:\Qt". And the dynamical version failed to run on other macthines.

                        For static version, I just release it.

                        1 Reply Last reply
                        0
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          The --qmldiroption should point to your application QML sources folder.

                          Even if static, you need to deploy the QML files.

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          F 1 Reply Last reply
                          0
                          • SGaistS SGaist

                            The --qmldiroption should point to your application QML sources folder.

                            Even if static, you need to deploy the QML files.

                            F Offline
                            F Offline
                            Fly Fan
                            wrote on last edited by
                            #13

                            @SGaist I have deployed my program by dynamical version. More information about my problem has been updated in the topic. I'm looking forward your reply again.

                            For static version, how to deploy the QML files. There is only one file for static version

                            1 Reply Last reply
                            0
                            • SGaistS Offline
                              SGaistS Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on last edited by
                              #14

                              Did you also run windployqt for your static application ?

                              Interested in AI ? www.idiap.ch
                              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                              F 1 Reply Last reply
                              0
                              • SGaistS SGaist

                                Did you also run windployqt for your static application ?

                                F Offline
                                F Offline
                                Fly Fan
                                wrote on last edited by
                                #15

                                @SGaist No, I just use the source code of Qt to make a new Qt version which can release a software staticaly. And the static configure command has been mentioned before in the topic.

                                1 Reply Last reply
                                0
                                • SGaistS Offline
                                  SGaistS Offline
                                  SGaist
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #16

                                  Your application might be static but it still needs the QML files from the corresponding Qt modules hence you should still call windeployqt.

                                  Interested in AI ? www.idiap.ch
                                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                  F 1 Reply Last reply
                                  0
                                  • SGaistS SGaist

                                    Your application might be static but it still needs the QML files from the corresponding Qt modules hence you should still call windeployqt.

                                    F Offline
                                    F Offline
                                    Fly Fan
                                    wrote on last edited by
                                    #17

                                    @SGaist But, how?

                                    1 Reply Last reply
                                    0
                                    • SGaistS Offline
                                      SGaistS Offline
                                      SGaist
                                      Lifetime Qt Champion
                                      wrote on last edited by
                                      #18

                                      The same as you would on a build using the dynamic version of Qt.

                                      Interested in AI ? www.idiap.ch
                                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                      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