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. How to use Qt's DeclarativeSurface in my app?
Forum Updated to NodeBB v4.3 + New Features

How to use Qt's DeclarativeSurface in my app?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 450 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.
  • Tom assoT Offline
    Tom assoT Offline
    Tom asso
    wrote on last edited by Tom asso
    #1

    Specifically, how can I build and link with DeclarativeSurface which is defined in /qtdatavis3d/src/datavisualizationqml2?

    I'm developing an app with QML-defined UI and C++ singleton back-end. I'm using Qt v5.14.2. My QML includes a Surface3D item and I want to manipulate it from the C++ back-end.
    The C++ back-end locates the Surface3D item in the root window object tree, and its className is "QtDataVisualization::DeclarativeSurface" - it's NOT QtDataVisualization::Q3DSurface, for some reason. Qt's include/QtDataVisualization directory does not have a file named "DeclarativeSurface". A search shows that class DeclarativeSurface is defined in datavisualizationqml2/declarativesurface_p.h. and datavisualizationqml2/declarativesurface.cpp. I include declarativesurface_p.h in my app, invoke DeclarativeSurface methods on the object from C++, and it compiles. But I get "undefined reference" errors at link time.

    What is the trick to using DeclarativeSurface? I am using qtcreator v4.5.2

    Thanks
    Tom

    1 Reply Last reply
    0
    • Tom assoT Offline
      Tom assoT Offline
      Tom asso
      wrote on last edited by Tom asso
      #2

      The DeclarativeSurface header file declarativesurface_p.h contains this disclaimer:

      //  W A R N I N G
      //  -------------
      //
      // This file is not part of the QtDataVisualization API.  It exists purely as an
      // implementation detail.  This header file may change from version to
      // version without notice, or even be removed.
      //
      // We mean it.
      

      From the above, it's pretty clear that the API currently has no supported way of accessing QML Surface3D from C++ - use this class at your own risk. There are no doxygen comments in that file, so user "interpretation" is required to figure out how the methods are to be used.

      Note that DeclarativeSurface is in namespace QtDataVisualization, but since it's not "formally" a part the API, several additional directories must be specified in INCLUDEPATH; my app's myApp.pro looks like this, where $QT is my QT source directory:

      INCLUDEPATH += $QT/5.14.2/Src/qtdatavis3d/src/
      INCLUDEPATH += $QT/5.14.2/Src/qtdatavis3d/src/datavisualization/global
      INCLUDEPATH += $QT/5.14.2/Src/qtdatavis3d/src/datavisualization/engine/
      INCLUDEPATH += $QT/5.14.2/Src/qtdatavis3d/src/datavisualization/data/
      INCLUDEPATH +=$QT/5.14.2/Src/qtdatavis3d/src/datavisualization/theme
      INCLUDEPATH += $QT/5.14.2/Src/qtdatavis3d/src/datavisualizationqml2
      

      I am developing for a desktop Linux target, and the DeclarativeSurface code is in library $QT/5.14.2/gcc_64/qml/QtDataVisualization/libdatavisualizationqml2.so

      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