mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2292 AppFwk : Fixed copyright and improved whitespace
This commit is contained in:
parent
695978ed95
commit
79818cecac
@ -1,7 +1,7 @@
|
||||
//##################################################################################################
|
||||
//
|
||||
// Custom Visualization Core library
|
||||
// Copyright (C) 2011-2013 Ceetron AS
|
||||
// Copyright (C) Ceetron Solutions AS
|
||||
//
|
||||
// This library may be used under the terms of either the GNU General Public License or
|
||||
// the GNU Lesser General Public License as follows:
|
||||
@ -34,30 +34,36 @@
|
||||
//
|
||||
//##################################################################################################
|
||||
|
||||
|
||||
#include "cafPdmUiDoubleValueEditor.h"
|
||||
|
||||
#include "cafPdmUiDefaultObjectEditor.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmUiFieldEditorHandle.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmUiDefaultObjectEditor.h"
|
||||
#include "cafPdmUiFieldEditorHandle.h"
|
||||
|
||||
#include "cafFactory.h"
|
||||
|
||||
#include <QLineEdit>
|
||||
#include <QLabel>
|
||||
#include <QHBoxLayout>
|
||||
#include <QDoubleValidator>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
|
||||
namespace caf
|
||||
{
|
||||
|
||||
CAF_PDM_UI_FIELD_EDITOR_SOURCE_INIT(PdmUiDoubleValueEditor);
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
PdmUiDoubleValueEditor::PdmUiDoubleValueEditor() {}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
PdmUiDoubleValueEditor::~PdmUiDoubleValueEditor() {}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmUiDoubleValueEditor::configureAndUpdateUi(const QString& uiConfigName)
|
||||
{
|
||||
@ -72,9 +78,9 @@ void PdmUiDoubleValueEditor::configureAndUpdateUi(const QString& uiConfigName)
|
||||
{
|
||||
uiObject->editorAttribute(field()->fieldHandle(), uiConfigName, &m_attributes);
|
||||
}
|
||||
|
||||
bool valueOk = false;
|
||||
double value = field()->uiValue().toDouble(&valueOk);
|
||||
|
||||
bool valueOk = false;
|
||||
double value = field()->uiValue().toDouble(&valueOk);
|
||||
QString textValue;
|
||||
if (valueOk)
|
||||
{
|
||||
@ -84,13 +90,14 @@ void PdmUiDoubleValueEditor::configureAndUpdateUi(const QString& uiConfigName)
|
||||
{
|
||||
textValue = field()->uiValue().toString();
|
||||
}
|
||||
|
||||
m_lineEdit->setText(textValue);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QWidget* PdmUiDoubleValueEditor::createEditorWidget(QWidget * parent)
|
||||
QWidget* PdmUiDoubleValueEditor::createEditorWidget(QWidget* parent)
|
||||
{
|
||||
QWidget* containerWidget = new QWidget(parent);
|
||||
|
||||
@ -107,17 +114,16 @@ QWidget* PdmUiDoubleValueEditor::createEditorWidget(QWidget * parent)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QWidget* PdmUiDoubleValueEditor::createLabelWidget(QWidget * parent)
|
||||
QWidget* PdmUiDoubleValueEditor::createLabelWidget(QWidget* parent)
|
||||
{
|
||||
m_label = new QLabel(parent);
|
||||
return m_label;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmUiDoubleValueEditor::slotEditingFinished()
|
||||
{
|
||||
@ -125,11 +131,11 @@ void PdmUiDoubleValueEditor::slotEditingFinished()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmUiDoubleValueEditor::writeValueToField()
|
||||
{
|
||||
QString textValue = m_lineEdit->text();
|
||||
QString textValue = m_lineEdit->text();
|
||||
QVariant v;
|
||||
v = textValue;
|
||||
this->setValueToField(v);
|
||||
|
@ -1,7 +1,7 @@
|
||||
//##################################################################################################
|
||||
//
|
||||
// Custom Visualization Core library
|
||||
// Copyright (C) 2011-2013 Ceetron AS
|
||||
// Copyright (C) Ceetron Solutions AS
|
||||
//
|
||||
// This library may be used under the terms of either the GNU General Public License or
|
||||
// the GNU Lesser General Public License as follows:
|
||||
@ -34,25 +34,22 @@
|
||||
//
|
||||
//##################################################################################################
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafPdmUiFieldEditorHandle.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QLabel>
|
||||
#include <QWidget>
|
||||
#include <QPointer>
|
||||
#include <QLineEdit>
|
||||
#include <QGroupBox>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QPointer>
|
||||
#include <QString>
|
||||
#include <QWidget>
|
||||
|
||||
|
||||
namespace caf
|
||||
namespace caf
|
||||
{
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
|
||||
class PdmUiDoubleValueEditorAttribute : public PdmUiEditorAttribute
|
||||
{
|
||||
public:
|
||||
@ -62,29 +59,31 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
int m_decimals;
|
||||
int m_decimals;
|
||||
};
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class PdmUiDoubleValueEditor : public PdmUiFieldEditorHandle
|
||||
{
|
||||
Q_OBJECT
|
||||
CAF_PDM_UI_FIELD_EDITOR_HEADER_INIT;
|
||||
|
||||
public:
|
||||
PdmUiDoubleValueEditor() {}
|
||||
virtual ~PdmUiDoubleValueEditor() {}
|
||||
PdmUiDoubleValueEditor();
|
||||
virtual ~PdmUiDoubleValueEditor();
|
||||
|
||||
protected:
|
||||
virtual void configureAndUpdateUi(const QString& uiConfigName);
|
||||
virtual QWidget* createEditorWidget(QWidget * parent);
|
||||
virtual QWidget* createLabelWidget(QWidget * parent);
|
||||
void configureAndUpdateUi(const QString& uiConfigName) override;
|
||||
QWidget* createEditorWidget(QWidget* parent) override;
|
||||
QWidget* createLabelWidget(QWidget* parent) override;
|
||||
|
||||
protected slots:
|
||||
void slotEditingFinished();
|
||||
void slotEditingFinished();
|
||||
|
||||
private:
|
||||
void writeValueToField();
|
||||
void writeValueToField();
|
||||
|
||||
private:
|
||||
QPointer<QLineEdit> m_lineEdit;
|
||||
@ -93,5 +92,4 @@ private:
|
||||
PdmUiDoubleValueEditorAttribute m_attributes;
|
||||
};
|
||||
|
||||
|
||||
} // end namespace caf
|
||||
|
Loading…
Reference in New Issue
Block a user