|
|
@ -35,30 +35,16 @@ class DelegateButton: public QGraphicsSvgItem |
|
|
|
Q_OBJECT |
|
|
|
Q_OBJECT |
|
|
|
|
|
|
|
|
|
|
|
public: |
|
|
|
public: |
|
|
|
DelegateButton(const QString & fileName, QGraphicsItem* pDelegated, QGraphicsItem * parent = 0, Qt::WindowFrameSection section = Qt::TopLeftSection) |
|
|
|
DelegateButton(const QString & fileName, QGraphicsItem* pDelegated, QGraphicsItem * parent = 0, Qt::WindowFrameSection section = Qt::TopLeftSection); |
|
|
|
: QGraphicsSvgItem(fileName, parent) |
|
|
|
|
|
|
|
, mDelegated(pDelegated) |
|
|
|
|
|
|
|
, mIsTransparentToMouseEvent(false) |
|
|
|
|
|
|
|
, mButtonAlignmentSection(section) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
setAcceptedMouseButtons(Qt::LeftButton); |
|
|
|
|
|
|
|
setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Control)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
virtual ~DelegateButton() |
|
|
|
virtual ~DelegateButton(); |
|
|
|
{ |
|
|
|
|
|
|
|
// NOOP
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void setTransparentToMouseEvent(bool tr) |
|
|
|
void setTransparentToMouseEvent(bool tr) |
|
|
|
{ |
|
|
|
{ |
|
|
|
mIsTransparentToMouseEvent = tr; |
|
|
|
mIsTransparentToMouseEvent = tr; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void setFileName(const QString & fileName) |
|
|
|
void setFileName(const QString & fileName); |
|
|
|
{ |
|
|
|
|
|
|
|
QGraphicsSvgItem::setSharedRenderer(new QSvgRenderer (fileName, this)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void setSection(Qt::WindowFrameSection section) {mButtonAlignmentSection = section;} |
|
|
|
void setSection(Qt::WindowFrameSection section) {mButtonAlignmentSection = section;} |
|
|
|
Qt::WindowFrameSection getSection() const {return mButtonAlignmentSection;} |
|
|
|
Qt::WindowFrameSection getSection() const {return mButtonAlignmentSection;} |
|
|
|