Forgot emiting "layoutAbouttobechanged" in NetlistModel::setCell().

* Bug: In NetlistModel::setCell() template, forgot to send the
    "layoutAboutToBeChanged" signal before disconnecting the
    netlist datas. This seemed to go unnoticed until ported
    under Qt5. Was generating strange random core dump when
    running the engines with a net kept selected. Disgraceful
    crash during demos...
This commit is contained in:
Jean-Paul Chaput 2022-01-26 19:41:39 +01:00
parent 7f936367f8
commit fd624f03b6
3 changed files with 18 additions and 16 deletions

View File

@ -218,32 +218,32 @@ namespace Hurricane {
void TabNetlist::setSyncNetlist ( bool state )
{
if ( state and getCellWidget() ) {
_netlistBrowser->setCell<SimpleNetInformations> ( getCellWidget()->getCell() );
if (state and getCellWidget()) {
_netlistBrowser->setCell<SimpleNetInformations>( getCellWidget()->getCell() );
} else {
_netlistBrowser->setCell<SimpleNetInformations> ( NULL );
_netlistBrowser->setCell<SimpleNetInformations>( NULL );
}
}
void TabNetlist::setSyncSelection ( bool state )
{
if ( state and getCellWidget() and _syncNetlist->isChecked() ) {
if (state and getCellWidget() and _syncNetlist->isChecked()) {
_cwCumulativeSelection = getCellWidget()->cumulativeSelection();
if ( not _cwCumulativeSelection ) {
if (not _cwCumulativeSelection) {
getCellWidget()->openRefreshSession ();
getCellWidget()->unselectAll ();
getCellWidget()->closeRefreshSession ();
}
getCellWidget()->setShowSelection ( true );
connect ( _netlistBrowser, SIGNAL(netSelected (Occurrence)), getCellWidget(), SLOT(select (Occurrence)) );
connect ( _netlistBrowser, SIGNAL(netUnselected(Occurrence)), getCellWidget(), SLOT(unselect(Occurrence)) );
_netlistBrowser->updateSelecteds ();
getCellWidget()->setShowSelection( true );
connect( _netlistBrowser, SIGNAL(netSelected (Occurrence)), getCellWidget(), SLOT(select (Occurrence)) );
connect( _netlistBrowser, SIGNAL(netUnselected(Occurrence)), getCellWidget(), SLOT(unselect(Occurrence)) );
_netlistBrowser->updateSelecteds();
} else {
getCellWidget()->setShowSelection ( false );
getCellWidget()->setCumulativeSelection ( _cwCumulativeSelection );
_netlistBrowser->disconnect ( getCellWidget(), SLOT(select (Occurrence)) );
_netlistBrowser->disconnect ( getCellWidget(), SLOT(unselect(Occurrence)) );
getCellWidget()->setShowSelection( false );
getCellWidget()->setCumulativeSelection( _cwCumulativeSelection );
_netlistBrowser->disconnect( getCellWidget(), SLOT(select (Occurrence)) );
_netlistBrowser->disconnect( getCellWidget(), SLOT(unselect(Occurrence)) );
}
}
@ -269,13 +269,13 @@ namespace Hurricane {
void TabNetlist::cellPreModificate ()
{
_netlistBrowser->setCell<SimpleNetInformations> ( NULL );
_netlistBrowser->setCell<SimpleNetInformations>( NULL );
}
void TabNetlist::cellPostModificate ()
{
setSyncNetlist ( _syncNetlist->isChecked() );
setSyncNetlist( _syncNetlist->isChecked() );
}

View File

@ -178,7 +178,7 @@ namespace Hurricane {
void NetlistWidget::textFilterChanged ()
{
_sortModel->setFilterRegExp ( _filterPatternLineEdit->text() );
_sortModel->setFilterRegExp( _filterPatternLineEdit->text() );
//updateSelecteds ();
}

View File

@ -67,6 +67,8 @@ namespace Hurricane {
void NetlistModel::setCell ( Cell* cell )
{
if (_cell != cell) {
emit layoutAboutToBeChanged ();
if (_cell) delete _netlist;
_cell = cell;