60 lines
1.3 KiB
C++
60 lines
1.3 KiB
C++
#include "PaiJobSummaryItem.h"
|
|
#include "PaiJobSummaryWidget.h"
|
|
#include <QPen>
|
|
#include <QPainter>
|
|
#include <QWidget>
|
|
#include <QGraphicsProxyWidget>
|
|
|
|
|
|
namespace pai
|
|
{
|
|
namespace gui
|
|
{
|
|
|
|
PaiJobSummaryItem::PaiJobSummaryItem(pai::objectmodel::PaiJob *pJob,QGraphicsItem *pParent): QGraphicsItem(pParent)
|
|
{
|
|
m_width = 10;
|
|
m_height = 10;
|
|
|
|
m_pSummDlg = new pai::gui::PaiJobSummaryWidget(pJob);
|
|
QGraphicsProxyWidget *proxyWidgetItem = new QGraphicsProxyWidget(this);
|
|
proxyWidgetItem->setWidget(m_pSummDlg);
|
|
}
|
|
|
|
PaiJobSummaryItem::~PaiJobSummaryItem()
|
|
{
|
|
}
|
|
|
|
int PaiJobSummaryItem::type() const
|
|
{
|
|
return Type;
|
|
}
|
|
|
|
pai::gui::PaiJobSummaryWidget* PaiJobSummaryItem::GetSummaryWidget() const
|
|
{
|
|
return m_pSummDlg;
|
|
}
|
|
|
|
QRectF PaiJobSummaryItem::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 PaiJobSummaryItem::UpdatePosition()
|
|
{
|
|
//QPointF point(157,60);
|
|
//setPos(point);
|
|
}
|
|
|
|
void PaiJobSummaryItem::paint(QPainter */*pPainter*/, const QStyleOptionGraphicsItem */*pOption*/, QWidget */*pWidget*/)
|
|
{
|
|
// TODO
|
|
}
|
|
}
|
|
}
|