: QDoubleSpinBox( parent ),
myCleared( false )
{
+ // VSR 01/07/2010: Disable thousands separator for spin box
+ // (to avoid incosistency of double-2-string and string-2-double conversion)
+ QLocale loc;
+ loc.setNumberOptions(loc.numberOptions() | QLocale::OmitGroupSeparator | QLocale::RejectGroupSeparator);
+ setLocale(loc);
+
// Use precision equal to default Qt decimals
myPrecision = decimals();
: QDoubleSpinBox( parent ),
myCleared( false )
{
+ // VSR 01/07/2010: Disable thousands separator for spin box
+ // (to avoid incosistency of double-2-string and string-2-double conversion)
+ QLocale loc;
+ loc.setNumberOptions(loc.numberOptions() | QLocale::OmitGroupSeparator | QLocale::RejectGroupSeparator);
+ setLocale(loc);
+
// Use precision equal to default Qt decimals
myPrecision = decimals();
myCleared( false ),
myPrecision( prec )
{
+ // VSR 01/07/2010: Disable thousands separator for spin box
+ // (to avoid incosistency of double-2-string and string-2-double conversion)
+ QLocale loc;
+ loc.setNumberOptions(loc.numberOptions() | QLocale::OmitGroupSeparator | QLocale::RejectGroupSeparator);
+ setLocale(loc);
+
setDecimals( dec );
setMinimum( min );
setMaximum( max );
*/
QString QtxDoubleSpinBox::textFromValue( double val ) const
{
- QString s = QLocale().toString( val, myPrecision >= 0 ? 'f' : 'g', qAbs( myPrecision ) );
+ QString s = locale().toString( val, myPrecision >= 0 ? 'f' : 'g', qAbs( myPrecision ) );
return removeTrailingZeroes( s );
}
*/
QString QtxDoubleSpinBox::removeTrailingZeroes( const QString& src ) const
{
- QString delim( QLocale().decimalPoint() );
+ QString delim( locale().decimalPoint() );
int idx = src.lastIndexOf( delim );
if ( idx == -1 )
}
else if ( myPrecision < 0 ){
// Consider too large negative exponent as Invalid
- QChar e( QLocale().exponential() );
+ QChar e( locale().exponential() );
int epos = str.indexOf( e, 0, Qt::CaseInsensitive );
if ( epos != -1 ){
epos++; // Skip exponential symbol itself
if( !theIsHighlight ) {
SetPreSelected( false );
- VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
- vtkActorCollection* theActors = aCopy.GetActors();
- theActors->InitTraversal();
- while( vtkActor *ac = theActors->GetNextActor() )
- if( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac ) )
- if( anActor->hasIO() && myIO->isSame( anActor->getIO() ) )
- anActor->SetPreSelected( false );
-
+ if ( hasIO() ) {
+ VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+ vtkActorCollection* theActors = aCopy.GetActors();
+ theActors->InitTraversal();
+ while( vtkActor *ac = theActors->GetNextActor() )
+ if( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac ) )
+ if( anActor->hasIO() && myIO->isSame( anActor->getIO() ) )
+ anActor->SetPreSelected( false );
+ }
}else{
switch(aSelectionMode) {
case NodeSelection:
if( !mySelector->IsSelected( myIO ) ) {
SetPreSelected( true );
- VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
- vtkActorCollection* theActors = aCopy.GetActors();
- theActors->InitTraversal();
- while( vtkActor *anAct = theActors->GetNextActor() ) {
- if( anAct != this )
- if( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( anAct ) )
- if( anActor->hasIO() && myIO->isSame( anActor->getIO() ) )
- anActor->SetPreSelected( true );
- }
+ if ( hasIO() ) {
+ VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+ vtkActorCollection* theActors = aCopy.GetActors();
+ theActors->InitTraversal();
+ while( vtkActor *anAct = theActors->GetNextActor() ) {
+ if( anAct != this )
+ if( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( anAct ) )
+ if( anActor->hasIO() && myIO->isSame( anActor->getIO() ) )
+ anActor->SetPreSelected( true );
+ }
+ }
}
}
default:
int aVtkId = myPointPicker->GetPointId();
if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId, true ) ) {
int anObjId = GetNodeObjId( aVtkId );
- if( anObjId >= 0 ) {
+ if( hasIO() && anObjId >= 0 ) {
mySelector->AddOrRemoveIndex( myIO, anObjId, anIsShift );
mySelector->AddIObject( this );
}
if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId ) ) {
int anObjId = GetElemObjId( aVtkId );
if( anObjId >= 0 ) {
- if ( CheckDimensionId(aSelectionMode,this,anObjId) ) {
+ if ( hasIO() && CheckDimensionId(aSelectionMode,this,anObjId) ) {
mySelector->AddOrRemoveIndex( myIO, anObjId, anIsShift );
mySelector->AddIObject( this );
}
int anObjId = GetElemObjId( aVtkId );
if( anObjId >= 0 ) {
int anEdgeId = GetEdgeId(this,myCellPicker.GetPointer(),anObjId);
- if( anEdgeId < 0 ) {
+ if( hasIO() && anEdgeId < 0 ) {
mySelector->AddOrRemoveIndex( myIO, anObjId, false );
mySelector->AddOrRemoveIndex( myIO, anEdgeId, true );
mySelector->AddIObject( this );
}
case ActorSelection :
{
- if( mySelector->IsSelected( myIO ) && anIsShift )
- mySelector->RemoveIObject( this );
- else {
- mySelector->AddIObject( this );
+ if ( hasIO() ) {
+ if( mySelector->IsSelected( myIO ) && anIsShift )
+ mySelector->RemoveIObject( this );
+ else {
+ mySelector->AddIObject( this );
+ }
}
break;
}
}
}
- if( !anIndexes.IsEmpty() ) {
- mySelector->AddOrRemoveIndex( myIO, anIndexes, anIsShift );
- mySelector->AddIObject( this );
- anIndexes.Clear();
+ if ( hasIO() ) {
+ if( !anIndexes.IsEmpty() ) {
+ mySelector->AddOrRemoveIndex( myIO, anIndexes, anIsShift );
+ mySelector->AddIObject( this );
+ anIndexes.Clear();
+ }
+ else if ( !anIsShift )
+ mySelector->RemoveIObject( this );
}
- else if ( !anIsShift )
- mySelector->RemoveIObject( this );
-
break;
}
case ActorSelection :
}
}
}
- if( !anIndexes.IsEmpty() ) {
- mySelector->AddOrRemoveIndex( myIO, anIndexes, anIsShift );
- mySelector->AddIObject( this );
- anIndexes.Clear();
+
+ if ( hasIO() ) {
+ if( !anIndexes.IsEmpty() ) {
+ mySelector->AddOrRemoveIndex( myIO, anIndexes, anIsShift );
+ mySelector->AddIObject( this );
+ anIndexes.Clear();
+ }
+ else if ( !anIsShift )
+ mySelector->RemoveIObject( this );
}
- else if ( !anIsShift )
- mySelector->RemoveIObject( this );
}
default:
break;