mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
AppFwk (clang-tidy) : modernize-use-nullptr
This commit is contained in:
parent
5a2072e6ec
commit
3239c66f54
@ -92,7 +92,7 @@ namespace caf
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
CmdExecCommandManager::CmdExecCommandManager()
|
||||
{
|
||||
m_commandFeatureInterface = NULL;
|
||||
m_commandFeatureInterface = nullptr;
|
||||
|
||||
m_undoStack = new QUndoStack();
|
||||
}
|
||||
@ -124,7 +124,7 @@ void CmdExecCommandManager::activateCommandSystem()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void CmdExecCommandManager::deactivateCommandSystem()
|
||||
{
|
||||
PdmUiCommandSystemProxy::instance()->setCommandInterface(NULL);
|
||||
PdmUiCommandSystemProxy::instance()->setCommandInterface(nullptr);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -84,7 +84,7 @@ QAction* CmdFeature::actionWithCustomText(const QString& customText)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QAction* CmdFeature::actionWithUserData(const QString& customText, const QVariant& userData)
|
||||
{
|
||||
QAction* action = NULL;
|
||||
QAction* action = nullptr;
|
||||
|
||||
std::map<QString, QAction*>::iterator it;
|
||||
it = m_customTextToActionMap.find(customText);
|
||||
|
@ -170,7 +170,7 @@ std::pair<CmdFeature*, size_t> CmdFeatureManager::findExistingCmdFeature(const
|
||||
}
|
||||
else
|
||||
{
|
||||
return std::make_pair(static_cast<CmdFeature*>(NULL), -1);
|
||||
return std::make_pair(static_cast<CmdFeature*>(nullptr), -1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -191,7 +191,7 @@ caf::CmdFeature* CmdFeatureManager::commandFeature(const std::string& commandId)
|
||||
return item;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -65,7 +65,7 @@ namespace caf
|
||||
CmdExecuteCommand* CmdAddItemFeature::createExecuteCommand()
|
||||
{
|
||||
caf::PdmChildArrayFieldHandle* childArrayFieldHandle = SelectionManager::instance()->activeChildArrayFieldHandle();
|
||||
if (!childArrayFieldHandle) return NULL;
|
||||
if (!childArrayFieldHandle) return nullptr;
|
||||
|
||||
int indexAfter = -1;
|
||||
CmdAddItemExec* addItemExec = new CmdAddItemExec(SelectionManager::instance()->notificationCenter());
|
||||
|
@ -61,9 +61,9 @@ CmdExecuteCommand* CmdDeleteItemFeature::createExecuteCommand()
|
||||
SelectionManager::instance()->selectedItems(items, SelectionManager::CURRENT);
|
||||
|
||||
caf::PdmChildArrayFieldHandle* childArrayFieldHandle = caf::SelectionManager::instance()->activeChildArrayFieldHandle();
|
||||
if (!childArrayFieldHandle) return NULL;
|
||||
if (!childArrayFieldHandle) return nullptr;
|
||||
|
||||
caf::PdmObjectHandle* currentPdmObject = NULL;
|
||||
caf::PdmObjectHandle* currentPdmObject = nullptr;
|
||||
|
||||
for (size_t i = 0; i < items.size(); i++)
|
||||
{
|
||||
@ -73,7 +73,7 @@ CmdExecuteCommand* CmdDeleteItemFeature::createExecuteCommand()
|
||||
}
|
||||
}
|
||||
|
||||
if (!currentPdmObject) return NULL;
|
||||
if (!currentPdmObject) return nullptr;
|
||||
|
||||
int indexAfter = -1;
|
||||
|
||||
|
@ -95,7 +95,7 @@ void NotificationCenter::notifyObservers()
|
||||
{
|
||||
foreach(DataModelObserver* o, m_observers)
|
||||
{
|
||||
o->handleModelNotification(NULL);
|
||||
o->handleModelNotification(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ class PdmFieldCapability;
|
||||
class PdmFieldHandle
|
||||
{
|
||||
public:
|
||||
PdmFieldHandle() { m_ownerObject = NULL; }
|
||||
PdmFieldHandle() { m_ownerObject = nullptr; }
|
||||
virtual ~PdmFieldHandle();
|
||||
|
||||
QString keyword() const { return m_keyword; }
|
||||
@ -45,7 +45,7 @@ public:
|
||||
PdmXmlFieldHandle* xmlCapability();
|
||||
|
||||
protected:
|
||||
bool isInitializedByInitFieldMacro() const { return m_ownerObject != NULL; }
|
||||
bool isInitializedByInitFieldMacro() const { return m_ownerObject != nullptr; }
|
||||
|
||||
private:
|
||||
PDM_DISABLE_COPY_AND_ASSIGN(PdmFieldHandle);
|
||||
|
@ -24,7 +24,7 @@ PdmObjectHandle::~PdmObjectHandle()
|
||||
std::set<PdmObjectHandle**>::iterator it;
|
||||
for (it = m_pointersReferencingMe.begin(); it != m_pointersReferencingMe.end() ; ++it)
|
||||
{
|
||||
(**it) = NULL;
|
||||
(**it) = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ void PdmObjectHandle::fields(std::vector<PdmFieldHandle*>& fields) const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmObjectHandle::setAsParentField(PdmFieldHandle* parentField)
|
||||
{
|
||||
CAF_ASSERT(m_parentField == NULL);
|
||||
CAF_ASSERT(m_parentField == nullptr);
|
||||
|
||||
m_parentField = parentField;
|
||||
}
|
||||
@ -53,7 +53,7 @@ void PdmObjectHandle::removeAsParentField(PdmFieldHandle* parentField)
|
||||
{
|
||||
CAF_ASSERT(m_parentField == parentField);
|
||||
|
||||
m_parentField = NULL;
|
||||
m_parentField = nullptr;
|
||||
}
|
||||
|
||||
|
||||
@ -62,7 +62,7 @@ void PdmObjectHandle::removeAsParentField(PdmFieldHandle* parentField)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmObjectHandle::addReferencingPtrField(PdmFieldHandle* fieldReferringToMe)
|
||||
{
|
||||
if (fieldReferringToMe != NULL) m_referencingPtrFields.insert(fieldReferringToMe);
|
||||
if (fieldReferringToMe != nullptr) m_referencingPtrFields.insert(fieldReferringToMe);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -70,7 +70,7 @@ void PdmObjectHandle::addReferencingPtrField(PdmFieldHandle* fieldReferringToMe)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmObjectHandle::removeReferencingPtrField(PdmFieldHandle* fieldReferringToMe)
|
||||
{
|
||||
if (fieldReferringToMe != NULL) m_referencingPtrFields.erase(fieldReferringToMe);
|
||||
if (fieldReferringToMe != nullptr) m_referencingPtrFields.erase(fieldReferringToMe);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -110,7 +110,7 @@ void PdmObjectHandle::addField(PdmFieldHandle* field, const QString& keyword)
|
||||
field->m_ownerObject = this;
|
||||
|
||||
CAF_ASSERT(!keyword.isEmpty());
|
||||
CAF_ASSERT(this->findField(keyword) == NULL);
|
||||
CAF_ASSERT(this->findField(keyword) == nullptr);
|
||||
|
||||
field->setKeyword(keyword);
|
||||
m_fields.push_back(field);
|
||||
@ -134,7 +134,7 @@ PdmFieldHandle* PdmObjectHandle::findField(const QString& keyword) const
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -54,7 +54,7 @@ namespace caf
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString PdmReferenceHelper::referenceFromRootToObject(PdmObjectHandle* root, PdmObjectHandle* obj)
|
||||
{
|
||||
if (obj == NULL || root == NULL) return QString();
|
||||
if (obj == nullptr || root == nullptr) return QString();
|
||||
|
||||
QStringList objectNames = referenceFromRootToObjectAsStringList(root, obj);
|
||||
|
||||
@ -67,7 +67,7 @@ QString PdmReferenceHelper::referenceFromRootToObject(PdmObjectHandle* root, Pdm
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString PdmReferenceHelper::referenceFromRootToField(PdmObjectHandle* root, PdmFieldHandle* field)
|
||||
{
|
||||
if (field == NULL || root == NULL) return QString();
|
||||
if (field == nullptr || root == nullptr) return QString();
|
||||
|
||||
PdmObjectHandle* owner = field->ownerObject();
|
||||
if (!owner) return QString(); // Should be assert ?
|
||||
@ -97,7 +97,7 @@ PdmObjectHandle* PdmReferenceHelper::objectFromReference(PdmObjectHandle* root,
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
PdmFieldHandle* PdmReferenceHelper::findField(PdmObjectHandle* object, const QString& fieldKeyword)
|
||||
{
|
||||
if (object == NULL) return NULL;
|
||||
if (object == nullptr) return nullptr;
|
||||
|
||||
std::vector<PdmFieldHandle*> fields;
|
||||
object->fields(fields);
|
||||
@ -110,7 +110,7 @@ PdmFieldHandle* PdmReferenceHelper::findField(PdmObjectHandle* object, const QSt
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -120,7 +120,7 @@ QStringList PdmReferenceHelper::referenceFromRootToObjectAsStringList(PdmObjectH
|
||||
{
|
||||
QStringList objectNames;
|
||||
|
||||
if (obj != NULL && root)
|
||||
if (obj != nullptr && root)
|
||||
{
|
||||
if (obj == root) return objectNames;
|
||||
|
||||
@ -186,7 +186,7 @@ QStringList PdmReferenceHelper::referenceFromRootToObjectAsStringList(PdmObjectH
|
||||
PdmFieldHandle* PdmReferenceHelper::fieldFromReference(PdmObjectHandle* root, const QString& reference)
|
||||
{
|
||||
QStringList decodedReference = reference.split(" ");
|
||||
if (decodedReference.size() == 0) return NULL;
|
||||
if (decodedReference.size() == 0) return nullptr;
|
||||
|
||||
QString fieldKeyword = decodedReference[0];
|
||||
decodedReference.pop_front();
|
||||
@ -200,7 +200,7 @@ PdmFieldHandle* PdmReferenceHelper::fieldFromReference(PdmObjectHandle* root, co
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
PdmObjectHandle* PdmReferenceHelper::objectFromReferenceStringList(PdmObjectHandle* root, const QStringList& reference)
|
||||
{
|
||||
if (!root) return NULL;
|
||||
if (!root) return nullptr;
|
||||
|
||||
PdmObjectHandle* currentObject = root;
|
||||
|
||||
@ -212,7 +212,7 @@ PdmObjectHandle* PdmReferenceHelper::objectFromReferenceStringList(PdmObjectHand
|
||||
PdmFieldHandle* fieldHandle = findField(currentObject, fieldKeyword);
|
||||
if (!fieldHandle)
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::vector<PdmObjectHandle*> childObjects;
|
||||
@ -220,7 +220,7 @@ PdmObjectHandle* PdmReferenceHelper::objectFromReferenceStringList(PdmObjectHand
|
||||
|
||||
if (childObjects.size() == 0)
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QString fieldIndex = reference.at(i++);
|
||||
@ -228,12 +228,12 @@ PdmObjectHandle* PdmReferenceHelper::objectFromReferenceStringList(PdmObjectHand
|
||||
int index = fieldIndex.toInt(&conversionOk);
|
||||
if (!conversionOk)
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (index < 0 || index > ((int)childObjects.size()) - 1)
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
currentObject = childObjects[index];
|
||||
@ -258,7 +258,7 @@ std::vector<PdmObjectHandle*> findPathToObjectFromRoot(PdmObjectHandle* obj)
|
||||
}
|
||||
else
|
||||
{
|
||||
currentObj = NULL;
|
||||
currentObj = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -281,7 +281,7 @@ QString PdmReferenceHelper::referenceFromFieldToObject(PdmFieldHandle* fromField
|
||||
std::vector<PdmObjectHandle*> toObjPath = findPathToObjectFromRoot(toObj);
|
||||
|
||||
// Make sure the objects actually have at least one common ancestor
|
||||
if (fromObjPath.front() != toObjPath.front()) return NULL;
|
||||
if (fromObjPath.front() != toObjPath.front()) return nullptr;
|
||||
|
||||
bool anchestorIsEqual = true;
|
||||
size_t idxToLastCommonAnchestor = 0;
|
||||
@ -318,8 +318,8 @@ QString PdmReferenceHelper::referenceFromFieldToObject(PdmFieldHandle* fromField
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
PdmObjectHandle* PdmReferenceHelper::objectFromFieldReference(PdmFieldHandle* fromField, const QString& reference)
|
||||
{
|
||||
if (!fromField) return NULL;
|
||||
if (reference.isEmpty()) return NULL;
|
||||
if (!fromField) return nullptr;
|
||||
if (reference.isEmpty()) return nullptr;
|
||||
|
||||
QStringList decodedReference = reference.split(QRegExp("\\s+"), QString::SkipEmptyParts);
|
||||
PdmObjectHandle* lastCommonAnchestor = fromField->ownerObject();
|
||||
@ -332,7 +332,7 @@ PdmObjectHandle* PdmReferenceHelper::objectFromFieldReference(PdmFieldHandle* fr
|
||||
if (!parentField)
|
||||
{
|
||||
// Error: Relative object reference has an invalid number of parent levels
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
lastCommonAnchestor = parentField->ownerObject();
|
||||
@ -351,7 +351,7 @@ PdmObjectHandle* PdmReferenceHelper::findRoot(PdmObjectHandle* obj)
|
||||
std::vector<PdmObjectHandle*> path = findPathToObjectFromRoot(obj);
|
||||
|
||||
if (path.size()) return path[0];
|
||||
else return NULL;
|
||||
else return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -365,7 +365,7 @@ PdmObjectHandle* PdmReferenceHelper::findRoot(PdmFieldHandle* field)
|
||||
return findRoot(ownerObject);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
} // end namespace caf
|
||||
|
@ -135,7 +135,7 @@ void PdmDocument::writeFile(QIODevice* xmlFile)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmDocument::updateUiIconStateRecursively(PdmObjectHandle* object)
|
||||
{
|
||||
if (object == NULL) return;
|
||||
if (object == nullptr) return;
|
||||
std::vector<PdmFieldHandle*> fields;
|
||||
object->fields(fields);
|
||||
|
||||
|
@ -64,7 +64,7 @@ PdmUiCommandSystemProxy* PdmUiCommandSystemProxy::instance()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
PdmUiCommandSystemProxy::PdmUiCommandSystemProxy()
|
||||
{
|
||||
m_commandInterface = NULL;
|
||||
m_commandInterface = nullptr;
|
||||
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@ namespace caf
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
PdmUiEditorHandle::PdmUiEditorHandle() : m_pdmItem(NULL)
|
||||
PdmUiEditorHandle::PdmUiEditorHandle() : m_pdmItem(nullptr)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -114,9 +114,9 @@ protected: // Virtual interface to override
|
||||
/// Implement one of these, or both editor and label. The widgets will be used in the parent layout according to
|
||||
/// being "Label" Editor" or a single combined widget.
|
||||
|
||||
virtual QWidget* createCombinedWidget(QWidget * parent) { return NULL; }
|
||||
virtual QWidget* createEditorWidget(QWidget * parent) { return NULL; }
|
||||
virtual QWidget* createLabelWidget(QWidget * parent) { return NULL; }
|
||||
virtual QWidget* createCombinedWidget(QWidget * parent) { return nullptr; }
|
||||
virtual QWidget* createEditorWidget(QWidget * parent) { return nullptr; }
|
||||
virtual QWidget* createLabelWidget(QWidget * parent) { return nullptr; }
|
||||
|
||||
void setValueToField(const QVariant& value);
|
||||
|
||||
|
@ -341,14 +341,14 @@ PdmUiItemInfo::LabelPosType PdmUiItem::uiLabelPosition(QString uiConfigName) con
|
||||
|
||||
const PdmUiItemInfo* PdmUiItem::configInfo(QString uiConfigName) const
|
||||
{
|
||||
if (uiConfigName == "" || uiConfigName.isNull()) return NULL;
|
||||
if (uiConfigName == "" || uiConfigName.isNull()) return nullptr;
|
||||
|
||||
std::map<QString, PdmUiItemInfo>::const_iterator it;
|
||||
it = m_configItemInfos.find(uiConfigName);
|
||||
|
||||
if (it != m_configItemInfos.end()) return &(it->second);
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -362,7 +362,7 @@ const PdmUiItemInfo* PdmUiItem::defaultInfo() const
|
||||
|
||||
if (it != m_configItemInfos.end()) return &(it->second);
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -395,7 +395,7 @@ PdmUiItem::~PdmUiItem()
|
||||
std::set<PdmUiEditorHandle*>::iterator it;
|
||||
for (it = m_editors.begin(); it != m_editors.end(); ++it)
|
||||
{
|
||||
(*it)->m_pdmItem = NULL;
|
||||
(*it)->m_pdmItem = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -191,7 +191,7 @@ bool PdmOptionItemInfo::findValues(const QList<PdmOptionItemInfo>& optionList, Q
|
||||
class PdmUiItem
|
||||
{
|
||||
public:
|
||||
PdmUiItem() : m_staticItemInfo(NULL) { }
|
||||
PdmUiItem() : m_staticItemInfo(nullptr) { }
|
||||
virtual ~PdmUiItem();
|
||||
|
||||
PdmUiItem(const PdmUiItem&) = delete;
|
||||
|
@ -104,7 +104,7 @@ PdmObjectHandle* PdmUiObjectEditorHandle::pdmObject()
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ PdmUiObjectHandle::PdmUiObjectHandle(PdmObjectHandle* owner, bool giveOwnership)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
PdmUiObjectHandle* uiObj(PdmObjectHandle* obj)
|
||||
{
|
||||
if (!obj) return NULL;
|
||||
if (!obj) return nullptr;
|
||||
PdmUiObjectHandle* uiObject = obj->capability<PdmUiObjectHandle>();
|
||||
CAF_ASSERT(uiObject);
|
||||
return uiObject;
|
||||
@ -92,7 +92,7 @@ PdmUiTreeOrdering* PdmUiObjectHandle::uiTreeOrdering(QString uiConfigName /*= ""
|
||||
{
|
||||
CAF_ASSERT(this); // This method actually is possible to call on a NULL ptr without getting a crash, so we assert instead.
|
||||
|
||||
PdmUiTreeOrdering* uiTreeOrdering = new PdmUiTreeOrdering(NULL, m_owner);
|
||||
PdmUiTreeOrdering* uiTreeOrdering = new PdmUiTreeOrdering(nullptr, m_owner);
|
||||
|
||||
expandUiTree(uiTreeOrdering, uiConfigName);
|
||||
|
||||
|
@ -48,10 +48,10 @@ public:
|
||||
|
||||
// Virtual interface to override in subclasses to support special behaviour if needed
|
||||
public: // Virtual
|
||||
virtual caf::PdmFieldHandle* userDescriptionField() { return NULL; }
|
||||
virtual caf::PdmFieldHandle* userDescriptionField() { return nullptr; }
|
||||
|
||||
/// Field used to toggle object on/off in UI-related uses of the object (ie checkbox in treeview)
|
||||
virtual caf::PdmFieldHandle* objectToggleField() { return NULL; }
|
||||
virtual caf::PdmFieldHandle* objectToggleField() { return nullptr; }
|
||||
|
||||
/// Method to reimplement to catch when the field has changed due to setUiValue()
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) {}
|
||||
|
@ -140,13 +140,13 @@ bool PdmUiTreeOrdering::containsObject(const PdmObjectHandle* object)
|
||||
/// Creates an new root PdmUiTreeOrdering item, pointing at a PdmObject
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
PdmUiTreeOrdering::PdmUiTreeOrdering(PdmObjectHandle* pdmObject) :
|
||||
m_parentItem(NULL),
|
||||
m_field(NULL),
|
||||
m_parentItem(nullptr),
|
||||
m_field(nullptr),
|
||||
m_forgetRemainingFields(false),
|
||||
m_isToIgnoreSubTree(false),
|
||||
m_uiItem(NULL),
|
||||
m_uiItem(nullptr),
|
||||
m_object(pdmObject),
|
||||
m_treeItemEditor(NULL)
|
||||
m_treeItemEditor(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@ -154,13 +154,13 @@ PdmUiTreeOrdering::PdmUiTreeOrdering(PdmObjectHandle* pdmObject) :
|
||||
/// Creates an new root PdmUiTreeOrdering item, pointing at a field
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
PdmUiTreeOrdering::PdmUiTreeOrdering( PdmFieldHandle* pdmField ) :
|
||||
m_parentItem(NULL),
|
||||
m_parentItem(nullptr),
|
||||
m_field(pdmField),
|
||||
m_forgetRemainingFields(false),
|
||||
m_isToIgnoreSubTree(false),
|
||||
m_uiItem(NULL),
|
||||
m_object(NULL),
|
||||
m_treeItemEditor(NULL)
|
||||
m_uiItem(nullptr),
|
||||
m_object(nullptr),
|
||||
m_treeItemEditor(nullptr)
|
||||
{
|
||||
if (pdmField) m_object = pdmField->ownerObject();
|
||||
}
|
||||
@ -169,13 +169,13 @@ PdmUiTreeOrdering::PdmUiTreeOrdering( PdmFieldHandle* pdmField ) :
|
||||
/// Creates an new root PdmUiTreeOrdering item, as a display item only
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
PdmUiTreeOrdering::PdmUiTreeOrdering(const QString & title, const QString& iconResourceName) :
|
||||
m_parentItem(NULL),
|
||||
m_field(NULL),
|
||||
m_parentItem(nullptr),
|
||||
m_field(nullptr),
|
||||
m_forgetRemainingFields(false),
|
||||
m_isToIgnoreSubTree(false),
|
||||
m_uiItem(NULL),
|
||||
m_object(NULL),
|
||||
m_treeItemEditor(NULL)
|
||||
m_uiItem(nullptr),
|
||||
m_object(nullptr),
|
||||
m_treeItemEditor(nullptr)
|
||||
{
|
||||
m_uiItem = new PdmUiItem();
|
||||
m_uiItem->setUiName(title);
|
||||
@ -188,12 +188,12 @@ PdmUiTreeOrdering::PdmUiTreeOrdering(const QString & title, const QString& iconR
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
PdmUiTreeOrdering::PdmUiTreeOrdering(PdmUiTreeOrdering* parent, PdmObjectHandle* pdmObject) :
|
||||
m_parentItem(parent),
|
||||
m_field(NULL),
|
||||
m_field(nullptr),
|
||||
m_forgetRemainingFields(false),
|
||||
m_isToIgnoreSubTree(false),
|
||||
m_uiItem(NULL),
|
||||
m_uiItem(nullptr),
|
||||
m_object(pdmObject),
|
||||
m_treeItemEditor(NULL)
|
||||
m_treeItemEditor(nullptr)
|
||||
{
|
||||
if (m_parentItem)
|
||||
{
|
||||
@ -210,9 +210,9 @@ PdmUiTreeOrdering::PdmUiTreeOrdering(PdmUiTreeOrdering* parent , PdmFieldHandle*
|
||||
m_field(pdmField),
|
||||
m_forgetRemainingFields(false),
|
||||
m_isToIgnoreSubTree(false),
|
||||
m_uiItem(NULL),
|
||||
m_object(NULL),
|
||||
m_treeItemEditor(NULL)
|
||||
m_uiItem(nullptr),
|
||||
m_object(nullptr),
|
||||
m_treeItemEditor(nullptr)
|
||||
{
|
||||
if (m_parentItem)
|
||||
{
|
||||
@ -274,7 +274,7 @@ PdmUiItem* PdmUiTreeOrdering::activeItem() const
|
||||
if (isRepresentingObject()) return uiObj(m_object);
|
||||
if (isRepresentingField()) return m_field->uiCapability();
|
||||
if (isDisplayItemOnly()) return m_uiItem;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -82,10 +82,10 @@ public:
|
||||
void setIgnoreSubTree(bool doIgnoreSubTree ) { m_isToIgnoreSubTree = doIgnoreSubTree; }
|
||||
|
||||
// Testing for the PdmItem being represented
|
||||
bool isRepresentingObject() const { return !isRepresentingField() && (m_object != NULL); }
|
||||
bool isRepresentingField() const { return (m_object != NULL) && (m_field != NULL);}
|
||||
bool isDisplayItemOnly() const { return (m_uiItem != NULL); }
|
||||
bool isValid() const { return (this->activeItem() != NULL); }
|
||||
bool isRepresentingObject() const { return !isRepresentingField() && (m_object != nullptr); }
|
||||
bool isRepresentingField() const { return (m_object != nullptr) && (m_field != nullptr);}
|
||||
bool isDisplayItemOnly() const { return (m_uiItem != nullptr); }
|
||||
bool isValid() const { return (this->activeItem() != nullptr); }
|
||||
|
||||
// Access to the PdmItem being represented
|
||||
PdmUiItem* activeItem() const;
|
||||
|
@ -119,7 +119,7 @@ PdmUiItem* SelectionManager::selectedItem(int role /*= SelectionManager::APPLICA
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -140,8 +140,8 @@ SelectionManager::SelectionManager()
|
||||
{
|
||||
m_selectionForRole.resize(UNDEFINED);
|
||||
|
||||
m_notificationCenter = NULL;
|
||||
m_activeChildArrayFieldHandle = NULL;
|
||||
m_notificationCenter = nullptr;
|
||||
m_activeChildArrayFieldHandle = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -20,7 +20,7 @@ PdmObjectHandle * PdmDefaultObjectFactory::create(const QString& classNameKeywor
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ PdmXmlObjectHandle::PdmXmlObjectHandle(PdmObjectHandle* owner, bool giveOwnershi
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
PdmXmlObjectHandle* xmlObj(PdmObjectHandle* obj)
|
||||
{
|
||||
if (!obj) return NULL;
|
||||
if (!obj) return nullptr;
|
||||
PdmXmlObjectHandle* xmlObject = obj->capability<PdmXmlObjectHandle>();
|
||||
CAF_ASSERT(xmlObject);
|
||||
return xmlObject;
|
||||
@ -248,7 +248,7 @@ bool PdmXmlObjectHandle::isValidXmlElementName(const QString& name)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmXmlObjectHandle::initAfterReadRecursively(PdmObjectHandle* object)
|
||||
{
|
||||
if (object == NULL) return;
|
||||
if (object == nullptr) return;
|
||||
|
||||
std::vector<PdmFieldHandle*> fields;
|
||||
object->fields(fields);
|
||||
@ -278,7 +278,7 @@ void PdmXmlObjectHandle::initAfterReadRecursively(PdmObjectHandle* object)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmXmlObjectHandle::resolveReferencesRecursively(PdmObjectHandle* object)
|
||||
{
|
||||
if (object == NULL) return;
|
||||
if (object == nullptr) return;
|
||||
|
||||
std::vector<PdmFieldHandle*> fields;
|
||||
object->fields(fields);
|
||||
@ -308,7 +308,7 @@ void PdmXmlObjectHandle::resolveReferencesRecursively(PdmObjectHandle* object)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmXmlObjectHandle::setupBeforeSaveRecursively(PdmObjectHandle* object)
|
||||
{
|
||||
if (object == NULL) return;
|
||||
if (object == nullptr) return;
|
||||
|
||||
std::vector<PdmFieldHandle*> fields;
|
||||
object->fields(fields);
|
||||
|
@ -155,7 +155,7 @@ void CustomObjectEditor::recursivelyConfigureAndUpdateTopLevelUiItems(const std:
|
||||
{
|
||||
resetCellId();
|
||||
|
||||
QWidget* previousTabOrderWidget = NULL;
|
||||
QWidget* previousTabOrderWidget = nullptr;
|
||||
|
||||
for (size_t i = 0; i < topLevelUiItems.size(); ++i)
|
||||
{
|
||||
|
@ -71,7 +71,7 @@ public:
|
||||
void defineGridLayout(int rowCount, int columnCount);
|
||||
|
||||
// See QGridLayout::addWidget
|
||||
void addWidget(QWidget* widget, int row, int column, int rowSpan, int columnSpan, Qt::Alignment alignment = 0);
|
||||
void addWidget(QWidget* widget, int row, int column, int rowSpan, int columnSpan, Qt::Alignment alignment = nullptr);
|
||||
void removeWidget(QWidget* widget);
|
||||
|
||||
void addBlankCell(int row, int column);
|
||||
|
@ -559,7 +559,7 @@ CAF_PDM_SOURCE_INIT(DemoPdmObject, "DemoPdmObject");
|
||||
|
||||
|
||||
|
||||
MainWindow* MainWindow::sm_mainWindowInstance = NULL;
|
||||
MainWindow* MainWindow::sm_mainWindowInstance = nullptr;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@ -789,10 +789,10 @@ void MainWindow::setPdmRoot(caf::PdmObjectHandle* pdmRoot)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
m_pdmUiTreeView->setPdmItem(NULL);
|
||||
m_pdmUiTreeView2->setPdmItem(NULL);
|
||||
m_pdmUiPropertyView->showProperties(NULL);
|
||||
m_pdmUiTableView->setListField(NULL);
|
||||
m_pdmUiTreeView->setPdmItem(nullptr);
|
||||
m_pdmUiTreeView2->setPdmItem(nullptr);
|
||||
m_pdmUiPropertyView->showProperties(nullptr);
|
||||
m_pdmUiTableView->setListField(nullptr);
|
||||
|
||||
delete m_pdmUiTreeView;
|
||||
delete m_pdmUiTreeView2;
|
||||
@ -865,7 +865,7 @@ void MainWindow::slotInsert()
|
||||
for (size_t i = 0; i < selection.size(); ++i)
|
||||
{
|
||||
caf::PdmUiFieldHandle* uiFh = dynamic_cast<caf::PdmUiFieldHandle*>(selection[i]);
|
||||
caf::PdmChildArrayField< caf::PdmObjectHandle*> * field = NULL;
|
||||
caf::PdmChildArrayField< caf::PdmObjectHandle*> * field = nullptr;
|
||||
|
||||
if (uiFh) field = dynamic_cast<caf::PdmChildArrayField< caf::PdmObjectHandle*> *>(uiFh->fieldHandle());
|
||||
|
||||
@ -935,8 +935,8 @@ void MainWindow::slotSimpleSelectionChanged()
|
||||
{
|
||||
std::vector<caf::PdmUiItem*> selection;
|
||||
m_pdmUiTreeView->selectedUiItems(selection);
|
||||
caf::PdmObjectHandle* obj = NULL;
|
||||
caf::PdmChildArrayFieldHandle* listField = NULL;
|
||||
caf::PdmObjectHandle* obj = nullptr;
|
||||
caf::PdmChildArrayFieldHandle* listField = nullptr;
|
||||
|
||||
if (selection.size())
|
||||
{
|
||||
@ -954,8 +954,8 @@ void MainWindow::slotShowTableView()
|
||||
{
|
||||
std::vector<caf::PdmUiItem*> selection;
|
||||
m_pdmUiTreeView2->selectedUiItems(selection);
|
||||
caf::PdmObjectHandle* obj = NULL;
|
||||
caf::PdmChildArrayFieldHandle* listField = NULL;
|
||||
caf::PdmObjectHandle* obj = nullptr;
|
||||
caf::PdmChildArrayFieldHandle* listField = nullptr;
|
||||
|
||||
if (selection.size())
|
||||
{
|
||||
@ -969,7 +969,7 @@ void MainWindow::slotShowTableView()
|
||||
{
|
||||
if (!listField->hasSameFieldCountForAllObjects())
|
||||
{
|
||||
listField = NULL;
|
||||
listField = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ void WidgetLayoutTest::setUpInitialConfigurationA()
|
||||
m_mainLayout->addWidget(m_widget2);
|
||||
|
||||
delete m_widget3;
|
||||
m_widget3 = NULL;
|
||||
m_widget3 = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -13,7 +13,7 @@ class WidgetLayoutTest : public QWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
WidgetLayoutTest(QWidget* parent = 0, Qt::WindowFlags f = 0);
|
||||
WidgetLayoutTest(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
|
||||
~WidgetLayoutTest();
|
||||
|
||||
private:
|
||||
|
@ -51,8 +51,8 @@ class QMinimizePanel : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit QMinimizePanel(QWidget* parent=0);
|
||||
explicit QMinimizePanel(const QString &title, QWidget* parent=0);
|
||||
explicit QMinimizePanel(QWidget* parent=nullptr);
|
||||
explicit QMinimizePanel(const QString &title, QWidget* parent=nullptr);
|
||||
~QMinimizePanel();
|
||||
|
||||
QFrame* contentFrame() { return m_contentFrame; }
|
||||
|
@ -52,7 +52,7 @@ class PdmUiCheckBoxDelegate : public QStyledItemDelegate
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit PdmUiCheckBoxDelegate( QObject* pParent = 0 );
|
||||
explicit PdmUiCheckBoxDelegate( QObject* pParent = nullptr );
|
||||
virtual ~PdmUiCheckBoxDelegate();
|
||||
|
||||
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
|
||||
|
@ -182,7 +182,7 @@ void PdmUiComboBoxEditor::configureAndUpdateUi(const QString& uiConfigName)
|
||||
class CustomQComboBox : public QComboBox
|
||||
{
|
||||
public:
|
||||
explicit CustomQComboBox(QWidget* parent = 0)
|
||||
explicit CustomQComboBox(QWidget* parent = nullptr)
|
||||
: QComboBox(parent)
|
||||
{}
|
||||
|
||||
|
@ -51,7 +51,7 @@
|
||||
class PdmDoubleValidator : public QDoubleValidator
|
||||
{
|
||||
public:
|
||||
explicit PdmDoubleValidator(QObject * parent = 0) : QDoubleValidator(parent)
|
||||
explicit PdmDoubleValidator(QObject * parent = nullptr) : QDoubleValidator(parent)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmUiFieldEditorHandle* caf::PdmUiFieldEditorHelper::fieldEditorForField(caf::PdmUiFieldHandle* field, const QString& uiConfigName)
|
||||
{
|
||||
caf::PdmUiFieldEditorHandle* fieldEditor = NULL;
|
||||
caf::PdmUiFieldEditorHandle* fieldEditor = nullptr;
|
||||
|
||||
// If editor type is specified, find in factory
|
||||
if (!field->uiEditorTypeName(uiConfigName).isEmpty())
|
||||
|
@ -208,7 +208,7 @@ void PdmUiLineEditor::configureAndUpdateUi(const QString& uiConfigName)
|
||||
{
|
||||
if (isMultipleFieldsWithSameKeywordSelected(field()->fieldHandle()))
|
||||
{
|
||||
QMessageBox::information(NULL, "Invalid operation", "The field you are manipulating is defined to have unique values. A selection of multiple fields is detected. Please select a single item.");
|
||||
QMessageBox::information(nullptr, "Invalid operation", "The field you are manipulating is defined to have unique values. A selection of multiple fields is detected. Please select a single item.");
|
||||
}
|
||||
|
||||
m_lineEdit->setValidator(new PdmUniqueIdValidator(leab.usedIds, isMultipleFieldsWithSameKeywordSelected(field()->fieldHandle()), leab.errorMessage, this));
|
||||
|
@ -64,7 +64,7 @@
|
||||
class MyStringListModel : public QStringListModel
|
||||
{
|
||||
public:
|
||||
explicit MyStringListModel(QObject *parent = 0) : m_isItemsEditable(false), QStringListModel(parent) { }
|
||||
explicit MyStringListModel(QObject *parent = nullptr) : m_isItemsEditable(false), QStringListModel(parent) { }
|
||||
|
||||
virtual Qt::ItemFlags flags (const QModelIndex& index) const
|
||||
{
|
||||
@ -90,7 +90,7 @@ private:
|
||||
class QListViewHeightHint : public QListView
|
||||
{
|
||||
public:
|
||||
explicit QListViewHeightHint(QWidget *parent = 0)
|
||||
explicit QListViewHeightHint(QWidget *parent = nullptr)
|
||||
: m_heightHint(-1)
|
||||
{
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ class PdmUiListView : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
PdmUiListView(QWidget* parent = 0, Qt::WindowFlags f = 0);
|
||||
PdmUiListView(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
|
||||
~PdmUiListView();
|
||||
|
||||
void setPdmObject(caf::PdmObjectCollection* object);
|
||||
|
@ -59,7 +59,7 @@ UiListViewModelPdm::UiListViewModelPdm(QObject* parent)
|
||||
: QAbstractTableModel(parent)
|
||||
{
|
||||
m_columnCount = 0;
|
||||
m_pdmObjectGroup = NULL;
|
||||
m_pdmObjectGroup = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -98,7 +98,7 @@ PdmUiPropertyView::PdmUiPropertyView(QWidget* parent, Qt::WindowFlags f)
|
||||
dummy->setContentsMargins(0,0,0,0);
|
||||
dummy->addWidget(scrollArea);
|
||||
|
||||
m_currentObjectView = NULL;
|
||||
m_currentObjectView = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -123,7 +123,7 @@ void PdmUiPropertyView::setUiConfigurationName(QString uiConfigName)
|
||||
{
|
||||
PdmObjectHandle* object = m_currentObjectView->pdmObject();
|
||||
delete m_currentObjectView;
|
||||
m_currentObjectView = NULL;
|
||||
m_currentObjectView = nullptr;
|
||||
this->showProperties(object);
|
||||
}
|
||||
}
|
||||
@ -163,7 +163,7 @@ void PdmUiPropertyView::showProperties( PdmObjectHandle* object)
|
||||
{
|
||||
this->m_placeHolderLayout->removeWidget(m_currentObjectView->widget());
|
||||
delete m_currentObjectView;
|
||||
m_currentObjectView = NULL;
|
||||
m_currentObjectView = nullptr;
|
||||
}
|
||||
|
||||
if (!m_currentObjectView)
|
||||
@ -192,7 +192,7 @@ void PdmUiPropertyView::showProperties( PdmObjectHandle* object)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
PdmObjectHandle* PdmUiPropertyView::currentObject()
|
||||
{
|
||||
if (!m_currentObjectView) return NULL;
|
||||
if (!m_currentObjectView) return nullptr;
|
||||
return m_currentObjectView->pdmObject();
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ class QVerticalScrollArea : public QScrollArea
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit QVerticalScrollArea(QWidget* parent = 0);
|
||||
explicit QVerticalScrollArea(QWidget* parent = nullptr);
|
||||
virtual bool eventFilter(QObject* object, QEvent* event) override;
|
||||
};
|
||||
|
||||
@ -72,7 +72,7 @@ class PdmUiPropertyView : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
PdmUiPropertyView(QWidget* parent = 0, Qt::WindowFlags f = 0);
|
||||
PdmUiPropertyView(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
|
||||
~PdmUiPropertyView();
|
||||
|
||||
void setUiConfigurationName(QString uiConfigName);
|
||||
|
@ -75,7 +75,7 @@ PdmUiPropertyViewDialog::PdmUiPropertyViewDialog(QWidget* parent, PdmObject* obj
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
PdmUiPropertyViewDialog::~PdmUiPropertyViewDialog()
|
||||
{
|
||||
m_pdmUiPropertyView->showProperties(NULL);
|
||||
m_pdmUiPropertyView->showProperties(nullptr);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -76,7 +76,7 @@ class PdmUiTableView : public QWidget, public DataModelObserver
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
PdmUiTableView(QWidget* parent = 0, Qt::WindowFlags f = 0);
|
||||
PdmUiTableView(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
|
||||
~PdmUiTableView();
|
||||
|
||||
PdmObjectHandle* pdmObjectFromModelIndex(const QModelIndex& mi);
|
||||
|
@ -91,13 +91,13 @@ private:
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
PdmUiTableViewEditor::PdmUiTableViewEditor()
|
||||
{
|
||||
m_layout = NULL;;
|
||||
m_tableView = NULL;
|
||||
m_tableHeading = NULL;
|
||||
m_tableModelPdm = NULL;
|
||||
m_tableHeadingIcon = NULL;
|
||||
m_pdmListField = NULL;
|
||||
m_delegate = NULL;
|
||||
m_layout = nullptr;;
|
||||
m_tableView = nullptr;
|
||||
m_tableHeading = nullptr;
|
||||
m_tableModelPdm = nullptr;
|
||||
m_tableHeadingIcon = nullptr;
|
||||
m_pdmListField = nullptr;
|
||||
m_delegate = nullptr;
|
||||
|
||||
m_useDefaultContextMenu = false;
|
||||
|
||||
@ -201,7 +201,7 @@ void PdmUiTableViewEditor::setListField(PdmChildArrayFieldHandle* pdmListField)
|
||||
{
|
||||
m_pdmListField = pdmListField;
|
||||
|
||||
caf::PdmUiFieldHandle* uifield = NULL;
|
||||
caf::PdmUiFieldHandle* uifield = nullptr;
|
||||
if (m_pdmListField)
|
||||
{
|
||||
uifield = m_pdmListField->uiCapability();
|
||||
@ -210,7 +210,7 @@ void PdmUiTableViewEditor::setListField(PdmChildArrayFieldHandle* pdmListField)
|
||||
|
||||
if (!m_pdmListField)
|
||||
{
|
||||
m_tableModelPdm->setPdmData(NULL, "");
|
||||
m_tableModelPdm->setPdmData(nullptr, "");
|
||||
m_tableHeading->setText("");
|
||||
m_tableHeadingIcon->setPixmap(QPixmap());
|
||||
}
|
||||
@ -297,7 +297,7 @@ void PdmUiTableViewEditor::updateContextMenuSignals()
|
||||
else
|
||||
{
|
||||
m_tableView->setContextMenuPolicy(Qt::DefaultContextMenu);
|
||||
disconnect(m_tableView, 0, this, 0);
|
||||
disconnect(m_tableView, nullptr, this, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@ -375,7 +375,7 @@ PdmObjectHandle* PdmUiTableViewEditor::pdmObjectFromModelIndex(const QModelIndex
|
||||
return m_tableModelPdm->pdmObjectForRow(mi.row());
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -62,7 +62,7 @@ namespace caf
|
||||
PdmUiTableViewModel::PdmUiTableViewModel(QWidget* parent)
|
||||
: QAbstractTableModel(parent)
|
||||
{
|
||||
m_pdmList = NULL;
|
||||
m_pdmList = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -353,7 +353,7 @@ void PdmUiTableViewModel::setPdmData(PdmChildArrayFieldHandle* listField, const
|
||||
std::map<QString, PdmUiFieldEditorHandle*>::iterator it;
|
||||
for (it = m_fieldEditors.begin(); it != m_fieldEditors.end(); ++it)
|
||||
{
|
||||
it->second->setField(NULL);
|
||||
it->second->setField(nullptr);
|
||||
}
|
||||
|
||||
m_modelColumnIndexToFieldIndex.clear();
|
||||
@ -366,7 +366,7 @@ void PdmUiTableViewModel::setPdmData(PdmChildArrayFieldHandle* listField, const
|
||||
|
||||
{
|
||||
PdmUiFieldHandle* field = dynamic_cast<PdmUiFieldHandle*>(uiItems[i]);
|
||||
PdmUiFieldEditorHandle* fieldEditor = NULL;
|
||||
PdmUiFieldEditorHandle* fieldEditor = nullptr;
|
||||
|
||||
// Find or create FieldEditor
|
||||
std::map<QString, PdmUiFieldEditorHandle*>::iterator it;
|
||||
@ -392,7 +392,7 @@ void PdmUiTableViewModel::setPdmData(PdmChildArrayFieldHandle* listField, const
|
||||
|
||||
//TODO: Create/update is not required at this point, as UI is recreated in getEditorWidgetAndTransferOwnership()
|
||||
// Can be moved, but a move will require changes in PdmUiFieldEditorHandle
|
||||
fieldEditor->createWidgets(NULL);
|
||||
fieldEditor->createWidgets(nullptr);
|
||||
fieldEditor->updateUi(configName);
|
||||
|
||||
int fieldIndex = getFieldIndex(field->fieldHandle());
|
||||
@ -407,7 +407,7 @@ void PdmUiTableViewModel::setPdmData(PdmChildArrayFieldHandle* listField, const
|
||||
std::vector< QString > fvhToRemoveFromMap;
|
||||
for (it = m_fieldEditors.begin(); it != m_fieldEditors.end(); ++it)
|
||||
{
|
||||
if (it->second->field() == 0)
|
||||
if (it->second->field() == nullptr)
|
||||
{
|
||||
PdmUiFieldEditorHandle* fvh = it->second;
|
||||
delete fvh;
|
||||
@ -451,7 +451,7 @@ PdmFieldHandle* PdmUiTableViewModel::getField(const QModelIndex &index) const
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -462,10 +462,10 @@ PdmUiFieldEditorHandle* PdmUiTableViewModel::getEditor(const QModelIndex &index)
|
||||
PdmFieldHandle* field = getField(index);
|
||||
if (!field)
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PdmUiFieldEditorHandle* editor = NULL;
|
||||
PdmUiFieldEditorHandle* editor = nullptr;
|
||||
|
||||
std::map<QString, PdmUiFieldEditorHandle*>::iterator it;
|
||||
it = m_fieldEditors.find(field->keyword());
|
||||
@ -503,7 +503,7 @@ QWidget* PdmUiTableViewModel::getEditorWidgetAndTransferOwnership(QWidget* paren
|
||||
return editorWidget;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -559,7 +559,7 @@ PdmObjectHandle* PdmUiTableViewModel::pdmObjectForRow(int row) const
|
||||
return m_pdmList->at(row);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -64,7 +64,7 @@ class TableViewPushButton : public QPushButton
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit TableViewPushButton(caf::PdmUiFieldHandle* field, const QString& text, QWidget* parent = 0);
|
||||
explicit TableViewPushButton(caf::PdmUiFieldHandle* field, const QString& text, QWidget* parent = nullptr);
|
||||
|
||||
private slots:
|
||||
void slotPressed();
|
||||
|
@ -92,7 +92,7 @@ class TextEdit : public QTextEdit
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit TextEdit(QWidget *parent = 0);
|
||||
explicit TextEdit(QWidget *parent = nullptr);
|
||||
|
||||
virtual QSize sizeHint() const override;
|
||||
void setHeightHint(int heightHint);
|
||||
|
@ -101,7 +101,7 @@ QWidget* PdmUiToolButtonEditor::createEditorWidget(QWidget * parent)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QWidget* PdmUiToolButtonEditor::createLabelWidget(QWidget * parent)
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -46,7 +46,7 @@ namespace caf
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
PdmUiTreeItemEditor::PdmUiTreeItemEditor(PdmUiItem* uiItem)
|
||||
{
|
||||
m_treeViewEditor = NULL;
|
||||
m_treeViewEditor = nullptr;
|
||||
this->bindToPdmItem(uiItem);
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@
|
||||
class QTreeViewHeightHint : public QTreeView
|
||||
{
|
||||
public:
|
||||
explicit QTreeViewHeightHint(QWidget *parent = 0)
|
||||
explicit QTreeViewHeightHint(QWidget *parent = nullptr)
|
||||
: m_heightHint(-1)
|
||||
{
|
||||
}
|
||||
@ -100,7 +100,7 @@ private:
|
||||
class FilterLeafNodesOnlyProxyModel : public QSortFilterProxyModel
|
||||
{
|
||||
public:
|
||||
FilterLeafNodesOnlyProxyModel(QObject *parent = 0)
|
||||
FilterLeafNodesOnlyProxyModel(QObject *parent = nullptr)
|
||||
: QSortFilterProxyModel(parent)
|
||||
{
|
||||
}
|
||||
@ -131,7 +131,7 @@ protected:
|
||||
class PlaceholderLineEdit : public QLineEdit
|
||||
{
|
||||
public:
|
||||
explicit PlaceholderLineEdit(const QString& placeholderText, QWidget* parent = 0)
|
||||
explicit PlaceholderLineEdit(const QString& placeholderText, QWidget* parent = nullptr)
|
||||
: QLineEdit(parent),
|
||||
m_placeholderText(placeholderText)
|
||||
{
|
||||
|
@ -58,7 +58,7 @@ class PdmUiTreeSelectionQModel : public QAbstractItemModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit PdmUiTreeSelectionQModel(QObject *parent = 0);
|
||||
explicit PdmUiTreeSelectionQModel(QObject *parent = nullptr);
|
||||
~PdmUiTreeSelectionQModel();
|
||||
|
||||
static int headingRole();
|
||||
|
@ -132,7 +132,7 @@ void PdmUiTreeView::slotOnSelectionChanged()
|
||||
|
||||
std::vector<PdmUiItem*> objects;
|
||||
m_treeViewEditor->selectedUiItems(objects);
|
||||
PdmObjectHandle* objHandle = NULL;
|
||||
PdmObjectHandle* objHandle = nullptr;
|
||||
|
||||
if (objects.size())
|
||||
{
|
||||
|
@ -61,7 +61,7 @@ class PdmUiTreeView : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
PdmUiTreeView(QWidget* parent = 0, Qt::WindowFlags f = 0);
|
||||
PdmUiTreeView(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
|
||||
~PdmUiTreeView();
|
||||
|
||||
void enableDefaultContextMenu(bool enable);
|
||||
|
@ -64,7 +64,7 @@ namespace caf
|
||||
class PdmUiTreeViewWidget : public QTreeView
|
||||
{
|
||||
public:
|
||||
explicit PdmUiTreeViewWidget(QWidget* parent = 0) : QTreeView(parent) {};
|
||||
explicit PdmUiTreeViewWidget(QWidget* parent = nullptr) : QTreeView(parent) {};
|
||||
virtual ~PdmUiTreeViewWidget() {};
|
||||
|
||||
bool isTreeItemEditWidgetActive() const
|
||||
@ -115,7 +115,7 @@ PdmUiTreeViewEditor::PdmUiTreeViewEditor()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
PdmUiTreeViewEditor::~PdmUiTreeViewEditor()
|
||||
{
|
||||
m_treeViewModel->setPdmItemRoot(NULL);
|
||||
m_treeViewModel->setPdmItemRoot(nullptr);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -249,7 +249,7 @@ void PdmUiTreeViewEditor::updateContextMenuSignals()
|
||||
else
|
||||
{
|
||||
m_treeView->setContextMenuPolicy(Qt::DefaultContextMenu);
|
||||
disconnect(m_treeView, 0, this, 0);
|
||||
disconnect(m_treeView, nullptr, this, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@ -303,7 +303,7 @@ PdmChildArrayFieldHandle* PdmUiTreeViewEditor::currentChildArrayFieldHandle()
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -56,8 +56,8 @@ namespace caf
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
PdmUiTreeViewModel::PdmUiTreeViewModel(PdmUiTreeViewEditor* treeViewEditor)
|
||||
{
|
||||
m_treeOrderingRoot = NULL;
|
||||
m_dragDropInterface = NULL;
|
||||
m_treeOrderingRoot = nullptr;
|
||||
m_dragDropInterface = nullptr;
|
||||
|
||||
m_treeViewEditor = treeViewEditor;
|
||||
}
|
||||
@ -75,7 +75,7 @@ void PdmUiTreeViewModel::setPdmItemRoot(PdmUiItem* rootItem)
|
||||
return;
|
||||
}
|
||||
|
||||
PdmUiTreeOrdering* newRoot = NULL;
|
||||
PdmUiTreeOrdering* newRoot = nullptr;
|
||||
PdmUiFieldHandle* field = dynamic_cast<PdmUiFieldHandle*> (rootItem);
|
||||
|
||||
if (field)
|
||||
@ -92,7 +92,7 @@ void PdmUiTreeViewModel::setPdmItemRoot(PdmUiItem* rootItem)
|
||||
}
|
||||
}
|
||||
|
||||
CAF_ASSERT( newRoot || rootItem == NULL ); // Only fields, objects or NULL is allowed.
|
||||
CAF_ASSERT( newRoot || rootItem == nullptr ); // Only fields, objects or NULL is allowed.
|
||||
|
||||
//if (newRoot) newRoot->debugDump(0);
|
||||
|
||||
@ -141,7 +141,7 @@ void PdmUiTreeViewModel::updateSubTree(PdmUiItem* pdmRoot)
|
||||
{
|
||||
// Build the new "Correct" Tree
|
||||
|
||||
PdmUiTreeOrdering* newTreeRootTmp = NULL;
|
||||
PdmUiTreeOrdering* newTreeRootTmp = nullptr;
|
||||
PdmUiFieldHandle* field = dynamic_cast<PdmUiFieldHandle*> (pdmRoot);
|
||||
if (field)
|
||||
{
|
||||
@ -167,7 +167,7 @@ void PdmUiTreeViewModel::updateSubTree(PdmUiItem* pdmRoot)
|
||||
|
||||
QModelIndex existingSubTreeRootModIdx = findModelIndex(pdmRoot);
|
||||
|
||||
PdmUiTreeOrdering* existingSubTreeRoot = NULL;
|
||||
PdmUiTreeOrdering* existingSubTreeRoot = nullptr;
|
||||
if (existingSubTreeRootModIdx.isValid())
|
||||
{
|
||||
existingSubTreeRoot = treeItemFromIndex(existingSubTreeRootModIdx);
|
||||
@ -460,7 +460,7 @@ QModelIndex PdmUiTreeViewModel::index(int row, int column, const QModelIndex &pa
|
||||
if (!m_treeOrderingRoot)
|
||||
return QModelIndex();
|
||||
|
||||
PdmUiTreeOrdering* parentItem = NULL;
|
||||
PdmUiTreeOrdering* parentItem = nullptr;
|
||||
|
||||
if (!parentIndex.isValid())
|
||||
parentItem = m_treeOrderingRoot;
|
||||
@ -794,7 +794,7 @@ PdmUiItem* PdmUiTreeViewModel::uiItemFromModelIndex(const QModelIndex& index) co
|
||||
return treeItem->activeItem();
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -76,7 +76,7 @@ void caf::PdmUiWidgetBasedObjectEditor::recursivelyConfigureAndUpdateUiItemsInGr
|
||||
CAF_ASSERT(containerWidgetWithGridLayout);
|
||||
|
||||
int currentRowIndex = 0;
|
||||
QWidget* previousTabOrderWidget = NULL;
|
||||
QWidget* previousTabOrderWidget = nullptr;
|
||||
|
||||
// Currently, only QGridLayout is supported
|
||||
QGridLayout* parentLayout = dynamic_cast<QGridLayout*>(containerWidgetWithGridLayout->layout());
|
||||
@ -204,8 +204,8 @@ bool caf::PdmUiWidgetBasedObjectEditor::isUiGroupExpanded(const PdmUiGroup* uiGr
|
||||
QMinimizePanel* caf::PdmUiWidgetBasedObjectEditor::findOrCreateGroupBox(QWidget* parent, PdmUiGroup* group, const QString& uiConfigName)
|
||||
{
|
||||
QString groupBoxKey = group->keyword();
|
||||
QMinimizePanel* groupBox = NULL;
|
||||
QGridLayout* groupBoxLayout = NULL;
|
||||
QMinimizePanel* groupBox = nullptr;
|
||||
QGridLayout* groupBoxLayout = nullptr;
|
||||
|
||||
// Find or create groupBox
|
||||
std::map<QString, QPointer<QMinimizePanel> >::iterator it;
|
||||
@ -338,7 +338,7 @@ void caf::PdmUiWidgetBasedObjectEditor::configureAndUpdateUi(const QString& uiCo
|
||||
std::map<PdmFieldHandle*, PdmUiFieldEditorHandle*>::iterator it;
|
||||
for (it = m_fieldViews.begin(); it != m_fieldViews.end(); ++it)
|
||||
{
|
||||
it->second->setField(NULL);
|
||||
it->second->setField(nullptr);
|
||||
}
|
||||
|
||||
// Set all group Boxes to be unvisited
|
||||
@ -352,7 +352,7 @@ void caf::PdmUiWidgetBasedObjectEditor::configureAndUpdateUi(const QString& uiCo
|
||||
std::vector< PdmFieldHandle* > fvhToRemoveFromMap;
|
||||
for (it = m_fieldViews.begin(); it != m_fieldViews.end(); ++it)
|
||||
{
|
||||
if (it->second->field() == 0)
|
||||
if (it->second->field() == nullptr)
|
||||
{
|
||||
PdmUiFieldEditorHandle* fvh = it->second;
|
||||
delete fvh;
|
||||
|
@ -407,7 +407,7 @@ namespace caf {
|
||||
//progressDialog()->setWindowModality(Qt::ApplicationModal);
|
||||
progressDialog()->setMinimum(0);
|
||||
progressDialog()->setWindowTitle(title);
|
||||
progressDialog()->setCancelButton(NULL);
|
||||
progressDialog()->setCancelButton(nullptr);
|
||||
progressDialog()->show();
|
||||
}
|
||||
|
||||
@ -557,7 +557,7 @@ namespace caf {
|
||||
// If we are finishing the last level, clean up
|
||||
if (!maxProgressStack_v.size())
|
||||
{
|
||||
if (progressDialog() != NULL)
|
||||
if (progressDialog() != nullptr)
|
||||
{
|
||||
progressDialog()->reset();
|
||||
progressDialog()->close();
|
||||
|
@ -60,7 +60,7 @@ private:
|
||||
QTime m_timer;
|
||||
|
||||
public:
|
||||
explicit UiProcess(QObject* pParent = 0);
|
||||
explicit UiProcess(QObject* pParent = nullptr);
|
||||
|
||||
private:
|
||||
void doEmitStatusMsg(const QString& msg, int statusMsgType);
|
||||
|
Loading…
Reference in New Issue
Block a user