mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#12075 When activating an item, also select the item
This commit is contained in:
parent
d17ecc4345
commit
533885239d
@ -1290,10 +1290,9 @@ void RiuSummaryVectorSelectionUi::defineEditorAttribute( const caf::PdmFieldHand
|
||||
{
|
||||
if ( &m_selectedSummaryCategories == field )
|
||||
{
|
||||
attrib->currentIndexFieldHandle = &m_currentSummaryCategory;
|
||||
attrib->showTextFilter = false;
|
||||
attrib->showToggleAllCheckbox = false;
|
||||
attrib->setCurrentIndexWhenItemIsChecked = true;
|
||||
attrib->currentIndexFieldHandle = &m_currentSummaryCategory;
|
||||
attrib->showTextFilter = false;
|
||||
attrib->showToggleAllCheckbox = false;
|
||||
}
|
||||
|
||||
// All tree selection editors are set in specified selection mode
|
||||
|
@ -354,8 +354,6 @@ QWidget* PdmUiTreeSelectionEditor::createEditorWidget( QWidget* parent )
|
||||
headerLayout->setContentsMargins( 0, 0, 0, 0 );
|
||||
layout->addLayout( headerLayout );
|
||||
|
||||
PdmUiTreeSelectionEditorAttribute attrib;
|
||||
|
||||
m_toggleAllCheckBox = new QCheckBox();
|
||||
headerLayout->addWidget( m_toggleAllCheckBox );
|
||||
|
||||
@ -715,7 +713,7 @@ void PdmUiTreeSelectionEditor::slotClicked( const QModelIndex& index )
|
||||
return;
|
||||
}
|
||||
|
||||
if ( m_attributes.setCurrentIndexWhenItemIsChecked && index.isValid() )
|
||||
if ( index.isValid() )
|
||||
{
|
||||
QModelIndexList selectedIndexes = m_treeView->selectionModel()->selectedIndexes();
|
||||
if ( selectedIndexes.size() < 2 )
|
||||
@ -723,6 +721,7 @@ void PdmUiTreeSelectionEditor::slotClicked( const QModelIndex& index )
|
||||
QVariant v = m_proxyModel->data( index, Qt::CheckStateRole );
|
||||
if ( v == Qt::Checked )
|
||||
{
|
||||
// Make sure the activated item also is selected in the tree view
|
||||
m_treeView->setCurrentIndex( index );
|
||||
}
|
||||
}
|
||||
|
@ -63,7 +63,6 @@ public:
|
||||
bool showTextFilter;
|
||||
bool showToggleAllCheckbox;
|
||||
bool singleSelectionMode;
|
||||
bool setCurrentIndexWhenItemIsChecked;
|
||||
bool showCheckBoxes;
|
||||
bool showContextMenu;
|
||||
int heightHint;
|
||||
@ -77,13 +76,12 @@ public:
|
||||
public:
|
||||
PdmUiTreeSelectionEditorAttribute()
|
||||
{
|
||||
showTextFilter = true;
|
||||
showToggleAllCheckbox = true;
|
||||
singleSelectionMode = false;
|
||||
setCurrentIndexWhenItemIsChecked = false;
|
||||
showCheckBoxes = true;
|
||||
showContextMenu = true;
|
||||
heightHint = -1;
|
||||
showTextFilter = true;
|
||||
showToggleAllCheckbox = true;
|
||||
singleSelectionMode = false;
|
||||
showCheckBoxes = true;
|
||||
showContextMenu = true;
|
||||
heightHint = -1;
|
||||
|
||||
currentIndexFieldHandle = nullptr;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user