GET_VERSION_FUNC getVersion = 0;
#ifdef WIN32
- HINSTANCE modLib = ::LoadLibrary( libName.toLatin1() );
+ HINSTANCE modLib = ::LoadLibrary( libName.toUtf8() );
if ( !modLib )
{
LPVOID lpMsgBuf;
getVersion = (GET_VERSION_FUNC)::GetProcAddress( modLib, GET_VERSION_NAME );
}
#else
- void* modLib = dlopen( libName.toLatin1(), RTLD_LAZY | RTLD_GLOBAL );
+ void* modLib = dlopen( libName.toUtf8(), RTLD_LAZY | RTLD_GLOBAL );
if ( !modLib )
err = QString( "Can not load library %1. %2" ).arg( libName ).arg( dlerror() );
else
int anISize = sizeof( int );
const char* aTypeStr = myType.toLatin1().constData();
- const char* aToolTipStr = myToolTipText.toLatin1().constData();
+ const char* aToolTipStr = myToolTipText.toUtf8().constData();
int aTypeLength = myType.length();
int aToolTipLength = myToolTipText.length();
if ( !getActiveView() )
return false;
- QFile hFile( FileName.toLatin1() );
+ QFile hFile( FileName.toUtf8() );
#ifdef WIN32
HDC hMetaFileDC;
HDC screen_dc = GetDC( 0 ); //The screen device context
HDC bitDC = CreateCompatibleDC ( screen_dc ); //The context compatible with screen
- hMetaFileDC = CreateEnhMetaFile( bitDC, FileName.toLatin1().data(), &r, "" );
+ hMetaFileDC = CreateEnhMetaFile( bitDC, FileName.toUtf8().data(), &r, "" );
SetMapMode( hMetaFileDC, MM_HIMETRIC );
SetWindowOrgEx( hMetaFileDC, 0, r.bottom, NULL );
HRGN ClipRgn = CreateRectRgn( 0, 0, AW, AH );
std::cout << std::endl;
std::cout << "SALOME Help Browser" << std::endl;
std::cout << std::endl;
- std::cout << "usage: " << qPrintable( fi.fileName() ) << " [options] file" << std::endl;
+ std::cout << "usage: " << qUtf8Printable( fi.fileName() ) << " [options] file" << std::endl;
std::cout << " file is a help file to be opened" << std::endl;
std::cout << std::endl;
std::cout << "Options:" << std::endl;
QString modName = moduleName( aModule ); // module name
if ( modName.isEmpty() ) modName = aModule; // for KERNEL and GUI
QString rootDir = QString( "%1_ROOT_DIR" ).arg( modName ); // module root dir variable
- QString modDir = getenv( rootDir.toLatin1().constData() ); // module root dir
+ QString modDir = getenv( rootDir.toUtf8().constData() ); // module root dir
QString docSection;
if (resMgr->hasValue( modName, "documentation" ) )
docSection = resMgr->stringValue(modName, "documentation");
SUIT_DataOwnerPtrList aList;
#ifndef DISABLE_SALOMEOBJECT
Handle(SALOME_InteractiveObject) aSObj = new SALOME_InteractiveObject
- ( anObject->entry().toLatin1().constData(),
+ ( anObject->entry().toUtf8().constData(),
anObject->componentDataType().toLatin1().constData(),
- anObject->name().toLatin1().constData() );
+ anObject->name().toUtf8().constData() );
LightApp_DataOwner* owner = new LightApp_DataOwner( aSObj );
#else
LightApp_DataOwner* owner = new LightApp_DataOwner( anEntry );
QStringList::const_iterator it = list.constBegin();
for ( ; it != list.constEnd(); ++it)
{
- SALOME_Prs* prs = vf->CreatePrs( (*it).toLatin1().data() );
+ SALOME_Prs* prs = vf->CreatePrs( (*it).toUtf8().data() );
if ( prs ) {
myLastEntry = *it;
vf->BeforeErase( this, prs );
{
#ifndef DISABLE_SALOMEOBJECT
Handle( SALOME_InteractiveObject ) temp = new SALOME_InteractiveObject();
- temp->setEntry( entry.toLatin1() );
+ temp->setEntry( entry.toUtf8() );
res = vf->isVisible( temp );
#endif
}
SALOME_View* vf = theViewFrame ? theViewFrame : GetActiveView();
if ( vf )
- prs = vf->CreatePrs( entry.toLatin1() );
+ prs = vf->CreatePrs( entry.toUtf8() );
return prs;
}
if(aFileBuffer == NULL)
return false;
- myTmpDir = QDir::toNativeSeparators( QFileInfo( theFileName ).absolutePath() + "/" ).toLatin1().constData() ;
+ myTmpDir = QDir::toNativeSeparators( QFileInfo( theFileName ).absolutePath() + "/" ).toUtf8().constData() ;
int aCurrentPos = 0;
ifstream aFile(theFileName);
#endif
- myTmpDir = QDir::toNativeSeparators( QFileInfo( theFileName ).absolutePath() + "/" ).toLatin1().constData() ;
+ myTmpDir = QDir::toNativeSeparators( QFileInfo( theFileName ).absolutePath() + "/" ).toUtf8().constData() ;
aFile.seekg(0, ios::end);
int aFileBufferSize = aFile.tellg();
if ( obj && app->checkDataObject( obj) ) {
#ifndef DISABLE_SALOMEOBJECT
Handle(SALOME_InteractiveObject) aSObj = new SALOME_InteractiveObject
- ( obj->entry().toLatin1().constData(),
+ ( obj->entry().toUtf8().constData(),
obj->componentDataType().toLatin1().constData(),
- obj->name().toLatin1().constData() );
+ obj->name().toUtf8().constData() );
LightApp_DataOwner* owner = new LightApp_DataOwner( aSObj );
#else
LightApp_DataOwner* owner = new LightApp_DataOwner( obj->entry() );
{
if( !myCurEntry.isNull() ) {
#ifndef DISABLE_SALOMEOBJECT
- theList.append( new LightApp_DataOwner( new SALOME_InteractiveObject(qPrintable(myCurEntry),"","") ) );
+ theList.append( new LightApp_DataOwner( new SALOME_InteractiveObject(qUtf8Printable(myCurEntry),"","") ) );
#else
theList.append( new LightApp_DataOwner( myCurEntry ) );
#endif
anIOList.Append(owner->IO());
}
else if ( !owner->entry().isEmpty() ) {
- anIOList.Append( new SALOME_InteractiveObject(qPrintable(owner->entry()),"","") );
+ anIOList.Append( new SALOME_InteractiveObject(qUtf8Printable(owner->entry()),"","") );
}
}
}
if ( refEntry != entry ) {
entry = refEntry;
QString component = study->componentDataType( entry );
- theList.Append( new SALOME_InteractiveObject( (const char*)entry.toLatin1(),
+ theList.Append( new SALOME_InteractiveObject( (const char*)entry.toUtf8(),
(const char*)component.toLatin1(),
""/*refobj->Name().c_str()*/ ) );
}
if ( subOwner )
{
//#ifndef WIN32
- if ( !theMap.IsBound( TCollection_AsciiString(subOwner->entry().toLatin1().data()) ) )
+ if ( !theMap.IsBound( TCollection_AsciiString(subOwner->entry().toUtf8().data()) ) )
//#else
// if ( !theMap.IsBound( subOwner->entry().toLatin1().data() ) )
//#endif
anIndexes.Add( subOwner2->index() );
}
//
- theMap.Bind( subOwner->entry().toLatin1().data(), anIndexes );
+ theMap.Bind( subOwner->entry().toUtf8().data(), anIndexes );
}
}
}
for ( QStringList::Iterator it = theListOfFiles.begin(); it != theListOfFiles.end(); ++it ) {
if ( (*it).isEmpty() )
continue;
- aListOfFiles[anIndex] = (*it).toLatin1().constData();
+ aListOfFiles[anIndex] = (*it).toUtf8().constData();
anIndex++;
}
myDriver->SetListOfFiles(theModuleName.toLatin1().constData(), aListOfFiles);
return false;
bool isMultiFile = resMgr->booleanValue( "Study", "multi_file", false );
- bool aRes = myDriver->SaveDatasInFile(theFileName.toLatin1(), isMultiFile);
+ bool aRes = myDriver->SaveDatasInFile(theFileName.toUtf8(), isMultiFile);
return aRes;
}
return false;
bool isMultiFile = resMgr->booleanValue( "Study", "multi_file", false );
- bool aRes = myDriver->ReadDatasFromFile(theFileName.toLatin1(), isMultiFile);
+ bool aRes = myDriver->ReadDatasFromFile(theFileName.toUtf8(), isMultiFile);
return aRes;
}
aSelector->AddOrRemoveIndex(anIO,anOwner->GetIds(),false);
}else if(const LightApp_DataOwner* anOwner = dynamic_cast<const LightApp_DataOwner*>(aDataOwner)){
Handle(SALOME_InteractiveObject) anIO =
- new SALOME_InteractiveObject(anOwner->entry().toLatin1(),"");
+ new SALOME_InteractiveObject(anOwner->entry().toUtf8(),"");
aSelector->AddIObject(anIO);
anAppendList.Append(anIO);
}
void OCCViewer_CreateRestoreViewDlg::editItemText( QListWidgetItem* anItem )
{
int index = anItem->listWidget()->row( anItem );
- myParametersMap[ index ].name = anItem->text().toLatin1();
+ myParametersMap[ index ].name = anItem->text().toUtf8();
}
/*!
// axes params
for ( int i = 0; i < 3; i++ ) {
Graphic3d_AxisAspect& aspect = gt.ChangeAxisAspect(i);
- aspect.SetName(anAxisData[i].Name.toLatin1().constData());
+ aspect.SetName(anAxisData[i].Name.toUtf8().constData());
aspect.SetDrawName(anAxisData[i].DrawName);
aspect.SetDrawValues(anAxisData[i].DrawValues);
aspect.SetDrawTickmarks(anAxisData[i].DrawTickmarks);
// set texture image: file name and fill mode
switch ( textureMode ) {
case Qtx::CenterTexture:
- activeView()->SetBackgroundImage( fi.absoluteFilePath().toLatin1().constData(), Aspect_FM_CENTERED );
+ activeView()->SetBackgroundImage( fi.absoluteFilePath().toUtf8().constData(), Aspect_FM_CENTERED );
break;
case Qtx::TileTexture:
- activeView()->SetBackgroundImage( fi.absoluteFilePath().toLatin1().constData(), Aspect_FM_TILED );
+ activeView()->SetBackgroundImage( fi.absoluteFilePath().toUtf8().constData(), Aspect_FM_TILED );
break;
case Qtx::StretchTexture:
- activeView()->SetBackgroundImage( fi.absoluteFilePath().toLatin1().constData(), Aspect_FM_STRETCH );
+ activeView()->SetBackgroundImage( fi.absoluteFilePath().toUtf8().constData(), Aspect_FM_STRETCH );
break;
default:
break;
OpenGl_Caps* aCaps = &aDriver->ChangeOptions();
int prev = aCaps->ffpEnable;
aCaps->ffpEnable = 1;
- res = a3dView->Export(strdup(qPrintable(fileName)), Graphic3d_EF_PostScript);
+ res = a3dView->Export(strdup(qUtf8Printable(fileName)), Graphic3d_EF_PostScript);
aCaps->ffpEnable = prev;
}
else if (format == "EPS") {
OpenGl_Caps* aCaps = &aDriver->ChangeOptions();
int prev = aCaps->ffpEnable;
aCaps->ffpEnable = 1;
- res = a3dView->Export(strdup(qPrintable(fileName)), Graphic3d_EF_EnhPostScript);
+ res = a3dView->Export(strdup(qUtf8Printable(fileName)), Graphic3d_EF_EnhPostScript);
aCaps->ffpEnable = prev;
}
else {
aPyScript = aPyScript.arg(theExpr);
int result = -1;
PyGILState_STATE gstate = PyGILState_Ensure();
- PyObject* obj = PyRun_String(qPrintable(aPyScript), Py_file_input, myMainDict, NULL);
+ PyObject* obj = PyRun_String(qUtf8Printable(aPyScript), Py_file_input, myMainDict, NULL);
if(obj == NULL) {
PyErr_Print();
*/
bool Qtx::dos2unix( const QString& absName )
{
- FILE* src = ::fopen( absName.toLatin1(), "rb" );
+ FILE* src = ::fopen( absName.toUtf8(), "rb" );
if ( !src )
return false;
/* we'll use temporary file */
char temp[512] = { '\0' };
QString dir = Qtx::dir( absName );
- FILE* tgt = ::fopen( strcpy( temp, ::tempnam( dir.toLatin1(), "__x" ) ), "wb" );
+ FILE* tgt = ::fopen( strcpy( temp, ::tempnam( dir.toUtf8(), "__x" ) ), "wb" );
if ( !tgt )
return false;
break;
QString newStr;
- if ( ::getenv( envName.toLatin1() ) || mode == Always )
- newStr = QString( ::getenv( envName.toLatin1() ) );
+ if ( ::getenv( envName.toUtf8() ) || mode == Always )
+ newStr = QString( ::getenv( envName.toUtf8() ) );
if ( newStr.isNull() )
{
const QObjectList& objList = myCont->children();
for ( QObjectList::const_iterator it = objList.begin(); it != objList.end(); ++it )
{
- if ( (*it)->isWidgetType() && qstrcmp( "qt_dockwidget_internal", (*it)->objectName().toLatin1() ) )
+ if ( (*it)->isWidgetType() && qstrcmp( "qt_dockwidget_internal", (*it)->objectName().toUtf8() ) )
(*it)->installEventFilter( this );
}
}
QtxWorkstackChild* c = map.contains( name ) ? map[name] : 0;
if ( !c )
{
- qWarning( "QtxWorkstack: Restored child widget \"%s\" not found.", (const char*)name.toLatin1() );
+ qWarning( "QtxWorkstack: Restored child widget \"%s\" not found.", (const char*)name.toUtf8() );
return false;
}
map.insert( c->widget()->objectName(), c );
- qDebug( "QtxWorkstack::restoreState: found widget \"%s\"", (const char*)c->widget()->objectName().toLatin1() );
+ qDebug( "QtxWorkstack::restoreState: found widget \"%s\"", (const char*)c->widget()->objectName().toUtf8() );
}
}
return false;
- std::string aTmpDir = study->GetTmpDir(myStudyURL.toLatin1().constData(), isMultiFile );
+ std::string aTmpDir = study->GetTmpDir(myStudyURL.toUtf8().constData(), isMultiFile );
theListOfFiles.append(QString(aTmpDir.c_str()));
int listSize = theListOfFiles.size();
if(!aModule || !study)
return false;
- std::string aTmpDir = study->GetTmpDir( theURL.toLatin1().constData(), isMultiFile );
+ std::string aTmpDir = study->GetTmpDir( theURL.toUtf8().constData(), isMultiFile );
theListOfFiles.append( QString( aTmpDir.c_str() ) );
int oldSize = theListOfFiles.size();
SUIT_ResourceMgr* resMgr = module()->getApp()->resourceMgr();
QPixmap pixmap = resMgr->loadPixmap( module()->name(),
QApplication::translate( module()->name().toLatin1().data(),
- fileName.toLatin1().data() ) );
+ fileName.toUtf8().data() ) );
if ( !pixmap.isNull() )
icon = QIcon( pixmap );
}
PyObjWrapper res( PyObject_CallMethod( myPyModule,
(char*)"preferenceChanged",
(char*)"ss",
- section.toLatin1().constData(),
- setting.toLatin1().constData() ) );
+ section.toUtf8().constData(),
+ setting.toUtf8().constData() ) );
if( !res ) {
PyErr_Print();
}
PyObjWrapper res( PyObject_CallMethod( myPyModule,
(char*)"definePopup",
(char*)"sss",
- context.toLatin1().constData(),
- aObject.toLatin1().constData(),
- aParent.toLatin1().constData() ) );
+ context.toUtf8().constData(),
+ aObject.toUtf8().constData(),
+ aParent.toUtf8().constData() ) );
if( !res ) {
PyErr_Print();
}
(char*)"createPopupMenu",
(char*)"Os",
sipPopup.get(),
- context.toLatin1().constData() ) );
+ context.toUtf8().constData() ) );
if( !res1 ) {
PyErr_Print();
}
(char*)"customPopup",
(char*)"Osss",
sipPopup.get(),
- aContext.toLatin1().constData(),
- aObject.toLatin1().constData(),
- aParent.toLatin1().constData() ) );
+ aContext.toUtf8().constData(),
+ aObject.toUtf8().constData(),
+ aParent.toUtf8().constData() ) );
if( !res2 ) {
PyErr_Print();
}
// try with two parameters (new syntax)
PyObjWrapper res( PyObject_CallMethod( myPyModule, (char*)"saveFiles",
(char*)"ss",
- files.first().toLatin1().constData(),
- url.toLatin1().constData() ) );
+ files.first().toUtf8().constData(),
+ url.toUtf8().constData() ) );
if ( !res )
// try with single parameter (old syntax)
res = PyObject_CallMethod( myPyModule, (char*)"saveFiles",
- (char*)"s", files.first().toLatin1().constData() );
+ (char*)"s", files.first().toUtf8().constData() );
if ( !res ) {
PyErr_Print();
// try with two parameters (new syntax)
PyObjWrapper res( PyObject_CallMethod( myPyModule, (char*)"openFiles",
(char*)"Os", sipList.get(),
- url.toLatin1().constData() ) );
+ url.toUtf8().constData() ) );
if ( !res )
// try with single parameter (old syntax)
if ( PyObject_HasAttrString(myPyModule, (char*)"dumpStudy") ) {
PyObjWrapper res( PyObject_CallMethod( myPyModule, (char*)"dumpStudy",
- (char*)"s", files.first().toLatin1().constData()));
+ (char*)"s", files.first().toUtf8().constData()));
if ( !res ) {
PyErr_Print();
if ( PyObject_HasAttrString(myPyModule , (char*)"isDraggable") ) {
PyObjWrapper res( PyObject_CallMethod( myPyModule, (char*)"isDraggable",
- (char*)"s", what->entry().toLatin1().constData() ) );
+ (char*)"s", what->entry().toUtf8().constData() ) );
if( !res || !PyBool_Check( res )) {
PyErr_Print();
draggable = false;
if ( PyObject_HasAttrString(myPyModule , (char*)"isDropAccepted") ) {
PyObjWrapper res( PyObject_CallMethod( myPyModule, (char*)"isDropAccepted",
- (char*)"s", where->entry().toLatin1().constData() ) );
+ (char*)"s", where->entry().toUtf8().constData() ) );
if( !res || !PyBool_Check( res )) {
PyErr_Print();
dropAccepted = false;
if ( PyObject_HasAttrString(myPyModule, (char*)"dropObjects") ) {
PyObjWrapper res( PyObject_CallMethod( myPyModule, (char*)"dropObjects", (char*)"Osii",
sipList.get(),
- whereObject->entry().toLatin1().constData(),
+ whereObject->entry().toUtf8().constData(),
row, action ) );
if( !res ) {
return; // Error
if ( PyObject_HasAttrString( myPyModule, (char*)"onObjectBrowserClicked" ) ) {
- PyObjWrapper res( PyObject_CallMethod( myPyModule, (char*)"onObjectBrowserClicked", (char*)"si", theObj.toLatin1().constData(), theColumn ) );
+ PyObjWrapper res( PyObject_CallMethod( myPyModule, (char*)"onObjectBrowserClicked", (char*)"si", theObj.toUtf8().constData(), theColumn ) );
if( !res ) {
PyErr_Print();
}
SALOME_PYQT_BorrowedDataObjectLight *obj = new SALOME_PYQT_BorrowedDataObjectLight(myLocalEntries[i]);
#ifndef DISABLE_SALOMEOBJECT
Handle(SALOME_InteractiveObject)aSObj = new SALOME_InteractiveObject
- ( obj->entry().toLatin1().constData(),
+ ( obj->entry().toUtf8().constData(),
obj->componentDataType().toLatin1().constData(),
- obj->name().toLatin1().constData() );
+ obj->name().toUtf8().constData() );
LightApp_DataOwner* owner = new LightApp_DataOwner(aSObj);
#else
LightApp_DataOwner* owner = new LightApp_DataOwner( obj->entry() );
if ( app && !fileName.isEmpty() ) {
QPixmap pixmap = app->resourceMgr()->loadPixmap( module,
QApplication::translate( module.toLatin1().data(),
- fileName.toLatin1().data() ) );
+ fileName.toUtf8().data() ) );
if ( !pixmap.isNull() )
icon = QIcon( pixmap );
}
{
QStringList selected = ProcessEvent( new TGetSelectedEvent() );
return index >= 0 && index < selected.count() ?
- strdup( selected[ index ].toLatin1().constData() ) : 0;
+ strdup( selected[ index ].toUtf8().constData() ) : 0;
}
/*!
LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr();
if ( aStudy && aSelMgr ) {
SALOME_ListIO anIOList;
- anIOList.Append( new SALOME_InteractiveObject( myEntry.toLatin1(), "", "" ) );
+ anIOList.Append( new SALOME_InteractiveObject( myEntry.toUtf8(), "", "" ) );
aSelMgr->setSelectedObjects( anIOList, true );
}
}
aSelMgr->selectedObjects( anIOList );
SALOME_ListIteratorOfListIO anIter( anIOList );
for( ; anIter.More(); anIter.Next() ) {
- if ( anIter.Value()->isSame( new SALOME_InteractiveObject( myEntry.toLatin1(), "", "" ) ) ) {
+ if ( anIter.Value()->isSame( new SALOME_InteractiveObject( myEntry.toUtf8(), "", "" ) ) ) {
anIOList.Remove( anIter );
aSelMgr->setSelectedObjects( anIOList, true );
return;
if ( window ) {
SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getViewModel() );
if ( view ) {
- SALOME_Prs* aPrs = view->CreatePrs( myEntry.toLatin1() );
+ SALOME_Prs* aPrs = view->CreatePrs( myEntry.toUtf8() );
myResult = !aPrs->IsNull();
}
}
const char* SALOMEGUI_Swig::getViewParameters() {
QString result = ProcessEvent( new TGetViewParameters() );
- return result.isEmpty() ? 0 : strdup( result.toLatin1().constData() );
+ return result.isEmpty() ? 0 : strdup( result.toUtf8().constData() );
}
Handle(SALOME_InteractiveObject) IO = aSh->getIO();
if ( IO->isSame( obj ) )
{
- aSh->setName( name.toLatin1().data() );
+ aSh->setName( name.toUtf8().data() );
break;
}
}
}
if( aCurve && aCurve->hasTableIO() && aCurve->getTableIO()->isSame( IObject ) )
- aCurve->getTableIO()->setName( newName.toLatin1() );
+ aCurve->getTableIO()->setName( newName.toUtf8() );
}
aViewFrame->updateTitles();
}
return 0;
AppLib lib = 0;
- QByteArray bid = libFile.toLatin1();
+ QByteArray bid = libFile.toUtf8();
#ifdef WIN32
#ifdef UNICODE
LPTSTR str = (LPTSTR)libFile.utf16();
#endif
lib = ::LoadLibrary( str );
#else
- lib = dlopen( (const char*)libFile.toLatin1(), RTLD_LAZY | RTLD_GLOBAL );
+ lib = dlopen( (const char*)libFile.toUtf8(), RTLD_LAZY | RTLD_GLOBAL );
#endif
return lib;
}
tmpPath += QString( "Salome_trace" );
FILE* pStream;
- pStream = fopen( lpszLog ? lpszLog : (const char*)tmpPath.toLatin1(), "a" );
+ pStream = fopen( lpszLog ? lpszLog : (const char*)tmpPath.toUtf8(), "a" );
if ( pStream )
{
va_list argptr;
script += "import sys\n";
script += "sys.excepthook = _custom_except_hook\n";
script += "del _custom_except_hook, sys\n";
- int res = PyRun_SimpleString(qPrintable(script));
+ int res = PyRun_SimpleString(qUtf8Printable(script));
// VSR (22/09/2016): end of workaround
PyEval_InitThreads(); // Create (and acquire) the interpreter lock - can be called many times
// Py_InitThreads acquires the GIL
// Name
theActor->SetTitleVisibility(myNameGrp->isChecked() ? 1 : 0);
- theActor->SetTitle(myAxisName->text().toLatin1());
+ theActor->SetTitle(myAxisName->text().toUtf8());
QColor aTitleColor(255, 255, 255);
int aTitleFontFamily = VTK_ARIAL;
") & (for /f %i in (" + tmpFile + ") do (del \"%i\")) & (del " + tmpFile + "))) > NUL";
#endif
- if(MYDEBUG) cout<<"SVTK_Recorder::MakeFileAVI - "<<(const char*)aCommand.toLatin1()<<endl;
- system((const char*)aCommand.toLatin1());
+ if(MYDEBUG) cout<<"SVTK_Recorder::MakeFileAVI - "<<(const char*)aCommand.toUtf8()<<endl;
+ system((const char*)aCommand.toUtf8());
}
if( myFileName.isNull() )
return;
- myRecorder->SetName( (const char*)myFileName.toLatin1() );
+ myRecorder->SetName( (const char*)myFileName.toUtf8() );
myRecorder->SetUseSkippedFrames( myRecordingModeComboBox->currentIndex() == 0 );
myRecorder->SetNbFPS( myFPSSpinBox->value() );
ForEachIf<SALOME_Actor>(aCopy.GetActors(),
TIsSameIObject<SALOME_Actor>(theIObject),
TSetFunction<SALOME_Actor,const char*,const char*>
- (&SALOME_Actor::setName,theName.toLatin1().data()));
+ (&SALOME_Actor::setName,theName.toUtf8().data()));
}
/*!
aReader = vtkMetaImageReader::New();
if ( aReader ) {
// create texture
- aReader->SetFileName( fi.absoluteFilePath().toLatin1().constData() );
+ aReader->SetFileName( fi.absoluteFilePath().toUtf8().constData() );
aReader->Update();
VTKViewer_Texture* aTexture = VTKViewer_Texture::New();
vtkImageMapToColors* aMap = 0;
QString aFilePrefix(fileName);
QString anExtension(SUIT_Tools::extension(fileName));
aFilePrefix.truncate(aFilePrefix.length() - 1 - anExtension.length());
- anExporter->SetFilePrefix(aFilePrefix.toLatin1().data());
+ anExporter->SetFilePrefix(aFilePrefix.toUtf8().data());
anExporter->Write();
anExporter->Delete();
}
//printf("#### Color: %f, %f, %f\n", color[0], color[1], color[2]);
actor->SetTitleVisibility( isVisible );
- actor->SetTitle( title.toLatin1() );
+ actor->SetTitle( title.toUtf8() );
vtkTextProperty* txtProp = actor->GetTitleTextProperty();
if ( txtProp ) {
txtProp->SetColor( color );
int shadow = paramsLst[10].toInt();
actor->SetTitleVisibility( isVisible );
- actor->SetTitle( title.toLatin1() );
+ actor->SetTitle( title.toUtf8() );
vtkTextProperty* txtProp = actor->GetTitleTextProperty();
if ( txtProp ) {
txtProp->SetColor( color );
} else { // file is not exist on disk
SUIT_MessageBox::warning( desktop(),
QObject::tr("WRN_WARNING"),
- QObject::tr("WRN_FILE_NOT_EXIST").arg(aName.toLatin1().data()));
+ QObject::tr("WRN_FILE_NOT_EXIST").arg(aName.toUtf8().data()));
return false;
}
{
QString marg; marg.fill( ' ', 3*it.depth() );
QString nnn = "%1 '%2'";
- qDebug( nnn.arg( marg ).arg( it.current()->name() ).toLatin1() );
+ qDebug( nnn.arg( marg ).arg( it.current()->name() ).toUtf8() );
}
}
if ( anId.isEmpty() )
return true; // Probably nothing to load
- _PTR(SComponent) aSComp ( SalomeApp_Application::getStudy()->FindComponentID( std::string( anId.toLatin1() ) ) );
+ _PTR(SComponent) aSComp ( SalomeApp_Application::getStudy()->FindComponentID( std::string( anId.toUtf8() ) ) );
if ( aSComp )
updateTree( aSComp, aDoc );
studyRoot = dynamic_cast<LightApp_RootObject*>( aSStudy->root() );
QString anId = getRootEntry( aSStudy );
if ( !anId.isEmpty() ){ // if nothing is published in the study for this module -> do nothing
- sobj = SalomeApp_Application::getStudy()->FindComponentID( std::string( anId.toLatin1() ) );
+ sobj = SalomeApp_Application::getStudy()->FindComponentID( std::string( anId.toUtf8() ) );
}
}
}
aSStudy = dynamic_cast<SalomeApp_Study*>( studyRoot->study() ); // <study> value should not change here theoretically, but just to make sure
if ( aSStudy ) {
// modelRoot->object() cannot be reused here: it is about to be deleted by buildTree() soon
- sobj = SalomeApp_Application::getStudy()->FindComponentID( std::string( modelRoot->entry().toLatin1() ) );
+ sobj = SalomeApp_Application::getStudy()->FindComponentID( std::string( modelRoot->entry().toUtf8() ) );
}
}
}
if ( !CORBA::is_nil(aComponent) && aComponent->hasObjectInfo() ) {
LightApp_RootObject* aRoot = dynamic_cast<LightApp_RootObject*>( root() );
if ( aRoot && aRoot->study() ) {
- CORBA::String_var data = aComponent->getObjectInfo( entry().toLatin1().constData());
+ CORBA::String_var data = aComponent->getObjectInfo( entry().toUtf8().constData());
QString objInfo = data.in();
QStringList l;
l << name();
val = valSO->GetName().c_str();
Handle( SALOME_InteractiveObject ) new_obj =
- new SALOME_InteractiveObject( id.toLatin1(), comp.toLatin1(), val.toLatin1() );
+ new SALOME_InteractiveObject( id.toUtf8(), comp.toLatin1(), val.toLatin1() );
dest.Append( new_obj );
}
anIter->Next();
if( myVariableMap.contains( anIndex ) )
{
const NoteBoox_Variable& aVariable = myVariableMap[ anIndex ];
- if( !aVariable.Name.isEmpty() && SalomeApp_Application::getStudy()->IsVariableUsed( std::string( aVariable.Name.toLatin1().constData() ) ) )
+ if( !aVariable.Name.isEmpty() && SalomeApp_Application::getStudy()->IsVariableUsed( std::string( aVariable.Name.toUtf8().constData() ) ) )
{
if( QMessageBox::warning( parentWidget(), tr( "WARNING" ),
tr( "RENAME_VARIABLE_IS_USED" ).arg( aVariable.Name ),
else {
int nRow = row(aSelectedItems[i]);
- if( aStudy->IsVariableUsed( std::string( aRow->GetName().toLatin1().constData() ) ) )
+ if( aStudy->IsVariableUsed( std::string( aRow->GetName().toUtf8().constData() ) ) )
{
if( QMessageBox::warning( parentWidget(), tr( "WARNING" ),
tr( "REMOVE_VARIABLE_IS_USED" ).arg( aRow->GetName() ),
myVariableMap.remove( index );
removeRow(nRow);
myRows.removeAt(nRow);
- if(aStudy->IsVariable(aVarName.toLatin1().constData()))
+ if(aStudy->IsVariable(aVarName.toUtf8().constData()))
removedFromStudy = true;
}
}
if( aVariableMapRef.contains( anIndex ) )
{
QString aRemovedVariable = aVariableMapRef[ anIndex ].Name;
- aStudy->RemoveVariable( std::string( aRemovedVariable.toLatin1().constData() ) );
+ aStudy->RemoveVariable( std::string( aRemovedVariable.toUtf8().constData() ) );
}
}
if( !aNameRef.isEmpty() && !aValueRef.isEmpty() && aNameRef != aName )
{
- aStudy->RenameVariable( std::string( aNameRef.toLatin1().constData() ),
- std::string( aName.toLatin1().constData() ) );
+ aStudy->RenameVariable( std::string( aNameRef.toUtf8().constData() ),
+ std::string( aName.toUtf8().constData() ) );
}
}
if( NoteBook_TableRow::IsIntegerValue(aValue,&anIVal) )
- aStudy->SetInteger(std::string(aName.toLatin1().constData()),anIVal);
+ aStudy->SetInteger(std::string(aName.toUtf8().constData()),anIVal);
else if( NoteBook_TableRow::IsRealValue(aValue,&aDVal) )
- aStudy->SetReal(std::string(aName.toLatin1().constData()),aDVal);
+ aStudy->SetReal(std::string(aName.toUtf8().constData()),aDVal);
else if( NoteBook_TableRow::IsBooleanValue(aValue,&aBVal) )
- aStudy->SetBoolean(std::string(aName.toLatin1().constData()),aBVal);
+ aStudy->SetBoolean(std::string(aName.toUtf8().constData()),aBVal);
else
- aStudy->SetString(std::string(aName.toLatin1().constData()),aValue.toStdString());
+ aStudy->SetString(std::string(aName.toUtf8().constData()),aValue.toStdString());
}
}
myTable->ResetMaps();
while (o) {
SalomeApp_DataObject* so = dynamic_cast<SalomeApp_DataObject*>( o );
if ( so ) {
- std::string entry = so->entry().toLatin1().constData();
+ std::string entry = so->entry().toUtf8().constData();
if ( entry.size() )
entry2SuitObject[entry] = so;
}
{
LightApp_DataObject* o = 0;
if ( myObserver ) {
- o = dynamic_cast<LightApp_DataObject*>( myObserver->findObject( theEntry.toLatin1().constData() ) );
+ o = dynamic_cast<LightApp_DataObject*>( myObserver->findObject( theEntry.toUtf8().constData() ) );
}
if ( !o ) {
o = LightApp_Study::findObjectByEntry( theEntry );
QString anAlphaTexture = getenv( "GUI_ROOT_DIR" );
anAlphaTexture.append( "/share/salome/resources/gui/sprite_alpha.vti" );
- vtkSmartPointer<vtkImageData> aTextureValue = VTK::MakeTexture( aMainTexture.toLatin1().constData(), anAlphaTexture.toLatin1().constData() );
+ vtkSmartPointer<vtkImageData> aTextureValue = VTK::MakeTexture( aMainTexture.toUtf8().constData(), anAlphaTexture.toUtf8().constData() );
this->SpecialTextures[BallTextureId] = aTextureValue;
}
this->ImageData = this->SpecialTextures[BallTextureId];
aReader = vtkMetaImageReader::New();
if ( aReader ) {
// create texture
- aReader->SetFileName( fi.absoluteFilePath().toLatin1().constData() );
+ aReader->SetFileName( fi.absoluteFilePath().toUtf8().constData() );
aReader->Update();
VTKViewer_Texture* aTexture = VTKViewer_Texture::New();