4 Star 36 Fork 14

ITVENTI科技/WorkXP

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
linepicker.h 2.04 KB
一键复制 编辑 原始数据 按行查看 历史
huanglingzhi 提交于 2020-06-29 18:07 +08:00 . Let's roll
#ifndef LINEPICKER_H
#define LINEPICKER_H
#include "basepicker.h"
class BaseElement;
class LineElement;
class LinePicker;
#define DEFAULT_ARCHOR_WIDTH 6
class LinePickerArchor : public QGraphicsItem
{
QRectF m_boundingRect;
bool m_picked;
QPointF m_point;
bool m_hovered;
public:
LinePickerArchor(LinePicker * parent);
void setPicked(bool arg1);
inline bool picked() const {return m_picked;}
inline const QPointF & point() const { return m_point;}
inline void setPoint(const QPointF & p ) { m_point = p;}
QRectF boundingRect() const override;
protected:
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = Q_NULLPTR) override;
LinePicker * m_picker;
protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override;
void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override;
void mouseMoveEvent(QGraphicsSceneMouseEvent * event) override;
};
class LinePicker : public BasePicker
{
public:
explicit LinePicker(LineElement * element);
~LinePicker();
void setByElement() override;
QRectF boundingRect() const Q_DECL_OVERRIDE;
void setCurrentArchor( LinePickerArchor * archor);
inline void setCurrentArchor(int arg1) { m_currentArchor = arg1;}
protected:
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = Q_NULLPTR) Q_DECL_OVERRIDE;
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
//void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override;
//void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override;
private:
//QList<LinePickerArchor *> m_anchors;
int m_currentArchor;
QVector<LinePickerArchor *> m_archors;
protected:
LineElement * m_lineElement;
};
#endif // LINEPICKER_H
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/itventi/workxp.git
git@gitee.com:itventi/workxp.git
itventi
workxp
WorkXP
master

搜索帮助