69 lines
1.5 KiB
C++
69 lines
1.5 KiB
C++
#include <QDebug>
|
|
#include <QWidget>
|
|
#include <QGraphicsProxyWidget>
|
|
|
|
#include "PaiJobParameterItem.h"
|
|
#include "PaiJobParameterItemWidget.h"
|
|
|
|
namespace pai
|
|
{
|
|
namespace gui
|
|
{
|
|
|
|
PaiJobParameterItem::PaiJobParameterItem(QGraphicsItem *pParent) : QGraphicsItem(pParent)
|
|
{
|
|
m_width = 120;
|
|
m_height = 100;
|
|
m_flag = false;
|
|
|
|
m_pParameItemWidget = new pai::gui::PaiJobParameterItemWidget();
|
|
QGraphicsProxyWidget *proxyWidgetItem = new QGraphicsProxyWidget(this);
|
|
proxyWidgetItem->setWidget(m_pParameItemWidget);
|
|
|
|
}
|
|
|
|
PaiJobParameterItem::~PaiJobParameterItem()
|
|
{
|
|
}
|
|
|
|
int PaiJobParameterItem::type() const
|
|
{
|
|
return Type;
|
|
}
|
|
|
|
pai::gui::PaiJobParameterItemWidget* PaiJobParameterItem::GetWidget() const
|
|
{
|
|
return m_pParameItemWidget;
|
|
}
|
|
void PaiJobParameterItem::hoverEnterEvent(QGraphicsSceneHoverEvent */*pEvent*/)
|
|
{
|
|
m_flag = false;
|
|
}
|
|
|
|
void PaiJobParameterItem::hoverLeaveEvent(QGraphicsSceneHoverEvent */*pEvent*/)
|
|
{
|
|
m_flag = true;
|
|
}
|
|
|
|
QRectF PaiJobParameterItem::boundingRect() const
|
|
{
|
|
qreal dPenWidth = 2;
|
|
|
|
qreal topLeftX = -(m_width + dPenWidth) / 2;
|
|
qreal topLeftY = -(m_height + dPenWidth) / 2;
|
|
|
|
return QRectF(topLeftX, topLeftY, m_width + dPenWidth, m_height + dPenWidth);
|
|
}
|
|
|
|
void PaiJobParameterItem::UpdatePosition()
|
|
{
|
|
}
|
|
|
|
void PaiJobParameterItem::paint(QPainter */*pPainter*/, const QStyleOptionGraphicsItem */*pOption*/, QWidget */*pWidget*/)
|
|
{
|
|
// TODO
|
|
}
|
|
}
|
|
}
|
|
|