You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nmWATI/Include/iBase/iProperty/PtyItems/ZxPenEdit.h

78 lines
1.5 KiB
C

#pragma once
#include <QWidget>
#include <QPen>
#include "iProperty_global.h"
class ZxLineStyleComboBox;
class QLineEdit;
class QMouseEvent;
class QPaintEvent;
class QResizeEvent;
class ZxColorPicker;
// ZxPenEdit
class I_PROPERTY_EXPORT ZxPenEdit : public QWidget
{
Q_OBJECT
public:
explicit ZxPenEdit(QWidget *parent = 0);
void setPen( const QPen& pen );
QPen getPen();
signals:
void signalPenStyleChanged(int);
void signalPenColorChanged(QColor);
void signalPenWidthChanged(qreal);
protected slots:
void onStyleChanged(int);
void onRadiusChanged();
void onColorChanged(const QColor&);
protected:
virtual void paintEvent(QPaintEvent *);
virtual void mousePressEvent(QMouseEvent *);
virtual void resizeEvent(QResizeEvent *);
protected:
void showLineStyleWidget(const QRect &rcLine);
void showLineWidthWidget(const QRect &rcWidth);
void hideLineStyleWidget();
void hideLineWidthWidget();
void getConponentRect( QRect& rcLine, QRect& rcWidth, QRect& rcColor );
ZxLineStyleComboBox* getLineStyleComboBox();
QLineEdit* getLineWidthEdit();
ZxColorPicker* getColorPicker();
//线宽的单位
enum LineWidthUnit
{
Millimeter, //毫米
Millimeter_div_10 //0.1毫米
};
protected:
LineWidthUnit m_lineWidthUnit;
int m_widthWidth;//线宽编辑控件的宽度
int m_colorWidth;//颜色部分的宽度
QPen m_pen;
ZxLineStyleComboBox* m_lineStyle;
QLineEdit* m_lineWidth;
ZxColorPicker* m_colorPicker;
};