예제 #1
0
EObject::EObject(qreal w,qreal h,qreal m, QGraphicsItem *parent)
	:width(w),height(h),margin(m), QGraphicsItem(parent)
{
	setAcceptDrops(true);
    setAcceptsHoverEvents(true);
	setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable | QGraphicsItem::ItemIsFocusable);

	createResizeFocus();
}
예제 #2
0
void KUnitItem::init()
{
    setAcceptDrops(true);
    setAcceptHoverEvents(true);
    setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable | QGraphicsItem::ItemIsFocusable);

    m_frame = QRectF(0, 0, 0, 0);

    createResizeFocus();
    createRotateItem();
}