2024-12-03 20:07:25 +08:00
|
|
|
#include "graphicsItem/itemControlHandle.h"
|
2024-12-13 18:08:00 +08:00
|
|
|
#include "graphicsItem/graphicsBaseItem.h"
|
2024-12-03 20:07:25 +08:00
|
|
|
#include <QPainter>
|
|
|
|
|
|
|
|
|
|
ItemControlHandle::ItemControlHandle(QGraphicsItem *parent)
|
2024-12-13 18:08:00 +08:00
|
|
|
: QGraphicsItem(parent)
|
|
|
|
|
,_parent(nullptr)
|
2024-12-03 20:07:25 +08:00
|
|
|
{
|
|
|
|
|
m_type = T_resize;
|
|
|
|
|
m_tag = H_none;
|
2024-12-07 17:24:36 +08:00
|
|
|
m_enable = true;
|
|
|
|
|
m_ifShow = true;
|
2024-12-03 20:07:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ItemControlHandle::~ItemControlHandle()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ItemControlHandle::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
|
|
|
|
|
{
|
|
|
|
|
Q_UNUSED(option)
|
|
|
|
|
Q_UNUSED(widget)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ItemControlHandle::hoverEnterEvent(QGraphicsSceneHoverEvent* event)
|
|
|
|
|
{
|
2024-12-13 18:08:00 +08:00
|
|
|
QGraphicsItem::hoverEnterEvent(event);
|
2024-12-03 20:07:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ItemControlHandle::hoverLeaveEvent(QGraphicsSceneHoverEvent* event)
|
|
|
|
|
{
|
2024-12-13 18:08:00 +08:00
|
|
|
QGraphicsItem::hoverLeaveEvent(event);
|
2024-12-03 20:07:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int ItemControlHandle::getSize()
|
|
|
|
|
{
|
|
|
|
|
int nSize = HNDLE_SIZE;
|
|
|
|
|
return nSize;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ItemControlHandle::move(double x, double y)
|
|
|
|
|
{
|
|
|
|
|
setPos(x, y);
|
|
|
|
|
}
|
2025-02-06 16:36:50 +08:00
|
|
|
|
|
|
|
|
void ItemControlHandle::setText(QString s)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
QString ItemControlHandle::getText() const
|
|
|
|
|
{
|
|
|
|
|
return QString();
|
|
|
|
|
}
|