mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4972 Summary : Add placeholder text to combo box editor
This commit is contained in:
parent
ee3f6a5a43
commit
a950852559
@ -438,28 +438,16 @@ void RimSummaryPlotFilterTextCurveSetEditor::defineEditorAttribute( const caf::P
|
||||
{
|
||||
if ( field == &m_curveFilterText )
|
||||
{
|
||||
auto attr = dynamic_cast<caf::PdmUiComboBoxEditorAttribute*>( attribute );
|
||||
if ( attr )
|
||||
{
|
||||
auto attr = dynamic_cast<caf::PdmUiLineEditorAttribute*>( attribute );
|
||||
if ( attr )
|
||||
{
|
||||
if ( uiConfigName == caf::PdmUiToolBarEditor::uiEditorConfigName() )
|
||||
{
|
||||
// Special config for toolbar
|
||||
attr->maximumWidth = 150;
|
||||
}
|
||||
attr->enableEditableContent = true;
|
||||
attr->adjustWidthToContents = true;
|
||||
attr->placeholderText = "Click to edit curves";
|
||||
|
||||
attr->selectAllOnFocusEvent = true;
|
||||
attr->placeholderText = "Click to define filter";
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
auto attr = dynamic_cast<caf::PdmUiComboBoxEditorAttribute*>( attribute );
|
||||
if ( attr )
|
||||
if ( uiConfigName == caf::PdmUiToolBarEditor::uiEditorConfigName() )
|
||||
{
|
||||
attr->enableEditableContent = true;
|
||||
attr->adjustWidthToContents = true;
|
||||
attr->minimumWidth = 140;
|
||||
attr->minimumWidth = 140;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -48,6 +48,7 @@
|
||||
#include <QComboBox>
|
||||
#include <QDebug>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QListView>
|
||||
#include <QWheelEvent>
|
||||
|
||||
@ -234,6 +235,8 @@ void PdmUiComboBoxEditor::configureAndUpdateUi(const QString& uiConfigName)
|
||||
if (m_attributes.enableEditableContent)
|
||||
{
|
||||
m_comboBox->setEditable(true);
|
||||
|
||||
m_comboBox->lineEdit()->setPlaceholderText(m_attributes.placeholderText);
|
||||
}
|
||||
|
||||
if (m_attributes.minimumWidth != -1)
|
||||
|
@ -74,6 +74,7 @@ public:
|
||||
|
||||
bool enableEditableContent;
|
||||
int minimumWidth;
|
||||
QString placeholderText;
|
||||
QString nextButtonText;
|
||||
QString prevButtonText;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user