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/ZxBrushEdit.h

59 lines
1.1 KiB
C

#pragma once
#include <QWidget>
#include <QBrush>
#include "iProperty_global.h"
class ZxBrushStyleComboBox;
class QPaintEvent;
class QMouseEvent;
class ZxColorPicker;
/// 画刷编辑控件
class I_PROPERTY_EXPORT ZxBrushEdit : public QWidget
{
Q_OBJECT
public:
explicit ZxBrushEdit(QWidget *parent = 0);
void setBrush( const QBrush& brush );
QBrush getBrush();
signals:
void signalBrushStyleChanged(int);
void signalBrushColorChanged(QColor);
protected slots:
void onStyleClicked(int);
void onColorChanged(const QColor&);
protected:
virtual void paintEvent(QPaintEvent *);
virtual void mousePressEvent(QMouseEvent *);
virtual void resizeEvent(QResizeEvent *);
protected:
void showBrushStyleWidget(const QRect &rcStyle);
void hideBrushStyleWidget();
void getConponentRect( QRect& rcStyle, QRect& rcColor );
ZxBrushStyleComboBox* getBrushStyleComboBox();
ZxColorPicker* getColorPicker();
protected:
int m_colorWidth;//颜色部分的宽度
QBrush m_brush;
ZxBrushStyleComboBox* m_brushStyle;
ZxColorPicker* m_colorPicker;
};