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