mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-11-15 10:08:34 +05:00
Correct implementation of Max Subshape limiter.
This commit is contained in:
parent
99c3d13441
commit
12cb4bfcdd
@ -83,7 +83,7 @@ StdMeshersGUI_SubShapeSelectorWdg
|
||||
::StdMeshersGUI_SubShapeSelectorWdg( QWidget * parent ):
|
||||
QWidget( parent ),
|
||||
myPreviewActor( 0 ),
|
||||
myMaxSize( 0 )
|
||||
myMaxSize( -1 )
|
||||
{
|
||||
QPixmap image0( SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap( "SMESH", tr( "ICON_SELECT" ) ) );
|
||||
|
||||
@ -270,7 +270,7 @@ void StdMeshersGUI_SubShapeSelectorWdg::onAdd()
|
||||
return;
|
||||
|
||||
myListWidget->blockSignals( true );
|
||||
for (int i = 0; i < mySelectedIDs.size() && (myMaxSize < 1 || myListOfIDs.size() < myMaxSize); i++) {
|
||||
for (int i = 0; i < mySelectedIDs.size() && (myMaxSize == -1 || myListOfIDs.size() < myMaxSize); i++) {
|
||||
if ( myListOfIDs.indexOf( mySelectedIDs.at(i) ) == -1 ) {
|
||||
QString anID = QString(" %1").arg( mySelectedIDs.at(i) );
|
||||
|
||||
@ -282,7 +282,7 @@ void StdMeshersGUI_SubShapeSelectorWdg::onAdd()
|
||||
}
|
||||
onListSelectionChanged();
|
||||
myListWidget->blockSignals( false );
|
||||
myAddButton->setEnabled( myListOfIDs.size() < myMaxSize );
|
||||
myAddButton->setEnabled( myMaxSize == -1 || myListOfIDs.size() < myMaxSize );
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
|
Loading…
Reference in New Issue
Block a user