Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to inclide #include <QtCharts> library to qt project
QtWS25 Last Chance

How to inclide #include <QtCharts> library to qt project

Scheduled Pinned Locked Moved Unsolved General and Desktop
13 Posts 3 Posters 9.7k 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.
  • M Offline
    M Offline
    mark_ua_1999
    wrote on last edited by mark_ua_1999
    #1

    Hi I downloaded qt 5.9.3 and would like to make diagrams but qt dont see <QtCharts> library how is it possible to resolve it (where to load the library)

    0_1511595879018_Capture.PNG

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Make sure the QtCharts module is installed. Then, make sure it is included in your .pro file:

      QT += charts
      

      Also, read this: https://doc.qt.io/qt-5/qtcharts-index.html

      (Z(:^

      M 1 Reply Last reply
      2
      • sierdzioS sierdzio

        Make sure the QtCharts module is installed. Then, make sure it is included in your .pro file:

        QT += charts
        

        Also, read this: https://doc.qt.io/qt-5/qtcharts-index.html

        M Offline
        M Offline
        mark_ua_1999
        wrote on last edited by
        #3

        @sierdzio Ok I am trying using MaintenceTool.EXE but get this red colour massage what should i do

        0_1511599359200_Capture.PNG

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          Never seen that one myself. Have you installed Qt 5.9.3 from the offline package? Try using online installer instead.

          Or you can provide repository URL in settings, if you know them. I don't know the URLs.

          (Z(:^

          M JonBJ 2 Replies Last reply
          0
          • sierdzioS sierdzio

            Never seen that one myself. Have you installed Qt 5.9.3 from the offline package? Try using online installer instead.

            Or you can provide repository URL in settings, if you know them. I don't know the URLs.

            M Offline
            M Offline
            mark_ua_1999
            wrote on last edited by
            #5

            @sierdzio i find about the problem stackoverflow but it does not help I downoload qt using this link , could I give your download link if <QtCharts> library is available there , thanks

            1 Reply Last reply
            0
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #6

              Try the online installer https://www1.qt.io/download-open-source/

              Anyway, in your current installation, is QtCharts checkbox checked? Maybe you have it already and do not need to do anything (apart form fixing the .pro file).

              I haven't asked, but just to be sure: the code does not compile for you, right?

              (Z(:^

              M 1 Reply Last reply
              0
              • sierdzioS sierdzio

                Try the online installer https://www1.qt.io/download-open-source/

                Anyway, in your current installation, is QtCharts checkbox checked? Maybe you have it already and do not need to do anything (apart form fixing the .pro file).

                I haven't asked, but just to be sure: the code does not compile for you, right?

                M Offline
                M Offline
                mark_ua_1999
                wrote on last edited by
                #7

                @sierdzio Yes it doesnt see the library

                0_1511602912357_Capture.PNG

                JonBJ 1 Reply Last reply
                0
                • sierdzioS Offline
                  sierdzioS Offline
                  sierdzio
                  Moderators
                  wrote on last edited by
                  #8

                  That only tells me that Qt Creator does not see it. It may still compile.

                  (Z(:^

                  1 Reply Last reply
                  0
                  • M mark_ua_1999

                    @sierdzio Yes it doesnt see the library

                    0_1511602912357_Capture.PNG

                    JonBJ Offline
                    JonBJ Offline
                    JonB
                    wrote on last edited by JonB
                    #9

                    @mark_ua_1999
                    There are 2 QtCharts files involved here. Try to understand the difference between:

                    • #include <QtCharts> in your source code, which is looking for the header file (I'm not a C++ expert, I can't recall whether the file is named plain QtCharts or is QtCharts.h, but I think it's the latter)
                    • QT += charts in your .pro file, which is looking for the library file to link against (QtCharts.lib or libQtCharts.a or something --- actually it may be .dll/.so)

                    First you need to verify you actually have the necessary two files. Then the header file will need to be found via something like (I don't use QtCreator either) the INCLUDE used in your Qt project, while the library file will need to be found LIBS.

                    M 1 Reply Last reply
                    2
                    • JonBJ JonB

                      @mark_ua_1999
                      There are 2 QtCharts files involved here. Try to understand the difference between:

                      • #include <QtCharts> in your source code, which is looking for the header file (I'm not a C++ expert, I can't recall whether the file is named plain QtCharts or is QtCharts.h, but I think it's the latter)
                      • QT += charts in your .pro file, which is looking for the library file to link against (QtCharts.lib or libQtCharts.a or something --- actually it may be .dll/.so)

                      First you need to verify you actually have the necessary two files. Then the header file will need to be found via something like (I don't use QtCreator either) the INCLUDE used in your Qt project, while the library file will need to be found LIBS.

                      M Offline
                      M Offline
                      mark_ua_1999
                      wrote on last edited by
                      #10

                      @JNBarchan No I have not found the files but found( maybe )it to download link text and where i should paste the files after downloading to get access to the library do somebody know?

                      JonBJ 1 Reply Last reply
                      0
                      • M mark_ua_1999

                        @JNBarchan No I have not found the files but found( maybe )it to download link text and where i should paste the files after downloading to get access to the library do somebody know?

                        JonBJ Offline
                        JonBJ Offline
                        JonB
                        wrote on last edited by
                        #11

                        @mark_ua_1999
                        I don't think you should be downloading individual files and figuring where to put them yourself. I believe you need to sort out why you are not able to get the necessary files via the proper install/maintenance tool, it will cause less later grief to get this right. Not my area as to why you are having trouble when others are claiming it should be straightforward....

                        1 Reply Last reply
                        0
                        • sierdzioS sierdzio

                          Never seen that one myself. Have you installed Qt 5.9.3 from the offline package? Try using online installer instead.

                          Or you can provide repository URL in settings, if you know them. I don't know the URLs.

                          JonBJ Offline
                          JonBJ Offline
                          JonB
                          wrote on last edited by JonB
                          #12

                          @mark_ua_1999
                          @sierdzio said in How to inclide #include <QtCharts> library to qt project:

                          Never seen that one myself. Have you installed Qt 5.9.3 from the offline package? Try using online installer instead.

                          Or you can provide repository URL in settings, if you know them. I don't know the URLs.

                          You didn't answer @sierdzio's question? The wording of the red error message you got suggests to me that your installation does not know where to look to fetch further Qt packages from, hence your problem?

                          sierdzioS 1 Reply Last reply
                          0
                          • JonBJ JonB

                            @mark_ua_1999
                            @sierdzio said in How to inclide #include <QtCharts> library to qt project:

                            Never seen that one myself. Have you installed Qt 5.9.3 from the offline package? Try using online installer instead.

                            Or you can provide repository URL in settings, if you know them. I don't know the URLs.

                            You didn't answer @sierdzio's question? The wording of the red error message you got suggests to me that your installation does not know where to look to fetch further Qt packages from, hence your problem?

                            sierdzioS Offline
                            sierdzioS Offline
                            sierdzio
                            Moderators
                            wrote on last edited by
                            #13

                            @JNBarchan said in How to inclide #include <QtCharts> library to qt project:

                            You didn't answer @sierdzio's question?

                            He kind of did. He's using the offline installer, so the repos are not there. I recommend going with the online installer, it will all simply work. (although to be honest I think QtCharts are included also in offline installer. Dunno, though, I haven't tried it in years).

                            Anyway, he has some pointers where the issue can be, if he wants to he will sort it out.

                            (Z(:^

                            1 Reply Last reply
                            2

                            • Login

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