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. QtCharts installation on Ubuntu
QtWS25 Last Chance

QtCharts installation on Ubuntu

Scheduled Pinned Locked Moved Solved Installation and Deployment
10 Posts 3 Posters 17.1k 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.
  • W Offline
    W Offline
    willemf
    wrote on last edited by
    #1

    I recently installed Ubuntu 20.04 where Qt 5.12.8 is the bundled with the operating system. However Ubuntu did not supply either Qt MaintenanceTool or QtCharts. I wish to install QtCharts, but without MaintenanceTool it is impossible. What is the easiest way of getting QtCharts installed on my system?

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

      I still don't get what the problem is...

      if you want to distribute your app on linux - don't distribute a binary, deploy to some packaging solution instead (DEB, RPM etc.) - this way the system will make sure that all necessary libs are installed, and it will be done automatically.

      Or do a standalone package (AppImage, snap, Flatpak) which will bundle everything inside - then you also don't need to worry about any libs.

      However, I have a cmake-based system

      The procedure for cmake is the same, only the syntax a bit different:

      find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
      find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Charts REQUIRED)
      # then make sure to link to Charts when building your app
      target_link_libraries (yourApp Qt${QT_VERSION_MAJOR}::Charts)
      

      (Z(:^

      W 1 Reply Last reply
      3
      • W willemf

        I recently installed Ubuntu 20.04 where Qt 5.12.8 is the bundled with the operating system. However Ubuntu did not supply either Qt MaintenanceTool or QtCharts. I wish to install QtCharts, but without MaintenanceTool it is impossible. What is the easiest way of getting QtCharts installed on my system?

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #2

        @willemf said in QtCharts installation on Ubuntu:

        What is the easiest way of getting QtCharts installed on my system?

        Use the Qt online installer to install a recent Qt version together with QtCharts (you also will have the maintenance tool then).
        Or are you bound to the Qt version Ubuntu is providing?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

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

          You need to install this package:

          sudo apt install libqt5charts5-dev
          

          Please remember that QtCharts are not available under LGPL license (only GPLv3).

          (Z(:^

          W 1 Reply Last reply
          5
          • sierdzioS sierdzio

            You need to install this package:

            sudo apt install libqt5charts5-dev
            

            Please remember that QtCharts are not available under LGPL license (only GPLv3).

            W Offline
            W Offline
            willemf
            wrote on last edited by
            #4

            @sierdzio

            I installed the library. However, when I do
            #include <QtCharts> in a cpp header file
            I get an error "No such file"

            Since Qt components are not all installed in the same place in the system area, it's not easily possible to upgrade (or even delete) the bundled version. So I am stuck with the bundled Qt.

            jsulmJ sierdzioS 2 Replies Last reply
            0
            • W willemf

              @sierdzio

              I installed the library. However, when I do
              #include <QtCharts> in a cpp header file
              I get an error "No such file"

              Since Qt components are not all installed in the same place in the system area, it's not easily possible to upgrade (or even delete) the bundled version. So I am stuck with the bundled Qt.

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #5

              @willemf Did you add

              QT += charts
              

              to your pro file as explained in the documentation?

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              2
              • W willemf

                @sierdzio

                I installed the library. However, when I do
                #include <QtCharts> in a cpp header file
                I get an error "No such file"

                Since Qt components are not all installed in the same place in the system area, it's not easily possible to upgrade (or even delete) the bundled version. So I am stuck with the bundled Qt.

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

                @willemf said in QtCharts installation on Ubuntu:

                @sierdzio

                I installed the library. However, when I do
                #include <QtCharts> in a cpp header file
                I get an error "No such file"

                You need to add the module in your .pro (or cmake) file:

                QT += charts
                

                Since Qt components are not all installed in the same place in the system area, it's not easily possible to upgrade (or even delete) the bundled version. So I am stuck with the bundled Qt.

                I don't understand what you mean to say here.

                (Z(:^

                W 1 Reply Last reply
                2
                • sierdzioS sierdzio

                  @willemf said in QtCharts installation on Ubuntu:

                  @sierdzio

                  I installed the library. However, when I do
                  #include <QtCharts> in a cpp header file
                  I get an error "No such file"

                  You need to add the module in your .pro (or cmake) file:

                  QT += charts
                  

                  Since Qt components are not all installed in the same place in the system area, it's not easily possible to upgrade (or even delete) the bundled version. So I am stuck with the bundled Qt.

                  I don't understand what you mean to say here.

                  W Offline
                  W Offline
                  willemf
                  wrote on last edited by
                  #7

                  @sierdzio
                  When installing Qt from the Qt web site, the whole of Qt resides in a single folder, typically someting like:
                  Qt/5.12.8/

                  The bundled Qt in Ubuntu is not in a single folder, e.g. the header files are in usr/incude/x86_64-linux-gnu/qt5

                  I have:
                  // ----------------------------------------------------------------------------------
                  willem[~]$ dpkg -s libqt5charts5-dev
                  Package: libqt5charts5-dev
                  Status: install ok installed
                  Priority: optional
                  Section: libdevel
                  Installed-Size: 286
                  Maintainer: Ubuntu Developers ubuntu-devel-discuss@lists.ubuntu.com
                  Architecture: amd64
                  Multi-Arch: same
                  Source: qtcharts-opensource-src
                  Version: 5.12.8-0ubuntu1
                  Depends: libqt5charts5 (= 5.12.8-0ubuntu1), qtbase5-dev
                  Description: Qt charts development files
                  Qt Charts module provides a set of easy to use chart components.
                  .
                  This package contains the header development files used for building Qt 5
                  applications using QtCharts.
                  Homepage: https://doc.qt.io/qt-5/qtcharts-index.html
                  Original-Maintainer: Debian Qt/KDE Maintainers debian-qt-kde@lists.debian.org
                  // -----------------------------------------------------------------------------------
                  This means the header files are in place. Indeed, I find the header files in usr/incude/x86_64-linux-gnu/qt5

                  I need away to verify that the correct library is loaded, as opposed to the header file package.

                  So, I need the library against which these headers can link, typically performed using
                  QT += charts
                  in a qmake-based system.

                  However, I have a cmake-based system.

                  How can one verify that the library exists on one's linux box?

                  jsulmJ 1 Reply Last reply
                  0
                  • W willemf

                    @sierdzio
                    When installing Qt from the Qt web site, the whole of Qt resides in a single folder, typically someting like:
                    Qt/5.12.8/

                    The bundled Qt in Ubuntu is not in a single folder, e.g. the header files are in usr/incude/x86_64-linux-gnu/qt5

                    I have:
                    // ----------------------------------------------------------------------------------
                    willem[~]$ dpkg -s libqt5charts5-dev
                    Package: libqt5charts5-dev
                    Status: install ok installed
                    Priority: optional
                    Section: libdevel
                    Installed-Size: 286
                    Maintainer: Ubuntu Developers ubuntu-devel-discuss@lists.ubuntu.com
                    Architecture: amd64
                    Multi-Arch: same
                    Source: qtcharts-opensource-src
                    Version: 5.12.8-0ubuntu1
                    Depends: libqt5charts5 (= 5.12.8-0ubuntu1), qtbase5-dev
                    Description: Qt charts development files
                    Qt Charts module provides a set of easy to use chart components.
                    .
                    This package contains the header development files used for building Qt 5
                    applications using QtCharts.
                    Homepage: https://doc.qt.io/qt-5/qtcharts-index.html
                    Original-Maintainer: Debian Qt/KDE Maintainers debian-qt-kde@lists.debian.org
                    // -----------------------------------------------------------------------------------
                    This means the header files are in place. Indeed, I find the header files in usr/incude/x86_64-linux-gnu/qt5

                    I need away to verify that the correct library is loaded, as opposed to the header file package.

                    So, I need the library against which these headers can link, typically performed using
                    QT += charts
                    in a qmake-based system.

                    However, I have a cmake-based system.

                    How can one verify that the library exists on one's linux box?

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #8

                    @willemf said in QtCharts installation on Ubuntu:

                    How can one verify that the library exists on one's linux box?

                    Simply check whether the related Ubuntu packages are installed...
                    Like libqt5charts5-dev which was pointed out in this thread.

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

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

                      I still don't get what the problem is...

                      if you want to distribute your app on linux - don't distribute a binary, deploy to some packaging solution instead (DEB, RPM etc.) - this way the system will make sure that all necessary libs are installed, and it will be done automatically.

                      Or do a standalone package (AppImage, snap, Flatpak) which will bundle everything inside - then you also don't need to worry about any libs.

                      However, I have a cmake-based system

                      The procedure for cmake is the same, only the syntax a bit different:

                      find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
                      find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Charts REQUIRED)
                      # then make sure to link to Charts when building your app
                      target_link_libraries (yourApp Qt${QT_VERSION_MAJOR}::Charts)
                      

                      (Z(:^

                      W 1 Reply Last reply
                      3
                      • sierdzioS sierdzio

                        I still don't get what the problem is...

                        if you want to distribute your app on linux - don't distribute a binary, deploy to some packaging solution instead (DEB, RPM etc.) - this way the system will make sure that all necessary libs are installed, and it will be done automatically.

                        Or do a standalone package (AppImage, snap, Flatpak) which will bundle everything inside - then you also don't need to worry about any libs.

                        However, I have a cmake-based system

                        The procedure for cmake is the same, only the syntax a bit different:

                        find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
                        find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Charts REQUIRED)
                        # then make sure to link to Charts when building your app
                        target_link_libraries (yourApp Qt${QT_VERSION_MAJOR}::Charts)
                        
                        W Offline
                        W Offline
                        willemf
                        wrote on last edited by
                        #10

                        @sierdzio
                        This helped very much.
                        Thank oyu.

                        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