ObjectList::iterator it = pipeTShapeGroupObjects.begin();
for (int i = 0; it != pipeTShapeGroupObjects.end(); it++, i++) {
- getGeomEngine()->AddInStudy(theStudy, (*it), tr((*it)->GetName()).toStdString().c_str(), theFather);
+ CORBA::String_var sname = (*it)->GetName();
+ getGeomEngine()->AddInStudy(theStudy, (*it), sname.in(), theFather);
}
}
if ( vals->length() == nbRows * nbComps )
for ( int iV = 0, iR = 0; iR < nbRows; ++iR )
for ( int iC = 1; iC < nbColumns; ++iC )
- setItem( iR, iC, new QTableWidgetItem( vals[ iV++ ].in() ));
+ setItem( iR, iC, new QTableWidgetItem( QString::fromUtf8( vals[ iV++ ].in() ) ) );
}
break;
}
vals->length( nbRows * nbComps );
for ( int iV = 0, iR = 0; iR < nbRows; ++iR )
for ( int iC = 1; iC < nbColumns; ++iC )
- vals[ iV++ ] = item( iR, iC )->text().toLatin1().constData();
+ vals[ iV++ ] = item( iR, iC )->text().toUtf8().constData();
ss->SetValues( vals );
}
}
myIsCreation = false;
CORBA::String_var fName = myField->GetName();
- myMainFrame->ResultName->setText( fName.in() );
+ myMainFrame->ResultName->setText( QString::fromUtf8( fName.in() ) );
myShape = myField->GetShape();
CORBA::String_var sName;
if ( !myShape->_is_nil() )
sName = myShape->GetName();
- myShapeName->setText( sName.in() ? sName.in() : "");
+ myShapeName->setText( QString::fromUtf8( sName.in() ? sName.in() : "" ) );
myTypeCombo->setCurrentIndex( myField->GetDataType() );
{
GEOM::string_array_var compNames = myField->GetComponents();
for ( int iC = 0; iC < compNames->length(); ++iC )
- headers << compNames[ iC ].in();
+ headers << QString::fromUtf8( compNames[ iC ].in() );
}
else
{
GEOM::string_array_var compNames = new GEOM::string_array();
compNames->length( nbComps );
for ( int iC = 0; iC < nbComps; ++iC )
- compNames[ iC ] = columnNames[ iC+1 ].toLatin1().constData();
+ compNames[ iC ] = columnNames[ iC+1 ].toUtf8().constData();
GEOM::GEOM_IFieldOperations_var anOper = GEOM::GEOM_IFieldOperations::_narrow(getOperation());
myField = anOper->CreateField( myShape,
- aName.toLatin1().constData(),
+ aName.toUtf8().constData(),
GEOM::field_data_type( getDataType() ),
CORBA::Short( getDim() ),
compNames );
return false;
SALOMEDS::SObject_wrap aSO =
- getGeomEngine()->AddInStudy( aStudyDS, myField, aName.toLatin1().constData(), myShape );
+ getGeomEngine()->AddInStudy( aStudyDS, myField, aName.toUtf8().constData(), myShape );
if ( !aSO->_is_nil() ) {
myField->UnRegister();
CORBA::String_var entry = aSO->GetID();
}
else // update field name
{
- myField->SetName( aName.toLatin1().constData() );
+ myField->SetName( aName.toUtf8().constData() );
CORBA::String_var entry = myField->GetStudyEntry();
if ( entry.in() ) {
SALOMEDS::SObject_wrap SO = aStudyDS->FindObjectID( entry.in() );
if ( !SO->_is_nil() ) {
- aBuilder->SetName(SO, aName.toLatin1().constData());
+ aBuilder->SetName(SO, aName.toUtf8().constData());
}
}
}
step = myField->AddStep( tbl->getStepID(), tbl->getStamp() );
SALOMEDS::SObject_wrap aSO =
- getGeomEngine()->AddInStudy( aStudyDS, step, stepName.toLatin1().constData(), myField );
+ getGeomEngine()->AddInStudy( aStudyDS, step, stepName.toUtf8().constData(), myField );
if ( /*!myIsCreation &&*/ !aSO->_is_nil() ) {
step->UnRegister();
CORBA::String_var entry = aSO->GetID();
if ( entry.in() ) {
SALOMEDS::SObject_wrap SO = aStudyDS->FindObjectID( entry.in() );
if ( !SO->_is_nil() )
- aBuilder->SetName( SO, stepName.toLatin1().constData() );
+ aBuilder->SetName( SO, stepName.toUtf8().constData() );
}
}
_PTR(GenericAttribute) anAttr;
if ( obj && obj->FindAttribute( anAttr, "AttributeName" ) ) {
_PTR(AttributeName) aNameAttr ( anAttr );
- name = aNameAttr->Value().c_str();
+ name = QString::fromUtf8( aNameAttr->Value().c_str() );
}
}
}
/* Create a SALOME_InteractiveObject with a SALOME::SObject */
Handle(SALOME_InteractiveObject) IO = new SALOME_InteractiveObject( listSO[0]->GetID().c_str(),
"GEOM",
- objectUserName.toLatin1().constData() );
+ objectUserName.toUtf8().constData() );
/* Add as a selected object */
/* Clear any previous selection : */
_PTR(GenericAttribute) anAttr;
if ( aSObj && aSObj->FindAttribute( anAttr, "AttributeName") ) {
_PTR(AttributeName) aNameAttr( anAttr );
- name = aNameAttr->Value().c_str();
+ name = QString::fromUtf8( aNameAttr->Value().c_str() );
}
}
if ( entry.isEmpty() && !CORBA::is_nil( father ) && !fatherEntry.isEmpty() ) {
QString name = GetName( object );
GeometryGUI::GetGeomGen()->AddInStudy( GeometryGUI::ClientStudyToStudy( studyDS ),
- object, name.toLatin1().data(), father.in() );
+ object, name.toUtf8().data(), father.in() );
}
}
}
QString entry = getEntry( object );
getDisplayer()->Erase( new SALOME_InteractiveObject(
entry.toLatin1().constData(),
- "GEOM", strdup( GEOMBase::GetName( object ).toLatin1().constData() ) ), true, updateView );
+ "GEOM", strdup( GEOMBase::GetName( object ).toUtf8().constData() ) ), true, updateView );
}
}
QString entry = getEntry( object );
getDisplayer()->Redisplay(new SALOME_InteractiveObject
- (entry.toLatin1().constData(), "GEOM", strdup(GEOMBase::GetName(object).toLatin1().constData())), false);
+ (entry.toLatin1().constData(), "GEOM", strdup(GEOMBase::GetName(object).toUtf8().constData())), false);
}
if ( withChildren ) {
if ( !aChild->_is_nil() ) {
QString entry = getEntry( aChild );
getDisplayer()->Redisplay( new SALOME_InteractiveObject(
- entry.toLatin1().constData(), "GEOM", strdup( GEOMBase::GetName( aChild ).toLatin1().constData() ) ), false );
+ entry.toLatin1().constData(), "GEOM", strdup( GEOMBase::GetName( aChild ).toUtf8().constData() ) ), false );
}
}
}
QString anEntry = getEntry( anObj );
if ( anEntry != "" )
aListOfIO.Append( new SALOME_InteractiveObject(
- anEntry.toLatin1().constData(), "GEOM", strdup( GEOMBase::GetName( anObj ).toLatin1().constData() ) ) );
+ anEntry.toLatin1().constData(), "GEOM", strdup( GEOMBase::GetName( anObj ).toUtf8().constData() ) ) );
}
getDisplayer()->LocalSelection( aListOfIO, modes );
QString aName = getObjectName(obj);
if (aName.isEmpty()) {
aName = getNewObjectName(currObj);
- if ( nbObjs > 1 ) {
- if (aName.isEmpty())
- aName = getPrefix(obj);
- if (nbObjs <= 30) {
- // Try to find a unique name
- aName = GEOMBase::GetDefaultName(aName, extractPrefix());
- } else {
- // Don't check name uniqueness in case of numerous objects
- aName = aName + "_" + QString::number(aNumber++);
- }
- } else {
- // PAL6521: use a prefix, if some dialog box doesn't reimplement getNewObjectName()
- if ( aName.isEmpty() )
- aName = GEOMBase::GetDefaultName( getPrefix( obj ) );
- }
+ if ( nbObjs > 1 ) {
+ if (aName.isEmpty())
+ aName = getPrefix(obj);
+ if (nbObjs <= 30) {
+ // Try to find a unique name
+ aName = GEOMBase::GetDefaultName(aName, extractPrefix());
+ } else {
+ // Don't check name uniqueness in case of numerous objects
+ aName = aName + "_" + QString::number(aNumber++);
+ }
+ } else {
+ // PAL6521: use a prefix, if some dialog box doesn't reimplement getNewObjectName()
+ if ( aName.isEmpty() )
+ aName = GEOMBase::GetDefaultName( getPrefix( obj ) );
+ }
}
- anEntryList << addInStudy( obj, aName.toLatin1().constData() );
+ anEntryList << addInStudy( obj, aName.toUtf8().constData() );
// updateView=false
if( isDisplayResult() )
display( obj, false );
{
GEOM::string_array_var aValues = aGeomStringFieldStep->GetValues();
for( size_t i = 0, n = aValues->length(); i < n; i++ )
- aFieldStepData << QString( aValues[i] );
+ aFieldStepData << QString::fromUtf8( aValues[i].in() );
}
}
QString plugin_name;
for ( size_t i = 0; i < info->params.length(); ++i ) {
- myCreationInfoWdg->addParam( info->params[i].name.in(),
- info->params[i].value.in() );
+ myCreationInfoWdg->addParam( QString::fromUtf8( info->params[i].name.in() ),
+ QString::fromUtf8( info->params[i].value.in() ) );
QString value = info->params[i].name.in();
if( value == PLUGIN_NAME ) {
plugin_name = info->params[i].value.in();
if ( obj->FindAttribute(anAttr, "AttributeName") ) {
_PTR(AttributeName) aName (anAttr);
- aName->SetValue( name.toLatin1().data() ); // rename the SObject
+ aName->SetValue( name.toUtf8().data() ); // rename the SObject
GEOM::GEOM_Object_var anObj = GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(obj));
if (!CORBA::is_nil(anObj)) {
- anObj->SetName( name.toLatin1().data() ); // Rename the corresponding GEOM_Object
+ anObj->SetName( name.toUtf8().data() ); // Rename the corresponding GEOM_Object
emit SignalDependencyTreeRenameObject( anObj->GetEntry() );
}
result = true;
int aMgrId = dynamic_cast< SUIT_ViewModel* >( window )->getViewManager()->getGlobalId();
GEOMToolsGUI_LineWidthDlg* Dlg =
- new GEOMToolsGUI_LineWidthDlg( SUIT_Session::session()->activeApplication()->desktop(), "EDGE_WIDTH_TLT" );
+ new GEOMToolsGUI_LineWidthDlg( SUIT_Session::session()->activeApplication()->desktop(), tr("EDGE_WIDTH_TLT") );
QVariant v = appStudy->getObjectProperty( aMgrId, selected.First()->getEntry(), GEOM::propertyName( GEOM::LineWidth ), QVariant() );
int aWidth = v.isValid() ? v.toInt() : SUIT_Session::session()->resourceMgr()->integerValue( "Geometry", "edge_width", 1 );
int aMgrId = dynamic_cast< SUIT_ViewModel* >( window )->getViewManager()->getGlobalId();
GEOMToolsGUI_LineWidthDlg* Dlg =
- new GEOMToolsGUI_LineWidthDlg( SUIT_Session::session()->activeApplication()->desktop(), "ISOS_WIDTH_TLT" );
+ new GEOMToolsGUI_LineWidthDlg( SUIT_Session::session()->activeApplication()->desktop(), tr("ISOS_WIDTH_TLT") );
QVariant v = appStudy->getObjectProperty( aMgrId, selected.First()->getEntry(), GEOM::propertyName( GEOM::IsosWidth ), QVariant() );
int aWidth = v.isValid() ? v.toInt() : SUIT_Session::session()->resourceMgr()->integerValue( "Geometry", "isolines_width", 1 );
_PTR(SObject) aFatherSO(aStudy->FindObjectID(anIObject->getEntry()));
if ( !aFatherSO ) return;
- GeometryGUI::GetGeomGen()->CreateFolder( tr("NEW_FOLDER_NAME").toLatin1().constData(),
+ GeometryGUI::GetGeomGen()->CreateFolder( tr("NEW_FOLDER_NAME").toUtf8().constData(),
_CAST(SObject, aFatherSO)->GetSObject() );
app->updateObjectBrowser( false );
}
setObjectName("GEOMToolsGUI_LineWidthDlg");
setModal(true);
- setWindowTitle(tr(title.toLatin1().constData()));
+ setWindowTitle(title);
setSizeGripEnabled(TRUE);
QGridLayout* MyDialogLayout = new QGridLayout(this);
MyDialogLayout->setSpacing(6);
filters << tr( "Texture files (*.dat)" ) << tr( "All files (*)" );
QString aFileName = SUIT_Session::session()->activeApplication()->getFileName( true, QString(), filters.join( ";;" ), tr( "LOAD_TEXTURE_TLT" ), this );
if ( !aFileName.isEmpty() ) {
- addTexture( myOperation->LoadTexture( aFileName.toLatin1().constData() ), true );
+ addTexture( myOperation->LoadTexture( aFileName.toUtf8().constData() ), true );
}
}
if ( !comps.IsNull() )
{
compArr->length( comps->Length() );
- std::string entry;
int i, i0, nb;
for ( i = i0 = comps->Lower(), nb = comps->Upper(); i <= nb; ++i )
{
const TCollection_ExtendedString& anEntry = comps->Value( i );
- entry.resize( anEntry.LengthOfCString() );
- char* pstr = &entry[0];
- anEntry.ToUTF8CString( pstr );
- compArr[ i-i0 ] = CORBA::string_dup( entry.c_str() );
+ compArr[ i-i0 ] = CORBA::string_dup( TCollection_AsciiString( anEntry ).ToCString() );
}
}
return compArr._retn();
if ( !values.IsNull() )
{
resArray->length( values->Length() );
- std::string entry;
int i, i0, nb;
for ( i = i0 = values->Lower(), nb = values->Upper(); i <= nb; ++i )
{
const TCollection_ExtendedString& anEntry = values->Value( i );
- entry.resize( anEntry.LengthOfCString() );
- char* pstr = &entry[0];
- anEntry.ToUTF8CString( pstr );
- resArray[ i-i0 ] = CORBA::string_dup( entry.c_str() );
+ resArray[ i-i0 ] = CORBA::string_dup( TCollection_AsciiString( anEntry ).ToCString() );
}
}
return resArray._retn();
_PTR(SObject) SO (study->studyDS()->FindObjectIOR(objIOR.toLatin1().constData()));
if (SO) {
_PTR(StudyBuilder) aBuilder (study->studyDS()->NewBuilder());
- aBuilder->SetName(SO, getNewObjectName().toLatin1().constData());
+ aBuilder->SetName(SO, getNewObjectName().toUtf8().constData());
}
}
}
anAspectText3d->SetStyle( Aspect_TOST_ANNOTATION );
aGroup->SetPrimitivesAspect( anAspectText3d );
- aGroup->Text( aString.toLatin1().constData(), aVertex, 14 );
+ aGroup->Text( aString.toUtf8().constData(), aVertex, 14 );
}
}
else
if (aName.isEmpty())
aName = GEOMBase::GetDefaultName(getPrefix(*it));
}
- addInStudy(*it, aName.toLatin1().data());
+ addInStudy(*it, aName.toUtf8().data());
display(*it, false);
}
if (aName.isEmpty())
aName = GEOMBase::GetDefaultName(getPrefix(*it));
}
- addInStudy(*it, aName.toLatin1().data());
+ addInStudy(*it, aName.toUtf8().data());
display(*it, false);
}
}
if ( !anErrorObjNames.empty() )
- MESSAGE( "ERRORS occured while processing the following objects: " << anErrorObjNames.join( " " ).toLatin1().data() );
+ MESSAGE( "ERRORS occured while processing the following objects: " << anErrorObjNames.join( " " ).toUtf8().data() );
return anErrorObjNames.size() < myObjects->length(); // true if at least one object was OK, false if ALL objects were nil after Healing.
}
{
QListWidgetItem* item = new QListWidgetItem();
item->setData(Qt::UserRole, QVariant(i));
- item->setText(fields[i]->GetName());
+ item->setText(QString::fromUtf8(fields[i]->GetName()));
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
item->setCheckState(Qt::Checked);
lstFields->addItem(item);
GEOM::GEOM_FieldStep_ptr step = theField->GetStep(steps[i]);
QString stepName = (tr("XAOPLUGIN_STEP") + " %1 %2").arg( step->GetID() ).arg( step->GetStamp() );
SALOMEDS::SObject_wrap aSOField =
- getGeomEngine()->AddInStudy( aStudyDS, step, stepName.toLatin1().constData(), theField );
+ getGeomEngine()->AddInStudy( aStudyDS, step, stepName.toUtf8().constData(), theField );
}
aSO->UnRegister();