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. Initialzing QSurfaceDataProxy Problems
Qt 6.11 is out! See what's new in the release blog

Initialzing QSurfaceDataProxy Problems

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 590 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.
  • LordOfTheMorningL Offline
    LordOfTheMorningL Offline
    LordOfTheMorning
    wrote on last edited by
    #1

    I'm simply trying to use QSurfaceDataProxy in my c++ code, so that I can do:

    negativeTabView->findChild<QSurfaceDataProxy *>("proxyTest");
    

    Where 'negativeTabView' is a QQuickView object, and 'proxyTest' is the ItemModelSurfaceDataProxy from a Surface3DSeries in QML, like this:

    Surface3DSeries {
                    id: surfaceSeries
                    flatShadingEnabled: false
                    drawMode: Surface3DSeries.DrawSurface
                    baseGradient: surfaceGradient
                    colorStyle: Theme3D.ColorStyleRangeGradient
                    itemLabelFormat: "(@xLabel, @zLabel): @yLabel"
                    onSelectedPointChanged: getSurfaceDataItem(itemLabel, selectedPoint)
    
    
                    ItemModelSurfaceDataProxy {
                        id:surfaceSeriesDataProxy
                        objectName: proxyTest
                        itemModel: surfaceData0.model
                        rowRole: "radius"
                        columnRole: "angle"
                        yPosRole: "value"
                    }
                }
    

    I cannot share my full code, but in my main.h I have included QSurfaceDataProxy, added the namespace, and added one QSurfaceDataProxy object in the private section, as such:

    #include <QtDataVisualization/QSurfaceDataProxy>
    using namespace QtDataVisualization;
    ...
     QSurfaceDataProxy *m_dataProxy;
    
    

    In my main.cpp I have done included the same line

    #include <QtDataVisualization/QSurfaceDataProxy>
    

    without the namespace. If I try to instantiate the m_dataproxy variable like such:

     m_dataProxy = new QSurfaceDataProxy();
    

    or

     m_dataProxy = negativeTabView->findChild<QSurfaceDataProxy *>("proxyTest");
    

    It will lead to this error (full path removed)

    C:\\....main.cpp:-1: error: undefined reference to `__imp__ZN19QtDataVisualization17QSurfaceDataProxyC1EP7QObject'
    

    What am I doing wrong?
    Here is the top of my .pro file:

    QT       += core gui charts quickwidgets qml quick
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
    
    CONFIG += c++11
    

    What am I doing wrong?
    Using https://doc.qt.io/qt-5.9/qtdatavisualization-surface-surfacegraph-h.html as reference, they seem to instantiate their QSurfaceDataProxy in the same manner with no issues.

    Thank you.

    jsulmJ 1 Reply Last reply
    0
    • LordOfTheMorningL LordOfTheMorning

      I'm simply trying to use QSurfaceDataProxy in my c++ code, so that I can do:

      negativeTabView->findChild<QSurfaceDataProxy *>("proxyTest");
      

      Where 'negativeTabView' is a QQuickView object, and 'proxyTest' is the ItemModelSurfaceDataProxy from a Surface3DSeries in QML, like this:

      Surface3DSeries {
                      id: surfaceSeries
                      flatShadingEnabled: false
                      drawMode: Surface3DSeries.DrawSurface
                      baseGradient: surfaceGradient
                      colorStyle: Theme3D.ColorStyleRangeGradient
                      itemLabelFormat: "(@xLabel, @zLabel): @yLabel"
                      onSelectedPointChanged: getSurfaceDataItem(itemLabel, selectedPoint)
      
      
                      ItemModelSurfaceDataProxy {
                          id:surfaceSeriesDataProxy
                          objectName: proxyTest
                          itemModel: surfaceData0.model
                          rowRole: "radius"
                          columnRole: "angle"
                          yPosRole: "value"
                      }
                  }
      

      I cannot share my full code, but in my main.h I have included QSurfaceDataProxy, added the namespace, and added one QSurfaceDataProxy object in the private section, as such:

      #include <QtDataVisualization/QSurfaceDataProxy>
      using namespace QtDataVisualization;
      ...
       QSurfaceDataProxy *m_dataProxy;
      
      

      In my main.cpp I have done included the same line

      #include <QtDataVisualization/QSurfaceDataProxy>
      

      without the namespace. If I try to instantiate the m_dataproxy variable like such:

       m_dataProxy = new QSurfaceDataProxy();
      

      or

       m_dataProxy = negativeTabView->findChild<QSurfaceDataProxy *>("proxyTest");
      

      It will lead to this error (full path removed)

      C:\\....main.cpp:-1: error: undefined reference to `__imp__ZN19QtDataVisualization17QSurfaceDataProxyC1EP7QObject'
      

      What am I doing wrong?
      Here is the top of my .pro file:

      QT       += core gui charts quickwidgets qml quick
      
      greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
      
      CONFIG += c++11
      

      What am I doing wrong?
      Using https://doc.qt.io/qt-5.9/qtdatavisualization-surface-surfacegraph-h.html as reference, they seem to instantiate their QSurfaceDataProxy in the same manner with no issues.

      Thank you.

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

      @LordOfTheMorning Please read https://doc.qt.io/qt-5/qtdatavisualization-index.html
      You have to add

      QT += datavisualization
      

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

      LordOfTheMorningL 1 Reply Last reply
      1
      • jsulmJ jsulm

        @LordOfTheMorning Please read https://doc.qt.io/qt-5/qtdatavisualization-index.html
        You have to add

        QT += datavisualization
        
        LordOfTheMorningL Offline
        LordOfTheMorningL Offline
        LordOfTheMorning
        wrote on last edited by
        #3

        @jsulm
        Ah man I thought I added that to the pro file. Thanks jsulm.

        Marked resolved.

        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