团队合作该怎么封装类(c++)可参考

本文介绍了MY命名空间下的QT子命名空间中的PLOT_WIN类,该类继承自QwtPlot,包含set_curve_samples方法用于设置曲线样本值,以及create_legend函数用于创建图例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

#ifndef __MY_QT_PLOT_WIN_H___
#define __MY_QT_PLOT_WIN_H___

#include <qwt_plot_zoomer.h>
#include "my_qt_utility.h"

namespace MY
{
	namespace QT
	{
		class PLOT_WIN : public QwtPlot
		{	
		public:
			PLOT_WIN(const std::string& tile,QWidget* parent = 0)
			{
				setAutoFillBackground(true);
				return curve;
			}
			void set_curve_samples(QwtPlotCurve* curve, const QVector<QPointF>& sample_val)
			{	
				curve->setSamples(sample_val);
			}
			void create_legend()
			{
				QwtLegend * const legend = new QwtLegend;
			}
		};
	}
}

#endif 

my_qt_plot_win.h.cpp什么都不写,就一个头文件
#include “my_qt_plot_win.h”

解释:1.命名空间MY里面还有命名空间QT
2.里面接口函数当场实现

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值