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
@ -437,28 +437,16 @@ void RimSummaryPlotFilterTextCurveSetEditor::defineEditorAttribute( const caf::P
|
|||||||
caf::PdmUiEditorAttribute* attribute )
|
caf::PdmUiEditorAttribute* attribute )
|
||||||
{
|
{
|
||||||
if ( field == &m_curveFilterText )
|
if ( field == &m_curveFilterText )
|
||||||
{
|
|
||||||
{
|
|
||||||
auto attr = dynamic_cast<caf::PdmUiLineEditorAttribute*>( attribute );
|
|
||||||
if ( attr )
|
|
||||||
{
|
|
||||||
if ( uiConfigName == caf::PdmUiToolBarEditor::uiEditorConfigName() )
|
|
||||||
{
|
|
||||||
// Special config for toolbar
|
|
||||||
attr->maximumWidth = 150;
|
|
||||||
}
|
|
||||||
|
|
||||||
attr->selectAllOnFocusEvent = true;
|
|
||||||
attr->placeholderText = "Click to define filter";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
auto attr = dynamic_cast<caf::PdmUiComboBoxEditorAttribute*>( attribute );
|
auto attr = dynamic_cast<caf::PdmUiComboBoxEditorAttribute*>( attribute );
|
||||||
if ( attr )
|
if ( attr )
|
||||||
{
|
{
|
||||||
attr->enableEditableContent = true;
|
attr->enableEditableContent = true;
|
||||||
attr->adjustWidthToContents = true;
|
attr->adjustWidthToContents = true;
|
||||||
|
attr->placeholderText = "Click to edit curves";
|
||||||
|
|
||||||
|
if ( uiConfigName == caf::PdmUiToolBarEditor::uiEditorConfigName() )
|
||||||
|
{
|
||||||
attr->minimumWidth = 140;
|
attr->minimumWidth = 140;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,7 @@
|
|||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
#include <QLineEdit>
|
||||||
#include <QListView>
|
#include <QListView>
|
||||||
#include <QWheelEvent>
|
#include <QWheelEvent>
|
||||||
|
|
||||||
@ -234,6 +235,8 @@ void PdmUiComboBoxEditor::configureAndUpdateUi(const QString& uiConfigName)
|
|||||||
if (m_attributes.enableEditableContent)
|
if (m_attributes.enableEditableContent)
|
||||||
{
|
{
|
||||||
m_comboBox->setEditable(true);
|
m_comboBox->setEditable(true);
|
||||||
|
|
||||||
|
m_comboBox->lineEdit()->setPlaceholderText(m_attributes.placeholderText);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_attributes.minimumWidth != -1)
|
if (m_attributes.minimumWidth != -1)
|
||||||
|
@ -74,6 +74,7 @@ public:
|
|||||||
|
|
||||||
bool enableEditableContent;
|
bool enableEditableContent;
|
||||||
int minimumWidth;
|
int minimumWidth;
|
||||||
|
QString placeholderText;
|
||||||
QString nextButtonText;
|
QString nextButtonText;
|
||||||
QString prevButtonText;
|
QString prevButtonText;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user