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. Add QChartView to Qt Desiner like custom widget
Forum Updated to NodeBB v4.3 + New Features

Add QChartView to Qt Desiner like custom widget

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 3 Posters 3.5k Views 2 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
    bronstein87
    wrote on last edited by bronstein87
    #1

    Trying to add QChartView to qt designer. I making "Promote to...", then "Promote" QGraphicsView to QChartView.
    alt text

    But compiler gives an error in auto generated ui file:

    alt text
    *C:\Users\Shmeisser\Documents\build-DBHandler-Desktop_Qt_5_7_1_MinGW_32bit-Debug\ui_dbanalyzewindow.h:30: error: 'QChartView' does not name a type
    QChartView graphicsView;

    What could be the problem? QT+= charts added in .pro file.

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by Chris Kawa
      #2

      You've got the includes and class name wrong (it should be in a namespace).
      In the promotion dialog make sure you set up the name/includes as follows:

      Base class name: QWidget
      Promoted class name: QtCharts::QChartView
      Header file: QtCharts/QChartView
      Global include: checked
      `

      1 Reply Last reply
      5
      • S Offline
        S Offline
        sunnyliutong
        wrote on last edited by
        #3

        Thanks, it works!

        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