子控件



#ifndef MD_COMFORT_H
#define MD_COMFORT_H

#include <QWidget>
#include <QPaintEvent>
#include <QPainter>

namespace Ui {
class MD_Comfort;
}

class MD_Comfort : public QWidget
{
Q_OBJECT

public:
explicit MD_Comfort(QWidget *parent = 0);
~MD_Comfort();
void set_MDC_RotateSpeed(int rotateSpeed);
void set_MDC_CarSpeed(int carSpeed);
protected:

/*
* 事件过滤器
*/
bool eventFilter(QObject *watched, QEvent *event);
/*
* 绘制转速表
*/
void draw_RotatetSpeed(int rotateSpeed);
/*
* 绘制转速
*/
void draw_CarSpeed(int carSpeed);
private:
Ui::MD_Comfort *ui;
int m_RotateSpeed = 0; //转速
int m_CarSpeed = 0; //车速
};

#endif // MD_COMFORT_H
--------------------- 

posted @ 2019-08-05 18:34  李艳艳665  阅读(109)  评论(0编辑  收藏  举报