QString::fromAscii() is obsolete in Qt5. Replace it with fromLatin1().
This change is Qt4/Qt5 neutral.
This commit is contained in:
parent
3df6064e85
commit
b5519922d8
|
@ -33,7 +33,7 @@
|
|||
using namespace Gui;
|
||||
using namespace DAG;
|
||||
|
||||
FilterBase::FilterBase() : name(QString::fromAscii("empty name")), enabled(true), type(Type::Exclusion)
|
||||
FilterBase::FilterBase() : name(QString::fromLatin1("empty name")), enabled(true), type(Type::Exclusion)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -856,7 +856,7 @@ void Model::updateStates()
|
|||
else
|
||||
(*theGraph)[currentVertex].stateIcon->setPixmap(pendingPixmap);
|
||||
}
|
||||
(*theGraph)[currentVertex].stateIcon->setToolTip(QString::fromAscii(record.DObject->getStatusString()));
|
||||
(*theGraph)[currentVertex].stateIcon->setToolTip(QString::fromLatin1(record.DObject->getStatusString()));
|
||||
(*theGraph)[currentVertex].lastFeatureState = currentFeatureState;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -386,7 +386,7 @@ MainWindow::MainWindow(QWidget * parent, Qt::WindowFlags f)
|
|||
{
|
||||
DAG::DockWindow *dagDockWindow = new DAG::DockWindow(nullptr, this);
|
||||
dagDockWindow->setObjectName
|
||||
(QString::fromAscii(QT_TRANSLATE_NOOP("QDockWidget","DAG View")));
|
||||
(QString::fromLatin1(QT_TRANSLATE_NOOP("QDockWidget","DAG View")));
|
||||
pDockMgr->registerDockWindow("Std_DAGView", dagDockWindow);
|
||||
}
|
||||
|
||||
|
|
|
@ -493,9 +493,9 @@ bool SelectionSingleton::setPreselect(const char* pDocName, const char* pObjectN
|
|||
}
|
||||
msg.append(
|
||||
QObject::tr(" %1.%2.%3 ")
|
||||
.arg(QString::fromAscii(pDocName))
|
||||
.arg(QString::fromAscii(pObjectName))
|
||||
.arg(QString::fromAscii(pSubName))
|
||||
.arg(QString::fromLatin1(pDocName))
|
||||
.arg(QString::fromLatin1(pObjectName))
|
||||
.arg(QString::fromLatin1(pSubName))
|
||||
);
|
||||
|
||||
if (getMainWindow()) {
|
||||
|
|
|
@ -203,21 +203,21 @@ void ViewProviderDocumentObjectGroup::drop(const std::vector<const App::Document
|
|||
if (par) {
|
||||
// allow an object to be in one group only
|
||||
QString cmd;
|
||||
cmd = QString::fromAscii("App.getDocument(\"%1\").getObject(\"%2\").removeObject("
|
||||
cmd = QString::fromLatin1("App.getDocument(\"%1\").getObject(\"%2\").removeObject("
|
||||
"App.getDocument(\"%1\").getObject(\"%3\"))")
|
||||
.arg(QString::fromAscii(doc->getName()))
|
||||
.arg(QString::fromAscii(par->getNameInDocument()))
|
||||
.arg(QString::fromAscii(obj->getNameInDocument()));
|
||||
.arg(QString::fromLatin1(doc->getName()))
|
||||
.arg(QString::fromLatin1(par->getNameInDocument()))
|
||||
.arg(QString::fromLatin1(obj->getNameInDocument()));
|
||||
Gui::Application::Instance->runPythonCode(cmd.toUtf8());
|
||||
}
|
||||
|
||||
// build Python command for execution
|
||||
QString cmd;
|
||||
cmd = QString::fromAscii("App.getDocument(\"%1\").getObject(\"%2\").addObject("
|
||||
cmd = QString::fromLatin1("App.getDocument(\"%1\").getObject(\"%2\").addObject("
|
||||
"App.getDocument(\"%1\").getObject(\"%3\"))")
|
||||
.arg(QString::fromAscii(doc->getName()))
|
||||
.arg(QString::fromAscii(grp->getNameInDocument()))
|
||||
.arg(QString::fromAscii(obj->getNameInDocument()));
|
||||
.arg(QString::fromLatin1(doc->getName()))
|
||||
.arg(QString::fromLatin1(grp->getNameInDocument()))
|
||||
.arg(QString::fromLatin1(obj->getNameInDocument()));
|
||||
|
||||
Gui::Application::Instance->runPythonCode(cmd.toUtf8());
|
||||
}
|
||||
|
|
|
@ -635,7 +635,7 @@ void CmdPartDesignMoveFeature::activated(int iMsg)
|
|||
} catch (Base::Exception &) {
|
||||
QMessageBox::warning( Gui::getMainWindow(), QObject::tr("Sketch plane cannot be migrated"),
|
||||
QObject::tr("Please edit '%1' and redefine it to use a Base or Datum plane as the sketch plane.").
|
||||
arg( QString::fromAscii( sketch->Label.getValue () ) ) );
|
||||
arg( QString::fromLatin1( sketch->Label.getValue () ) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -231,13 +231,13 @@ void getReferencedSelection(const App::DocumentObject* thisObj, const Gui::Selec
|
|||
QString getRefStr(const App::DocumentObject* obj, const std::vector<std::string>& sub)
|
||||
{
|
||||
if (obj == NULL)
|
||||
return QString::fromAscii("");
|
||||
return QString::fromLatin1("");
|
||||
|
||||
if (PartDesign::Feature::isDatum(obj))
|
||||
return QString::fromAscii(obj->getNameInDocument());
|
||||
return QString::fromLatin1(obj->getNameInDocument());
|
||||
else if (sub.size()>0)
|
||||
return QString::fromAscii(obj->getNameInDocument()) + QString::fromAscii(":") +
|
||||
QString::fromAscii(sub.front().c_str());
|
||||
return QString::fromLatin1(obj->getNameInDocument()) + QString::fromLatin1(":") +
|
||||
QString::fromLatin1(sub.front().c_str());
|
||||
else
|
||||
return QString();
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ TaskBooleanParameters::TaskBooleanParameters(ViewProviderBoolean *BooleanView,QW
|
|||
std::vector<App::DocumentObject*> bodies = pcBoolean->Bodies.getValues();
|
||||
for (std::vector<App::DocumentObject*>::const_iterator b = bodies.begin(); b != bodies.end(); b++)
|
||||
{
|
||||
ui->listWidgetBodies->insertItem(0, QString::fromAscii((*b)->getNameInDocument()));
|
||||
ui->listWidgetBodies->insertItem(0, QString::fromLatin1((*b)->getNameInDocument()));
|
||||
}
|
||||
// Create context menu
|
||||
QAction* action = new QAction(tr("Remove"), this);
|
||||
|
@ -331,7 +331,7 @@ bool TaskDlgBooleanParameters::accept()
|
|||
Gui::Command::doCommand(Gui::Command::Doc,str.str().c_str());
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
QMessageBox::warning(parameter, tr("Boolean: Accept: Input error"), QString::fromAscii(e.what()));
|
||||
QMessageBox::warning(parameter, tr("Boolean: Accept: Input error"), QString::fromLatin1(e.what()));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -72,21 +72,21 @@ const QString makeRefString(const App::DocumentObject* obj, const std::string& s
|
|||
if (obj->getTypeId().isDerivedFrom(App::OriginFeature::getClassTypeId()) ||
|
||||
obj->getTypeId().isDerivedFrom(Part::Datum::getClassTypeId()))
|
||||
// App::Plane, Liine or Datum feature
|
||||
return QString::fromAscii(obj->getNameInDocument());
|
||||
return QString::fromLatin1(obj->getNameInDocument());
|
||||
|
||||
if ((sub.size() > 4) && (sub.substr(0,4) == "Face")) {
|
||||
int subId = std::atoi(&sub[4]);
|
||||
return QString::fromAscii(obj->getNameInDocument()) + QString::fromAscii(":") + QObject::tr("Face") + QString::number(subId);
|
||||
return QString::fromLatin1(obj->getNameInDocument()) + QString::fromLatin1(":") + QObject::tr("Face") + QString::number(subId);
|
||||
} else if ((sub.size() > 4) && (sub.substr(0,4) == "Edge")) {
|
||||
int subId = std::atoi(&sub[4]);
|
||||
return QString::fromAscii(obj->getNameInDocument()) + QString::fromAscii(":") + QObject::tr("Edge") + QString::number(subId);
|
||||
return QString::fromLatin1(obj->getNameInDocument()) + QString::fromLatin1(":") + QObject::tr("Edge") + QString::number(subId);
|
||||
} else if ((sub.size() > 6) && (sub.substr(0,6) == "Vertex")) {
|
||||
int subId = std::atoi(&sub[6]);
|
||||
return QString::fromAscii(obj->getNameInDocument()) + QString::fromAscii(":") + QObject::tr("Vertex") + QString::number(subId);
|
||||
return QString::fromLatin1(obj->getNameInDocument()) + QString::fromLatin1(":") + QObject::tr("Vertex") + QString::number(subId);
|
||||
} else {
|
||||
//something else that face/edge/vertex. Can be empty string.
|
||||
return QString::fromAscii(obj->getNameInDocument())
|
||||
+ (sub.length()>0 ? QString::fromAscii(":") : QString())
|
||||
return QString::fromLatin1(obj->getNameInDocument())
|
||||
+ (sub.length()>0 ? QString::fromLatin1(":") : QString())
|
||||
+ QString::fromLatin1(sub.c_str());
|
||||
}
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ void TaskDatumParameters::makeRefStrings(std::vector<QString>& refstrings, std::
|
|||
}
|
||||
|
||||
TaskDatumParameters::TaskDatumParameters(ViewProviderDatum *DatumView,QWidget *parent)
|
||||
: TaskBox(Gui::BitmapFactory().pixmap((QString::fromAscii("PartDesign_") + DatumView->datumType).toLatin1()),
|
||||
: TaskBox(Gui::BitmapFactory().pixmap((QString::fromLatin1("PartDesign_") + DatumView->datumType).toLatin1()),
|
||||
DatumView->datumType + tr(" parameters"), true, parent),
|
||||
DatumView(DatumView)
|
||||
{
|
||||
|
@ -276,7 +276,7 @@ const QString makeHintText(std::set<eRefType> hint)
|
|||
for (std::set<eRefType>::const_iterator t = hint.begin(); t != hint.end(); t++) {
|
||||
QString tText;
|
||||
tText = getShTypeText(*t);
|
||||
result += QString::fromAscii(result.size() == 0 ? "" : "/") + tText;
|
||||
result += QString::fromLatin1(result.size() == 0 ? "" : "/") + tText;
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -288,9 +288,9 @@ void TaskDatumParameters::updateUI(std::string message, bool error)
|
|||
if(!message.empty()) {
|
||||
ui->message->setText(QString::fromStdString(message));
|
||||
if(error)
|
||||
ui->message->setStyleSheet(QString::fromAscii("QLabel{color: red;}"));
|
||||
ui->message->setStyleSheet(QString::fromLatin1("QLabel{color: red;}"));
|
||||
else
|
||||
ui->message->setStyleSheet(QString::fromAscii("QLabel{color: green;}"));
|
||||
ui->message->setStyleSheet(QString::fromLatin1("QLabel{color: green;}"));
|
||||
}
|
||||
|
||||
ui->checkBoxFlip->setVisible(false);
|
||||
|
@ -593,9 +593,9 @@ void TaskDatumParameters::onRefName(const QString& text, unsigned idx)
|
|||
return;
|
||||
}
|
||||
|
||||
QStringList parts = text.split(QChar::fromAscii(':'));
|
||||
QStringList parts = text.split(QChar::fromLatin1(':'));
|
||||
if (parts.length() < 2)
|
||||
parts.push_back(QString::fromAscii(""));
|
||||
parts.push_back(QString::fromLatin1(""));
|
||||
// Check whether this is the name of an App::Plane or Part::Datum feature
|
||||
App::DocumentObject* obj = DatumView->getObject()->getDocument()->getObject(parts[0].toLatin1());
|
||||
if (obj == NULL) return;
|
||||
|
@ -617,17 +617,17 @@ void TaskDatumParameters::onRefName(const QString& text, unsigned idx)
|
|||
QRegExp rx;
|
||||
std::stringstream ss;
|
||||
|
||||
rx.setPattern(QString::fromAscii("^") + tr("Face") + QString::fromAscii("(\\d+)$"));
|
||||
rx.setPattern(QString::fromLatin1("^") + tr("Face") + QString::fromLatin1("(\\d+)$"));
|
||||
if (parts[1].indexOf(rx) >= 0) {
|
||||
int faceId = rx.cap(1).toInt();
|
||||
ss << "Face" << faceId;
|
||||
} else {
|
||||
rx.setPattern(QString::fromAscii("^") + tr("Edge") + QString::fromAscii("(\\d+)$"));
|
||||
rx.setPattern(QString::fromLatin1("^") + tr("Edge") + QString::fromLatin1("(\\d+)$"));
|
||||
if (parts[1].indexOf(rx) >= 0) {
|
||||
int lineId = rx.cap(1).toInt();
|
||||
ss << "Edge" << lineId;
|
||||
} else {
|
||||
rx.setPattern(QString::fromAscii("^") + tr("Vertex") + QString::fromAscii("(\\d+)$"));
|
||||
rx.setPattern(QString::fromLatin1("^") + tr("Vertex") + QString::fromLatin1("(\\d+)$"));
|
||||
if (parts[1].indexOf(rx) >= 0) {
|
||||
int vertexId = rx.cap(1).toInt();
|
||||
ss << "Vertex" << vertexId;
|
||||
|
@ -957,7 +957,7 @@ bool TaskDlgDatumParameters::accept()
|
|||
}
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
QMessageBox::warning(parameter, tr("Datum dialog: Input error"), QString::fromAscii(e.what()));
|
||||
QMessageBox::warning(parameter, tr("Datum dialog: Input error"), QString::fromLatin1(e.what()));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -195,7 +195,7 @@ void TaskDraftParameters::onRefDeleted(void)
|
|||
void TaskDraftParameters::getPlane(App::DocumentObject*& obj, std::vector<std::string>& sub) const
|
||||
{
|
||||
sub = std::vector<std::string>(1,"");
|
||||
QStringList parts = ui->linePlane->text().split(QChar::fromAscii(':'));
|
||||
QStringList parts = ui->linePlane->text().split(QChar::fromLatin1(':'));
|
||||
obj = DressUpView->getObject()->getDocument()->getObject(parts[0].toStdString().c_str());
|
||||
if (parts.size() > 1)
|
||||
sub[0] = parts[1].toStdString();
|
||||
|
@ -204,7 +204,7 @@ void TaskDraftParameters::getPlane(App::DocumentObject*& obj, std::vector<std::s
|
|||
void TaskDraftParameters::getLine(App::DocumentObject*& obj, std::vector<std::string>& sub) const
|
||||
{
|
||||
sub = std::vector<std::string>(1,"");
|
||||
QStringList parts = ui->lineLine->text().split(QChar::fromAscii(':'));
|
||||
QStringList parts = ui->lineLine->text().split(QChar::fromLatin1(':'));
|
||||
obj = DressUpView->getObject()->getDocument()->getObject(parts[0].toStdString().c_str());
|
||||
if (parts.size() > 1)
|
||||
sub[0] = parts[1].toStdString();
|
||||
|
|
|
@ -49,7 +49,7 @@ using namespace Gui;
|
|||
|
||||
TaskDressUpParameters::TaskDressUpParameters(ViewProviderDressUp *DressUpView, bool selectEdges, bool selectFaces, QWidget *parent)
|
||||
: TaskBox(Gui::BitmapFactory().pixmap((std::string("PartDesign_") + DressUpView->featureName()).c_str()),
|
||||
QString::fromAscii((DressUpView->featureName() + " parameters").c_str()),
|
||||
QString::fromLatin1((DressUpView->featureName() + " parameters").c_str()),
|
||||
true,
|
||||
parent),
|
||||
DressUpView(DressUpView), allowFaces(selectFaces), allowEdges(selectEdges)
|
||||
|
@ -138,7 +138,7 @@ const std::vector<std::string> TaskDressUpParameters::getReferences() const
|
|||
// TODO: This code is identical with TaskTransformedParameters::removeItemFromListWidget()
|
||||
void TaskDressUpParameters::removeItemFromListWidget(QListWidget* widget, const char* itemstr)
|
||||
{
|
||||
QList<QListWidgetItem*> items = widget->findItems(QString::fromAscii(itemstr), Qt::MatchExactly);
|
||||
QList<QListWidgetItem*> items = widget->findItems(QString::fromLatin1(itemstr), Qt::MatchExactly);
|
||||
if (!items.empty()) {
|
||||
for (QList<QListWidgetItem*>::const_iterator i = items.begin(); i != items.end(); i++) {
|
||||
QListWidgetItem* it = widget->takeItem(widget->row(*i));
|
||||
|
|
|
@ -111,7 +111,7 @@ bool TaskDlgFeatureParameters::accept() {
|
|||
Gui::Command::commitCommand();
|
||||
} catch (const Base::Exception& e) {
|
||||
// Generally the only thing that should fail is feature->isValid() others should be fine
|
||||
QMessageBox::warning( 0, tr("Input error"), QString::fromAscii(e.what()));
|
||||
QMessageBox::warning( 0, tr("Input error"), QString::fromLatin1(e.what()));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ TaskFeaturePick::TaskFeaturePick(std::vector<App::DocumentObject*>& objects,
|
|||
const std::vector<featureStatus>& status,
|
||||
QWidget* parent)
|
||||
: TaskBox(Gui::BitmapFactory().pixmap("edit-select-box"),
|
||||
QString::fromAscii("Select feature"), true, parent), ui(new Ui_TaskFeaturePick)
|
||||
QString::fromLatin1("Select feature"), true, parent), ui(new Ui_TaskFeaturePick)
|
||||
{
|
||||
|
||||
proxy = new QWidget(this);
|
||||
|
@ -100,8 +100,8 @@ TaskFeaturePick::TaskFeaturePick(std::vector<App::DocumentObject*>& objects,
|
|||
assert(status.size() == objects.size());
|
||||
for (; statusIt != status.end(); ++statusIt, ++objIt) {
|
||||
QListWidgetItem* item = new QListWidgetItem(
|
||||
QString::fromAscii((*objIt)->getNameInDocument()) +
|
||||
QString::fromAscii(" (") + getFeatureStatusString(*statusIt) + QString::fromAscii(")") );
|
||||
QString::fromLatin1((*objIt)->getNameInDocument()) +
|
||||
QString::fromLatin1(" (") + getFeatureStatusString(*statusIt) + QString::fromLatin1(")") );
|
||||
ui->listWidget->addItem(item);
|
||||
|
||||
//check if we need to set any origin in temporary visibility mode
|
||||
|
@ -191,7 +191,7 @@ std::vector<App::DocumentObject*> TaskFeaturePick::getFeatures() {
|
|||
continue;
|
||||
|
||||
QString t = item->text();
|
||||
t = t.left(t.indexOf(QString::fromAscii("(")) - 1);
|
||||
t = t.left(t.indexOf(QString::fromLatin1("(")) - 1);
|
||||
features.push_back(t);
|
||||
}
|
||||
|
||||
|
@ -216,7 +216,7 @@ std::vector<App::DocumentObject*> TaskFeaturePick::buildFeatures() {
|
|||
if(item->isSelected() && !item->isHidden()) {
|
||||
|
||||
QString t = item->text();
|
||||
t = t.left(t.indexOf(QString::fromAscii("(")) - 1);
|
||||
t = t.left(t.indexOf(QString::fromLatin1("(")) - 1);
|
||||
auto obj = App::GetApplication().getActiveDocument()->getObject(t.toLatin1().data());
|
||||
|
||||
//build the dependend copy or reference if wanted by the user
|
||||
|
@ -389,8 +389,8 @@ void TaskFeaturePick::onSelectionChanged(const Gui::SelectionChanges& msg)
|
|||
|
||||
QListWidgetItem *item = ui->listWidget->item(row);
|
||||
QString t = item->text();
|
||||
t = t.left(t.indexOf(QString::fromAscii("(")) - 1);
|
||||
if(t.compare(QString::fromAscii(obj.FeatName))==0) {
|
||||
t = t.left(t.indexOf(QString::fromLatin1("(")) - 1);
|
||||
if(t.compare(QString::fromLatin1(obj.FeatName))==0) {
|
||||
ui->listWidget->setItemSelected(item, true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -296,7 +296,7 @@ void TaskLinearPatternParameters::onDirectionChanged(int num) {
|
|||
pcLinearPattern->Direction.Paste(dirLinks.getCurrentLink());
|
||||
}
|
||||
} catch (Base::Exception &e) {
|
||||
QMessageBox::warning(0,tr("Error"),QString::fromAscii(e.what()));
|
||||
QMessageBox::warning(0,tr("Error"),QString::fromLatin1(e.what()));
|
||||
}
|
||||
|
||||
kickUpdateViewTimer();
|
||||
|
|
|
@ -205,7 +205,7 @@ void TaskLoftParameters::changeEvent(QEvent *e)
|
|||
ui->changeMode->addItem(tr("Two dimensions"));
|
||||
ui->changeMode->setCurrentIndex(index);
|
||||
|
||||
QStringList parts = ui->lineFaceName->text().split(QChar::fromAscii(':'));
|
||||
QStringList parts = ui->lineFaceName->text().split(QChar::fromLatin1(':'));
|
||||
QByteArray upToFace = ui->lineFaceName->property("FaceName").toByteArray();
|
||||
int faceId = -1;
|
||||
bool ok = false;
|
||||
|
@ -216,7 +216,7 @@ void TaskLoftParameters::changeEvent(QEvent *e)
|
|||
ui->lineFaceName->setPlaceholderText(tr("No face selected"));
|
||||
#endif
|
||||
ui->lineFaceName->setText(ok ?
|
||||
parts[0] + QString::fromAscii(":") + tr("Face") + QString::number(faceId) :
|
||||
parts[0] + QString::fromLatin1(":") + tr("Face") + QString::number(faceId) :
|
||||
tr("No face selected"));
|
||||
ui->spinOffset->blockSignals(false);
|
||||
ui->lengthEdit->blockSignals(false);
|
||||
|
|
|
@ -223,7 +223,7 @@ void TaskMirroredParameters::onPlaneChanged(int num) {
|
|||
pcMirrored->MirrorPlane.Paste(planeLinks.getCurrentLink());
|
||||
}
|
||||
} catch (Base::Exception &e) {
|
||||
QMessageBox::warning(0,tr("Error"),QString::fromAscii(e.what()));
|
||||
QMessageBox::warning(0,tr("Error"),QString::fromLatin1(e.what()));
|
||||
}
|
||||
|
||||
recomputeFeature();
|
||||
|
|
|
@ -98,9 +98,9 @@ TaskPadParameters::TaskPadParameters(ViewProviderPad *PadView, QWidget *parent,
|
|||
// shouldn't be de-activated if the pad has a support face
|
||||
ui->checkBoxReversed->setChecked(reversed);
|
||||
if ((obj != NULL) && PartDesign::Feature::isDatum(obj))
|
||||
ui->lineFaceName->setText(QString::fromAscii(obj->getNameInDocument()));
|
||||
ui->lineFaceName->setText(QString::fromLatin1(obj->getNameInDocument()));
|
||||
else if (faceId >= 0)
|
||||
ui->lineFaceName->setText(QString::fromAscii(obj->getNameInDocument()) + QString::fromAscii(":") + tr("Face") +
|
||||
ui->lineFaceName->setText(QString::fromLatin1(obj->getNameInDocument()) + QString::fromLatin1(":") + tr("Face") +
|
||||
QString::number(faceId));
|
||||
else
|
||||
ui->lineFaceName->setText(tr("No face selected"));
|
||||
|
@ -366,7 +366,7 @@ void TaskPadParameters::changeEvent(QEvent *e)
|
|||
ui->changeMode->addItem(tr("Two dimensions"));
|
||||
ui->changeMode->setCurrentIndex(index);
|
||||
|
||||
QStringList parts = ui->lineFaceName->text().split(QChar::fromAscii(':'));
|
||||
QStringList parts = ui->lineFaceName->text().split(QChar::fromLatin1(':'));
|
||||
QByteArray upToFace = ui->lineFaceName->property("FaceName").toByteArray();
|
||||
int faceId = -1;
|
||||
bool ok = false;
|
||||
|
@ -377,7 +377,7 @@ void TaskPadParameters::changeEvent(QEvent *e)
|
|||
ui->lineFaceName->setPlaceholderText(tr("No face selected"));
|
||||
#endif
|
||||
ui->lineFaceName->setText(ok ?
|
||||
parts[0] + QString::fromAscii(":") + tr("Face") + QString::number(faceId) :
|
||||
parts[0] + QString::fromLatin1(":") + tr("Face") + QString::number(faceId) :
|
||||
tr(""));
|
||||
ui->lengthEdit->blockSignals(false);
|
||||
ui->lengthEdit2->blockSignals(false);
|
||||
|
|
|
@ -89,9 +89,9 @@ TaskPocketParameters::TaskPocketParameters(ViewProviderPocket *PocketView,QWidge
|
|||
ui->checkBoxMidplane->setChecked(midplane);
|
||||
ui->checkBoxReversed->setChecked(reversed);
|
||||
if ((obj != NULL) && PartDesign::Feature::isDatum(obj))
|
||||
ui->lineFaceName->setText(QString::fromAscii(obj->getNameInDocument()));
|
||||
ui->lineFaceName->setText(QString::fromLatin1(obj->getNameInDocument()));
|
||||
else if (faceId >= 0)
|
||||
ui->lineFaceName->setText(QString::fromAscii(obj->getNameInDocument()) + QString::fromAscii(":") + tr("Face") +
|
||||
ui->lineFaceName->setText(QString::fromLatin1(obj->getNameInDocument()) + QString::fromLatin1(":") + tr("Face") +
|
||||
QString::number(faceId));
|
||||
else
|
||||
ui->lineFaceName->setText(tr("No face selected"));
|
||||
|
@ -357,7 +357,7 @@ void TaskPocketParameters::changeEvent(QEvent *e)
|
|||
ui->changeMode->addItem(tr("Up to face"));
|
||||
ui->changeMode->setCurrentIndex(index);
|
||||
|
||||
QStringList parts = ui->lineFaceName->text().split(QChar::fromAscii(':'));
|
||||
QStringList parts = ui->lineFaceName->text().split(QChar::fromLatin1(':'));
|
||||
QByteArray upToFace = ui->lineFaceName->property("FaceName").toByteArray();
|
||||
int faceId = -1;
|
||||
bool ok = false;
|
||||
|
@ -368,7 +368,7 @@ void TaskPocketParameters::changeEvent(QEvent *e)
|
|||
ui->lineFaceName->setPlaceholderText(tr("No face selected"));
|
||||
#endif
|
||||
ui->lineFaceName->setText(ok ?
|
||||
parts[0] + QString::fromAscii(":") + tr("Face") + QString::number(faceId) :
|
||||
parts[0] + QString::fromLatin1(":") + tr("Face") + QString::number(faceId) :
|
||||
tr(""));
|
||||
ui->lengthEdit->blockSignals(false);
|
||||
ui->offsetEdit->blockSignals(false);
|
||||
|
|
|
@ -295,7 +295,7 @@ void TaskPolarPatternParameters::onAxisChanged(int num) {
|
|||
pcPolarPattern->Axis.Paste(axesLinks.getCurrentLink());
|
||||
}
|
||||
} catch (Base::Exception &e) {
|
||||
QMessageBox::warning(0,tr("Error"),QString::fromAscii(e.what()));
|
||||
QMessageBox::warning(0,tr("Error"),QString::fromLatin1(e.what()));
|
||||
}
|
||||
|
||||
kickUpdateViewTimer();
|
||||
|
|
|
@ -469,7 +469,7 @@ void TaskBoxPrimitives::setPrimitive(QString name)
|
|||
}
|
||||
switch(ui.widgetStack->currentIndex()) {
|
||||
case 1: // box
|
||||
cmd = QString::fromAscii(
|
||||
cmd = QString::fromLatin1(
|
||||
"App.ActiveDocument.%1.Length=%2\n"
|
||||
"App.ActiveDocument.%1.Width=%3\n"
|
||||
"App.ActiveDocument.%1.Height=%4\n")
|
||||
|
@ -480,7 +480,7 @@ void TaskBoxPrimitives::setPrimitive(QString name)
|
|||
break;
|
||||
|
||||
case 2: // cylinder
|
||||
cmd = QString::fromAscii(
|
||||
cmd = QString::fromLatin1(
|
||||
"App.ActiveDocument.%1.Radius=%2\n"
|
||||
"App.ActiveDocument.%1.Height=%3\n"
|
||||
"App.ActiveDocument.%1.Angle=%4\n")
|
||||
|
@ -491,7 +491,7 @@ void TaskBoxPrimitives::setPrimitive(QString name)
|
|||
break;
|
||||
|
||||
case 3: // cone
|
||||
cmd = QString::fromAscii(
|
||||
cmd = QString::fromLatin1(
|
||||
"App.ActiveDocument.%1.Radius1=%2\n"
|
||||
"App.ActiveDocument.%1.Radius2=%3\n"
|
||||
"App.ActiveDocument.%1.Height=%4\n"
|
||||
|
@ -504,7 +504,7 @@ void TaskBoxPrimitives::setPrimitive(QString name)
|
|||
break;
|
||||
|
||||
case 4: // sphere
|
||||
cmd = QString::fromAscii(
|
||||
cmd = QString::fromLatin1(
|
||||
"App.ActiveDocument.%1.Radius=%2\n"
|
||||
"App.ActiveDocument.%1.Angle1=%3\n"
|
||||
"App.ActiveDocument.%1.Angle2=%4\n"
|
||||
|
@ -516,7 +516,7 @@ void TaskBoxPrimitives::setPrimitive(QString name)
|
|||
.arg(ui.sphereAngle3->value().getValue(),0,'f',2);
|
||||
break;
|
||||
case 5: // ellipsoid
|
||||
cmd = QString::fromAscii(
|
||||
cmd = QString::fromLatin1(
|
||||
"App.ActiveDocument.%1.Radius1=%2\n"
|
||||
"App.ActiveDocument.%1.Radius2=%3\n"
|
||||
"App.ActiveDocument.%1.Radius3=%4\n"
|
||||
|
@ -533,7 +533,7 @@ void TaskBoxPrimitives::setPrimitive(QString name)
|
|||
break;
|
||||
|
||||
case 6: // torus
|
||||
cmd = QString::fromAscii(
|
||||
cmd = QString::fromLatin1(
|
||||
"App.ActiveDocument.%1.Radius1=%2\n"
|
||||
"App.ActiveDocument.%1.Radius2=%3\n"
|
||||
"App.ActiveDocument.%1.Angle1=%4\n"
|
||||
|
@ -547,7 +547,7 @@ void TaskBoxPrimitives::setPrimitive(QString name)
|
|||
.arg(ui.torusAngle3->value().getValue(),0,'f',2);
|
||||
break;
|
||||
case 7: // prism
|
||||
cmd = QString::fromAscii(
|
||||
cmd = QString::fromLatin1(
|
||||
"App.ActiveDocument.%1.Polygon=%2\n"
|
||||
"App.ActiveDocument.%1.Circumradius=%3\n"
|
||||
"App.ActiveDocument.%1.Height=%4\n")
|
||||
|
@ -557,7 +557,7 @@ void TaskBoxPrimitives::setPrimitive(QString name)
|
|||
.arg(ui.prismHeight->value().getValue(),0,'f',2);
|
||||
break;
|
||||
case 8: // wedge
|
||||
cmd = QString::fromAscii(
|
||||
cmd = QString::fromLatin1(
|
||||
"App.ActiveDocument.%1.Xmin=%2\n"
|
||||
"App.ActiveDocument.%1.Ymin=%3\n"
|
||||
"App.ActiveDocument.%1.Zmin=%4\n"
|
||||
|
|
|
@ -71,17 +71,17 @@ const QString TaskSketchBasedParameters::onAddSelection(const Gui::SelectionChan
|
|||
PartDesign::ProfileBased* pcSketchBased = static_cast<PartDesign::ProfileBased*>(vp->getObject());
|
||||
App::DocumentObject* selObj = pcSketchBased->getDocument()->getObject(msg.pObjectName);
|
||||
if (selObj == pcSketchBased)
|
||||
return QString::fromAscii("");
|
||||
return QString::fromLatin1("");
|
||||
std::string subname = msg.pSubName;
|
||||
QString refStr;
|
||||
|
||||
// Remove subname for planes and datum features
|
||||
if (PartDesign::Feature::isDatum(selObj)) {
|
||||
subname = "";
|
||||
refStr = QString::fromAscii(selObj->getNameInDocument());
|
||||
refStr = QString::fromLatin1(selObj->getNameInDocument());
|
||||
} else {
|
||||
int faceId = std::atoi(&subname[4]);
|
||||
refStr = QString::fromAscii(selObj->getNameInDocument()) + QString::fromAscii(":") + QObject::tr("Face") + QString::number(faceId);
|
||||
refStr = QString::fromLatin1(selObj->getNameInDocument()) + QString::fromLatin1(":") + QObject::tr("Face") + QString::number(faceId);
|
||||
}
|
||||
|
||||
std::vector<std::string> upToFaces(1,subname);
|
||||
|
@ -132,9 +132,9 @@ const QByteArray TaskSketchBasedParameters::onFaceName(const QString& text)
|
|||
if (text.length() == 0)
|
||||
return QByteArray();
|
||||
|
||||
QStringList parts = text.split(QChar::fromAscii(':'));
|
||||
QStringList parts = text.split(QChar::fromLatin1(':'));
|
||||
if (parts.length() < 2)
|
||||
parts.push_back(QString::fromAscii(""));
|
||||
parts.push_back(QString::fromLatin1(""));
|
||||
// Check whether this is the name of an App::Plane or Part::Datum feature
|
||||
App::DocumentObject* obj = vp->getObject()->getDocument()->getObject(parts[0].toLatin1());
|
||||
if (obj == NULL)
|
||||
|
@ -173,13 +173,13 @@ const QByteArray TaskSketchBasedParameters::onFaceName(const QString& text)
|
|||
|
||||
QString TaskSketchBasedParameters::getFaceReference(const QString& obj, const QString& sub)
|
||||
{
|
||||
QString o = obj.left(obj.indexOf(QString::fromAscii(":")));
|
||||
QString o = obj.left(obj.indexOf(QString::fromLatin1(":")));
|
||||
|
||||
if (o == tr("No face selected"))
|
||||
return QString::fromAscii("");
|
||||
return QString::fromLatin1("");
|
||||
else
|
||||
return QString::fromAscii("(App.activeDocument().") + o +
|
||||
QString::fromAscii(", [\"") + sub + QString::fromAscii("\"])");
|
||||
return QString::fromLatin1("(App.activeDocument().") + o +
|
||||
QString::fromLatin1(", [\"") + sub + QString::fromLatin1("\"])");
|
||||
}
|
||||
|
||||
TaskSketchBasedParameters::~TaskSketchBasedParameters()
|
||||
|
|
|
@ -162,7 +162,7 @@ void TaskTransformedParameters::onButtonRemoveFeature(bool checked)
|
|||
|
||||
void TaskTransformedParameters::removeItemFromListWidget(QListWidget* widget, const char* itemstr)
|
||||
{
|
||||
QList<QListWidgetItem*> items = widget->findItems(QString::fromAscii(itemstr), Qt::MatchExactly);
|
||||
QList<QListWidgetItem*> items = widget->findItems(QString::fromLatin1(itemstr), Qt::MatchExactly);
|
||||
if (!items.empty()) {
|
||||
for (QList<QListWidgetItem*>::const_iterator i = items.begin(); i != items.end(); i++) {
|
||||
QListWidgetItem* it = widget->takeItem(widget->row(*i));
|
||||
|
|
|
@ -208,8 +208,8 @@ void fixSketchSupport (Sketcher::SketchObject* sketch)
|
|||
std::string Datum = doc->getUniqueObjectName("DatumPlane");
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.activeDocument().addObject('PartDesign::Plane','%s')",
|
||||
Datum.c_str());
|
||||
QString refStr = QString::fromAscii("[(App.activeDocument().%1,'')]")
|
||||
.arg ( QString::fromAscii ( plane->getNameInDocument () ) );
|
||||
QString refStr = QString::fromLatin1("[(App.activeDocument().%1,'')]")
|
||||
.arg ( QString::fromLatin1 ( plane->getNameInDocument () ) );
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.activeDocument().%s.Support = %s",
|
||||
Datum.c_str(), refStr.toStdString().c_str());
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.activeDocument().%s.MapMode = '%s'",
|
||||
|
|
|
@ -194,7 +194,7 @@ std::string ViewProviderDatum::getElement(const SoDetail* detail) const
|
|||
|
||||
SoDetail* ViewProviderDatum::getDetail(const char* subelement) const
|
||||
{
|
||||
QString subelem = QString::fromAscii(subelement);
|
||||
QString subelem = QString::fromLatin1(subelement);
|
||||
|
||||
if (subelem == QObject::tr("Line")) {
|
||||
SoLineDetail* detail = new SoLineDetail();
|
||||
|
|
|
@ -190,14 +190,14 @@ void ViewProviderLoft::highlightReferences(const bool on, bool auxillery)
|
|||
}
|
||||
|
||||
QIcon ViewProviderLoft::getIcon(void) const {
|
||||
QString str = QString::fromAscii("PartDesign_");
|
||||
QString str = QString::fromLatin1("PartDesign_");
|
||||
auto* prim = static_cast<PartDesign::Loft*>(getObject());
|
||||
if(prim->getAddSubType() == PartDesign::FeatureAddSub::Additive)
|
||||
str += QString::fromAscii("Additive_");
|
||||
str += QString::fromLatin1("Additive_");
|
||||
else
|
||||
str += QString::fromAscii("Subtractive_");
|
||||
str += QString::fromLatin1("Subtractive_");
|
||||
|
||||
str += QString::fromAscii("Loft.svg");
|
||||
str += QString::fromLatin1("Loft.svg");
|
||||
return Gui::BitmapFactory().pixmap(str.toStdString().c_str());
|
||||
}
|
||||
|
||||
|
|
|
@ -190,14 +190,14 @@ void ViewProviderPipe::highlightReferences(const bool on, bool auxillery)
|
|||
}
|
||||
|
||||
QIcon ViewProviderPipe::getIcon(void) const {
|
||||
QString str = QString::fromAscii("PartDesign_");
|
||||
QString str = QString::fromLatin1("PartDesign_");
|
||||
auto* prim = static_cast<PartDesign::Pipe*>(getObject());
|
||||
if(prim->getAddSubType() == PartDesign::FeatureAddSub::Additive)
|
||||
str += QString::fromAscii("Additive_");
|
||||
str += QString::fromLatin1("Additive_");
|
||||
else
|
||||
str += QString::fromAscii("Subtractive_");
|
||||
str += QString::fromLatin1("Subtractive_");
|
||||
|
||||
str += QString::fromAscii("Pipe.svg");
|
||||
str += QString::fromLatin1("Pipe.svg");
|
||||
return Gui::BitmapFactory().pixmap(str.toStdString().c_str());
|
||||
}
|
||||
|
||||
|
|
|
@ -135,41 +135,41 @@ std::vector< App::DocumentObject* > ViewProviderPrimitive::claimChildren(void) c
|
|||
|
||||
QIcon ViewProviderPrimitive::getIcon(void) const {
|
||||
|
||||
QString str = QString::fromAscii("PartDesign_");
|
||||
QString str = QString::fromLatin1("PartDesign_");
|
||||
auto* prim = static_cast<PartDesign::FeaturePrimitive*>(getObject());
|
||||
if(prim->getAddSubType() == PartDesign::FeatureAddSub::Additive)
|
||||
str += QString::fromAscii("Additive_");
|
||||
str += QString::fromLatin1("Additive_");
|
||||
else
|
||||
str += QString::fromAscii("Subtractive_");
|
||||
str += QString::fromLatin1("Subtractive_");
|
||||
|
||||
switch(prim->getPrimitiveType()) {
|
||||
|
||||
case PartDesign::FeaturePrimitive::Box:
|
||||
str += QString::fromAscii("Box");
|
||||
str += QString::fromLatin1("Box");
|
||||
break;
|
||||
case PartDesign::FeaturePrimitive::Cylinder:
|
||||
str += QString::fromAscii("Cylinder");
|
||||
str += QString::fromLatin1("Cylinder");
|
||||
break;
|
||||
case PartDesign::FeaturePrimitive::Sphere:
|
||||
str += QString::fromAscii("Sphere");
|
||||
str += QString::fromLatin1("Sphere");
|
||||
break;
|
||||
case PartDesign::FeaturePrimitive::Cone:
|
||||
str += QString::fromAscii("Cone");
|
||||
str += QString::fromLatin1("Cone");
|
||||
break;
|
||||
case PartDesign::FeaturePrimitive::Ellipsoid:
|
||||
str += QString::fromAscii("Ellipsoid");
|
||||
str += QString::fromLatin1("Ellipsoid");
|
||||
break;
|
||||
case PartDesign::FeaturePrimitive::Torus:
|
||||
str += QString::fromAscii("Torus");
|
||||
str += QString::fromLatin1("Torus");
|
||||
break;
|
||||
case PartDesign::FeaturePrimitive::Prism:
|
||||
str += QString::fromAscii("Prism");
|
||||
str += QString::fromLatin1("Prism");
|
||||
break;
|
||||
case PartDesign::FeaturePrimitive::Wedge:
|
||||
str += QString::fromAscii("Wedge");
|
||||
str += QString::fromLatin1("Wedge");
|
||||
break;
|
||||
}
|
||||
|
||||
str += QString::fromAscii(".svg");
|
||||
str += QString::fromLatin1(".svg");
|
||||
return Gui::BitmapFactory().pixmap(str.toStdString().c_str());
|
||||
}
|
||||
|
|
|
@ -144,7 +144,7 @@ void ViewProviderTransformed::recomputeFeature(void)
|
|||
unsigned rejected = 0;
|
||||
for (PartDesign::Transformed::rejectedMap::const_iterator r = rejected_trsf.begin(); r != rejected_trsf.end(); r++)
|
||||
rejected += r->second.size();
|
||||
QString msg = QString::fromAscii("%1");
|
||||
QString msg = QString::fromLatin1("%1");
|
||||
if (rejected > 0) {
|
||||
msg = QString::fromLatin1("<font color='orange'>%1<br/></font>\r\n%2");
|
||||
if (rejected == 1)
|
||||
|
|
Loading…
Reference in New Issue
Block a user