我是靠谱客的博主 安静背包,这篇文章主要介绍qtvs添加qchart,如何使用Qt Designer在窗体中插入QChartView?,现在分享给大家,希望可以做个参考。

I want to add QChart to the form. But I can't find it in the Widget Box. So I created it in the code. How can I insert it in QWidget or QFrame or something else?

I want to set area of that widget in QtDesigner.

解决方案

Option 1: Promoted

I suppose you mean inserting a QChartView, because QChartView inherits from QGraphicsView, this would be a good option, for this we do the following:

first add QT += charts in the .pro

place the QGraphicsView to the design.

Right click on the QGraphicsView and select Promote to...

When doing the above, a menu appears, in the menu it should be set in QChartView in Promoted Class Name, and QtCharts in Header file, then press the add button and finally press promote.

Screenshots of some steps:

[3.]

最后

以上就是安静背包最近收集整理的关于qtvs添加qchart,如何使用Qt Designer在窗体中插入QChartView?的全部内容,更多相关qtvs添加qchart,如何使用Qt内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(60)

评论列表共有 0 条评论

立即
投稿
返回
顶部