QString::fromAscii() is obsolete in Qt5. Replace it with fromLatin1().
This change is Qt4/Qt5 neutral.
This commit is contained in:
committed by
wmayer
parent
d5c074f80d
commit
cd2db00f22
@@ -118,7 +118,7 @@ void LoftWidget::findShapes()
|
||||
shape.ShapeType() == TopAbs_EDGE ||
|
||||
shape.ShapeType() == TopAbs_VERTEX) {
|
||||
QString label = QString::fromUtf8((*it)->Label.getValue());
|
||||
QString name = QString::fromAscii((*it)->getNameInDocument());
|
||||
QString name = QString::fromLatin1((*it)->getNameInDocument());
|
||||
|
||||
QTreeWidgetItem* child = new QTreeWidgetItem();
|
||||
child->setText(0, label);
|
||||
@@ -135,19 +135,19 @@ bool LoftWidget::accept()
|
||||
{
|
||||
QString list, solid, ruled, closed;
|
||||
if (d->ui.checkSolid->isChecked())
|
||||
solid = QString::fromAscii("True");
|
||||
solid = QString::fromLatin1("True");
|
||||
else
|
||||
solid = QString::fromAscii("False");
|
||||
solid = QString::fromLatin1("False");
|
||||
|
||||
if (d->ui.checkRuledSurface->isChecked())
|
||||
ruled = QString::fromAscii("True");
|
||||
ruled = QString::fromLatin1("True");
|
||||
else
|
||||
ruled = QString::fromAscii("False");
|
||||
ruled = QString::fromLatin1("False");
|
||||
|
||||
if (d->ui.checkClosed->isChecked())
|
||||
closed = QString::fromAscii("True");
|
||||
closed = QString::fromLatin1("True");
|
||||
else
|
||||
closed = QString::fromAscii("False");
|
||||
closed = QString::fromLatin1("False");
|
||||
|
||||
QTextStream str(&list);
|
||||
|
||||
@@ -164,13 +164,13 @@ bool LoftWidget::accept()
|
||||
|
||||
try {
|
||||
QString cmd;
|
||||
cmd = QString::fromAscii(
|
||||
cmd = QString::fromLatin1(
|
||||
"App.getDocument('%5').addObject('Part::Loft','Loft')\n"
|
||||
"App.getDocument('%5').ActiveObject.Sections=[%1]\n"
|
||||
"App.getDocument('%5').ActiveObject.Solid=%2\n"
|
||||
"App.getDocument('%5').ActiveObject.Ruled=%3\n"
|
||||
"App.getDocument('%5').ActiveObject.Closed=%4\n"
|
||||
).arg(list).arg(solid).arg(ruled).arg(closed).arg(QString::fromAscii(d->document.c_str()));
|
||||
).arg(list).arg(solid).arg(ruled).arg(closed).arg(QString::fromLatin1(d->document.c_str()));
|
||||
|
||||
Gui::Document* doc = Gui::Application::Instance->getDocument(d->document.c_str());
|
||||
if (!doc) throw Base::Exception("Document doesn't exist anymore");
|
||||
@@ -186,7 +186,7 @@ bool LoftWidget::accept()
|
||||
doc->commitCommand();
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
QMessageBox::warning(this, tr("Input error"), QString::fromAscii(e.what()));
|
||||
QMessageBox::warning(this, tr("Input error"), QString::fromLatin1(e.what()));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user