Memory leaks detection

preferencesAboutTextFull
Anatoly Mihalchenko 13 years ago
parent 214e0711ba
commit 047be003af
  1. 2
      src/core/main.cpp
  2. 21
      src/domain/UBGraphicsItemDelegate.cpp
  3. 20
      src/domain/UBGraphicsItemDelegate.h
  4. 2
      src/gui/UBFeaturesWidget.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;}

@ -183,7 +183,7 @@ public:
void setFeaturesList(const QList <UBFeature> &flist ) { featuresList = flist; }
private:
QList <UBFeature> featuresList;
QList <UBFeature> featuresList;
};
class UBFeaturesProxyModel : public QSortFilterProxyModel

Loading…
Cancel
Save