mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Revert "#3564 System : Recreate QGridLayout for each property editor"
This reverts commit f6c92a15a6.
This commit is contained in:
@@ -50,6 +50,7 @@
|
||||
|
||||
namespace caf
|
||||
{
|
||||
|
||||
// Register default field editor for selected types
|
||||
CAF_PDM_UI_REGISTER_DEFAULT_FIELD_EDITOR(PdmUiCheckBoxEditor, bool);
|
||||
|
||||
@@ -67,50 +68,43 @@ CAF_PDM_UI_REGISTER_DEFAULT_FIELD_EDITOR(PdmUiListEditor, std::vector<float>);
|
||||
|
||||
CAF_PDM_UI_REGISTER_DEFAULT_FIELD_EDITOR(PdmUiFilePathEditor, FilePath);
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
PdmUiDefaultObjectEditor::PdmUiDefaultObjectEditor() {}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
PdmUiDefaultObjectEditor::~PdmUiDefaultObjectEditor() {}
|
||||
PdmUiDefaultObjectEditor::PdmUiDefaultObjectEditor()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
PdmUiDefaultObjectEditor::~PdmUiDefaultObjectEditor()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QWidget* PdmUiDefaultObjectEditor::createWidget(QWidget* parent)
|
||||
{
|
||||
QWidget* widget = new QWidget(parent);
|
||||
|
||||
|
||||
QGridLayout* gridLayout = new QGridLayout();
|
||||
gridLayout->setContentsMargins(0, 0, 0, 0);
|
||||
widget->setLayout(gridLayout);
|
||||
|
||||
return widget;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmUiDefaultObjectEditor::recursivelyConfigureAndUpdateTopLevelUiOrdering(const PdmUiOrdering& topLevelUiOrdering,
|
||||
const QString& uiConfigName)
|
||||
void PdmUiDefaultObjectEditor::recursivelyConfigureAndUpdateTopLevelUiOrdering(const PdmUiOrdering& topLevelUiOrdering, const QString& uiConfigName)
|
||||
{
|
||||
CAF_ASSERT(this->widget());
|
||||
|
||||
// Recreate layout object, as the content of the grid layout grows. This causes Cell Result to have a lot of space at the
|
||||
// bottom and no other solution has been found. Similar issues might also be the case for the grid layout inside group boxes
|
||||
{
|
||||
auto currentLayout = this->widget()->layout();
|
||||
if (currentLayout)
|
||||
{
|
||||
delete currentLayout;
|
||||
}
|
||||
}
|
||||
|
||||
CAF_ASSERT(this->widget()->layout() == nullptr);
|
||||
|
||||
QGridLayout* gridLayout = new QGridLayout();
|
||||
gridLayout->setContentsMargins(0, 0, 0, 0);
|
||||
this->widget()->setLayout(gridLayout);
|
||||
|
||||
recursivelyConfigureAndUpdateUiOrderingInGridLayoutColumn(topLevelUiOrdering, this->widget(), uiConfigName);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
//
|
||||
//##################################################################################################
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafPdmUiFormLayoutObjectEditor.h"
|
||||
@@ -43,12 +44,14 @@
|
||||
class QGridLayout;
|
||||
class QString;
|
||||
|
||||
namespace caf
|
||||
namespace caf
|
||||
{
|
||||
|
||||
class PdmUiFieldEditorHandle;
|
||||
class PdmUiItem;
|
||||
class PdmUiGroup;
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
/// The default editor for PdmObjects. Manages the field editors in a grid layout vertically
|
||||
//==================================================================================================
|
||||
@@ -62,7 +65,9 @@ public:
|
||||
private:
|
||||
QWidget* createWidget(QWidget* parent) override;
|
||||
void recursivelyConfigureAndUpdateTopLevelUiOrdering(const PdmUiOrdering& topLevelUiItems,
|
||||
const QString& uiConfigName) override;
|
||||
const QString& uiConfigName) override;
|
||||
|
||||
};
|
||||
|
||||
|
||||
} // end namespace caf
|
||||
|
||||
Reference in New Issue
Block a user