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

68 lines
1.2 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:
virtual void onStyleClicked(int nStyle);
virtual void onColorChanged(const QColor& clr);
protected:
virtual void paintEvent(QPaintEvent *);
virtual void mousePressEvent(QMouseEvent *);
virtual void resizeEvent(QResizeEvent *);
protected:
// 布局
void splitSubBounds(QRect& rcStyle, QRect& rcColor);
// 获取子窗体(刷子+颜色)
ZxBrushStyleComboBox* getBrushStyleComboBox();
ZxColorPicker* getColorPicker();
// 显示隐藏
void showBrushStyleWidget(const QRect& rcStyle);
void hideBrushStyleWidget();
protected:
// 颜色部分的宽度
int m_nClrWidth;
QBrush m_brush;
// 子窗体(刷子+颜色)
ZxBrushStyleComboBox* m_pBrushStyle;
ZxColorPicker* m_pClrPicker;
};