System : Fix name collision of macro expansion

The macro CAF_PDM_UI_FIELD_EDITOR_SOURCE_INIT expands to a variable name colliding with an identical variable name in a different file. Cotire put the two files into same file, and this causes compilation issues.

Fixed by removing some empty lines in one file, to make sure the two statements are defined at different lines.
This commit is contained in:
Magne Sjaastad 2018-11-01 19:56:55 +01:00
parent 9730048319
commit 78505bb44d

View File

@ -34,28 +34,23 @@
//
//##################################################################################################
#include "cafPdmUiCheckBoxEditor.h"
#include "cafPdmUiDefaultObjectEditor.h"
#include "cafPdmField.h"
#include "cafPdmObject.h"
#include "cafPdmUiFieldEditorHandle.h"
#include "cafPdmUiOrdering.h"
#include "cafPdmField.h"
#include "cafFactory.h"
namespace caf
{
CAF_PDM_UI_FIELD_EDITOR_SOURCE_INIT(PdmUiCheckBoxEditor);
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void PdmUiCheckBoxEditor::configureAndUpdateUi(const QString& uiConfigName)
{
@ -63,7 +58,7 @@ void PdmUiCheckBoxEditor::configureAndUpdateUi(const QString& uiConfigName)
CAF_ASSERT(!m_label.isNull());
PdmUiCheckBoxEditorAttribute attributes;
caf::PdmUiObjectHandle* uiObject = uiObj(uiField()->fieldHandle()->ownerObject());
caf::PdmUiObjectHandle* uiObject = uiObj(uiField()->fieldHandle()->ownerObject());
if (uiObject)
{
uiObject->editorAttribute(uiField()->fieldHandle(), uiConfigName, &attributes);
@ -78,7 +73,7 @@ void PdmUiCheckBoxEditor::configureAndUpdateUi(const QString& uiConfigName)
}
else
{
PdmUiFieldEditorHandle::updateLabelFromField(m_label, uiConfigName);
PdmUiFieldEditorHandle::updateLabelFromField(m_label, uiConfigName);
}
m_checkBox->setEnabled(!uiField()->isUiReadOnly(uiConfigName));
@ -87,11 +82,10 @@ void PdmUiCheckBoxEditor::configureAndUpdateUi(const QString& uiConfigName)
m_checkBox->setChecked(uiField()->uiValue().toBool());
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QWidget* PdmUiCheckBoxEditor::createEditorWidget(QWidget * parent)
QWidget* PdmUiCheckBoxEditor::createEditorWidget(QWidget* parent)
{
m_checkBox = new QCheckBox(parent);
connect(m_checkBox, SIGNAL(clicked(bool)), this, SLOT(slotClicked(bool)));
@ -99,16 +93,16 @@ QWidget* PdmUiCheckBoxEditor::createEditorWidget(QWidget * parent)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QWidget* PdmUiCheckBoxEditor::createLabelWidget(QWidget * parent)
QWidget* PdmUiCheckBoxEditor::createLabelWidget(QWidget* parent)
{
m_label = new QLabel(parent);
return m_label;
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void PdmUiCheckBoxEditor::slotClicked(bool checked)
{
@ -117,5 +111,4 @@ void PdmUiCheckBoxEditor::slotClicked(bool checked)
this->setValueToField(v);
}
} // end namespace caf