mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Make sure ensemble is checked when a realization is checked
This commit is contained in:
parent
488a5a192a
commit
00c70a6da6
@ -287,6 +287,7 @@ RicRecursiveFileSearchDialogResult RicRecursiveFileSearchDialog::runRecursiveSea
|
||||
RicRecursiveFileSearchDialog::RicRecursiveFileSearchDialog( QWidget* parent, const std::vector<FileType>& fileTypes )
|
||||
: QDialog( parent, RiuTools::defaultDialogFlags() )
|
||||
, m_incomingFileTypes( fileTypes )
|
||||
, m_blockUpdateOfOtherItems( false )
|
||||
{
|
||||
// Create widgets
|
||||
m_browseButton = new QPushButton();
|
||||
@ -359,12 +360,25 @@ RicRecursiveFileSearchDialog::RicRecursiveFileSearchDialog( QWidget* parent, con
|
||||
|
||||
QObject::connect( &m_filePathModel,
|
||||
&QStandardItemModel::itemChanged,
|
||||
[]( QStandardItem* item )
|
||||
[this]( QStandardItem* item )
|
||||
{
|
||||
if ( m_blockUpdateOfOtherItems ) return;
|
||||
|
||||
if ( item->isCheckable() )
|
||||
{
|
||||
setCheckedStateChildItems( item, item->checkState() );
|
||||
}
|
||||
|
||||
if ( item->checkState() == Qt::Checked )
|
||||
{
|
||||
auto parent = item->parent();
|
||||
if ( parent )
|
||||
{
|
||||
m_blockUpdateOfOtherItems = true;
|
||||
parent->setCheckState( Qt::Checked );
|
||||
m_blockUpdateOfOtherItems = false;
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
m_fileTreeView->setModel( &m_filePathModel );
|
||||
|
@ -175,6 +175,7 @@ private:
|
||||
FileType m_fileType;
|
||||
|
||||
bool m_isCancelPressed;
|
||||
bool m_blockUpdateOfOtherItems;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
|
Loading…
Reference in New Issue
Block a user