Commit 6dff01de authored by Pat Marion's avatar Pat Marion
Browse files

Fix compiler warning and style issue

- silence 'assignment operator could not be generated' warning
  on vtkQtDebugLeaksModel::qObserver
- rename variables to avoid shadow variable warnings
- add comment about variable initialization in vtkDebugLeaks.cxx

Change-Id: Id6b65f2cc8f5b3453820197a2bc7320c3ee7a7c6
parent 9182f039
......@@ -491,4 +491,5 @@ vtkSimpleCriticalSection* vtkDebugLeaks::CriticalSection;
// Purposely not initialized. ClassInitialize will handle it.
int vtkDebugLeaks::ExitError;
// Purposely not initialized. ClassInitialize will handle it.
vtkDebugLeaksObserver* vtkDebugLeaks::Observer;
......@@ -47,6 +47,11 @@ public:
}
vtkQtDebugLeaksModel& Model;
private:
qObserver(const qObserver&); // Not implemented.
void operator=(const qObserver&); // Not implemented.
};
......@@ -77,8 +82,8 @@ public:
};
//-----------------------------------------------------------------------------
vtkQtDebugLeaksModel::vtkQtDebugLeaksModel(QObject* parent)
: QStandardItemModel(0, 2, parent)
vtkQtDebugLeaksModel::vtkQtDebugLeaksModel(QObject* p)
: QStandardItemModel(0, 2, p)
{
this->Internal = new qInternal;
this->Observer = new qObserver(*this);
......@@ -223,9 +228,9 @@ QStandardItemModel* vtkQtDebugLeaksModel::referenceCountModel(const QString& cla
}
//-----------------------------------------------------------------------------
Qt::ItemFlags vtkQtDebugLeaksModel::flags(const QModelIndex &index) const
Qt::ItemFlags vtkQtDebugLeaksModel::flags(const QModelIndex &modelIndex) const
{
Q_UNUSED(index);
Q_UNUSED(modelIndex);
return Qt::ItemIsSelectable | Qt::ItemIsEnabled;
}
......@@ -233,14 +238,15 @@ Qt::ItemFlags vtkQtDebugLeaksModel::flags(const QModelIndex &index) const
Q_DECLARE_METATYPE(vtkObjectBase*);
//-----------------------------------------------------------------------------
ReferenceCountModel::ReferenceCountModel(QObject* parent)
: QStandardItemModel(0, 2, parent)
ReferenceCountModel::ReferenceCountModel(QObject* p)
: QStandardItemModel(0, 2, p)
{
this->setHeaderData(0, Qt::Horizontal, QObject::tr("Pointer"));
this->setHeaderData(1, Qt::Horizontal, QObject::tr("Reference Count"));
QTimer::singleShot(100, this, SLOT(updateReferenceCounts()));
}
//-----------------------------------------------------------------------------
ReferenceCountModel::~ReferenceCountModel()
{
}
......@@ -293,8 +299,8 @@ void ReferenceCountModel::updateReferenceCounts()
}
//-----------------------------------------------------------------------------
Qt::ItemFlags ReferenceCountModel::flags(const QModelIndex &index) const
Qt::ItemFlags ReferenceCountModel::flags(const QModelIndex &modelIndex) const
{
Q_UNUSED(index);
Q_UNUSED(modelIndex);
return Qt::ItemIsSelectable | Qt::ItemIsEnabled;
}
......@@ -33,7 +33,7 @@ class QVTK_EXPORT vtkQtDebugLeaksModel : public QStandardItemModel
public:
vtkQtDebugLeaksModel(QObject* parent=0);
vtkQtDebugLeaksModel(QObject* p=0);
virtual ~vtkQtDebugLeaksModel();
// Description:
......@@ -76,7 +76,7 @@ class ReferenceCountModel : public QStandardItemModel
Q_OBJECT
public:
ReferenceCountModel(QObject* parent=0);
ReferenceCountModel(QObject* p=0);
~ReferenceCountModel();
void addObject(vtkObjectBase* obj);
void removeObject(vtkObjectBase* obj);
......
......@@ -42,7 +42,7 @@ public:
};
//----------------------------------------------------------------------------
vtkQtDebugLeaksView::vtkQtDebugLeaksView(QWidget *parent) : QWidget(parent)
vtkQtDebugLeaksView::vtkQtDebugLeaksView(QWidget *p) : QWidget(p)
{
this->Internal = new qInternal;
......
......@@ -36,7 +36,7 @@ class QVTK_EXPORT vtkQtDebugLeaksView : public QWidget
public:
vtkQtDebugLeaksView(QWidget *parent=0);
vtkQtDebugLeaksView(QWidget *p=0);
virtual ~vtkQtDebugLeaksView();
vtkQtDebugLeaksModel* model();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment