Merge branch 'master' of github.com:Sankore/Sankore-3.1

preferencesAboutTextFull
Anna Udovichenko 12 years ago
commit 17dd85640b
  1. 2
      src/core/main.cpp
  2. 21
      src/domain/UBGraphicsItemDelegate.cpp
  3. 20
      src/domain/UBGraphicsItemDelegate.h

@ -72,7 +72,7 @@ int main(int argc, char *argv[])
// Uncomment next section to have memory leaks information
// tracing in VC++ debug mode under Windows
/*
/*
#if defined(_MSC_VER) && defined(_DEBUG)
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
#endif

@ -50,6 +50,27 @@
class UBGraphicsParaschoolEditorWidgetItem;
DelegateButton::DelegateButton(const QString & fileName, QGraphicsItem* pDelegated, QGraphicsItem * parent, Qt::WindowFrameSection section)
: QGraphicsSvgItem(fileName, parent)
, mDelegated(pDelegated)
, mIsTransparentToMouseEvent(false)
, mButtonAlignmentSection(section)
{
setAcceptedMouseButtons(Qt::LeftButton);
setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Control));
}
DelegateButton::~DelegateButton()
{
// NOOP
}
void DelegateButton::setFileName(const QString & fileName)
{
QGraphicsSvgItem::setSharedRenderer(new QSvgRenderer (fileName, this));
}
void DelegateButton::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
// make sure delegate is selected, to avoid control being hidden

@ -35,30 +35,16 @@ class DelegateButton: public QGraphicsSvgItem
Q_OBJECT
public:
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));
}
DelegateButton(const QString & fileName, QGraphicsItem* pDelegated, QGraphicsItem * parent = 0, Qt::WindowFrameSection section = Qt::TopLeftSection);
virtual ~DelegateButton()
{
// NOOP
}
virtual ~DelegateButton();
void setTransparentToMouseEvent(bool tr)
{
mIsTransparentToMouseEvent = tr;
}
void setFileName(const QString & fileName)
{
QGraphicsSvgItem::setSharedRenderer(new QSvgRenderer (fileName, this));
}
void setFileName(const QString & fileName);
void setSection(Qt::WindowFrameSection section) {mButtonAlignmentSection = section;}
Qt::WindowFrameSection getSection() const {return mButtonAlignmentSection;}

Loading…
Cancel
Save