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. Use Qt Data Visualization with Visual Studio 2015
Forum Updated to NodeBB v4.3 + New Features

Use Qt Data Visualization with Visual Studio 2015

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 2 Posters 2.6k 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.
  • B Offline
    B Offline
    BadHombre
    wrote on last edited by
    #1

    Hi Guys,

    I have some Problems using Qt Data visualization with Visual Studio 2015.
    I installed Qt Data Visualization at the Installation of Qt.

    1. Problem:
      In Qt Creator i include the
      #include <QtDataVisualization> and everything worked fine
      But in Visual Studio there is no such Lib.
      There is only the Folder
      #include <QtDataVisualization> with headers like :
      #include <QtDataVisualization\qtdatavisualizationversion.h> or
      #include <QtDataVisualization\q3dbars.h>

    so i'm not really sure which header File i need.

    1. Problem :

    So first i wanted to create only the dialog with Qt Data Visualization and without any Diagram so i used :

    Q3DBars *graph = new Q3DBars();
    QWidget *container = QWidget::createWindowContainer(graph);

    in the main Function.
    But nothing happens (1.Problem).
    Did I forget sth ?
    In the Tutorial they say i should add this in the .pro File :
    QT += datavisualization
    But in Visual Studio there is no .pro FIle... do I have to add sth else ?

    I hope that sb can Help me.

    Thanks !

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

      Hi
      Did u install the plugin / add in for 2015 ?

      https://blog.qt.io/blog/2016/08/11/from-visual-studio-add-in-to-qt-vs-tools-beta/
      https://marketplace.visualstudio.com/items?itemName=havendv.QtPackage

      Those provide a .pro generator.

      1 Reply Last reply
      2
      • B Offline
        B Offline
        BadHombre
        wrote on last edited by
        #3

        Yes I installed the plugin for 2015. Do i have to create a .pro File and insert the line : QT += datavisualization ?

        mrjjM 1 Reply Last reply
        0
        • B BadHombre

          Yes I installed the plugin for 2015. Do i have to create a .pro File and insert the line : QT += datavisualization ?

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @BadHombre
          Well that is needed normally.
          You should have a .pro file already ?

          1 Reply Last reply
          0
          • B Offline
            B Offline
            BadHombre
            wrote on last edited by BadHombre
            #5

            If I start a Qt Project with VIsual Studio there is no .pro File. I created a .pro File wiith the Qt Add on and added the line : QT += datavisualization

            This is my Code :

            #include <QtDataVisualization\q3dbars.h>

            using namespace QtDataVisualization;

            int main(int argc, char *argv[])
            {
            QApplication a(argc, argv);
            Q3DBars *graph = new Q3DBars();
            newtest w;
            w.show();
            return a.exec();
            }

            and then i get a lot of Link errors ... see Picture
            https://s30.postimg.org/6yhfsytmp/test.png

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

              Did you make sure to run qmake on the .pro file?
              Sorry , I have not use VS with the qt plugin so not sure why it just dont work.
              It seems not to link it in.

              Could you try with Creator so we know QtDataVisualization is installed and working and its just a VS issue ?

              1 Reply Last reply
              0
              • B Offline
                B Offline
                BadHombre
                wrote on last edited by
                #7

                With the Qt Creator every thing works. Now I imported the Qt lib with the Properties of the Project and i don't get any Errors when i build my Project.

                But when I start my Project nothing happens :/

                see Picture:
                The Problem are caused by the Lines:

                Q3DBars *graph = new Q3DBars();
                QWidget *container = QWidget::createWindowContainer(graph);

                The Code works perfectly on Qt Creator

                http://up.picr.de/27860508vg.jpg

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

                  Why do u need QWidget::createWindowContainer() ?
                  Is this QML ?
                  Anyway, same code should work both in VS and Creator.
                  Did you use the VS compiler in Creator?

                  1 Reply Last reply
                  0
                  • B Offline
                    B Offline
                    BadHombre
                    wrote on last edited by
                    #9

                    I'm not sure about the QWidget ... i took a QtDataVisualization example ...and copied it..because i works in qtcreator.

                    Yes iam usin the VS compiler in the Creator

                    Microsoft visual c++ compiler 14

                    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