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. Getting Started Qt Data Visualization Visual Studio 2015
QtWS25 Last Chance

Getting Started Qt Data Visualization Visual Studio 2015

Scheduled Pinned Locked Moved Solved General and Desktop
12 Posts 2 Posters 4.2k 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.
  • B BadHombre
    9 Jan 2017, 09:38

    Hi Guys,

    i really need some Help getting started with QT and Qtdatavizualization.

    I followed the QT Documentation but always get a lot of Error :/ Maybe you could help me .

    What i want to do :
    Creating a 3d Koordinatesystem with Points in it.

    What i have done so far :

    1. I installed the QT Offline Version (with QTDatavisualization)
    2. Installed the QT Plugin in Vsual Studio
    3. Added the QT version to VIsual Studio.
    4. I created a QT Project with Visual Studio
    5. I created the .pro File with the QT Plug in.
    # ----------------------------------------------------
    # This file is generated by the Qt Visual Studio Add-in.
    # ------------------------------------------------------
    
    TEMPLATE = app
    TARGET = HelloWorld
    DESTDIR = ../Win32/Debug
    QT += core widgets gui
    CONFIG += debug
    DEFINES += QT_DLL QT_WIDGETS_LIB
    INCLUDEPATH += ./GeneratedFiles \
        . \
        ./GeneratedFiles/Debug
    DEPENDPATH += .
    MOC_DIR += ./GeneratedFiles/debug
    OBJECTS_DIR += debug
    UI_DIR += ./GeneratedFiles
    RCC_DIR += ./GeneratedFiles
    include(HelloWorld.pri)
    
    SOURCES += helloworld.cpp
    SOURCES += main.cpp
    HEADERS += helloworld.h
    QT += datavisualization
    
    1. Then i started qmake -o Makefile HelloWorld.pro in the Command Prompt of Visual Studio and get my First Error !
      see picture https://s30.postimg.org/48uso8vdt/Command_Prompt_error.png

    2. the only things i changed in my code are:
      Adding :
      #include <QtDataVisualization\qtdatavisualizationversion.h>
      #include <QtDataVisualization\q3dbars.h>

    using namespace QtDataVisualization;

    and

    Adding : QT += datavisualization to the .pro File
    and

    Q3DBars *graph = new Q3DBars();

    These are the Errors i get...
    https://s27.postimg.org/ed3s2z843/Errors_in_Visual_studio.png

    I hope that sb can help me pls :(

    B Offline
    B Offline
    beecksche
    wrote on 9 Jan 2017, 15:47 last edited by beecksche 1 Sept 2017, 15:50
    #2

    Hi @BadHombre ,

    Do you already have created some apps with Qt and Visual Studio? Or it is your first?

    Did add the library to your MSVC project?

    I'm little bit confused, because when i created apps with MSVC i didn't need to create a .pro file.

    1 Reply Last reply
    0
    • B Offline
      B Offline
      BadHombre
      wrote on 9 Jan 2017, 17:54 last edited by
      #3
      1. Yes i have created some little Gui Apps with Qt

      2. Yes i added the Qtdatavisulization Lib to MSVC... Project properties -> Added the include Directorie of QTDatavisualization and the Library Directory

      3. I never used the .pro File in MSVC ... but in the QT documentation they mentioned to add QT += datavisualization to the .pro File ... so i thought maybe i have to create a .pro FIle

      B 1 Reply Last reply 9 Jan 2017, 20:10
      0
      • B BadHombre
        9 Jan 2017, 17:54
        1. Yes i have created some little Gui Apps with Qt

        2. Yes i added the Qtdatavisulization Lib to MSVC... Project properties -> Added the include Directorie of QTDatavisualization and the Library Directory

        3. I never used the .pro File in MSVC ... but in the QT documentation they mentioned to add QT += datavisualization to the .pro File ... so i thought maybe i have to create a .pro FIle

        B Offline
        B Offline
        beecksche
        wrote on 9 Jan 2017, 20:10 last edited by beecksche 1 Oct 2017, 06:40
        #4

        @BadHombre
        Okay,
        i think you miss to add the library to the additional dependencies for the linker.

        The compiler have to know where the classes, functions, etc. are defined. In your case it's defined in the Qt5DataVisulizationd.lib / Qt5DataVisulization.lib, so you have to add them to your project. In general you can add the libraries with the vs plugin (like network, sql, etc.. ) but the data visualization module is really new and you're not able to add it with the vs plug-in.

        You have to add it manually. Have a look at the project properties, linker, input, additional dependencies (or something similiar). There you have to add QtDataVisualizationd.lib or QtDataVisualization.lib depending on your build environment (debug / release).

        1 Reply Last reply
        0
        • B Offline
          B Offline
          BadHombre
          wrote on 9 Jan 2017, 20:55 last edited by
          #5

          @beecksche Thanks for your answer ! i added QtDataVisualization.lib to additional dependencies. Now i get less Errors.

          There is only one Error :

          Link1104 Cannot open file 'QtDataVisualization.lib'

          Any Idea ?

          B 1 Reply Last reply 9 Jan 2017, 21:03
          0
          • B BadHombre
            9 Jan 2017, 20:55

            @beecksche Thanks for your answer ! i added QtDataVisualization.lib to additional dependencies. Now i get less Errors.

            There is only one Error :

            Link1104 Cannot open file 'QtDataVisualization.lib'

            Any Idea ?

            B Offline
            B Offline
            beecksche
            wrote on 9 Jan 2017, 21:03 last edited by beecksche 1 Oct 2017, 06:40
            #6

            @BadHombre
            Yeah i'm not quite sure if i have wrote it correctly. The best way is, that you look in the Qt directory, where all the libraries are installed. There you should see your necessary file.

            1 Reply Last reply
            0
            • B Offline
              B Offline
              BadHombre
              wrote on 9 Jan 2017, 21:25 last edited by
              #7

              @beecksche oh sry my fault... the name of the the file is Qt5DataVisualization.lib.. i added the File.. and now i get again a lot of Link Errors :/ see picture

              http://up.picr.de/27972606pb.jpg
              http://up.picr.de/27972607gv.jpg
              http://up.picr.de/27972608em.jpg
              http://up.picr.de/27972609uo.jpg

              B 1 Reply Last reply 9 Jan 2017, 21:35
              0
              • B BadHombre
                9 Jan 2017, 21:25

                @beecksche oh sry my fault... the name of the the file is Qt5DataVisualization.lib.. i added the File.. and now i get again a lot of Link Errors :/ see picture

                http://up.picr.de/27972606pb.jpg
                http://up.picr.de/27972607gv.jpg
                http://up.picr.de/27972608em.jpg
                http://up.picr.de/27972609uo.jpg

                B Offline
                B Offline
                beecksche
                wrote on 9 Jan 2017, 21:35 last edited by
                #8

                @BadHombre
                so you have to add the libraries also. In that case you can do it with the vs plug in.
                Open your VS Plugin in and check the needed modules. I think it only should be GUI.

                1 Reply Last reply
                0
                • B Offline
                  B Offline
                  BadHombre
                  wrote on 10 Jan 2017, 07:24 last edited by
                  #9

                  @beecksche sorry but what do you mean with Vs Plug in ? the Qt Plug in in Vs ? And if yes how do i check the modules ?
                  sorry for the supid questions.

                  B 1 Reply Last reply 10 Jan 2017, 08:03
                  0
                  • B Offline
                    B Offline
                    BadHombre
                    wrote on 10 Jan 2017, 07:56 last edited by
                    #10

                    @beecksche now i added all libraries to the Project... and i have two errors left :

                    1. Error LNK1120 1unresolved externals File : HelloWorld.exe
                      2.Error LNK2019 unresolved external symbol WinMain referenced in function ''int_cdecl invoke_main(void)''(? invoke_main@@YAHXZ)
                    1 Reply Last reply
                    0
                    • B BadHombre
                      10 Jan 2017, 07:24

                      @beecksche sorry but what do you mean with Vs Plug in ? the Qt Plug in in Vs ? And if yes how do i check the modules ?
                      sorry for the supid questions.

                      B Offline
                      B Offline
                      beecksche
                      wrote on 10 Jan 2017, 08:03 last edited by
                      #11

                      @BadHombre
                      Questions are never stupid. I think my explanations are bad!

                      You said, that you have installed the "QT Plugin in Vsual Studio". Am i right that you mean the Qt VS Add In http://doc.qt.io/qtvstools/index.html ?

                      In your Solution Explorer in Visual Studio right click on your project and select Qt Project Settings. Go to the tab: Qt Modules.
                      There you can add/remove the needed Qt modules.

                      I think in your case an easier way to learn Qt Datavisualization is to work the examples (if you have installed them). You find them in the Qt directory.

                      To convert the examples for Visual Studio you can do this:

                      1. Open the visual studio developer command prompt
                      2. Go to the Qt directory an call the qtenv2.bat
                      3. Go to the examples directory
                      4. Call qmake -tp vc
                      5. Call devenv xx.vcxproj

                      An example

                      C:\>Qt\Qt5.7.0_MSVC2013\5.7\msvc2013\bin\qtenv2.bat
                      C:\Qt\Qt5.7.0_MSVC2013\Examples\Qt-5.7\datavisualization\bars>
                      C:\Qt\Qt5.7.0_MSVC2013\Examples\Qt-5.7\datavisualization\bars>qmake -tp vc
                      C:\Qt\Qt5.7.0_MSVC2013\Examples\Qt-5.7\datavisualization\bars>devenv bars.vcxproj
                      
                      
                      
                      1 Reply Last reply
                      2
                      • B Offline
                        B Offline
                        BadHombre
                        wrote on 10 Jan 2017, 09:21 last edited by
                        #12

                        @beecksche Thanks for your Help.

                        I checked the modules and all are active.

                        I also convert the Example for Visual Studio and it works perfectly.

                        So what i will do now is .. i take the example and change it to my Project :D

                        Again Thanks @beecksche for your good Help !

                        1 Reply Last reply
                        0

                        11/12

                        10 Jan 2017, 08:03

                        • Login

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