1 Star 0 Fork 14

yupeng/WorkXP

forked from ITVENTI科技/WorkXP 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
textelement.h 1.28 KB
一键复制 编辑 原始数据 按行查看 历史
huanglingzhi 提交于 2020-06-29 18:07 . Let's roll
#ifndef TEXTELEMENT_H
#define TEXTELEMENT_H
#include "baseelement.h"
class QGraphicsTextItem;
class TextItem_private;
class TextElement : public BaseElement
{
Q_OBJECT
TextItem_private * m_textItem;
public:
enum { Type = QGraphicsItem::UserType + GRAPHICSITEM_TYPE_TEXT };
int type() const override
{
// Enable the use of qgraphicsitem_cast with this item.
return Type;
}
TextElement(
BaseElement *parent,
BaseSpace * space,
QRectF initRect = QRectF(0,0,100,100)
);
QGraphicsTextItem * textItem() const;
void emitCursorChanged();
void setAlignment(Qt::Alignment alignment);
protected:
virtual void startDraw(const QPointF & p) override;
virtual void doDrawing(const QPointF & p) override;
virtual void clickDraw(const QPointF & p) override;
virtual void doubleClickDraw(const QPointF & p) override;
virtual BasePicker * createPicker() override;
void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget *widget=nullptr) Q_DECL_OVERRIDE;
virtual void keyPressEvent(QKeyEvent *event) override;
virtual void keyReleaseEvent(QKeyEvent *event) override;
signals:
void cursorPositionChanged(const QTextCursor & cursor);
};
#endif // TEXTELEMENT_H
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/yujingpeng/workxp.git
git@gitee.com:yujingpeng/workxp.git
yujingpeng
workxp
WorkXP
master

搜索帮助