mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
* Adjust the max value for summary curves to get more space on top of plot * Compute axis range before computing auto plot settings * Use axis object name as key when computing aggregated min/max * Guard infinite recursion for enableAutoValue()
61 lines
2.1 KiB
C++
61 lines
2.1 KiB
C++
#pragma once
|
|
|
|
#include "cafPdmFieldCapability.h"
|
|
#include "cafPdmUiFieldHandleInterface.h"
|
|
#include "cafPdmUiItem.h"
|
|
|
|
namespace caf
|
|
{
|
|
class PdmFieldHandle;
|
|
|
|
class PdmUiFieldHandle : public PdmUiItem, public PdmFieldCapability, public PdmUiFieldHandleInterface
|
|
{
|
|
public:
|
|
PdmUiFieldHandle( PdmFieldHandle* owner, bool giveOwnership );
|
|
~PdmUiFieldHandle() override;
|
|
|
|
PdmFieldHandle* fieldHandle();
|
|
|
|
// Generalized access methods for User interface
|
|
// The QVariant encapsulates the real value, or an index into the valueOptions
|
|
|
|
virtual QVariant uiValue() const;
|
|
virtual QList<PdmOptionItemInfo> valueOptions() const;
|
|
|
|
void notifyFieldChanged( const QVariant& oldUiBasedQVariant, const QVariant& newUiBasedQVariant ) override;
|
|
|
|
bool isAutoAddingOptionFromValue() const;
|
|
void setAutoAddingOptionFromValue( bool isAddingValue );
|
|
|
|
void enableAndSetAutoValue( const QVariant& autoValue );
|
|
void setAutoValue( const QVariant& autoValue, bool notifyFieldChanged = true );
|
|
QVariant autoValue() const;
|
|
void enableAutoValue( bool enable, bool notifyFieldChanged = true );
|
|
bool isAutoValueEnabled() const;
|
|
void enableAutoValueSupport( bool enable );
|
|
bool isAutoValueSupported() const;
|
|
|
|
std::vector<std::pair<QString, QString>> attributes() const override;
|
|
void setAttributes( const std::vector<std::pair<QString, QString>>& attributes ) override;
|
|
|
|
private:
|
|
friend class PdmUiCommandSystemProxy;
|
|
friend class CmdFieldChangeExec;
|
|
virtual void setValueFromUiEditor( const QVariant& uiValue, bool notifyFieldChanged );
|
|
// This is needed to handle custom types in QVariants since operator == between QVariant does not work when they use
|
|
// custom types.
|
|
virtual bool isQVariantDataEqual( const QVariant& oldUiBasedQVariant, const QVariant& newUiBasedQVariant ) const;
|
|
|
|
void applyAutoValueAndUpdateEditors( bool notifyFieldChanged );
|
|
|
|
private:
|
|
PdmFieldHandle* m_owner;
|
|
bool m_isAutoAddingOptionFromValue;
|
|
|
|
QVariant m_autoValue;
|
|
bool m_useAutoValue;
|
|
bool m_isAutoValueSupported;
|
|
};
|
|
|
|
} // End of namespace caf
|