Finally solve the selection desynchronisation problem.
* Bug: In CellViewer::setShowSelection(bool), this slot is connected to the hidden 's' menu key. It was toggling state according to the state of the *menu key* (Qt) which was *not* kept in synch with the state of the CellWidget. So it was causing desinchronized selection visibility toggle. Now, ignore the state of the menu and toggle the CellWidget state directly. * Bug: In Selector::attachTo(), when adding the new CellWidget to the map<>, the initial flag must be Selector::Selected instead of 0, so we see it. * Change: In CellWidget & ControllerWidget, adjust the default size of the widgets (to better suit my display...).
This commit is contained in:
parent
247ddb3a5c
commit
846ac49ab8
|
@ -754,10 +754,10 @@ namespace Hurricane {
|
|||
}
|
||||
|
||||
|
||||
void CellViewer::setShowSelection ( bool state )
|
||||
void CellViewer::setShowSelection ( bool )
|
||||
{
|
||||
_updateState = InternalEmit;
|
||||
_cellWidget->setShowSelection ( state );
|
||||
_cellWidget->setShowSelection ( not _cellWidget->showSelection() );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1128,8 +1128,8 @@ namespace Hurricane {
|
|||
_textFontHeight = QFontMetrics(font).ascent();
|
||||
|
||||
if (Graphics::isHighDpi()) {
|
||||
resize( Graphics::toHighDpi(Cfg::getParamInt("viewer.minimumSize",350)->asInt())
|
||||
, Graphics::toHighDpi(Cfg::getParamInt("viewer.minimumSize",350)->asInt()) );
|
||||
resize( Graphics::toHighDpi(Cfg::getParamInt("viewer.minimumSize",500)->asInt())
|
||||
, Graphics::toHighDpi(Cfg::getParamInt("viewer.minimumSize",500)->asInt()) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1285,7 +1285,6 @@ namespace Hurricane {
|
|||
_state->setShowSelection ( state );
|
||||
_selectionHasChanged = false;
|
||||
refresh ();
|
||||
|
||||
emit selectionModeChanged ();
|
||||
}
|
||||
}
|
||||
|
@ -1320,7 +1319,7 @@ namespace Hurricane {
|
|||
|
||||
void CellWidget::_redraw ( QRect redrawArea )
|
||||
{
|
||||
//cerr << "CellWidget::redraw() - start "
|
||||
//cerr << "CellWidget::_redraw() - start "
|
||||
// << _selectionHasChanged << " filter:"
|
||||
// << _state->getQueryFilter() << endl;
|
||||
|
||||
|
@ -2788,6 +2787,7 @@ namespace Hurricane {
|
|||
if ( occurrence.getOwnerCell() != getCell() )
|
||||
throw Error( "CellWidget::toggleSelection(): Occurrence do not belong to the loaded cell." );
|
||||
|
||||
cerr << "CellWidget::toggleSelection() " << occurrence << endl;
|
||||
Property* property = occurrence.getProperty( Selector::getPropertyName() );
|
||||
Selector* selector = NULL;
|
||||
if (not property) {
|
||||
|
|
|
@ -605,7 +605,7 @@ namespace Hurricane {
|
|||
|
||||
Graphics::getGraphics()->addObserver( &_observer );
|
||||
|
||||
resize( Graphics::toHighDpi(620), Graphics::toHighDpi(500) );
|
||||
resize( Graphics::toHighDpi(1000), Graphics::toHighDpi(700) );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -186,7 +186,7 @@ namespace Hurricane {
|
|||
if (not widget)
|
||||
throw Error( "Selector::attachTo(): Cannot attach, NULL widget argument." );
|
||||
|
||||
_cellWidgets.insert( make_pair(widget,0) );
|
||||
_cellWidgets.insert( make_pair(widget,Selected) );
|
||||
widget->getSelectorSet().insert( this );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue