-// Copyright (C) 2014-2017 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <ModelAPI_AttributeString.h>
aMainLay->addWidget(aTitleLabel, 0, 0);
myPathField = new QLineEdit(this);
aMainLay->addWidget(myPathField, 1, 0);
+
QPushButton* aSelectPathBtn = new QPushButton("...", this);
aSelectPathBtn->setToolTip(tr("Select file..."));
aSelectPathBtn->setMaximumWidth(20);
DataPtr aData = myFeature->data();
AttributeStringPtr aStringAttr = aData->string(attributeID());
QString aWidgetValue = myPathField->text();
- aStringAttr->setValue(aWidgetValue.toStdString());
+ aStringAttr->setValue(aWidgetValue.toStdWString());
updateObject(myFeature);
return true;
}
DataPtr aData = myFeature->data();
AttributeStringPtr aStringAttr = aData->string(attributeID());
- bool isBlocked = myPathField->blockSignals(true);
- QString aNewText = QString::fromStdString(aStringAttr->value());
- if( myPathField->text() != aNewText )
- myPathField->setText( aNewText );
- myPathField->blockSignals(isBlocked);
+ std::wstring aUtfStr = aStringAttr->valueW();
+ QString aNewText = QString::fromStdWString(aUtfStr);
+ if (myPathField->text() != aNewText) {
+ bool isBlocked = myPathField->blockSignals(true);
+ myPathField->setText(aNewText);
+ myPathField->blockSignals(isBlocked);
+ }
return true;
}
if (!aFileName.isEmpty()) {
if (myType == WFS_SAVE)
aFileName = applyExtension(aFileName, mySelectedFilter);
- myPathField->setText(aFileName);
+ myPathField->setText(aFileName.toUtf8());
myDefaultPath = QFileInfo(aFileName).absolutePath();
emit focusOutWidget(this);
}