mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4192 Add swap axis and update property editor
This commit is contained in:
parent
22f7bf7c21
commit
117731a24a
@ -821,6 +821,8 @@ void RimGridCrossPlotCurveSet::swapAxisProperties(bool updatePlot)
|
||||
m_yAxisProperty.removeChildObject(yAxisProperties);
|
||||
m_yAxisProperty = xAxisProperties;
|
||||
m_xAxisProperty = yAxisProperties;
|
||||
|
||||
updateConnectedEditors();
|
||||
loadDataAndUpdate(updatePlot);
|
||||
}
|
||||
|
||||
|
@ -222,6 +222,8 @@ void RiuGridCrossQwtPlot::contextMenuEvent(QContextMenuEvent* event)
|
||||
|
||||
caf::SelectionManager::instance()->setSelectedItem(ownerViewWindow());
|
||||
|
||||
menuBuilder << "RicSwapGridCrossPlotCurveSetAxesFeature";
|
||||
menuBuilder << "Separator";
|
||||
menuBuilder << "RicShowPlotDataFeature";
|
||||
|
||||
menuBuilder.appendToMenu(&menu);
|
||||
|
@ -17,6 +17,7 @@ include_directories (
|
||||
|
||||
# These headers need to go through Qt's MOC compiler
|
||||
set (MOC_HEADER_FILES
|
||||
cafPdmUiEditorHandle.h
|
||||
cafPdmUiFieldEditorHandle.h
|
||||
cafPdmUiSelection3dEditorVisualizer.h
|
||||
)
|
||||
|
@ -68,6 +68,8 @@ void PdmUiEditorHandle::updateUi(const QString& uiConfigName)
|
||||
m_currentConfigName = uiConfigName;
|
||||
this->configureAndUpdateUi(uiConfigName);
|
||||
m_isConfiguringUi = false;
|
||||
|
||||
emit uiUpdated();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -79,6 +81,8 @@ void PdmUiEditorHandle::updateUi()
|
||||
m_isConfiguringUi = true;
|
||||
this->configureAndUpdateUi(m_currentConfigName);
|
||||
m_isConfiguringUi = false;
|
||||
|
||||
emit uiUpdated();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -52,6 +52,7 @@ class PdmUiItem;
|
||||
|
||||
class PdmUiEditorHandle : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
PdmUiEditorHandle();
|
||||
~PdmUiEditorHandle() override;
|
||||
@ -60,6 +61,9 @@ public:
|
||||
void updateUi(const QString& uiConfigName);;
|
||||
void updateUi();
|
||||
|
||||
signals:
|
||||
void uiUpdated();
|
||||
|
||||
protected:
|
||||
// Interface to override:
|
||||
/// Virtual method to be overridden. Needs to set up the supplied widget
|
||||
|
@ -71,7 +71,7 @@ caf::PdmUiFormLayoutObjectEditor::~PdmUiFormLayoutObjectEditor()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void caf::PdmUiFormLayoutObjectEditor::scrollToSelectedItemsInFieldEditors() const
|
||||
void caf::PdmUiFormLayoutObjectEditor::slotScrollToSelectedItemsInFieldEditors() const
|
||||
{
|
||||
for (auto fieldView : m_fieldViews)
|
||||
{
|
||||
|
@ -66,7 +66,8 @@ public:
|
||||
PdmUiFormLayoutObjectEditor();
|
||||
~PdmUiFormLayoutObjectEditor() override;
|
||||
|
||||
void scrollToSelectedItemsInFieldEditors() const;
|
||||
public slots:
|
||||
void slotScrollToSelectedItemsInFieldEditors() const;
|
||||
|
||||
protected:
|
||||
/// When overriding this function, use findOrCreateGroupBox() or findOrCreateFieldEditor() for detailed control
|
||||
|
@ -43,7 +43,7 @@
|
||||
#include <QHBoxLayout>
|
||||
#include <QScrollArea>
|
||||
#include <QScrollBar>
|
||||
#include "QTimer"
|
||||
#include <QTimer>
|
||||
|
||||
|
||||
|
||||
@ -99,9 +99,6 @@ PdmUiPropertyView::PdmUiPropertyView(QWidget* parent, Qt::WindowFlags f)
|
||||
dummy->addWidget(scrollArea);
|
||||
|
||||
m_defaultObjectEditor = nullptr;
|
||||
|
||||
m_scrollToSelectedItemTimer = new QTimer(this);
|
||||
connect(m_scrollToSelectedItemTimer, SIGNAL(timeout()), this, SLOT(slotScrollToSelectedItemsInFieldEditors()));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -186,26 +183,20 @@ void PdmUiPropertyView::showProperties( PdmObjectHandle* object)
|
||||
}
|
||||
|
||||
m_defaultObjectEditor->setPdmObject(object);
|
||||
m_defaultObjectEditor->updateUi(m_uiConfigName);
|
||||
|
||||
if (object)
|
||||
{
|
||||
if (!m_scrollToSelectedItemTimer->isActive())
|
||||
{
|
||||
m_scrollToSelectedItemTimer->setSingleShot(true);
|
||||
m_scrollToSelectedItemTimer->start(150);
|
||||
}
|
||||
}
|
||||
QObject::connect(m_defaultObjectEditor, SIGNAL(uiUpdated()), this, SLOT(slotScheduleScrollToSelectedItemsInFieldEditors()));
|
||||
|
||||
m_defaultObjectEditor->updateUi(m_uiConfigName);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmUiPropertyView::slotScrollToSelectedItemsInFieldEditors()
|
||||
void PdmUiPropertyView::slotScheduleScrollToSelectedItemsInFieldEditors()
|
||||
{
|
||||
if (m_defaultObjectEditor)
|
||||
{
|
||||
m_defaultObjectEditor->scrollToSelectedItemsInFieldEditors();
|
||||
QTimer::singleShot(150, m_defaultObjectEditor, SLOT(slotScrollToSelectedItemsInFieldEditors()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -82,14 +82,13 @@ public:
|
||||
|
||||
public slots:
|
||||
void showProperties(caf::PdmObjectHandle* object); // Signal/Slot system needs caf:: prefix in some cases
|
||||
void slotScrollToSelectedItemsInFieldEditors();
|
||||
void slotScheduleScrollToSelectedItemsInFieldEditors();
|
||||
|
||||
private:
|
||||
PdmUiDefaultObjectEditor* m_defaultObjectEditor;
|
||||
QString m_uiConfigName;
|
||||
QPointer<QVBoxLayout> m_placeHolderLayout;
|
||||
QPointer<QWidget> m_placeholder;
|
||||
QTimer* m_scrollToSelectedItemTimer;
|
||||
};
|
||||
|
||||
} // End of namespace caf
|
||||
|
Loading…
Reference in New Issue
Block a user