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

80 lines
1.6 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#pragma once
#include <QWidget>
#include "QLineEdit"
#include "ZxDotStyleComboBox.h"
#include "ZxColorPicker.h"
#include "iProperty_global.h"
#include "ZxDrawHelper.h"
#include "ZxDot.h"
class ZxDot;
// ZxDotEdit Widget
class I_PROPERTY_EXPORT ZxDotEdit : public QWidget
{
Q_OBJECT
public:
explicit ZxDotEdit(QWidget* parent = 0);
// 载体
void setDot(const ZxDot& o);
ZxDot getDot();
signals:
// 四种信号
void signalDotStyleChanged(int);
void signalDotColorChanged(QColor);
void signalDotRadiusChanged(float);
void signalDotFillingChanged(bool);
protected slots:
// Changed,Filling在内部处理
void onDotStyleChangedEx(int);
void onRadiusChanged();
void onDotColorChangedEx(const QColor&);
protected:
virtual void paintEvent(QPaintEvent* );
virtual void mousePressEvent(QMouseEvent* );
virtual void mouseMoveEvent(QMouseEvent* );
virtual void resizeEvent(QResizeEvent* );
protected:
// 控件的显示与隐藏
void showStyleWidget(const QRect &rcLine);
void showRadiusWidget(const QRect &rcWidth);
void hideStyleWidget();
void hideRadiusWidget();
// 四种的Layout
void layoutRects();
// 子控件Filling在内部处理
ZxDotStyleComboBox* getStyleComboBox();
QLineEdit* getRadiusEdit();
ZxColorPicker* getColorPicker();
protected:
ZxDot m_oDot; //数据载体
// 控件
ZxDotStyleComboBox* m_pCbxType;
QLineEdit* m_pTbxRadius;
ZxColorPicker* m_colorPicker;
// 位置四个Rect: Style radius filling color
QVector<QRect> m_vecRects;
};