#3037 AppFwk : Use QPointer

This commit is contained in:
Magne Sjaastad 2018-06-11 14:21:24 +02:00
parent c486f7963e
commit acf2f61d25
2 changed files with 10 additions and 5 deletions

View File

@ -81,10 +81,13 @@ void PdmUiTableItemEditor::configureAndUpdateUi(const QString& uiConfigName)
uiObject->uiOrdering(uiConfigName, dummy);
}
QModelIndex miStart = m_model->index(m_row, 0);
QModelIndex miEnd = m_model->index(m_row, m_model->columnCount());
if (m_model)
{
QModelIndex miStart = m_model->index(m_row, 0);
QModelIndex miEnd = m_model->index(m_row, m_model->columnCount());
m_model->notifyDataChanged(miStart, miEnd);
m_model->notifyDataChanged(miStart, miEnd);
}
}

View File

@ -38,6 +38,8 @@
#include "cafPdmUiEditorHandle.h"
#include <QPointer>
namespace caf
{
class PdmUiTableViewQModel;
@ -57,8 +59,8 @@ protected: // Interface to override:
virtual void configureAndUpdateUi(const QString& uiConfigName);
private:
PdmUiTableViewQModel* m_model;
int m_row;
QPointer<PdmUiTableViewQModel> m_model;
int m_row;
};