Qt Charts and Data Visualization widgets

后端 未结 4 2062
臣服心动
臣服心动 2021-02-09 15:44

I have installed Qt 5.7 in order to try Qt Charts and Qt Data Visualization but I cannot find new widgets neither in Qt Designer nor in Qt Creator. Any suggestions what should I

4条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-09 16:25

    I would like to add this as a comment to the accepted post:

    If you are using python to build your project and process the .ui files with pyuic5 it might be the case that pyuic5 leaves you with an error message stating that QtChart.QChartview could not be found. This is the workaround:

    Go to the site-packages/PyQt5/uic/widget-plugins directory, it should look something like this:

    /widget-plugins/
      __pycache__/
      qaxcontainer.py
      qscintilla.py
      qtcharts.py  <- create this file by copying qtquickwidgets.py and renaming
      qtprintsupport.py
      qtquickwidgets.py
      qtwebkit.py
    

    qtcharts.py looks like this (you have to edit the file):

    # copyright information
    
    pluginType = MODULE
    
    def moduleInformation():
        return "PyQt5.QtChart", ("QChartView", )
    

提交回复
热议问题