QString::fromAscii() is obsolete in Qt5. Replace it with fromLatin1().

This change is Qt4/Qt5 neutral.
This commit is contained in:
Mateusz Skowroński
2016-01-05 16:07:25 +01:00
committed by wmayer
parent d5c074f80d
commit cd2db00f22
154 changed files with 836 additions and 836 deletions
+1 -1
View File
@@ -1164,7 +1164,7 @@ void Application::initConfig(int argc, char ** argv)
// Now it's time to read-in the file branding.xml if it exists
Branding brand;
QString binDir = QString::fromUtf8((mConfig["AppHomePath"] + "bin").c_str());
QFileInfo fi(binDir, QString::fromAscii("branding.xml"));
QFileInfo fi(binDir, QString::fromLatin1("branding.xml"));
if (brand.readFile(fi.absoluteFilePath())) {
Branding::XmlConfig cfg = brand.getUserDefines();
for (Branding::XmlConfig::iterator it = cfg.begin(); it != cfg.end(); ++it) {
+1 -1
View File
@@ -123,7 +123,7 @@ QString UnitsApi::schemaTranslate(Base::Quantity quant,double &factor,QString &u
//{
// return UserPrefSystem->toStrWithUserPrefs(t,Value);
// //double UnitValue = Value/UserPrefFactor[t];
// //return QString::fromAscii("%1 %2").arg(UnitValue).arg(UserPrefUnit[t]);
// //return QString::fromLatin1("%1 %2").arg(UnitValue).arg(UserPrefUnit[t]);
//}
//
//void UnitsApi::toStrWithUserPrefs(QuantityType t,double Value,QString &outValue,QString &outUnit)
+1 -1
View File
@@ -75,7 +75,7 @@ std::string Uuid::createUuid(void)
void Uuid::setValue(const char* sString)
{
if (sString) {
QUuid uuid(QString::fromAscii(sString));
QUuid uuid(QString::fromLatin1(sString));
if (uuid.isNull())
throw std::runtime_error("invalid uuid");
// remove curly braces
+6 -6
View File
@@ -60,7 +60,7 @@ using namespace Gui::Dialog;
Action::Action (Command* pcCmd, QObject * parent)
: QObject(parent), _action(new QAction( this )), _pcCmd(pcCmd)
{
_action->setObjectName(QString::fromAscii(_pcCmd->getName()));
_action->setObjectName(QString::fromLatin1(_pcCmd->getName()));
connect(_action, SIGNAL(triggered(bool)), this, SLOT(onActivated()));
}
@@ -68,7 +68,7 @@ Action::Action (Command* pcCmd, QAction* action, QObject * parent)
: QObject(parent), _action(action), _pcCmd(pcCmd)
{
_action->setParent(this);
_action->setObjectName(QString::fromAscii(_pcCmd->getName()));
_action->setObjectName(QString::fromLatin1(_pcCmd->getName()));
connect(_action, SIGNAL(triggered(bool)), this, SLOT(onActivated()));
}
@@ -589,7 +589,7 @@ void WorkbenchGroup::slotAddWorkbench(const char* name)
QList<QAction*> workbenches = _group->actions();
for (QList<QAction*>::Iterator it = workbenches.begin(); it != workbenches.end(); ++it) {
if (!(*it)->isVisible()) {
QString wb = QString::fromAscii(name);
QString wb = QString::fromLatin1(name);
QPixmap px = Application::Instance->workbenchIcon(wb);
QString text = Application::Instance->workbenchMenuText(wb);
QString tip = Application::Instance->workbenchToolTip(wb);
@@ -606,7 +606,7 @@ void WorkbenchGroup::slotAddWorkbench(const char* name)
void WorkbenchGroup::slotRemoveWorkbench(const char* name)
{
QString workbench = QString::fromAscii(name);
QString workbench = QString::fromLatin1(name);
QList<QAction*> workbenches = _group->actions();
for (QList<QAction*>::Iterator it = workbenches.begin(); it != workbenches.end(); ++it) {
if ((*it)->objectName() == workbench) {
@@ -668,7 +668,7 @@ void RecentFilesAction::setFiles(const QStringList& files)
int numRecentFiles = std::min<int>(recentFiles.count(), files.count());
for (int index = 0; index < numRecentFiles; index++) {
QFileInfo fi(files[index]);
recentFiles[index]->setText(QString::fromAscii("&%1 %2").arg(index+1).arg(fi.fileName()));
recentFiles[index]->setText(QString::fromLatin1("&%1 %2").arg(index+1).arg(fi.fileName()));
recentFiles[index]->setStatusTip(tr("Open file %1").arg(files[index]));
recentFiles[index]->setToolTip(files[index]); // set the full name that we need later for saving
recentFiles[index]->setData(QVariant(index));
@@ -769,7 +769,7 @@ void RecentFilesAction::save()
QList<QAction*> recentFiles = _group->actions();
int num = std::min<int>(count, recentFiles.count());
for (int index = 0; index < num; index++) {
QString key = QString::fromAscii("MRU%1").arg(index);
QString key = QString::fromLatin1("MRU%1").arg(index);
QString value = recentFiles[index]->toolTip();
if (value.isEmpty())
break;
+11 -11
View File
@@ -1050,7 +1050,7 @@ bool Application::activateWorkbench(const char* name)
ok = true; // already active
// now try to create and activate the matching workbench object
else if (WorkbenchManager::instance()->activate(name, type)) {
getMainWindow()->activateWorkbench(QString::fromAscii(name));
getMainWindow()->activateWorkbench(QString::fromLatin1(name));
this->signalActivateWorkbench(name);
ok = true;
}
@@ -1095,7 +1095,7 @@ bool Application::activateWorkbench(const char* name)
}
catch (Py::Exception&) {
Base::PyException e; // extract the Python error text
QString msg = QString::fromAscii(e.what());
QString msg = QString::fromLatin1(e.what());
QRegExp rx;
// ignore '<type 'exceptions.ImportError'>' prefixes
rx.setPattern(QLatin1String("^\\s*<type 'exceptions.ImportError'>:\\s*"));
@@ -1251,13 +1251,13 @@ QStringList Application::workbenches(void) const
const char* start = (st != config.end() ? st->second.c_str() : "<none>");
QStringList hidden, extra;
if (ht != config.end()) {
QString items = QString::fromAscii(ht->second.c_str());
QString items = QString::fromLatin1(ht->second.c_str());
hidden = items.split(QLatin1Char(';'), QString::SkipEmptyParts);
if (hidden.isEmpty())
hidden.push_back(QLatin1String(""));
}
if (et != config.end()) {
QString items = QString::fromAscii(et->second.c_str());
QString items = QString::fromLatin1(et->second.c_str());
extra = items.split(QLatin1Char(';'), QString::SkipEmptyParts);
if (extra.isEmpty())
extra.push_back(QLatin1String(""));
@@ -1273,18 +1273,18 @@ QStringList Application::workbenches(void) const
// add only allowed workbenches
bool ok = true;
if (!extra.isEmpty()&&ok) {
ok = (extra.indexOf(QString::fromAscii(wbName)) != -1);
ok = (extra.indexOf(QString::fromLatin1(wbName)) != -1);
}
if (!hidden.isEmpty()&&ok) {
ok = (hidden.indexOf(QString::fromAscii(wbName)) == -1);
ok = (hidden.indexOf(QString::fromLatin1(wbName)) == -1);
}
// okay the item is visible
if (ok)
wb.push_back(QString::fromAscii(wbName));
wb.push_back(QString::fromLatin1(wbName));
// also allow start workbench in case it is hidden
else if (strcmp(wbName, start) == 0)
wb.push_back(QString::fromAscii(wbName));
wb.push_back(QString::fromLatin1(wbName));
}
return wb;
@@ -1718,7 +1718,7 @@ void Application::runApplication(void)
// if the auto workbench is not visible then force to use the default workbech
// and replace the wrong entry in the parameters
QStringList wb = app.workbenches();
if (!wb.contains(QString::fromAscii(start.c_str()))) {
if (!wb.contains(QString::fromLatin1(start.c_str()))) {
start = App::Application::Config()["StartWorkbench"];
App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/General")->
SetASCII("AutoloadModule", start.c_str());
@@ -1805,11 +1805,11 @@ void Application::runApplication(void)
void Application::checkForPreviousCrashes()
{
QDir tmp = QString::fromUtf8(App::Application::getTempPath().c_str());
tmp.setNameFilters(QStringList() << QString::fromAscii("*.lock"));
tmp.setNameFilters(QStringList() << QString::fromLatin1("*.lock"));
tmp.setFilter(QDir::Files);
QList<QFileInfo> restoreDocFiles;
QString exeName = QString::fromAscii(App::GetApplication().getExecutableName());
QString exeName = QString::fromLatin1(App::GetApplication().getExecutableName());
QList<QFileInfo> locks = tmp.entryInfoList();
for (QList<QFileInfo>::iterator it = locks.begin(); it != locks.end(); ++it) {
QString bn = it->baseName();
+10 -10
View File
@@ -84,8 +84,8 @@ BitmapFactoryInst& BitmapFactoryInst::instance(void)
}
_pcSingleton->addPath(path);
}
_pcSingleton->addPath(QString::fromAscii("%1/icons").arg(QString::fromUtf8(App::GetApplication().getHomePath())));
_pcSingleton->addPath(QString::fromAscii("%1/icons").arg(QString::fromUtf8(App::GetApplication().Config()["UserAppData"].c_str())));
_pcSingleton->addPath(QString::fromLatin1("%1/icons").arg(QString::fromUtf8(App::GetApplication().getHomePath())));
_pcSingleton->addPath(QString::fromLatin1("%1/icons").arg(QString::fromUtf8(App::GetApplication().Config()["UserAppData"].c_str())));
_pcSingleton->addPath(QLatin1String(":/icons/"));
_pcSingleton->addPath(QLatin1String(":/Icons/"));
@@ -148,7 +148,7 @@ QStringList BitmapFactoryInst::findIconFiles() const
QStringList files, filters;
QList<QByteArray> formats = QImageReader::supportedImageFormats();
for (QList<QByteArray>::iterator it = formats.begin(); it != formats.end(); ++it)
filters << QString::fromAscii("*.%1").arg(QString::fromAscii(*it).toLower());
filters << QString::fromLatin1("*.%1").arg(QString::fromLatin1(*it).toLower());
QStringList paths = QDir::searchPaths(QString::fromLatin1("icons"));
#if QT_VERSION >= 0x040500
@@ -252,8 +252,8 @@ QPixmap BitmapFactoryInst::pixmap(const char* name) const
if (!loadPixmap(fileName, icon)) {
// Go through supported file formats
for (QList<QByteArray>::iterator fm = formats.begin(); fm != formats.end(); ++fm) {
QString path = QString::fromAscii("%1.%2").arg(fileName).
arg(QString::fromAscii((*fm).toLower().constData()));
QString path = QString::fromLatin1("%1.%2").arg(fileName).
arg(QString::fromLatin1((*fm).toLower().constData()));
if (loadPixmap(path, icon)) {
break;
}
@@ -316,8 +316,8 @@ QPixmap BitmapFactoryInst::pixmapFromSvg(const QByteArray& contents, const QSize
QPalette pal = webView.palette();
pal.setColor(QPalette::Background, Qt::transparent);
webView.setPalette(pal);
webView.setContent(contents, QString::fromAscii("image/svg+xml"));
QString node = QString::fromAscii("document.rootElement.nodeName");
webView.setContent(contents, QString::fromLatin1("image/svg+xml"));
QString node = QString::fromLatin1("document.rootElement.nodeName");
QWebFrame* frame = webView.page()->mainFrame();
if (!frame) {
return QPixmap();
@@ -328,8 +328,8 @@ QPixmap BitmapFactoryInst::pixmapFromSvg(const QByteArray& contents, const QSize
return QPixmap();
}
QString w = QString::fromAscii("document.rootElement.width.baseVal.value");
QString h = QString::fromAscii("document.rootElement.height.baseVal.value");
QString w = QString::fromLatin1("document.rootElement.width.baseVal.value");
QString h = QString::fromLatin1("document.rootElement.height.baseVal.value");
double ww = frame->evaluateJavaScript(w).toDouble();
double hh = frame->evaluateJavaScript(h).toDouble();
if (ww == 0.0 || hh == 0.0)
@@ -361,7 +361,7 @@ QPixmap BitmapFactoryInst::pixmapFromSvg(const QByteArray& contents, const QSize
if (!frame) {
return QPixmap();
}
frame->setContent(contents, QString::fromAscii("image/svg+xml"));
frame->setContent(contents, QString::fromLatin1("image/svg+xml"));
// Important to exclude user events here because otherwise
// it may happen that an item the icon is created for gets
// deleted in the meantime. This happens e.g. dragging over
+2 -2
View File
@@ -321,7 +321,7 @@ void CallTipsList::extractTipsFromObject(Py::Object& obj, Py::List& list, QMap<Q
Py::Object attr = obj.getAttr(attrname.as_string());
CallTip tip;
QString str = QString::fromAscii(attrname.as_string().c_str());
QString str = QString::fromLatin1(attrname.as_string().c_str());
tip.name = str;
if (attr.isCallable()) {
@@ -387,7 +387,7 @@ void CallTipsList::extractTipsFromProperties(Py::Object& obj, QMap<QString, Call
for (std::map<std::string,App::Property*>::const_iterator It=Map.begin();It!=Map.end();++It) {
CallTip tip;
QString str = QString::fromAscii(It->first.c_str());
QString str = QString::fromLatin1(It->first.c_str());
tip.name = str;
tip.type = CallTip::Property;
QString longdoc = QString::fromUtf8(container->getPropertyDocumentation(It->second));
+3 -3
View File
@@ -676,7 +676,7 @@ Action * Command::createAction(void)
Action *pcAction;
pcAction = new Action(this,getMainWindow());
pcAction->setShortcut(QString::fromAscii(sAccel));
pcAction->setShortcut(QString::fromLatin1(sAccel));
applyCommandData(this->className(), pcAction);
if (sPixmap)
pcAction->setIcon(Gui::BitmapFactory().iconFromTheme(sPixmap));
@@ -751,7 +751,7 @@ Action * MacroCommand::createAction(void)
pcAction->setWhatsThis(QString::fromUtf8(sWhatsThis));
if (sPixmap)
pcAction->setIcon(Gui::BitmapFactory().pixmap(sPixmap));
pcAction->setShortcut(QString::fromAscii(sAccel));
pcAction->setShortcut(QString::fromLatin1(sAccel));
QString accel = pcAction->shortcut().toString(QKeySequence::NativeText);
if (!accel.isEmpty()) {
@@ -959,7 +959,7 @@ Action * PythonCommand::createAction(void)
Action *pcAction;
pcAction = new Action(this, qtAction, getMainWindow());
pcAction->setShortcut(QString::fromAscii(getAccel()));
pcAction->setShortcut(QString::fromLatin1(getAccel()));
applyCommandData(this->getName(), pcAction);
if (strcmp(getResource("Pixmap"),"") != 0)
pcAction->setIcon(Gui::BitmapFactory().iconFromTheme(getResource("Pixmap")));
+3 -3
View File
@@ -397,7 +397,7 @@ StdCmdNew::StdCmdNew()
void StdCmdNew::activated(int iMsg)
{
QString cmd;
cmd = QString::fromAscii("App.newDocument(\"%1\")")
cmd = QString::fromLatin1("App.newDocument(\"%1\")")
.arg(qApp->translate("StdCmdNew","Unnamed"));
doCommand(Command::Doc,(const char*)cmd.toUtf8());
}
@@ -752,7 +752,7 @@ Action * StdCmdUndo::createAction(void)
Action *pcAction;
pcAction = new UndoAction(this,getMainWindow());
pcAction->setShortcut(QString::fromAscii(sAccel));
pcAction->setShortcut(QString::fromLatin1(sAccel));
applyCommandData(this->className(), pcAction);
if (sPixmap)
pcAction->setIcon(Gui::BitmapFactory().iconFromTheme(sPixmap));
@@ -795,7 +795,7 @@ Action * StdCmdRedo::createAction(void)
Action *pcAction;
pcAction = new RedoAction(this,getMainWindow());
pcAction->setShortcut(QString::fromAscii(sAccel));
pcAction->setShortcut(QString::fromLatin1(sAccel));
applyCommandData(this->className(), pcAction);
if (sPixmap)
pcAction->setIcon(Gui::BitmapFactory().iconFromTheme(sPixmap));
+2 -2
View File
@@ -124,7 +124,7 @@ Action * StdCmdWorkbench::createAction(void)
Action *pcAction;
pcAction = new WorkbenchGroup(this,getMainWindow());
pcAction->setShortcut(QString::fromAscii(sAccel));
pcAction->setShortcut(QString::fromLatin1(sAccel));
applyCommandData(this->className(), pcAction);
if (sPixmap)
pcAction->setIcon(Gui::BitmapFactory().iconFromTheme(sPixmap));
@@ -206,7 +206,7 @@ Action * StdCmdAbout::createAction(void)
QCoreApplication::CodecForTr).arg(exe));
pcAction->setWhatsThis(QLatin1String(sWhatsThis));
pcAction->setIcon(QApplication::windowIcon());
pcAction->setShortcut(QString::fromAscii(sAccel));
pcAction->setShortcut(QString::fromLatin1(sAccel));
//Prevent Qt from using AboutRole -- fixes issue #0001485
pcAction->setMenuRole(QAction::ApplicationSpecificRole);
+2 -2
View File
@@ -69,8 +69,8 @@ Std_TestQM::Std_TestQM()
void Std_TestQM::activated(int iMsg)
{
QStringList files = QFileDialog::getOpenFileNames(getMainWindow(),
QString::fromAscii("Test translation"), QString(),
QString::fromAscii("Translation (*.qm)"));
QString::fromLatin1("Test translation"), QString(),
QString::fromLatin1("Translation (*.qm)"));
if (!files.empty()) {
Translator::instance()->activateLanguage("English");
QList<QTranslator*> i18n = qApp->findChildren<QTranslator*>();
+15 -15
View File
@@ -229,17 +229,17 @@ Action * StdCmdFreezeViews::createAction(void)
// add the action items
saveView = pcAction->addAction(QObject::tr("Save views..."));
pcAction->addAction(QObject::tr("Load views..."));
pcAction->addAction(QString::fromAscii(""))->setSeparator(true);
pcAction->addAction(QString::fromLatin1(""))->setSeparator(true);
freezeView = pcAction->addAction(QObject::tr("Freeze view"));
freezeView->setShortcut(QString::fromAscii(sAccel));
freezeView->setShortcut(QString::fromLatin1(sAccel));
clearView = pcAction->addAction(QObject::tr("Clear views"));
separator = pcAction->addAction(QString::fromAscii(""));
separator = pcAction->addAction(QString::fromLatin1(""));
separator->setSeparator(true);
offset = pcAction->actions().count();
// allow up to 50 views
for (int i=0; i<maxViews; i++)
pcAction->addAction(QString::fromAscii(""))->setVisible(false);
pcAction->addAction(QString::fromLatin1(""))->setVisible(false);
return pcAction;
}
@@ -266,7 +266,7 @@ void StdCmdFreezeViews::activated(int iMsg)
savedViews++;
QString viewnr = QString(QObject::tr("Restore view &%1")).arg(index+1);
(*it)->setText(viewnr);
(*it)->setToolTip(QString::fromAscii(ppReturn));
(*it)->setToolTip(QString::fromLatin1(ppReturn));
(*it)->setVisible(true);
if (index < 9) {
int accel = Qt::CTRL+Qt::Key_1;
@@ -286,7 +286,7 @@ void StdCmdFreezeViews::activated(int iMsg)
// Activate a view
QList<QAction*> acts = pcAction->actions();
QString data = acts[iMsg]->toolTip();
QString send = QString::fromAscii("SetCamera %1").arg(data);
QString send = QString::fromLatin1("SetCamera %1").arg(data);
getGuiApplication()->sendMsgToActiveView(send.toLatin1());
}
}
@@ -316,10 +316,10 @@ void StdCmdFreezeViews::onSaveViews()
// remove the first line because it's a comment like '#Inventor V2.1 ascii'
QString viewPos;
if ( !data.isEmpty() ) {
QStringList lines = data.split(QString::fromAscii("\n"));
QStringList lines = data.split(QString::fromLatin1("\n"));
if ( lines.size() > 1 ) {
lines.pop_front();
viewPos = lines.join(QString::fromAscii(" "));
viewPos = lines.join(QString::fromLatin1(" "));
}
}
@@ -376,18 +376,18 @@ void StdCmdFreezeViews::onRestoreViews()
}
bool ok;
int scheme = root.attribute(QString::fromAscii("SchemaVersion")).toInt(&ok);
int scheme = root.attribute(QString::fromLatin1("SchemaVersion")).toInt(&ok);
if (!ok) return;
// SchemeVersion "1"
if (scheme == 1) {
// read the views, ignore the attribute 'Count'
QDomElement child = root.firstChildElement(QString::fromAscii("Views"));
QDomElement views = child.firstChildElement(QString::fromAscii("Camera"));
QDomElement child = root.firstChildElement(QString::fromLatin1("Views"));
QDomElement views = child.firstChildElement(QString::fromLatin1("Camera"));
QStringList cameras;
while (!views.isNull()) {
QString setting = views.attribute(QString::fromAscii("settings"));
QString setting = views.attribute(QString::fromLatin1("settings"));
cameras << setting;
views = views.nextSiblingElement(QString::fromAscii("Camera"));
views = views.nextSiblingElement(QString::fromLatin1("Camera"));
}
// use this rather than the attribute 'Count' because it could be
@@ -1468,12 +1468,12 @@ void StdViewScreenShot::activated(int iMsg)
Base::Reference<ParameterGrp> hExt = App::GetApplication().GetUserParameter().GetGroup("BaseApp")
->GetGroup("Preferences")->GetGroup("General");
QString ext = QString::fromAscii(hExt->GetASCII("OffscreenImageFormat").c_str());
QString ext = QString::fromLatin1(hExt->GetASCII("OffscreenImageFormat").c_str());
QStringList filter;
QString selFilter;
for (QStringList::Iterator it = formats.begin(); it != formats.end(); ++it) {
filter << QString::fromAscii("%1 %2 (*.%3)").arg((*it).toUpper()).
filter << QString::fromLatin1("%1 %2 (*.%3)").arg((*it).toUpper()).
arg(QObject::tr("files")).arg((*it).toLower());
if (ext == *it)
selFilter = filter.last();
+4 -4
View File
@@ -198,7 +198,7 @@ void DlgCustomActionsImp::on_actionListWidget_itemActivated(QTreeWidgetItem *ite
actionMenu -> setText(QString::fromUtf8(pScript->getMenuText()));
actionToolTip -> setText(QString::fromUtf8(pScript->getToolTipText()));
actionStatus -> setText(QString::fromUtf8(pScript->getStatusTip()));
actionAccel -> setText(QString::fromAscii(pScript->getAccel()));
actionAccel -> setText(QString::fromLatin1(pScript->getAccel()));
pixmapLabel->clear();
m_sPixmap = QString::null;
const char* name = pScript->getPixmap();
@@ -335,7 +335,7 @@ void DlgCustomActionsImp::on_buttonReplaceAction_clicked()
action->setStatusTip(QString::fromUtf8(macro->getStatusTip()));
if (macro->getPixmap())
action->setIcon(Gui::BitmapFactory().pixmap(macro->getPixmap()));
action->setShortcut(QString::fromAscii(macro->getAccel()));
action->setShortcut(QString::fromLatin1(macro->getAccel()));
QString accel = action->shortcut().toString(QKeySequence::NativeText);
if (!accel.isEmpty()) {
@@ -456,7 +456,7 @@ void IconDialog::onAddIconPath()
QStringList filters;
QList<QByteArray> formats = QImageReader::supportedImageFormats();
for (QList<QByteArray>::iterator jt = formats.begin(); jt != formats.end(); ++jt)
filters << QString::fromAscii("*.%1").arg(QString::fromAscii(*jt).toLower());
filters << QString::fromLatin1("*.%1").arg(QString::fromLatin1(*jt).toLower());
QDir d(*it);
d.setNameFilters(filters);
QFileInfoList fi = d.entryInfoList();
@@ -505,7 +505,7 @@ QString DlgCustomActionsImp::newActionName()
do
{
bUsed = false;
sName = QString::fromAscii("Std_Macro_%1").arg( id++ );
sName = QString::fromLatin1("Std_Macro_%1").arg( id++ );
std::vector<Command*>::iterator it;
for ( it = aclCurMacros.begin(); it!= aclCurMacros.end(); ++it )
+7 -7
View File
@@ -314,19 +314,19 @@ QVariant CommandModel::data(const QModelIndex &index, int role) const
if (role == Qt::UserRole)
{
if (node->nodeType == CommandNode::CommandType)
return QVariant(QString::fromAscii(node->aCommand->getName()));
return QVariant(QString::fromLatin1(node->aCommand->getName()));
if (node->nodeType == CommandNode::GroupType)
{
if (node->children.size() < 1)
return QVariant();
CommandNode *childNode = node->children.at(0);
return QVariant(QString::fromAscii(childNode->aCommand->getGroupName()));
return QVariant(QString::fromLatin1(childNode->aCommand->getGroupName()));
}
return QVariant();
}
if (role == Qt::ToolTipRole)
if (node->nodeType == CommandNode::CommandType)
return QVariant(QString::fromAscii(node->aCommand->getToolTipText()));
return QVariant(QString::fromLatin1(node->aCommand->getToolTipText()));
return QVariant();
}
@@ -358,7 +358,7 @@ CommandNode* CommandModel::nodeFromIndex(const QModelIndex &index) const
void CommandModel::goAddMacro(const QByteArray &macroName)
{
QModelIndexList indexList(this->match(this->index(0,0), Qt::UserRole, QVariant(QString::fromAscii("Macros")),
QModelIndexList indexList(this->match(this->index(0,0), Qt::UserRole, QVariant(QString::fromLatin1("Macros")),
1, Qt::MatchWrap | Qt::MatchRecursive));
QModelIndex macrosIndex;
if (indexList.size() < 1)
@@ -366,7 +366,7 @@ void CommandModel::goAddMacro(const QByteArray &macroName)
//this is the first macro and we have to add the Macros item.
//figure out where to insert it. Should be in the command groups now.
QStringList groups = orderedGroups();
int location(groups.indexOf(QString::fromAscii("Macros")));
int location(groups.indexOf(QString::fromLatin1("Macros")));
if (location == -1)
location = groups.size();
//add row
@@ -399,7 +399,7 @@ void CommandModel::goAddMacro(const QByteArray &macroName)
void CommandModel::goRemoveMacro(const QByteArray &macroName)
{
QModelIndexList macroList(this->match(this->index(0,0), Qt::UserRole, QVariant(QString::fromAscii(macroName.data())),
QModelIndexList macroList(this->match(this->index(0,0), Qt::UserRole, QVariant(QString::fromLatin1(macroName.data())),
1, Qt::MatchWrap | Qt::MatchRecursive));
if (macroList.isEmpty())
return;
@@ -455,7 +455,7 @@ QStringList CommandModel::orderedGroups()
std::vector <Command*> commands = Application::Instance->commandManager().getAllCommands();
for (std::vector <Command*>::iterator it = commands.begin(); it != commands.end(); ++it)
{
QString groupName(QString::fromAscii((*it)->getGroupName()));
QString groupName(QString::fromLatin1((*it)->getGroupName()));
if (!groups.contains(groupName))
groups << groupName;
}
+1 -1
View File
@@ -406,7 +406,7 @@ void DlgDisplayPropertiesImp::setDisplayModes(const std::vector<Gui::ViewProvide
App::Property* prop = (*it)->getPropertyByName("DisplayMode");
if (prop && prop->getTypeId() == App::PropertyEnumeration::getClassTypeId()) {
App::PropertyEnumeration* display = static_cast<App::PropertyEnumeration*>(prop);
QString activeMode = QString::fromAscii(display->getValueAsString());
QString activeMode = QString::fromLatin1(display->getValueAsString());
int index = changeMode->findText(activeMode);
if (index != -1) {
changeMode->setCurrentIndex(index);
+17 -17
View File
@@ -62,63 +62,63 @@ DlgSettingsEditorImp::DlgSettingsEditorImp( QWidget* parent )
col = Qt::black;
unsigned long lText = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8);
d->colormap.push_back(QPair<QString, unsigned long>
(QString::fromAscii(QT_TR_NOOP("Text")), lText));
(QString::fromLatin1(QT_TR_NOOP("Text")), lText));
col = Qt::cyan;
unsigned long lBookmarks = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8);
d->colormap.push_back(QPair<QString, unsigned long>
(QString::fromAscii(QT_TR_NOOP("Bookmark")), lBookmarks));
(QString::fromLatin1(QT_TR_NOOP("Bookmark")), lBookmarks));
col = Qt::red;
unsigned long lBreakpnts = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8);
d->colormap.push_back(QPair<QString, unsigned long>
(QString::fromAscii(QT_TR_NOOP("Breakpoint")), lBreakpnts));
(QString::fromLatin1(QT_TR_NOOP("Breakpoint")), lBreakpnts));
col = Qt::blue;
unsigned long lKeywords = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8);
d->colormap.push_back(QPair<QString, unsigned long>
(QString::fromAscii(QT_TR_NOOP("Keyword")), lKeywords));
(QString::fromLatin1(QT_TR_NOOP("Keyword")), lKeywords));
col.setRgb(0, 170, 0);
unsigned long lComments = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8);
d->colormap.push_back(QPair<QString, unsigned long>
(QString::fromAscii(QT_TR_NOOP("Comment")), lComments));
(QString::fromLatin1(QT_TR_NOOP("Comment")), lComments));
col.setRgb(160, 160, 164);
unsigned long lBlockCom = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8);
d->colormap.push_back(QPair<QString, unsigned long>
(QString::fromAscii(QT_TR_NOOP("Block comment")), lBlockCom));
(QString::fromLatin1(QT_TR_NOOP("Block comment")), lBlockCom));
col = Qt::blue;
unsigned long lNumbers = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8);
d->colormap.push_back(QPair<QString, unsigned long>
(QString::fromAscii(QT_TR_NOOP("Number")), lNumbers));
(QString::fromLatin1(QT_TR_NOOP("Number")), lNumbers));
col = Qt::red;
unsigned long lStrings = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8);
d->colormap.push_back(QPair<QString, unsigned long>
(QString::fromAscii(QT_TR_NOOP("String")), lStrings));
(QString::fromLatin1(QT_TR_NOOP("String")), lStrings));
col = Qt::red;
unsigned long lCharacter = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8);
d->colormap.push_back(QPair<QString, unsigned long>
(QString::fromAscii(QT_TR_NOOP("Character")), lCharacter));
(QString::fromLatin1(QT_TR_NOOP("Character")), lCharacter));
col.setRgb(255, 170, 0);
unsigned long lClass = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8);
d->colormap.push_back(QPair<QString, unsigned long>
(QString::fromAscii(QT_TR_NOOP("Class name")), lClass));
(QString::fromLatin1(QT_TR_NOOP("Class name")), lClass));
col.setRgb(255, 170, 0);
unsigned long lDefine = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8);
d->colormap.push_back(QPair<QString, unsigned long>
(QString::fromAscii(QT_TR_NOOP("Define name")), lDefine));
(QString::fromLatin1(QT_TR_NOOP("Define name")), lDefine));
col.setRgb(160, 160, 164);
unsigned long lOperat = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8);
d->colormap.push_back(QPair<QString, unsigned long>
(QString::fromAscii(QT_TR_NOOP("Operator")), lOperat));
(QString::fromLatin1(QT_TR_NOOP("Operator")), lOperat));
col.setRgb(170, 170, 127);
unsigned long lPyOutput = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8);
d->colormap.push_back(QPair<QString, unsigned long>
(QString::fromAscii(QT_TR_NOOP("Python output")), lPyOutput));
(QString::fromLatin1(QT_TR_NOOP("Python output")), lPyOutput));
col = Qt::red;
unsigned long lPyError = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8);
d->colormap.push_back(QPair<QString, unsigned long>
(QString::fromAscii(QT_TR_NOOP("Python error")), lPyError));
(QString::fromLatin1(QT_TR_NOOP("Python error")), lPyError));
col.setRgb(224, 224, 224);
unsigned long lCLine = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8);
d->colormap.push_back(QPair<QString, unsigned long>
(QString::fromAscii(QT_TR_NOOP("Current line highlight")), lCLine));
(QString::fromLatin1(QT_TR_NOOP("Current line highlight")), lCLine));
QStringList labels; labels << tr("Items");
this->displayItems->setHeaderLabels(labels);
@@ -188,7 +188,7 @@ void DlgSettingsEditorImp::loadSettings()
radioTabs->onRestore();
radioSpaces->onRestore();
textEdit1->setPlainText(QString::fromAscii(
textEdit1->setPlainText(QString::fromLatin1(
"# Short Python sample\n"
"import sys\n"
"def foo(begin, end):\n"
@@ -218,7 +218,7 @@ void DlgSettingsEditorImp::loadSettings()
QFontDatabase fdb;
QStringList familyNames = fdb.families( QFontDatabase::Any );
fontFamily->addItems(familyNames);
int index = familyNames.indexOf(QString::fromAscii(hGrp->GetASCII("Font", "Courier").c_str()));
int index = familyNames.indexOf(QString::fromLatin1(hGrp->GetASCII("Font", "Courier").c_str()));
if (index < 0) index = 0;
fontFamily->setCurrentIndex(index);
on_fontFamily_activated();
+7 -7
View File
@@ -218,12 +218,12 @@ void DlgGeneralImp::loadSettings()
QString lang = QLocale::languageToString(QLocale::system().language());
QByteArray language = hGrp->GetASCII("Language", (const char*)lang.toLatin1()).c_str();
int index = 1;
Languages->addItem(QString::fromAscii("English"), QByteArray("English"));
Languages->addItem(QString::fromLatin1("English"), QByteArray("English"));
TStringMap list = Translator::instance()->supportedLocales();
for (TStringMap::iterator it = list.begin(); it != list.end(); ++it, index++) {
QLocale locale(QString::fromAscii(it->second.c_str()));
QLocale locale(QString::fromLatin1(it->second.c_str()));
QByteArray lang = it->first.c_str();
QString langname = QString::fromAscii(lang.constData());
QString langname = QString::fromLatin1(lang.constData());
#if QT_VERSION >= 0x040800
QString native = locale.nativeLanguageName();
if (!native.isEmpty()) {
@@ -254,8 +254,8 @@ void DlgGeneralImp::loadSettings()
QMap<QString, QString> cssFiles;
QDir dir;
QStringList filter;
filter << QString::fromAscii("*.qss");
filter << QString::fromAscii("*.css");
filter << QString::fromLatin1("*.qss");
filter << QString::fromLatin1("*.css");
QFileInfoList fileNames;
// read from user, resource and built-in directory
@@ -271,12 +271,12 @@ void DlgGeneralImp::loadSettings()
}
// now add all unique items
this->StyleSheets->addItem(tr("No style sheet"), QString::fromAscii(""));
this->StyleSheets->addItem(tr("No style sheet"), QString::fromLatin1(""));
for (QMap<QString, QString>::iterator it = cssFiles.begin(); it != cssFiles.end(); ++it) {
this->StyleSheets->addItem(it.key(), it.value());
}
this->selectedStyleSheet = QString::fromAscii(hGrp->GetASCII("StyleSheet").c_str());
this->selectedStyleSheet = QString::fromLatin1(hGrp->GetASCII("StyleSheet").c_str());
index = this->StyleSheets->findData(this->selectedStyleSheet);
if (index > -1) this->StyleSheets->setCurrentIndex(index);
}
+5 -5
View File
@@ -141,7 +141,7 @@ void DlgCustomKeyboardImp::on_commandTreeWidget_currentItemChanged(QTreeWidgetIt
if (cmd) {
if (cmd->getAction()) {
QKeySequence ks = cmd->getAction()->shortcut();
QKeySequence ks2 = QString::fromAscii(cmd->getAccel());
QKeySequence ks2 = QString::fromLatin1(cmd->getAccel());
QKeySequence ks3 = editShortcut->text();
if (ks.isEmpty())
@@ -152,7 +152,7 @@ void DlgCustomKeyboardImp::on_commandTreeWidget_currentItemChanged(QTreeWidgetIt
buttonAssign->setEnabled(!editShortcut->text().isEmpty() && (ks != ks3));
buttonReset->setEnabled((ks != ks2));
} else {
QKeySequence ks = QString::fromAscii(cmd->getAccel());
QKeySequence ks = QString::fromLatin1(cmd->getAccel());
if (ks.isEmpty())
accelLineEditShortcut->setText( tr("none") );
else
@@ -273,7 +273,7 @@ void DlgCustomKeyboardImp::on_buttonReset_clicked()
CommandManager & cCmdMgr = Application::Instance->commandManager();
Command* cmd = cCmdMgr.getCommandByName(name.constData());
if (cmd && cmd->getAction()) {
cmd->getAction()->setShortcut(QString::fromAscii(cmd->getAccel()));
cmd->getAction()->setShortcut(QString::fromLatin1(cmd->getAccel()));
QString txt = cmd->getAction()->shortcut();
accelLineEditShortcut->setText((txt.isEmpty() ? tr("none") : txt));
ParameterGrp::handle hGrp = WindowParameter::getDefaultParameter()->GetGroup("Shortcut");
@@ -290,7 +290,7 @@ void DlgCustomKeyboardImp::on_buttonResetAll_clicked()
std::vector<Command*> cmds = cCmdMgr.getAllCommands();
for (std::vector<Command*>::iterator it = cmds.begin(); it != cmds.end(); ++it) {
if ((*it)->getAction()) {
(*it)->getAction()->setShortcut(QKeySequence(QString::fromAscii((*it)->getAccel())));
(*it)->getAction()->setShortcut(QKeySequence(QString::fromLatin1((*it)->getAccel())));
}
}
@@ -332,7 +332,7 @@ void DlgCustomKeyboardImp::on_editShortcut_textChanged(const QString& sc)
for (QList<QAction*>::iterator jt = acts.begin(); jt != acts.end(); ++jt) {
if ((*jt)->shortcut() == ks) {
++countAmbiguous;
ambiguousCommand = QString::fromAscii((*it)->getName()); // store the last one
ambiguousCommand = QString::fromLatin1((*it)->getName()); // store the last one
ambiguousMenu = qApp->translate((*it)->className(), (*it)->getMenuText());
QTreeWidgetItem* item = new QTreeWidgetItem(assignedTreeWidget);
+2 -2
View File
@@ -157,7 +157,7 @@ void DlgMacroExecuteImp::on_editButton_clicked()
if (!item) return;
QDir dir(this->macroPath);
QString file = QString::fromAscii("%1/%2").arg(dir.absolutePath()).arg(item->text(0));
QString file = QString::fromLatin1("%1/%2").arg(dir.absolutePath()).arg(item->text(0));
Application::Instance->open(file.toUtf8(), "FreeCADGui");
close();
@@ -194,7 +194,7 @@ void DlgMacroExecuteImp::on_createButton_clicked()
editor->setWindowIcon(Gui::BitmapFactory().iconFromTheme("applications-python"));
PythonEditorView* edit = new PythonEditorView(editor, getMainWindow());
edit->open(fi.absoluteFilePath());
edit->setWindowTitle(QString::fromAscii("%1[*]").arg(fn));
edit->setWindowTitle(QString::fromLatin1("%1[*]").arg(fn));
edit->resize(400, 300);
getMainWindow()->addWindow(edit);
close();
+16 -16
View File
@@ -757,8 +757,8 @@ void ParameterValue::onCreateBoolItem()
}
}
QStringList list; list << QString::fromAscii("true")
<< QString::fromAscii("false");
QStringList list; list << QString::fromLatin1("true")
<< QString::fromLatin1("false");
QString val = QInputDialog::getItem (this, QObject::tr("New boolean item"), QObject::tr("Choose an item:"),
list, 0, false, &ok);
if ( ok )
@@ -891,7 +891,7 @@ ParameterText::ParameterText ( QTreeWidget * parent, QString label, const char*
{
setIcon(0,BitmapFactory().pixmap("Param_Text") );
setText(0, label);
setText(1, QString::fromAscii("Text"));
setText(1, QString::fromLatin1("Text"));
setText(2, QString::fromUtf8(value));
}
@@ -935,8 +935,8 @@ ParameterInt::ParameterInt ( QTreeWidget * parent, QString label, long value, co
{
setIcon(0,BitmapFactory().pixmap("Param_Int") );
setText(0, label);
setText(1, QString::fromAscii("Integer"));
setText(2, QString::fromAscii("%1").arg(value));
setText(1, QString::fromLatin1("Integer"));
setText(2, QString::fromLatin1("%1").arg(value));
}
ParameterInt::~ParameterInt()
@@ -950,7 +950,7 @@ void ParameterInt::changeValue()
text(2).toInt(), -2147483647, 2147483647, 1, &ok);
if ( ok )
{
setText(2, QString::fromAscii("%1").arg(num));
setText(2, QString::fromLatin1("%1").arg(num));
_hcGrp->SetInt(text(0).toLatin1(), (long)num);
}
}
@@ -979,8 +979,8 @@ ParameterUInt::ParameterUInt ( QTreeWidget * parent, QString label, unsigned lon
{
setIcon(0,BitmapFactory().pixmap("Param_UInt") );
setText(0, label);
setText(1, QString::fromAscii("Unsigned"));
setText(2, QString::fromAscii("%1").arg(value));
setText(1, QString::fromLatin1("Unsigned"));
setText(2, QString::fromLatin1("%1").arg(value));
}
ParameterUInt::~ParameterUInt()
@@ -1002,7 +1002,7 @@ void ParameterUInt::changeValue()
if ( ok )
{
setText(2, QString::fromAscii("%1").arg(num));
setText(2, QString::fromLatin1("%1").arg(num));
_hcGrp->SetUnsigned(text(0).toLatin1(), (unsigned long)num);
}
}
@@ -1032,8 +1032,8 @@ ParameterFloat::ParameterFloat ( QTreeWidget * parent, QString label, double val
{
setIcon(0,BitmapFactory().pixmap("Param_Float") );
setText(0, label);
setText(1, QString::fromAscii("Float"));
setText(2, QString::fromAscii("%1").arg(value));
setText(1, QString::fromLatin1("Float"));
setText(2, QString::fromLatin1("%1").arg(value));
}
ParameterFloat::~ParameterFloat()
@@ -1047,7 +1047,7 @@ void ParameterFloat::changeValue()
text(2).toDouble(), -2147483647, 2147483647, 12, &ok);
if ( ok )
{
setText(2, QString::fromAscii("%1").arg(num));
setText(2, QString::fromLatin1("%1").arg(num));
_hcGrp->SetFloat(text(0).toLatin1(), num);
}
}
@@ -1076,8 +1076,8 @@ ParameterBool::ParameterBool ( QTreeWidget * parent, QString label, bool value,
{
setIcon(0,BitmapFactory().pixmap("Param_Bool") );
setText(0, label);
setText(1, QString::fromAscii("Boolean"));
setText(2, QString::fromAscii((value ? "true" : "false")));
setText(1, QString::fromLatin1("Boolean"));
setText(2, QString::fromLatin1((value ? "true" : "false")));
}
ParameterBool::~ParameterBool()
@@ -1087,8 +1087,8 @@ ParameterBool::~ParameterBool()
void ParameterBool::changeValue()
{
bool ok;
QStringList list; list << QString::fromAscii("true")
<< QString::fromAscii("false");
QStringList list; list << QString::fromLatin1("true")
<< QString::fromLatin1("false");
int pos = (text(2) == list[0] ? 0 : 1);
QString txt = QInputDialog::getItem (treeWidget(), QObject::tr("Change value"), QObject::tr("Choose an item:"),
+1 -1
View File
@@ -258,7 +258,7 @@ void DlgPreferencesImp::applyChanges()
catch (const Base::Exception& e) {
ui->listBox->setCurrentRow(i);
tabWidget->setCurrentIndex(j);
QMessageBox::warning(this, tr("Wrong parameter"), QString::fromAscii(e.what()));
QMessageBox::warning(this, tr("Wrong parameter"), QString::fromLatin1(e.what()));
throw;
}
}
+9 -9
View File
@@ -134,31 +134,31 @@ void DlgProjectInformationImp::onLicenseTypeChanged(int index)
{
switch (index) {
case 0:
ui->lineEditLicenseURL->setText(QString::fromAscii("http://en.wikipedia.org/wiki/All_rights_reserved"));
ui->lineEditLicenseURL->setText(QString::fromLatin1("http://en.wikipedia.org/wiki/All_rights_reserved"));
break;
case 1:
ui->lineEditLicenseURL->setText(QString::fromAscii("http://creativecommons.org/licenses/by/4.0/"));
ui->lineEditLicenseURL->setText(QString::fromLatin1("http://creativecommons.org/licenses/by/4.0/"));
break;
case 2:
ui->lineEditLicenseURL->setText(QString::fromAscii("http://creativecommons.org/licenses/by-sa/4.0/"));
ui->lineEditLicenseURL->setText(QString::fromLatin1("http://creativecommons.org/licenses/by-sa/4.0/"));
break;
case 3:
ui->lineEditLicenseURL->setText(QString::fromAscii("http://creativecommons.org/licenses/by-nd/4.0/"));
ui->lineEditLicenseURL->setText(QString::fromLatin1("http://creativecommons.org/licenses/by-nd/4.0/"));
break;
case 4:
ui->lineEditLicenseURL->setText(QString::fromAscii("http://creativecommons.org/licenses/by-nc/4.0/"));
ui->lineEditLicenseURL->setText(QString::fromLatin1("http://creativecommons.org/licenses/by-nc/4.0/"));
break;
case 5:
ui->lineEditLicenseURL->setText(QString::fromAscii("http://creativecommons.org/licenses/by-nc-sa/4.0/"));
ui->lineEditLicenseURL->setText(QString::fromLatin1("http://creativecommons.org/licenses/by-nc-sa/4.0/"));
break;
case 6:
ui->lineEditLicenseURL->setText(QString::fromAscii("http://creativecommons.org/licenses/by-nc-nd/4.0/"));
ui->lineEditLicenseURL->setText(QString::fromLatin1("http://creativecommons.org/licenses/by-nc-nd/4.0/"));
break;
case 7:
ui->lineEditLicenseURL->setText(QString::fromAscii("http://en.wikipedia.org/wiki/Public_domain"));
ui->lineEditLicenseURL->setText(QString::fromLatin1("http://en.wikipedia.org/wiki/Public_domain"));
break;
case 8:
ui->lineEditLicenseURL->setText(QString::fromAscii("http://artlibre.org/licence/lal"));
ui->lineEditLicenseURL->setText(QString::fromLatin1("http://artlibre.org/licence/lal"));
break;
default:
ui->lineEditLicenseURL->setText(QString::fromUtf8(_doc->LicenseURL.getValue()));
+7 -7
View File
@@ -136,20 +136,20 @@ void DlgSettings3DViewImp::on_mouseButton_clicked()
QVariant data = comboNavigationStyle->itemData(comboNavigationStyle->currentIndex(), Qt::UserRole);
void* instance = Base::Type::createInstanceByName((const char*)data.toByteArray());
std::auto_ptr<UserNavigationStyle> ns(static_cast<UserNavigationStyle*>(instance));
ui.groupBox->setTitle(ui.groupBox->title()+QString::fromAscii(" ")+comboNavigationStyle->currentText());
ui.groupBox->setTitle(ui.groupBox->title()+QString::fromLatin1(" ")+comboNavigationStyle->currentText());
QString descr;
descr = qApp->translate((const char*)data.toByteArray(),ns->mouseButtons(NavigationStyle::SELECTION));
descr.replace(QLatin1String("\n"), QLatin1String("<p>"));
ui.selectionLabel->setText(QString::fromAscii("<b>%1</b>").arg(descr));
ui.selectionLabel->setText(QString::fromLatin1("<b>%1</b>").arg(descr));
descr = qApp->translate((const char*)data.toByteArray(),ns->mouseButtons(NavigationStyle::PANNING));
descr.replace(QLatin1String("\n"), QLatin1String("<p>"));
ui.panningLabel->setText(QString::fromAscii("<b>%1</b>").arg(descr));
ui.panningLabel->setText(QString::fromLatin1("<b>%1</b>").arg(descr));
descr = qApp->translate((const char*)data.toByteArray(),ns->mouseButtons(NavigationStyle::DRAGGING));
descr.replace(QLatin1String("\n"), QLatin1String("<p>"));
ui.rotationLabel->setText(QString::fromAscii("<b>%1</b>").arg(descr));
ui.rotationLabel->setText(QString::fromLatin1("<b>%1</b>").arg(descr));
descr = qApp->translate((const char*)data.toByteArray(),ns->mouseButtons(NavigationStyle::ZOOMING));
descr.replace(QLatin1String("\n"), QLatin1String("<p>"));
ui.zoomingLabel->setText(QString::fromAscii("<b>%1</b>").arg(descr));
ui.zoomingLabel->setText(QString::fromLatin1("<b>%1</b>").arg(descr));
dlg.exec();
}
@@ -181,10 +181,10 @@ void DlgSettings3DViewImp::retranslate()
Base::Type::getAllDerivedFrom(UserNavigationStyle::getClassTypeId(), types);
comboNavigationStyle->clear();
QRegExp rx(QString::fromAscii("^\\w+::(\\w+)Navigation\\w+$"));
QRegExp rx(QString::fromLatin1("^\\w+::(\\w+)Navigation\\w+$"));
for (std::vector<Base::Type>::iterator it = types.begin(); it != types.end(); ++it) {
if (*it != UserNavigationStyle::getClassTypeId()) {
QString data = QString::fromAscii(it->getName());
QString data = QString::fromLatin1(it->getName());
QString name = data.mid(data.indexOf(QLatin1String("::"))+2);
if (rx.indexIn(data) > -1) {
name = tr("%1 navigation").arg(rx.cap(1));
+9 -9
View File
@@ -132,31 +132,31 @@ void DlgSettingsDocumentImp::onLicenseTypeChanged(int index)
switch (index) {
case 0:
prefLicenseUrl->setText(QString::fromAscii("http://en.wikipedia.org/wiki/All_rights_reserved"));
prefLicenseUrl->setText(QString::fromLatin1("http://en.wikipedia.org/wiki/All_rights_reserved"));
break;
case 1:
prefLicenseUrl->setText(QString::fromAscii("http://creativecommons.org/licenses/by/4.0/"));
prefLicenseUrl->setText(QString::fromLatin1("http://creativecommons.org/licenses/by/4.0/"));
break;
case 2:
prefLicenseUrl->setText(QString::fromAscii("http://creativecommons.org/licenses/by-sa/4.0/"));
prefLicenseUrl->setText(QString::fromLatin1("http://creativecommons.org/licenses/by-sa/4.0/"));
break;
case 3:
prefLicenseUrl->setText(QString::fromAscii("http://creativecommons.org/licenses/by-nd/4.0/"));
prefLicenseUrl->setText(QString::fromLatin1("http://creativecommons.org/licenses/by-nd/4.0/"));
break;
case 4:
prefLicenseUrl->setText(QString::fromAscii("http://creativecommons.org/licenses/by-nc/4.0/"));
prefLicenseUrl->setText(QString::fromLatin1("http://creativecommons.org/licenses/by-nc/4.0/"));
break;
case 5:
prefLicenseUrl->setText(QString::fromAscii("http://creativecommons.org/licenses/by-nc-sa/4.0/"));
prefLicenseUrl->setText(QString::fromLatin1("http://creativecommons.org/licenses/by-nc-sa/4.0/"));
break;
case 6:
prefLicenseUrl->setText(QString::fromAscii("http://creativecommons.org/licenses/by-nc-nd/4.0/"));
prefLicenseUrl->setText(QString::fromLatin1("http://creativecommons.org/licenses/by-nc-nd/4.0/"));
break;
case 7:
prefLicenseUrl->setText(QString::fromAscii("http://en.wikipedia.org/wiki/Public_domain"));
prefLicenseUrl->setText(QString::fromLatin1("http://en.wikipedia.org/wiki/Public_domain"));
break;
case 8:
prefLicenseUrl->setText(QString::fromAscii("http://artlibre.org/licence/lal"));
prefLicenseUrl->setText(QString::fromLatin1("http://artlibre.org/licence/lal"));
break;
default:
prefLicenseUrl->clear();
+1 -1
View File
@@ -115,7 +115,7 @@ void DlgTipOfTheDayImp::onDone(bool err)
return;
// get the page and search for the tips section
QString text = QString::fromAscii(_http->readAll());
QString text = QString::fromLatin1(_http->readAll());
QRegExp rx(QLatin1String("<p>You find the latest information.+<div class=\"printfooter\">"));
if (rx.indexIn(text) > -1) {
// the text of interest
+4 -4
View File
@@ -113,7 +113,7 @@ DlgCustomToolbars::DlgCustomToolbars(DlgCustomToolbars::Type t, QWidget* parent)
workbenches.sort();
index = 1;
workbenchBox->addItem(QApplication::windowIcon(), tr("Global"));
workbenchBox->setItemData(0, QVariant(QString::fromAscii("Global")), Qt::UserRole);
workbenchBox->setItemData(0, QVariant(QString::fromLatin1("Global")), Qt::UserRole);
for (QStringList::Iterator it = workbenches.begin(); it != workbenches.end(); ++it) {
QPixmap px = Application::Instance->workbenchIcon(*it);
QString mt = Application::Instance->workbenchMenuText(*it);
@@ -141,7 +141,7 @@ DlgCustomToolbars::DlgCustomToolbars(DlgCustomToolbars::Type t, QWidget* parent)
on_categoryBox_activated(categoryBox->currentIndex());
Workbench* w = WorkbenchManager::instance()->active();
if (w) {
QString name = QString::fromAscii(w->name().c_str());
QString name = QString::fromLatin1(w->name().c_str());
int index = workbenchBox->findData(name);
workbenchBox->setCurrentIndex(index);
}
@@ -301,7 +301,7 @@ void DlgCustomToolbars::exportCustomToolbars(const QByteArray& workbench)
CommandManager& rMgr = Application::Instance->commandManager();
for (int i=0; i<toolbarTreeWidget->topLevelItemCount(); i++) {
QTreeWidgetItem* toplevel = toolbarTreeWidget->topLevelItem(i);
QString groupName = QString::fromAscii("Custom_%1").arg(i+1);
QString groupName = QString::fromLatin1("Custom_%1").arg(i+1);
QByteArray toolbarName = toplevel->text(0).toUtf8();
ParameterGrp::handle hToolGrp = hGrp->GetGroup(groupName.toLatin1());
hToolGrp->SetASCII("Name", toolbarName.constData());
@@ -468,7 +468,7 @@ void DlgCustomToolbars::on_moveActionDownButton_clicked()
void DlgCustomToolbars::on_newButton_clicked()
{
bool ok;
QString text = QString::fromAscii("Custom%1").arg(toolbarTreeWidget->topLevelItemCount()+1);
QString text = QString::fromLatin1("Custom%1").arg(toolbarTreeWidget->topLevelItemCount()+1);
text = QInputDialog::getText(this, tr("New toolbar"), tr("Toolbar name:"), QLineEdit::Normal, text, &ok);
if (ok) {
// Check for duplicated name
+2 -2
View File
@@ -95,7 +95,7 @@ void DlgUnitsCalculator::valueChanged(const Base::Quantity& quant)
} else {
double value = quant.getValue()/actUnit.getValue();
QString val = QLocale::system().toString(value, 'f', Base::UnitsApi::getDecimals());
QString out = QString::fromAscii("%1 %2").arg(val).arg(this->UnitInput->text());
QString out = QString::fromLatin1("%1 %2").arg(val).arg(this->UnitInput->text());
this->ValueOutput->setText(out);
this->pushButton_Copy->setEnabled(true);
}
@@ -128,7 +128,7 @@ void DlgUnitsCalculator::help(void)
void DlgUnitsCalculator::returnPressed(void)
{
if (this->pushButton_Copy->isEnabled()) {
this->textEdit->append(this->ValueInput->text() + QString::fromAscii(" = ") + this->ValueOutput->text());
this->textEdit->append(this->ValueInput->text() + QString::fromLatin1(" = ") + this->ValueOutput->text());
this->ValueInput->pushToHistory();
}
}
+5 -5
View File
@@ -41,7 +41,7 @@
using namespace Gui::Dialog;
const QString DlgWorkbenchesImp::all_workbenches = QString::fromAscii("ALL");
const QString DlgWorkbenchesImp::all_workbenches = QString::fromLatin1("ALL");
/* TRANSLATOR Gui::Dialog::DlgWorkbenchesImp */
@@ -51,7 +51,7 @@ DlgWorkbenchesImp::DlgWorkbenchesImp(QWidget* parent)
this->setupUi(this);
set_lw_properties(lw_enabled_workbenches);
set_lw_properties(lw_disabled_workbenches);
const QString lw_disabled_name = QString::fromAscii("disabled workbenches");
const QString lw_disabled_name = QString::fromLatin1("disabled workbenches");
lw_disabled_workbenches->setAccessibleName(lw_disabled_name);
lw_disabled_workbenches->setSortingEnabled(true);
@@ -237,12 +237,12 @@ void DlgWorkbenchesImp::save_workbenches()
hGrp->Clear();
if (lw_enabled_workbenches->count() == 0) {
enabled_wbs.append(QString::fromAscii("NoneWorkbench"));
enabled_wbs.append(QString::fromLatin1("NoneWorkbench"));
} else {
for (int i = 0; i < lw_enabled_workbenches->count(); i++) {
QVariant item_data = lw_enabled_workbenches->item(i)->data(Qt::UserRole);
QString name = item_data.toString();
enabled_wbs.append(name + QString::fromAscii(","));
enabled_wbs.append(name + QString::fromLatin1(","));
}
}
hGrp->SetASCII("Enabled", enabled_wbs.toLatin1());
@@ -250,7 +250,7 @@ void DlgWorkbenchesImp::save_workbenches()
for (int i = 0; i < lw_disabled_workbenches->count(); i++) {
QVariant item_data = lw_disabled_workbenches->item(i)->data(Qt::UserRole);
QString name = item_data.toString();
disabled_wbs.append(name + QString::fromAscii(","));
disabled_wbs.append(name + QString::fromLatin1(","));
}
hGrp->SetASCII("Disabled", disabled_wbs.toLatin1());
}
+1 -1
View File
@@ -46,7 +46,7 @@ DockWindowItems::~DockWindowItems()
void DockWindowItems::addDockWidget(const char* name, Qt::DockWidgetArea pos, bool visibility, bool tabbed)
{
DockWindowItem item;
item.name = QString::fromAscii(name);
item.name = QString::fromLatin1(name);
item.pos = pos;
item.visibility = visibility;
item.tabbed = tabbed;
+2 -2
View File
@@ -882,7 +882,7 @@ void Document::SaveDocFile (Base::Writer &writer) const
d->_pcAppWnd->sendMsgToActiveView("GetCamera",&ppReturn);
// remove the first line because it's a comment like '#Inventor V2.1 ascii'
QStringList lines = QString(QString::fromAscii(ppReturn)).split(QLatin1String("\n"));
QStringList lines = QString(QString::fromLatin1(ppReturn)).split(QLatin1String("\n"));
if (lines.size() > 1) {
lines.pop_front();
viewPos = lines.join(QLatin1String(" "));
@@ -1039,7 +1039,7 @@ void Document::createView(const Base::Type& typeId)
view3D->getViewer()->addViewProvider(It2->second);
const char* name = getDocument()->Label.getValue();
QString title = QString::fromAscii("%1 : %2[*]")
QString title = QString::fromLatin1("%1 : %2[*]")
.arg(QString::fromUtf8(name)).arg(d->_iWinCount++);
view3D->setWindowTitle(title);
+1 -1
View File
@@ -116,7 +116,7 @@ void DownloadDialog::downloadFile()
QByteArray path = QUrl::toPercentEncoding(url.path(), "!$&'()*+,;=:@/");
if (path.isEmpty())
path = "/";
httpGetId = http->get(QString::fromAscii(path), file);
httpGetId = http->get(QString::fromLatin1(path), file);
statusLabel->setText(tr("Downloading %1.").arg(fileName));
downloadButton->setEnabled(false);
+1 -1
View File
@@ -271,7 +271,7 @@ void DownloadItem::init()
QString DownloadItem::getDownloadDirectory() const
{
QString exe = QString::fromAscii(App::GetApplication().getExecutableName());
QString exe = QString::fromLatin1(App::GetApplication().getExecutableName());
QString path = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
QString dirPath = QDir(path).filePath(exe);
Base::Reference<ParameterGrp> hPath = App::GetApplication().GetUserParameter().GetGroup("BaseApp")
+1 -1
View File
@@ -426,7 +426,7 @@ void EditorView::setCurrentFileName(const QString &fileName)
if (fileName.isEmpty())
shownName = tr("untitled[*]");
else
shownName = QString::fromAscii("%1[*]").arg(name);
shownName = QString::fromLatin1("%1[*]").arg(name);
shownName += tr(" - Editor");
setWindowTitle(shownName);
setWindowModified(false);
+2 -2
View File
@@ -120,8 +120,8 @@ std::string ExpressionBinding::getEscapedExpressionString() const
QPixmap ExpressionBinding::getIcon(const char* name, const QSize& size) const
{
QString key = QString::fromAscii("%1_%2x%3")
.arg(QString::fromAscii(name))
QString key = QString::fromLatin1("%1_%2x%3")
.arg(QString::fromLatin1(name))
.arg(size.width())
.arg(size.height());
QPixmap icon;
+5 -5
View File
@@ -43,9 +43,9 @@ ExpressionCompleter::ExpressionCompleter(const App::Document * currentDoc, const
/* Create tree with full path to all objects */
while (di != docs.end()) {
QStandardItem* docItem = new QStandardItem(QString::fromAscii((*di)->getName()));
QStandardItem* docItem = new QStandardItem(QString::fromLatin1((*di)->getName()));
docItem->setData(QString::fromAscii((*di)->getName()) + QString::fromAscii("#"), Qt::UserRole);
docItem->setData(QString::fromLatin1((*di)->getName()) + QString::fromLatin1("#"), Qt::UserRole);
createModelForDocument(*di, docItem, forbidden);
model->appendRow(docItem);
@@ -90,9 +90,9 @@ void ExpressionCompleter::createModelForDocument(const App::Document * doc, QSta
continue;
}
QStandardItem* docObjItem = new QStandardItem(QString::fromAscii((*doi)->getNameInDocument()));
QStandardItem* docObjItem = new QStandardItem(QString::fromLatin1((*doi)->getNameInDocument()));
docObjItem->setData(QString::fromAscii((*doi)->getNameInDocument()) + QString::fromAscii("."), Qt::UserRole);
docObjItem->setData(QString::fromLatin1((*doi)->getNameInDocument()) + QString::fromLatin1("."), Qt::UserRole);
createModelForDocumentObject(*doi, docObjItem);
parent->appendRow(docObjItem);
@@ -104,7 +104,7 @@ void ExpressionCompleter::createModelForDocument(const App::Document * doc, QSta
docObjItem = new QStandardItem(QString::fromUtf8(label.c_str()));
docObjItem->setData( QString::fromUtf8(label.c_str()) + QString::fromAscii("."), Qt::UserRole);
docObjItem->setData( QString::fromUtf8(label.c_str()) + QString::fromLatin1("."), Qt::UserRole);
createModelForDocumentObject(*doi, docObjItem);
parent->appendRow(docObjItem);
}
+8 -8
View File
@@ -433,7 +433,7 @@ void FileOptionsDialog::accept()
if (ext.isEmpty())
setDefaultSuffix(suf);
else if (ext.toLower() != suf.toLower()) {
fn = QString::fromAscii("%1.%2").arg(fn).arg(suf);
fn = QString::fromLatin1("%1.%2").arg(fn).arg(suf);
selectFile(fn);
}
}
@@ -709,7 +709,7 @@ SelectModule::SelectModule (const QString& type, const SelectModule::Dict& types
module = module.left(pos);
}
button->setText(QString::fromAscii("%1 (%2)").arg(filter).arg(module));
button->setText(QString::fromLatin1("%1 (%2)").arg(filter).arg(module));
button->setObjectName(it.value());
gridLayout1->addWidget(button, index, 0, 1, 1);
group->addButton(button, index);
@@ -784,7 +784,7 @@ SelectModule::Dict SelectModule::exportHandler(const QStringList& fileNames, con
std::map<std::string, std::string>::const_iterator it;
it = filterList.find((const char*)filter.toUtf8());
if (it != filterList.end()) {
QString module = QString::fromAscii(it->second.c_str());
QString module = QString::fromLatin1(it->second.c_str());
for (QStringList::const_iterator it = fileNames.begin(); it != fileNames.end(); ++it) {
dict[*it] = module;
}
@@ -808,10 +808,10 @@ SelectModule::Dict SelectModule::exportHandler(const QStringList& fileNames, con
fileExtension[ext].push_back(*it);
for (std::map<std::string, std::string>::iterator jt = filters.begin(); jt != filters.end(); ++jt)
filetypeHandler[ext][QString::fromUtf8(jt->first.c_str())] = QString::fromAscii(jt->second.c_str());
filetypeHandler[ext][QString::fromUtf8(jt->first.c_str())] = QString::fromLatin1(jt->second.c_str());
// set the default module handler
if (!filters.empty())
dict[*it] = QString::fromAscii(filters.begin()->second.c_str());
dict[*it] = QString::fromLatin1(filters.begin()->second.c_str());
}
for (QMap<QString, SelectModule::Dict>::const_iterator it = filetypeHandler.begin();
@@ -846,7 +846,7 @@ SelectModule::Dict SelectModule::importHandler(const QStringList& fileNames, con
std::map<std::string, std::string>::const_iterator it;
it = filterList.find((const char*)filter.toUtf8());
if (it != filterList.end()) {
QString module = QString::fromAscii(it->second.c_str());
QString module = QString::fromLatin1(it->second.c_str());
for (QStringList::const_iterator it = fileNames.begin(); it != fileNames.end(); ++it) {
dict[*it] = module;
}
@@ -870,10 +870,10 @@ SelectModule::Dict SelectModule::importHandler(const QStringList& fileNames, con
fileExtension[ext].push_back(*it);
for (std::map<std::string, std::string>::iterator jt = filters.begin(); jt != filters.end(); ++jt)
filetypeHandler[ext][QString::fromUtf8(jt->first.c_str())] = QString::fromAscii(jt->second.c_str());
filetypeHandler[ext][QString::fromUtf8(jt->first.c_str())] = QString::fromLatin1(jt->second.c_str());
// set the default module handler
if (!filters.empty())
dict[*it] = QString::fromAscii(filters.begin()->second.c_str());
dict[*it] = QString::fromLatin1(filters.begin()->second.c_str());
}
for (QMap<QString, SelectModule::Dict>::const_iterator it = filetypeHandler.begin();
+6 -6
View File
@@ -165,9 +165,9 @@ void GraphvizView::updateSvgItem(const App::Document &doc)
#endif
bool pathChanged = false;
#ifdef FC_OS_WIN32
QString exe = QString::fromAscii("\"%1/dot\"").arg(path);
QString exe = QString::fromLatin1("\"%1/dot\"").arg(path);
#else
QString exe = QString::fromAscii("%1/dot").arg(path);
QString exe = QString::fromLatin1("%1/dot").arg(path);
#endif
proc->setEnvironment(QProcess::systemEnvironment());
do {
@@ -190,9 +190,9 @@ void GraphvizView::updateSvgItem(const App::Document &doc)
}
pathChanged = true;
#ifdef FC_OS_WIN32
exe = QString::fromAscii("\"%1/dot\"").arg(path);
exe = QString::fromLatin1("\"%1/dot\"").arg(path);
#else
exe = QString::fromAscii("%1/dot").arg(path);
exe = QString::fromLatin1("%1/dot").arg(path);
#endif
}
else {
@@ -266,9 +266,9 @@ QByteArray GraphvizView::exportGraph(const QString& format)
#endif
#ifdef FC_OS_WIN32
QString exe = QString::fromAscii("\"%1/dot\"").arg(path);
QString exe = QString::fromLatin1("\"%1/dot\"").arg(path);
#else
QString exe = QString::fromAscii("%1/dot").arg(path);
QString exe = QString::fromLatin1("%1/dot").arg(path);
#endif
proc.setEnvironment(QProcess::systemEnvironment());
proc.start(exe, args);
+4 -4
View File
@@ -208,7 +208,7 @@ QVariant TextBrowser::loadFileResource(int type, const QUrl& name)
data = file.readAll();
file.close();
} else if (type == QTextDocument::HtmlResource) {
data = QString::fromAscii(
data = QString::fromLatin1(
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\">"
"<html>"
"<head>"
@@ -306,7 +306,7 @@ QVariant TextBrowser::loadHttpResource(int type, const QUrl& name)
return d->http->readAll();
} else {
if (type == QTextDocument::HtmlResource) {
data = QString::fromAscii(
data = QString::fromLatin1(
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\">"
"<html>"
"<head>"
@@ -474,7 +474,7 @@ void TextBrowser::dropEvent(QDropEvent * e)
QString info = pCmd->getAction()->whatsThis();
if ( !info.isEmpty() ) {
// cannot show help to this command
info = QString::fromAscii(
info = QString::fromLatin1(
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">"
"<html>"
"<body bgcolor=white text=black alink=red link=darkblue vlink=darkmagenta>"
@@ -482,7 +482,7 @@ void TextBrowser::dropEvent(QDropEvent * e)
"</body>"
"</html>" ).arg( info );
} else {
info = QString::fromAscii(
info = QString::fromLatin1(
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">"
"<html>"
"<body bgcolor=white text=black alink=red link=darkblue vlink=darkmagenta>"
+10 -10
View File
@@ -79,11 +79,11 @@ InputField::InputField(QWidget * parent)
iconLabel->setCursor(Qt::ArrowCursor);
QPixmap pixmap = getValidationIcon(":/icons/button_valid.svg", QSize(sizeHint().height(),sizeHint().height()));
iconLabel->setPixmap(pixmap);
iconLabel->setStyleSheet(QString::fromAscii("QLabel { border: none; padding: 0px; }"));
iconLabel->setStyleSheet(QString::fromLatin1("QLabel { border: none; padding: 0px; }"));
iconLabel->hide();
connect(this, SIGNAL(textChanged(const QString&)), this, SLOT(updateIconLabel(const QString&)));
int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
setStyleSheet(QString::fromAscii("QLineEdit { padding-right: %1px } ").arg(iconLabel->sizeHint().width() + frameWidth + 1));
setStyleSheet(QString::fromLatin1("QLineEdit { padding-right: %1px } ").arg(iconLabel->sizeHint().width() + frameWidth + 1));
QSize msz = minimumSizeHint();
setMinimumSize(qMax(msz.width(), iconLabel->sizeHint().height() + frameWidth * 2 + 2),
qMax(msz.height(), iconLabel->sizeHint().height() + frameWidth * 2 + 2));
@@ -137,8 +137,8 @@ bool InputField::apply()
QPixmap InputField::getValidationIcon(const char* name, const QSize& size) const
{
QString key = QString::fromAscii("%1_%2x%3")
.arg(QString::fromAscii(name))
QString key = QString::fromLatin1("%1_%2x%3")
.arg(QString::fromLatin1(name))
.arg(size.width())
.arg(size.height());
QPixmap icon;
@@ -185,7 +185,7 @@ void InputField::contextMenuEvent(QContextMenuEvent *event)
{
QMenu *editMenu = createStandardContextMenu();
editMenu->setTitle(tr("Edit"));
QMenu* menu = new QMenu(QString::fromAscii("InputFieldContextmenu"));
QMenu* menu = new QMenu(QString::fromLatin1("InputFieldContextmenu"));
menu->addMenu(editMenu);
menu->addSeparator();
@@ -253,10 +253,10 @@ void InputField::newInput(const QString & text)
}
catch(Base::Exception &e){
ErrorText = e.what();
this->setToolTip(QString::fromAscii(ErrorText.c_str()));
this->setToolTip(QString::fromLatin1(ErrorText.c_str()));
QPixmap pixmap = getValidationIcon(":/icons/button_invalid.svg", QSize(sizeHint().height(),sizeHint().height()));
iconLabel->setPixmap(pixmap);
parseError(QString::fromAscii(ErrorText.c_str()));
parseError(QString::fromLatin1(ErrorText.c_str()));
validInput = false;
return;
}
@@ -266,10 +266,10 @@ void InputField::newInput(const QString & text)
// check if unit fits!
if(!actUnit.isEmpty() && !res.getUnit().isEmpty() && actUnit != res.getUnit()){
this->setToolTip(QString::fromAscii("Wrong unit"));
this->setToolTip(QString::fromLatin1("Wrong unit"));
QPixmap pixmap = getValidationIcon(":/icons/button_invalid.svg", QSize(sizeHint().height(),sizeHint().height()));
iconLabel->setPixmap(pixmap);
parseError(QString::fromAscii("Wrong unit"));
parseError(QString::fromLatin1("Wrong unit"));
validInput = false;
return;
}
@@ -289,7 +289,7 @@ void InputField::newInput(const QString & text)
ErrorText = "Minimum reached";
}
this->setToolTip(QString::fromAscii(ErrorText.c_str()));
this->setToolTip(QString::fromLatin1(ErrorText.c_str()));
double dFactor;
res.getUserString(dFactor,actUnitStr);
+1 -1
View File
@@ -157,7 +157,7 @@ void LocationWidget::setDirection(const Base::Vector3d& dir)
}
// add a new item before the very last item
QString display = QString::fromAscii("(%1,%2,%3)")
QString display = QString::fromLatin1("(%1,%2,%3)")
.arg(dir.x)
.arg(dir.y)
.arg(dir.z);
+2 -2
View File
@@ -209,7 +209,7 @@ private:
}
// add a new item before the very last item
QString display = QString::fromAscii("(%1,%2,%3)")
QString display = QString::fromLatin1("(%1,%2,%3)")
.arg(dir.x)
.arg(dir.y)
.arg(dir.z);
@@ -320,7 +320,7 @@ public:
}
// add a new item before the very last item
QString display = QString::fromAscii("(%1,%2,%3)")
QString display = QString::fromLatin1("(%1,%2,%3)")
.arg(dir.x)
.arg(dir.y)
.arg(dir.z);
+3 -3
View File
@@ -171,7 +171,7 @@ TStringList Translator::supportedLanguages() const
QDir dir(QLatin1String(":/translations"));
for (std::map<std::string,std::string>::const_iterator it = d->mapLanguageTopLevelDomain.begin();
it != d->mapLanguageTopLevelDomain.end(); ++it) {
QString filter = QString::fromAscii("*_%1.qm").arg(QLatin1String(it->second.c_str()));
QString filter = QString::fromLatin1("*_%1.qm").arg(QLatin1String(it->second.c_str()));
QStringList fileNames = dir.entryList(QStringList(filter), QDir::Files, QDir::Name);
if (!fileNames.isEmpty())
languages.push_back(it->first);
@@ -187,7 +187,7 @@ TStringMap Translator::supportedLocales() const
QDir dir(QLatin1String(":/translations"));
for (std::map<std::string,std::string>::const_iterator it = d->mapLanguageTopLevelDomain.begin();
it != d->mapLanguageTopLevelDomain.end(); ++it) {
QString filter = QString::fromAscii("*_%1.qm").arg(QLatin1String(it->second.c_str()));
QString filter = QString::fromLatin1("*_%1.qm").arg(QLatin1String(it->second.c_str()));
QStringList fileNames = dir.entryList(QStringList(filter), QDir::Files, QDir::Name);
if (!fileNames.isEmpty())
languages[it->first] = it->second;
@@ -239,7 +239,7 @@ void Translator::addPath(const QString& path)
void Translator::installQMFiles(const QDir& dir, const char* locale)
{
QString filter = QString::fromAscii("*_%1.qm").arg(QLatin1String(locale));
QString filter = QString::fromLatin1("*_%1.qm").arg(QLatin1String(locale));
QStringList fileNames = dir.entryList(QStringList(filter), QDir::Files, QDir::Name);
for (QStringList::Iterator it = fileNames.begin(); it != fileNames.end(); ++it){
bool ok=false;
+1 -1
View File
@@ -115,7 +115,7 @@ void MDIView::onRelabel(Gui::Document *pDoc)
}
else {
cap = QString::fromUtf8(pDoc->getDocument()->Label.getValue());
cap = QString::fromAscii("%1[*]").arg(cap);
cap = QString::fromLatin1("%1[*]").arg(cap);
setWindowTitle(cap);
}
}
+8 -8
View File
@@ -100,7 +100,7 @@ void MacroManager::commit(void)
// sort import lines and avoid duplicates
QTextStream str(&file);
QStringList import;
import << QString::fromAscii("import FreeCAD");
import << QString::fromLatin1("import FreeCAD");
QStringList body;
QStringList::Iterator it;
@@ -119,14 +119,14 @@ void MacroManager::commit(void)
}
QString header;
header += QString::fromAscii("# -*- coding: utf-8 -*-\n\n");
header += QString::fromAscii("# Macro Begin: ");
header += QString::fromLatin1("# -*- coding: utf-8 -*-\n\n");
header += QString::fromLatin1("# Macro Begin: ");
header += this->macroName;
header += QString::fromAscii(" +++++++++++++++++++++++++++++++++++++++++++++++++\n");
header += QString::fromLatin1(" +++++++++++++++++++++++++++++++++++++++++++++++++\n");
QString footer = QString::fromAscii("# Macro End: ");
QString footer = QString::fromLatin1("# Macro End: ");
footer += this->macroName;
footer += QString::fromAscii(" +++++++++++++++++++++++++++++++++++++++++++++++++\n");
footer += QString::fromLatin1(" +++++++++++++++++++++++++++++++++++++++++++++++++\n");
// write the data to the text file
str << header;
@@ -173,7 +173,7 @@ void MacroManager::addLine(LineType Type, const char* sLine)
comment = true;
}
QStringList lines = QString::fromAscii(sLine).split(QLatin1String("\n"));
QStringList lines = QString::fromLatin1(sLine).split(QLatin1String("\n"));
if (comment) {
for (QStringList::iterator it = lines.begin(); it != lines.end(); ++it)
it->prepend(QLatin1String("#"));
@@ -195,7 +195,7 @@ void MacroManager::setModule(const char* sModule)
{
if (this->openMacro && sModule && *sModule != '\0')
{
this->macroInProgress.append(QString::fromAscii("import %1").arg(QString::fromAscii(sModule)));
this->macroInProgress.append(QString::fromLatin1("import %1").arg(QString::fromLatin1(sModule)));
}
}
+44 -44
View File
@@ -285,19 +285,19 @@ MainWindow::MainWindow(QWidget * parent, Qt::WFlags f)
// clears the action label
d->actionTimer = new QTimer( this );
d->actionTimer->setObjectName(QString::fromAscii("actionTimer"));
d->actionTimer->setObjectName(QString::fromLatin1("actionTimer"));
connect(d->actionTimer, SIGNAL(timeout()), d->actionLabel, SLOT(clear()));
// update gui timer
d->activityTimer = new QTimer(this);
d->activityTimer->setObjectName(QString::fromAscii("activityTimer"));
d->activityTimer->setObjectName(QString::fromLatin1("activityTimer"));
connect(d->activityTimer, SIGNAL(timeout()),this, SLOT(updateActions()));
d->activityTimer->setSingleShot(true);
d->activityTimer->start(300);
// show main window timer
d->visibleTimer = new QTimer(this);
d->visibleTimer->setObjectName(QString::fromAscii("visibleTimer"));
d->visibleTimer->setObjectName(QString::fromLatin1("visibleTimer"));
connect(d->visibleTimer, SIGNAL(timeout()),this, SLOT(showMainWindow()));
d->visibleTimer->setSingleShot(true);
@@ -329,27 +329,27 @@ MainWindow::MainWindow(QWidget * parent, Qt::WFlags f)
// Tree view
TreeDockWidget* tree = new TreeDockWidget(0, this);
tree->setObjectName
(QString::fromAscii(QT_TRANSLATE_NOOP("QDockWidget","Tree view")));
(QString::fromLatin1(QT_TRANSLATE_NOOP("QDockWidget","Tree view")));
tree->setMinimumWidth(210);
pDockMgr->registerDockWindow("Std_TreeView", tree);
// Property view
PropertyDockView* pcPropView = new PropertyDockView(0, this);
pcPropView->setObjectName
(QString::fromAscii(QT_TRANSLATE_NOOP("QDockWidget","Property view")));
(QString::fromLatin1(QT_TRANSLATE_NOOP("QDockWidget","Property view")));
pcPropView->setMinimumWidth(210);
pDockMgr->registerDockWindow("Std_PropertyView", pcPropView);
// Selection view
SelectionView* pcSelectionView = new SelectionView(0, this);
pcSelectionView->setObjectName
(QString::fromAscii(QT_TRANSLATE_NOOP("QDockWidget","Selection view")));
(QString::fromLatin1(QT_TRANSLATE_NOOP("QDockWidget","Selection view")));
pcSelectionView->setMinimumWidth(210);
pDockMgr->registerDockWindow("Std_SelectionView", pcSelectionView);
// Combo view
CombiView* pcCombiView = new CombiView(0, this);
pcCombiView->setObjectName(QString::fromAscii(QT_TRANSLATE_NOOP("QDockWidget","Combo View")));
pcCombiView->setObjectName(QString::fromLatin1(QT_TRANSLATE_NOOP("QDockWidget","Combo View")));
pcCombiView->setMinimumWidth(150);
pDockMgr->registerDockWindow("Std_CombiView", pcCombiView);
@@ -357,14 +357,14 @@ MainWindow::MainWindow(QWidget * parent, Qt::WFlags f)
// Report view
Gui::DockWnd::ReportView* pcReport = new Gui::DockWnd::ReportView(this);
pcReport->setObjectName
(QString::fromAscii(QT_TRANSLATE_NOOP("QDockWidget","Report view")));
(QString::fromLatin1(QT_TRANSLATE_NOOP("QDockWidget","Report view")));
pDockMgr->registerDockWindow("Std_ReportView", pcReport);
#else
// Report view (must be created before PythonConsole!)
ReportOutput* pcReport = new ReportOutput(this);
pcReport->setWindowIcon(BitmapFactory().pixmap("MacroEditor"));
pcReport->setObjectName
(QString::fromAscii(QT_TRANSLATE_NOOP("QDockWidget","Report view")));
(QString::fromLatin1(QT_TRANSLATE_NOOP("QDockWidget","Report view")));
pDockMgr->registerDockWindow("Std_ReportView", pcReport);
// Python console
@@ -372,7 +372,7 @@ MainWindow::MainWindow(QWidget * parent, Qt::WFlags f)
pcPython->setWordWrapMode(QTextOption::NoWrap);
pcPython->setWindowIcon(Gui::BitmapFactory().iconFromTheme("applications-python"));
pcPython->setObjectName
(QString::fromAscii(QT_TRANSLATE_NOOP("QDockWidget","Python console")));
(QString::fromLatin1(QT_TRANSLATE_NOOP("QDockWidget","Python console")));
pDockMgr->registerDockWindow("Std_PythonView", pcPython);
#if 0 //defined(Q_OS_WIN32) this portion of code is not able to run with a vanilla Qtlib build on Windows.
@@ -848,16 +848,16 @@ void MainWindow::onWindowsMenuAboutToShow()
QAction* action = actions.at(index);
QString text;
QString title = child->windowTitle();
int lastIndex = title.lastIndexOf(QString::fromAscii("[*]"));
int lastIndex = title.lastIndexOf(QString::fromLatin1("[*]"));
if (lastIndex > 0) {
title = title.left(lastIndex);
if (child->isWindowModified())
title = QString::fromAscii("%1*").arg(title);
title = QString::fromLatin1("%1*").arg(title);
}
if (index < 9)
text = QString::fromAscii("&%1 %2").arg(index+1).arg(title);
text = QString::fromLatin1("&%1 %2").arg(index+1).arg(title);
else
text = QString::fromAscii("%1 %2").arg(index+1).arg(title);
text = QString::fromLatin1("%1 %2").arg(index+1).arg(title);
action->setText(text);
action->setVisible(true);
action->setChecked(child == active);
@@ -1047,7 +1047,7 @@ void MainWindow::delayedStartup()
void MainWindow::appendRecentFile(const QString& filename)
{
RecentFilesAction *recent = this->findChild<RecentFilesAction *>
(QString::fromAscii("recentFiles"));
(QString::fromLatin1("recentFiles"));
if (recent) {
recent->appendFile(filename);
}
@@ -1093,18 +1093,18 @@ void MainWindow::switchToDockedMode()
void MainWindow::loadWindowSettings()
{
QString vendor = QString::fromAscii(App::Application::Config()["ExeVendor"].c_str());
QString application = QString::fromAscii(App::Application::Config()["ExeName"].c_str());
QString version = QString::fromAscii(App::Application::Config()["ExeVersion"].c_str());
QString vendor = QString::fromLatin1(App::Application::Config()["ExeVendor"].c_str());
QString application = QString::fromLatin1(App::Application::Config()["ExeName"].c_str());
QString version = QString::fromLatin1(App::Application::Config()["ExeVersion"].c_str());
int major = (QT_VERSION >> 0x10) & 0xff;
int minor = (QT_VERSION >> 0x08) & 0xff;
QString qtver = QString::fromAscii("Qt%1.%2").arg(major).arg(minor);
QString qtver = QString::fromLatin1("Qt%1.%2").arg(major).arg(minor);
QSettings config(vendor, application);
config.beginGroup(version);
config.beginGroup(qtver);
this->resize(config.value(QString::fromAscii("Size"), this->size()).toSize());
QPoint pos = config.value(QString::fromAscii("Position"), this->pos()).toPoint();
this->resize(config.value(QString::fromLatin1("Size"), this->size()).toSize());
QPoint pos = config.value(QString::fromLatin1("Position"), this->pos()).toPoint();
QRect rect = QApplication::desktop()->availableGeometry();
int x1,x2,y1,y2;
// make sure that the main window is not totally out of the visible rectangle
@@ -1115,14 +1115,14 @@ void MainWindow::loadWindowSettings()
// tmp. disable the report window to suppress some bothering warnings
Base::Console().SetEnabledMsgType("ReportOutput", ConsoleMsgType::MsgType_Wrn, false);
this->restoreState(config.value(QString::fromAscii("MainWindowState")).toByteArray());
this->restoreState(config.value(QString::fromLatin1("MainWindowState")).toByteArray());
std::clog << "Main window restored" << std::endl;
Base::Console().SetEnabledMsgType("ReportOutput", ConsoleMsgType::MsgType_Wrn, true);
bool max = config.value(QString::fromAscii("Maximized"), false).toBool();
bool max = config.value(QString::fromLatin1("Maximized"), false).toBool();
max ? showMaximized() : show();
statusBar()->setVisible(config.value(QString::fromAscii("StatusBar"), true).toBool());
statusBar()->setVisible(config.value(QString::fromLatin1("StatusBar"), true).toBool());
config.endGroup();
config.endGroup();
@@ -1132,21 +1132,21 @@ void MainWindow::loadWindowSettings()
void MainWindow::saveWindowSettings()
{
QString vendor = QString::fromAscii(App::Application::Config()["ExeVendor"].c_str());
QString application = QString::fromAscii(App::Application::Config()["ExeName"].c_str());
QString version = QString::fromAscii(App::Application::Config()["ExeVersion"].c_str());
QString vendor = QString::fromLatin1(App::Application::Config()["ExeVendor"].c_str());
QString application = QString::fromLatin1(App::Application::Config()["ExeName"].c_str());
QString version = QString::fromLatin1(App::Application::Config()["ExeVersion"].c_str());
int major = (QT_VERSION >> 0x10) & 0xff;
int minor = (QT_VERSION >> 0x08) & 0xff;
QString qtver = QString::fromAscii("Qt%1.%2").arg(major).arg(minor);
QString qtver = QString::fromLatin1("Qt%1.%2").arg(major).arg(minor);
QSettings config(vendor, application);
config.beginGroup(version);
config.beginGroup(qtver);
config.setValue(QString::fromAscii("Size"), this->size());
config.setValue(QString::fromAscii("Position"), this->pos());
config.setValue(QString::fromAscii("Maximized"), this->isMaximized());
config.setValue(QString::fromAscii("MainWindowState"), this->saveState());
config.setValue(QString::fromAscii("StatusBar"), this->statusBar()->isVisible());
config.setValue(QString::fromLatin1("Size"), this->size());
config.setValue(QString::fromLatin1("Position"), this->pos());
config.setValue(QString::fromLatin1("Maximized"), this->isMaximized());
config.setValue(QString::fromLatin1("MainWindowState"), this->saveState());
config.setValue(QString::fromLatin1("StatusBar"), this->statusBar()->isVisible());
config.endGroup();
config.endGroup();
@@ -1186,7 +1186,7 @@ QPixmap MainWindow::splashImage() const
// search in the UserAppData dir as very first
QPixmap splash_image;
QDir dir(QString::fromUtf8(App::Application::Config()["UserAppData"].c_str()));
QFileInfo fi(dir.filePath(QString::fromAscii("pixmaps/splash_image.png")));
QFileInfo fi(dir.filePath(QString::fromLatin1("pixmaps/splash_image.png")));
if (fi.isFile() && fi.exists())
splash_image.load(fi.filePath(), "PNG");
@@ -1211,9 +1211,9 @@ QPixmap MainWindow::splashImage() const
std::map<std::string,std::string>::const_iterator tc = App::Application::Config().find("SplashInfoColor");
if (tc != App::Application::Config().end()) {
QString title = qApp->applicationName();
QString major = QString::fromAscii(App::Application::Config()["BuildVersionMajor"].c_str());
QString minor = QString::fromAscii(App::Application::Config()["BuildVersionMinor"].c_str());
QString version = QString::fromAscii("%1.%2").arg(major).arg(minor);
QString major = QString::fromLatin1(App::Application::Config()["BuildVersionMajor"].c_str());
QString minor = QString::fromLatin1(App::Application::Config()["BuildVersionMinor"].c_str());
QString version = QString::fromLatin1("%1.%2").arg(major).arg(minor);
QPainter painter;
painter.begin(&splash_image);
@@ -1230,7 +1230,7 @@ QPixmap MainWindow::splashImage() const
int v = metricVer.width(version);
QColor color;
color.setNamedColor(QString::fromAscii(tc->second.c_str()));
color.setNamedColor(QString::fromLatin1(tc->second.c_str()));
if (color.isValid()) {
painter.setPen(color);
painter.setFont(fontExe);
@@ -1611,9 +1611,9 @@ void MainWindow::customEvent(QEvent* e)
StatusBarObserver::StatusBarObserver()
: WindowParameter("OutputWindow")
{
msg = QString::fromAscii("#000000"); // black
wrn = QString::fromAscii("#ffaa00"); // orange
err = QString::fromAscii("#ff0000"); // red
msg = QString::fromLatin1("#000000"); // black
wrn = QString::fromLatin1("#ffaa00"); // orange
err = QString::fromLatin1("#ff0000"); // red
Base::Console().AttachObserver(this);
getWindowParameter()->Attach(this);
getWindowParameter()->NotifyAll();
@@ -1648,7 +1648,7 @@ void StatusBarObserver::OnChange(Base::Subject<const char*> &rCaller, const char
void StatusBarObserver::Message(const char * m)
{
// Send the event to the main window to allow thread-safety. Qt will delete it when done.
QString txt = QString::fromAscii("<font color=\"%1\">%2</font>").arg(this->msg).arg(QString::fromUtf8(m));
QString txt = QString::fromLatin1("<font color=\"%1\">%2</font>").arg(this->msg).arg(QString::fromUtf8(m));
CustomMessageEvent* ev = new CustomMessageEvent(CustomMessageEvent::Msg, txt);
QApplication::postEvent(getMainWindow(), ev);
}
@@ -1659,7 +1659,7 @@ void StatusBarObserver::Message(const char * m)
void StatusBarObserver::Warning(const char *m)
{
// Send the event to the main window to allow thread-safety. Qt will delete it when done.
QString txt = QString::fromAscii("<font color=\"%1\">%2</font>").arg(this->wrn).arg(QString::fromUtf8(m));
QString txt = QString::fromLatin1("<font color=\"%1\">%2</font>").arg(this->wrn).arg(QString::fromUtf8(m));
CustomMessageEvent* ev = new CustomMessageEvent(CustomMessageEvent::Wrn, txt);
QApplication::postEvent(getMainWindow(), ev);
}
@@ -1670,7 +1670,7 @@ void StatusBarObserver::Warning(const char *m)
void StatusBarObserver::Error (const char *m)
{
// Send the event to the main window to allow thread-safety. Qt will delete it when done.
QString txt = QString::fromAscii("<font color=\"%1\">%2</font>").arg(this->err).arg(QString::fromUtf8(m));
QString txt = QString::fromLatin1("<font color=\"%1\">%2</font>").arg(this->err).arg(QString::fromUtf8(m));
CustomMessageEvent* ev = new CustomMessageEvent(CustomMessageEvent::Err, txt);
QApplication::postEvent(getMainWindow(), ev);
}
+9 -9
View File
@@ -198,7 +198,7 @@ void MenuManager::setup(MenuItem* menuItems) const
for (QList<MenuItem*>::ConstIterator it = items.begin(); it != items.end(); ++it)
{
// search for the menu action
QAction* action = findAction(actions, QString::fromAscii((*it)->command().c_str()));
QAction* action = findAction(actions, QString::fromLatin1((*it)->command().c_str()));
if (!action) {
// There must be not more than one separator in the menu bar, so
// we can safely remove it if available and append it at the end
@@ -213,12 +213,12 @@ void MenuManager::setup(MenuItem* menuItems) const
QApplication::translate("Workbench", menuName.c_str(),
0, QApplication::UnicodeUTF8));
action = menu->menuAction();
menu->setObjectName(QString::fromAscii(menuName.c_str()));
action->setObjectName(QString::fromAscii(menuName.c_str()));
menu->setObjectName(QString::fromLatin1(menuName.c_str()));
action->setObjectName(QString::fromLatin1(menuName.c_str()));
}
// set the menu user data
action->setData(QString::fromAscii((*it)->command().c_str()));
action->setData(QString::fromLatin1((*it)->command().c_str()));
}
else {
// put the menu at the end
@@ -250,7 +250,7 @@ void MenuManager::setup(MenuItem* item, QMenu* menu) const
QList<QAction*> actions = menu->actions();
for (QList<MenuItem*>::ConstIterator it = items.begin(); it != items.end(); ++it) {
// search for the menu item
QList<QAction*> used_actions = findActions(actions, QString::fromAscii((*it)->command().c_str()));
QList<QAction*> used_actions = findActions(actions, QString::fromLatin1((*it)->command().c_str()));
if (used_actions.isEmpty()) {
if ((*it)->command() == "Separator") {
QAction* action = menu->addSeparator();
@@ -267,10 +267,10 @@ void MenuManager::setup(MenuItem* item, QMenu* menu) const
QApplication::translate("Workbench", menuName.c_str(),
0, QApplication::UnicodeUTF8));
QAction* action = submenu->menuAction();
submenu->setObjectName(QString::fromAscii((*it)->command().c_str()));
action->setObjectName(QString::fromAscii((*it)->command().c_str()));
submenu->setObjectName(QString::fromLatin1((*it)->command().c_str()));
action->setObjectName(QString::fromLatin1((*it)->command().c_str()));
// set the menu user data
action->setData(QString::fromAscii((*it)->command().c_str()));
action->setData(QString::fromLatin1((*it)->command().c_str()));
used_actions.append(action);
}
else {
@@ -282,7 +282,7 @@ void MenuManager::setup(MenuItem* item, QMenu* menu) const
for (int i=count; i < acts.count(); i++) {
QAction* a = acts[i];
// set the menu user data
a->setData(QString::fromAscii((*it)->command().c_str()));
a->setData(QString::fromLatin1((*it)->command().c_str()));
used_actions.append(a);
}
}
+2 -2
View File
@@ -1498,12 +1498,12 @@ void NavigationStyle::openPopupMenu(const SbVec2s& position)
contextMenu.addMenu(&subMenu);
// add submenu at the end to select navigation style
QRegExp rx(QString::fromAscii("^\\w+::(\\w+)Navigation\\w+$"));
QRegExp rx(QString::fromLatin1("^\\w+::(\\w+)Navigation\\w+$"));
std::vector<Base::Type> types;
Base::Type::getAllDerivedFrom(UserNavigationStyle::getClassTypeId(), types);
for (std::vector<Base::Type>::iterator it = types.begin(); it != types.end(); ++it) {
if (*it != UserNavigationStyle::getClassTypeId()) {
QString data = QString::fromAscii(it->getName());
QString data = QString::fromLatin1(it->getName());
QString name = data.mid(data.indexOf(QLatin1String("::"))+2);
if (rx.indexIn(data) > -1) {
name = QObject::tr("%1 navigation").arg(rx.cap(1));
+25 -25
View File
@@ -240,15 +240,15 @@ bool NetworkRetriever::startDownload( const QString& startUrl )
if ( !d->proxy.isEmpty() )
{
QStringList env = wget->environment();
env << QString::fromAscii("http_proxy=%1").arg(d->proxy);
env << QString::fromAscii("ftp_proxy=%1").arg(d->proxy);
env << QString::fromLatin1("http_proxy=%1").arg(d->proxy);
env << QString::fromLatin1("ftp_proxy=%1").arg(d->proxy);
wget->setEnvironment(env);
}
else
{
QStringList env = wget->environment();
env.removeAll(QString::fromAscii("http_proxy=%1").arg(d->proxy));
env.removeAll(QString::fromAscii("ftp_proxy=%1").arg(d->proxy));
env.removeAll(QString::fromLatin1("http_proxy=%1").arg(d->proxy));
env.removeAll(QString::fromLatin1("ftp_proxy=%1").arg(d->proxy));
wget->setEnvironment(env);
}
@@ -277,43 +277,43 @@ bool NetworkRetriever::startDownload( const QString& startUrl )
{
if ( !d->user.isEmpty() )
{
wgetArguments << QString::fromAscii("--proxy-user=%1").arg( d->user );
wgetArguments << QString::fromLatin1("--proxy-user=%1").arg( d->user );
if ( !d->passwd.isEmpty() )
{
wgetArguments << QString::fromAscii("--proxy-passwd=%1").arg( d->passwd );
wgetArguments << QString::fromLatin1("--proxy-passwd=%1").arg( d->passwd );
}
}
}
// output file
if ( !d->outputFile.isEmpty() )
wgetArguments << QString::fromAscii("--output-document=%1").arg( d->outputFile );
wgetArguments << QString::fromLatin1("--output-document=%1").arg( d->outputFile );
// timestamping enabled -> update newer files only
if ( d->timeStamp )
wgetArguments << QString::fromAscii("-N");
wgetArguments << QString::fromLatin1("-N");
// get all needed image files
if ( d->img )
wgetArguments << QString::fromAscii("-p");
wgetArguments << QString::fromLatin1("-p");
// follow relative links only
if ( d->folRel )
wgetArguments<< QString::fromAscii("-L");
wgetArguments<< QString::fromLatin1("-L");
if ( d->recurse )
{
wgetArguments << QString::fromAscii("-r");
wgetArguments << QString::fromAscii("--level=%1").arg( d->level );
wgetArguments << QString::fromLatin1("-r");
wgetArguments << QString::fromLatin1("--level=%1").arg( d->level );
}
if ( d->nop )
wgetArguments << QString::fromAscii("-np");
wgetArguments << QString::fromLatin1("-np");
// convert absolute links in to relative
if ( d->convert )
wgetArguments << QString::fromAscii("-k");
wgetArguments << QString::fromLatin1("-k");
// number of tries
wgetArguments << QString::fromAscii("--tries=%1").arg( d->tries );
wgetArguments << QString::fromLatin1("--tries=%1").arg( d->tries );
// use HTML file extension
if ( d->html )
wgetArguments << QString::fromAscii("-E");
wgetArguments << QString::fromLatin1("-E");
// start URL
wgetArguments << startUrl;
@@ -326,10 +326,10 @@ bool NetworkRetriever::startDownload( const QString& startUrl )
QDir::setCurrent(d->dir);
}
wget->start(QString::fromAscii("wget"), wgetArguments);
wget->start(QString::fromLatin1("wget"), wgetArguments);
QDir::setCurrent( cwd );
#else
wget->start(QString::fromAscii("wget"), wgetArguments);
wget->start(QString::fromLatin1("wget"), wgetArguments);
#endif
return wget->state() == QProcess::Running;
@@ -371,7 +371,7 @@ void NetworkRetriever::wgetFinished(int exitCode, QProcess::ExitStatus status)
bool NetworkRetriever::testWget()
{
QProcess proc;
proc.start(QString::fromAscii("wget"));
proc.start(QString::fromLatin1("wget"));
bool ok = proc.state() == QProcess::Running;
proc.kill();
proc.waitForFinished();
@@ -414,7 +414,7 @@ Action * StdCmdDownloadOnlineHelp::createAction(void)
{
Action *pcAction;
QString exe = QString::fromAscii(App::GetApplication().getExecutableName());
QString exe = QString::fromLatin1(App::GetApplication().getExecutableName());
pcAction = new Action(this,getMainWindow());
pcAction->setText(QCoreApplication::translate(
this->className(), sMenuText, 0,
@@ -429,7 +429,7 @@ Action * StdCmdDownloadOnlineHelp::createAction(void)
this->className(), sWhatsThis, 0,
QCoreApplication::CodecForTr).arg(exe));
pcAction->setIcon(Gui::BitmapFactory().pixmap(sPixmap));
pcAction->setShortcut(QString::fromAscii(sAccel));
pcAction->setShortcut(QString::fromLatin1(sAccel));
return pcAction;
}
@@ -437,7 +437,7 @@ Action * StdCmdDownloadOnlineHelp::createAction(void)
void StdCmdDownloadOnlineHelp::languageChange()
{
if (_pcAction) {
QString exe = QString::fromAscii(App::GetApplication().getExecutableName());
QString exe = QString::fromLatin1(App::GetApplication().getExecutableName());
_pcAction->setText(QCoreApplication::translate(
this->className(), sMenuText, 0,
QCoreApplication::CodecForTr));
@@ -479,7 +479,7 @@ void StdCmdDownloadOnlineHelp::activated(int iMsg)
}
}
wget->setProxy(QString::fromAscii(prx.c_str()), username, password);
wget->setProxy(QString::fromLatin1(prx.c_str()), username, password);
}
int loop=3;
@@ -487,7 +487,7 @@ void StdCmdDownloadOnlineHelp::activated(int iMsg)
// set output directory
QString path = QString::fromUtf8(App::GetApplication().getHomePath());
path += QString::fromAscii("/doc/");
path += QString::fromLatin1("/doc/");
ParameterGrp::handle hURLGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/OnlineHelp");
path = QString::fromUtf8(hURLGrp->GetASCII( "DownloadLocation", path.toLatin1() ).c_str());
@@ -536,7 +536,7 @@ void StdCmdDownloadOnlineHelp::activated(int iMsg)
}
if (canStart) {
bool ok = wget->startDownload(QString::fromAscii(url.c_str()));
bool ok = wget->startDownload(QString::fromLatin1(url.c_str()));
if ( ok == false )
Base::Console().Error("The tool 'wget' couldn't be found. Please check your installation.");
else if ( wget->isDownloading() && _pcAction )
+10 -10
View File
@@ -78,7 +78,7 @@ OnlineDocumentation::OnlineDocumentation()
if (zip.isValid()) {
zipios::ConstEntries entries = zip.entries();
for (zipios::ConstEntries::iterator it = entries.begin(); it != entries.end(); ++it) {
this->files.push_back(QString::fromAscii((*it)->getFileName().c_str()));
this->files.push_back(QString::fromLatin1((*it)->getFileName().c_str()));
}
}
}
@@ -102,7 +102,7 @@ QByteArray OnlineDocumentation::loadResource(const QString& filename) const
}
else if (filename == QLatin1String("/")) {
// load the startpage
QString header = QString::fromAscii(
QString header = QString::fromLatin1(
"<!doctype html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">"
"<link rel=\"shortcut icon\" href=\"favicon.ico\" type=\"image/x-icon\">"
"<html><head><title>Python: Index of Modules</title>"
@@ -128,12 +128,12 @@ QByteArray OnlineDocumentation::loadResource(const QString& filename) const
if (file.endsWith(QLatin1String(".html"))) {
file.chop(5);
if ((++ct)%15 == 0)
header += QString::fromAscii("</td><td width=\"25%\" valign=top>");
header += QString::fromAscii("<a href=\"%1.html\">%2</a><br>").arg(file).arg(file);
header += QString::fromLatin1("</td><td width=\"25%\" valign=top>");
header += QString::fromLatin1("<a href=\"%1.html\">%2</a><br>").arg(file).arg(file);
}
}
header += QString::fromAscii(
header += QString::fromLatin1(
"</td></tr></table></td></tr></table> <p>"
//"<p align=right>"
//"<font color=\"#909090\" face=\"helvetica, arial\"><strong>"
@@ -158,8 +158,8 @@ QByteArray OnlineDocumentation::loadResource(const QString& filename) const
}
else {
// load the error page
QHttpResponseHeader header(404, QString::fromAscii("File not found"));
header.setContentType(QString::fromAscii("text/html\r\n"
QHttpResponseHeader header(404, QString::fromLatin1("File not found"));
header.setContentType(QString::fromLatin1("text/html\r\n"
"\r\n"
"<html><head><title>Error</title></head>"
"<body bgcolor=\"#f0f0f8\">"
@@ -318,8 +318,8 @@ QByteArray PythonOnlineHelp::loadResource(const QString& filename) const
QByteArray PythonOnlineHelp::fileNotFound() const
{
QByteArray res;
QHttpResponseHeader header(404, QString::fromAscii("File not found"));
header.setContentType(QString::fromAscii("text/html\r\n"
QHttpResponseHeader header(404, QString::fromLatin1("File not found"));
header.setContentType(QString::fromLatin1("text/html\r\n"
"\r\n"
"<html><head><title>Error</title></head>"
"<body bgcolor=\"#f0f0f8\">"
@@ -380,7 +380,7 @@ void HttpServer::readClient()
// corresponding HTML document from the ZIP file.
QTcpSocket* socket = (QTcpSocket*)sender();
if (socket->canReadLine()) {
QString request = QString::fromAscii(socket->readLine());
QString request = QString::fromLatin1(socket->readLine());
QHttpRequestHeader header(request);
if (header.method() == QLatin1String("GET")) {
socket->write(help.loadResource(header.path()));
+5 -5
View File
@@ -217,13 +217,13 @@ void Placement::applyPlacement(const QString& data, bool incremental)
if (jt != props.end()) {
QString cmd;
if (incremental)
cmd = QString::fromAscii(
cmd = QString::fromLatin1(
"App.getDocument(\"%1\").%2.Placement=%3.multiply(App.getDocument(\"%1\").%2.Placement)")
.arg(QLatin1String((*it)->getDocument()->getName()))
.arg(QLatin1String((*it)->getNameInDocument()))
.arg(data);
else {
cmd = QString::fromAscii(
cmd = QString::fromLatin1(
"App.getDocument(\"%1\").%2.Placement=%3")
.arg(QLatin1String((*it)->getDocument()->getName()))
.arg(QLatin1String((*it)->getNameInDocument()))
@@ -399,7 +399,7 @@ void Placement::setPlacementData(const Base::Placement& p)
if (newitem) {
// add a new item before the very last item
QString display = QString::fromAscii("(%1,%2,%3)")
QString display = QString::fromLatin1("(%1,%2,%3)")
.arg(dir.x)
.arg(dir.y)
.arg(dir.z);
@@ -448,7 +448,7 @@ QString Placement::getPlacementString() const
if (index == 0) {
Base::Vector3d dir = getDirection();
cmd = QString::fromAscii(
cmd = QString::fromLatin1(
"App.Placement(App.Vector(%1,%2,%3), App.Rotation(App.Vector(%4,%5,%6),%7), App.Vector(%8,%9,%10))")
.arg(ui->xPos->value().getValue())
.arg(ui->yPos->value().getValue())
@@ -462,7 +462,7 @@ QString Placement::getPlacementString() const
.arg(ui->zCnt->value().getValue());
}
else if (index == 1) {
cmd = QString::fromAscii(
cmd = QString::fromLatin1(
"App.Placement(App.Vector(%1,%2,%3), App.Rotation(%4,%5,%6), App.Vector(%7,%8,%9))")
.arg(ui->xPos->value().getValue())
.arg(ui->yPos->value().getValue())
+1 -1
View File
@@ -488,7 +488,7 @@ void PrefQuantitySpinBox::contextMenuEvent(QContextMenuEvent *event)
QMenu *editMenu = lineEdit()->createStandardContextMenu();
editMenu->setTitle(tr("Edit"));
QMenu* menu = new QMenu(QString::fromAscii("PrefQuantitySpinBox"));
QMenu* menu = new QMenu(QString::fromLatin1("PrefQuantitySpinBox"));
menu->addMenu(editMenu);
menu->addSeparator();
+1 -1
View File
@@ -243,7 +243,7 @@ void Sequencer::showRemainingTime()
QTime time( 0,0, 0);
time = time.addSecs( rest/1000 );
QString remain = Gui::ProgressBar::tr("Remaining: %1").arg(time.toString());
QString status = QString::fromAscii("%1\t[%2]").arg(txt).arg(remain);
QString status = QString::fromLatin1("%1\t[%2]").arg(txt).arg(remain);
if (thr != currentThread) {
QMetaObject::invokeMethod(getMainWindow()->statusBar(), "showMessage",
+12 -12
View File
@@ -316,7 +316,7 @@ void InteractiveInterpreter::runCode(PyCodeObject* code) const
*/
bool InteractiveInterpreter::push(const char* line)
{
d->buffer.append(QString::fromAscii(line));
d->buffer.append(QString::fromLatin1(line));
QString source = d->buffer.join(QLatin1String("\n"));
try {
// Source is already UTF-8, so we can use toLatin1()
@@ -373,7 +373,7 @@ PythonConsole::PythonConsole(QWidget *parent)
try {
d->interpreter = new InteractiveInterpreter();
} catch (const Base::Exception& e) {
setPlainText(QString::fromAscii(e.what()));
setPlainText(QString::fromLatin1(e.what()));
setEnabled(false);
}
@@ -412,9 +412,9 @@ PythonConsole::PythonConsole(QWidget *parent)
const char* version = PyString_AsString(PySys_GetObject("version"));
const char* platform = PyString_AsString(PySys_GetObject("platform"));
d->info = QString::fromAscii("Python %1 on %2\n"
d->info = QString::fromLatin1("Python %1 on %2\n"
"Type 'help', 'copyright', 'credits' or 'license' for more information.")
.arg(QString::fromAscii(version)).arg(QString::fromAscii(platform));
.arg(QString::fromLatin1(version)).arg(QString::fromLatin1(platform));
d->output = d->info;
printPrompt(PythonConsole::Complete);
}
@@ -439,7 +439,7 @@ void PythonConsole::OnChange( Base::Subject<const char*> &rCaller,const char* sR
if (strcmp(sReason, "FontSize") == 0 || strcmp(sReason, "Font") == 0) {
int fontSize = hPrefGrp->GetInt("FontSize", 10);
QString fontFamily = QString::fromAscii(hPrefGrp->GetASCII("Font", "Courier").c_str());
QString fontFamily = QString::fromLatin1(hPrefGrp->GetASCII("Font", "Courier").c_str());
QFont font(fontFamily, fontSize);
setFont(font);
@@ -447,13 +447,13 @@ void PythonConsole::OnChange( Base::Subject<const char*> &rCaller,const char* sR
int width = metric.width(QLatin1String("0000"));
setTabStopWidth(width);
} else {
QMap<QString, QColor>::ConstIterator it = d->colormap.find(QString::fromAscii(sReason));
QMap<QString, QColor>::ConstIterator it = d->colormap.find(QString::fromLatin1(sReason));
if (it != d->colormap.end()) {
QColor color = it.value();
unsigned long col = (color.red() << 24) | (color.green() << 16) | (color.blue() << 8);
col = hPrefGrp->GetUnsigned( sReason, col);
color.setRgb((col>>24)&0xff, (col>>16)&0xff, (col>>8)&0xff);
pythonSyntax->setColor(QString::fromAscii(sReason), color);
pythonSyntax->setColor(QString::fromLatin1(sReason), color);
}
}
}
@@ -523,7 +523,7 @@ void PythonConsole::keyPressEvent(QKeyEvent * e)
if (!inputStrg.isEmpty())
{
d->history.append( QLatin1String("# ") + inputStrg ); //< put commented string to history ...
inputLineBegin.insertText( QString::fromAscii("# ") ); //< and comment it on console
inputLineBegin.insertText( QString::fromLatin1("# ") ); //< and comment it on console
setTextCursor( inputLineBegin );
printPrompt(d->interpreter->hasPendingInput() //< print adequate prompt
? PythonConsole::Incomplete
@@ -677,10 +677,10 @@ void PythonConsole::printPrompt(PythonConsole::Prompt mode)
switch (mode)
{
case PythonConsole::Incomplete:
cursor.insertText(QString::fromAscii("... "));
cursor.insertText(QString::fromLatin1("... "));
break;
case PythonConsole::Complete:
cursor.insertText(QString::fromAscii(">>> "));
cursor.insertText(QString::fromLatin1(">>> "));
break;
default:
break;
@@ -893,7 +893,7 @@ void PythonConsole::dropEvent (QDropEvent * e)
for (int i=0; i<ctActions; i++) {
QString action;
dataStream >> action;
printStatement(QString::fromAscii("Gui.runCommand(\"%1\")").arg(action));
printStatement(QString::fromLatin1("Gui.runCommand(\"%1\")").arg(action));
}
e->setDropAction(Qt::CopyAction);
@@ -1259,7 +1259,7 @@ QString PythonConsole::readline( void )
if (loop.exec() != 0)
{ PyErr_SetInterrupt(); } //< send SIGINT to python
this->_sourceDrain = NULL; //< disable source drain
return inputBuffer.append(QChar::fromAscii('\n')); //< pass a newline here, since the readline-caller may need it!
return inputBuffer.append(QChar::fromLatin1('\n')); //< pass a newline here, since the readline-caller may need it!
}
// ---------------------------------------------------------------------
+1 -1
View File
@@ -46,7 +46,7 @@ QListWidgetCustom::~QListWidgetCustom()
void QListWidgetCustom::dragMoveEvent(QDragMoveEvent *e)
{
if (e->source() != 0) {
const QString disabled_wbs = QString::fromAscii("disabled workbenches");
const QString disabled_wbs = QString::fromLatin1("disabled workbenches");
if (e->source()->accessibleName() == disabled_wbs) {
if (e->source() == this) {
e->ignore();
+4 -4
View File
@@ -252,9 +252,9 @@ QuantitySpinBox::QuantitySpinBox(QWidget *parent)
iconLabel->setCursor(Qt::ArrowCursor);
QPixmap pixmap = getIcon(":/icons/bound-expression-unset.svg", QSize(iconHeight, iconHeight));
iconLabel->setPixmap(pixmap);
iconLabel->setStyleSheet(QString::fromAscii("QLabel { border: none; padding: 0px; padding-top: %2px; width: %1px; height: %1px }").arg(iconHeight).arg(frameWidth/2));
iconLabel->setStyleSheet(QString::fromLatin1("QLabel { border: none; padding: 0px; padding-top: %2px; width: %1px; height: %1px }").arg(iconHeight).arg(frameWidth/2));
iconLabel->hide();
lineEdit()->setStyleSheet(QString::fromAscii("QLineEdit { padding-right: %1px } ").arg(iconHeight+frameWidth));
lineEdit()->setStyleSheet(QString::fromLatin1("QLineEdit { padding-right: %1px } ").arg(iconHeight+frameWidth));
QObject::connect(iconLabel, SIGNAL(clicked()), this, SLOT(openFormulaDialog()));
}
@@ -282,7 +282,7 @@ void Gui::QuantitySpinBox::setExpression(boost::shared_ptr<Expression> expr)
QPalette p(lineEdit()->palette());
p.setColor(QPalette::Active, QPalette::Text, Qt::red);
lineEdit()->setPalette(p);
iconLabel->setToolTip(QString::fromAscii(e.what()));
iconLabel->setToolTip(QString::fromLatin1(e.what()));
}
}
@@ -375,7 +375,7 @@ void QuantitySpinBox::resizeEvent(QResizeEvent * event)
QPalette p(lineEdit()->palette());
p.setColor(QPalette::Active, QPalette::Text, Qt::red);
lineEdit()->setPalette(p);
iconLabel->setToolTip(QString::fromAscii(e.what()));
iconLabel->setToolTip(QString::fromLatin1(e.what()));
}
}
+1 -1
View File
@@ -124,7 +124,7 @@ public:
QColor backgroundColor(void) const;
void resetNavigationModeFile(void);
void setNavigationModeFile(const QUrl & url = QUrl(QString::fromAscii(DEFAULT_NAVIGATIONFILE)));
void setNavigationModeFile(const QUrl & url = QUrl(QString::fromLatin1(DEFAULT_NAVIGATIONFILE)));
const QUrl & navigationModeFile(void) const;
void setContextMenuEnabled(bool yes);
+1 -1
View File
@@ -552,7 +552,7 @@ void ReportOutput::OnChange(Base::Subject<const char*> &rCaller, const char * sR
}
else if (strcmp(sReason, "FontSize") == 0 || strcmp(sReason, "Font") == 0) {
int fontSize = rclGrp.GetInt("FontSize", 10);
QString fontFamily = QString::fromAscii(rclGrp.GetASCII("Font", "Courier").c_str());
QString fontFamily = QString::fromLatin1(rclGrp.GetASCII("Font", "Courier").c_str());
QFont font(fontFamily, fontSize);
setFont(font);
+2 -2
View File
@@ -87,7 +87,7 @@ void SceneModel::setNode(SoNode* node)
void SceneModel::setNode(QModelIndex index, SoNode* node)
{
this->setData(index, QVariant(QString::fromAscii(node->getTypeId().getName())));
this->setData(index, QVariant(QString::fromLatin1(node->getTypeId().getName())));
if (node->getTypeId().isDerivedFrom(SoGroup::getClassTypeId())) {
SoGroup *group = static_cast<SoGroup*>(node);
// insert SoGroup icon
@@ -96,7 +96,7 @@ void SceneModel::setNode(QModelIndex index, SoNode* node)
for (int i=0; i<group->getNumChildren();i++) {
SoNode* child = group->getChild(i);
setNode(this->index(i, 0, index), child);
this->setData(this->index(i, 1, index), QVariant(QString::fromAscii(child->getName())));
this->setData(this->index(i, 1, index), QVariant(QString::fromLatin1(child->getName())));
}
}
// insert icon
+4 -4
View File
@@ -467,7 +467,7 @@ bool SelectionSingleton::setPreselect(const char* pDocName, const char* pObjectN
);
if (getMainWindow()) {
getMainWindow()->showMessage(QString::fromAscii(buf),3000);
getMainWindow()->showMessage(QString::fromLatin1(buf),3000);
Gui::MDIView* mdi = Gui::Application::Instance->activeDocument()->getActiveView();
mdi->setOverrideCursor(QCursor(Qt::ForbiddenCursor));
}
@@ -511,7 +511,7 @@ bool SelectionSingleton::setPreselect(const char* pDocName, const char* pObjectN
//FIXME: We shouldn't replace the possibly defined edit cursor
//with the arrow cursor. But it seems that we don't even have to.
//if (getMainWindow()){
// getMainWindow()->showMessage(QString::fromAscii(buf),3000);
// getMainWindow()->showMessage(QString::fromLatin1(buf),3000);
// Gui::MDIView* mdi = Gui::Application::Instance->activeDocument()->getActiveView();
// mdi->restoreOverrideCursor();
//}
@@ -542,7 +542,7 @@ void SelectionSingleton::setPreselectCoord( float x, float y, float z)
,x,y,z);
if (getMainWindow())
getMainWindow()->showMessage(QString::fromAscii(buf),3000);
getMainWindow()->showMessage(QString::fromLatin1(buf),3000);
}
void SelectionSingleton::rmvPreselect()
@@ -641,7 +641,7 @@ bool SelectionSingleton::addSelection(const char* pDocName, const char* pObjectN
if (ActiveGate) {
if (!ActiveGate->allow(temp.pDoc,temp.pObject,pSubName)) {
if (getMainWindow()) {
getMainWindow()->showMessage(QString::fromAscii("Selection not allowed by filter"),5000);
getMainWindow()->showMessage(QString::fromLatin1("Selection not allowed by filter"),5000);
Gui::MDIView* mdi = Gui::Application::Instance->activeDocument()->getActiveView();
mdi->setOverrideCursor(Qt::ForbiddenCursor);
}
+18 -18
View File
@@ -67,7 +67,7 @@ SelectionView::SelectionView(Gui::Document* pcDocument, QWidget *parent)
QToolButton* clearButton = new QToolButton(this);
clearButton->setFixedSize(18, 21);
clearButton->setCursor(Qt::ArrowCursor);
clearButton->setStyleSheet(QString::fromAscii("QToolButton {margin-bottom:6px}"));
clearButton->setStyleSheet(QString::fromLatin1("QToolButton {margin-bottom:6px}"));
clearButton->setIcon(BitmapFactory().pixmap(":/icons/edit-cleartext.svg"));
clearButton->setToolTip(tr("Clears the search field"));
hLayout->addWidget(searchBox);
@@ -190,13 +190,13 @@ void SelectionView::select(QListWidgetItem* item)
item = selectionView->currentItem();
if (!item)
return;
QStringList elements = item->text().split(QString::fromAscii("."));
QStringList elements = item->text().split(QString::fromLatin1("."));
// remove possible space from object name followed by label
elements[1] = elements[1].split(QString::fromAscii(" "))[0];
elements[1] = elements[1].split(QString::fromLatin1(" "))[0];
//Gui::Selection().clearSelection();
Gui::Command::runCommand(Gui::Command::Gui,"Gui.Selection.clearSelection()");
//Gui::Selection().addSelection(elements[0].toLatin1(),elements[1].toLatin1(),0);
QString cmd = QString::fromAscii("Gui.Selection.addSelection(App.getDocument(\"%1\").getObject(\"%2\"))").arg(elements[0]).arg(elements[1]);
QString cmd = QString::fromLatin1("Gui.Selection.addSelection(App.getDocument(\"%1\").getObject(\"%2\"))").arg(elements[0]).arg(elements[1]);
Gui::Command::runCommand(Gui::Command::Gui,cmd.toLatin1());
}
@@ -205,11 +205,11 @@ void SelectionView::deselect(void)
QListWidgetItem *item = selectionView->currentItem();
if (!item)
return;
QStringList elements = item->text().split(QString::fromAscii("."));
QStringList elements = item->text().split(QString::fromLatin1("."));
// remove possible space from object name followed by label
elements[1] = elements[1].split(QString::fromAscii(" "))[0];
elements[1] = elements[1].split(QString::fromLatin1(" "))[0];
//Gui::Selection().rmvSelection(elements[0].toLatin1(),elements[1].toLatin1(),0);
QString cmd = QString::fromAscii("Gui.Selection.removeSelection(App.getDocument(\"%1\").getObject(\"%2\"))").arg(elements[0]).arg(elements[1]);
QString cmd = QString::fromLatin1("Gui.Selection.removeSelection(App.getDocument(\"%1\").getObject(\"%2\"))").arg(elements[0]).arg(elements[1]);
Gui::Command::runCommand(Gui::Command::Gui,cmd.toLatin1());
}
@@ -230,18 +230,18 @@ void SelectionView::toPython(void)
QListWidgetItem *item = selectionView->currentItem();
if (!item)
return;
QStringList elements = item->text().split(QString::fromAscii("."));
QStringList elements = item->text().split(QString::fromLatin1("."));
// remove possible space from object name followed by label
elements[1] = elements[1].split(QString::fromAscii(" "))[0];
elements[1] = elements[1].split(QString::fromLatin1(" "))[0];
QString cmd = QString::fromAscii("obj = App.getDocument(\"%1\").getObject(\"%2\")").arg(elements[0]).arg(elements[1]);
QString cmd = QString::fromLatin1("obj = App.getDocument(\"%1\").getObject(\"%2\")").arg(elements[0]).arg(elements[1]);
Gui::Command::runCommand(Gui::Command::Gui,cmd.toLatin1());
if (elements.length() > 2) {
elements[2] = elements[2].split(QString::fromAscii(" "))[0];
if ( elements[2].contains(QString::fromAscii("Face")) || elements[2].contains(QString::fromAscii("Edge")) ) {
cmd = QString::fromAscii("shp = App.getDocument(\"%1\").getObject(\"%2\").Shape").arg(elements[0]).arg(elements[1]);
elements[2] = elements[2].split(QString::fromLatin1(" "))[0];
if ( elements[2].contains(QString::fromLatin1("Face")) || elements[2].contains(QString::fromLatin1("Edge")) ) {
cmd = QString::fromLatin1("shp = App.getDocument(\"%1\").getObject(\"%2\").Shape").arg(elements[0]).arg(elements[1]);
Gui::Command::runCommand(Gui::Command::Gui,cmd.toLatin1());
cmd = QString::fromAscii("elt = App.getDocument(\"%1\").getObject(\"%2\").Shape.%3").arg(elements[0]).arg(elements[1]).arg(elements[2]);
cmd = QString::fromLatin1("elt = App.getDocument(\"%1\").getObject(\"%2\").Shape.%3").arg(elements[0]).arg(elements[1]).arg(elements[2]);
Gui::Command::runCommand(Gui::Command::Gui,cmd.toLatin1());
}
}
@@ -254,18 +254,18 @@ void SelectionView::onItemContextMenu(const QPoint& point)
return;
QMenu menu;
QAction *selectAction = menu.addAction(tr("Select only"),this,SLOT(select()));
selectAction->setIcon(QIcon::fromTheme(QString::fromAscii("view-select")));
selectAction->setIcon(QIcon::fromTheme(QString::fromLatin1("view-select")));
selectAction->setToolTip(tr("Selects only this object"));
QAction *deselectAction = menu.addAction(tr("Deselect"),this,SLOT(deselect()));
deselectAction->setIcon(QIcon::fromTheme(QString::fromAscii("view-unselectable")));
deselectAction->setIcon(QIcon::fromTheme(QString::fromLatin1("view-unselectable")));
deselectAction->setToolTip(tr("Deselects this object"));
QAction *zoomAction = menu.addAction(tr("Zoom fit"),this,SLOT(zoom()));
zoomAction->setIcon(QIcon::fromTheme(QString::fromAscii("zoom-fit-best")));
zoomAction->setIcon(QIcon::fromTheme(QString::fromLatin1("zoom-fit-best")));
zoomAction->setToolTip(tr("Selects and fits this object in the 3D window"));
QAction *gotoAction = menu.addAction(tr("Go to selection"),this,SLOT(treeSelect()));
gotoAction->setToolTip(tr("Selects and locates this object in the tree view"));
QAction *toPythonAction = menu.addAction(tr("To python console"),this,SLOT(toPython()));
toPythonAction->setIcon(QIcon::fromTheme(QString::fromAscii("applications-python")));
toPythonAction->setIcon(QIcon::fromTheme(QString::fromLatin1("applications-python")));
toPythonAction->setToolTip(tr("Reveals this object and its subelements in the python console."));
menu.exec(selectionView->mapToGlobal(point));
}
+5 -5
View File
@@ -345,7 +345,7 @@ SoFCSelection::handleEvent(SoHandleEventAction * action)
,pp->getPoint()[1]
,pp->getPoint()[2]);
getMainWindow()->showMessage(QString::fromAscii(buf),3000);
getMainWindow()->showMessage(QString::fromLatin1(buf),3000);
}
else { // picked point
if (highlighted) {
@@ -404,7 +404,7 @@ SoFCSelection::handleEvent(SoHandleEventAction * action)
,pp->getPoint()[1]
,pp->getPoint()[2]);
getMainWindow()->showMessage(QString::fromAscii(buf),3000);
getMainWindow()->showMessage(QString::fromLatin1(buf),3000);
}
}
}
@@ -438,7 +438,7 @@ SoFCSelection::handleEvent(SoHandleEventAction * action)
,pp->getPoint()[1]
,pp->getPoint()[2]);
getMainWindow()->showMessage(QString::fromAscii(buf),3000);
getMainWindow()->showMessage(QString::fromLatin1(buf),3000);
}
}
@@ -569,7 +569,7 @@ SoFCSelection::handleEvent(SoHandleEventAction * action)
,pp->getPoint()[1]
,pp->getPoint()[2]);
getMainWindow()->showMessage(QString::fromAscii(buf),3000);
getMainWindow()->showMessage(QString::fromLatin1(buf),3000);
}
}
}
@@ -603,7 +603,7 @@ SoFCSelection::handleEvent(SoHandleEventAction * action)
,pp->getPoint()[1]
,pp->getPoint()[2]);
getMainWindow()->showMessage(QString::fromAscii(buf),3000);
getMainWindow()->showMessage(QString::fromLatin1(buf),3000);
}
}
+3 -3
View File
@@ -373,7 +373,7 @@ SoFCUnifiedSelection::handleEvent(SoHandleEventAction * action)
,pp->getPoint()[1]
,pp->getPoint()[2]);
getMainWindow()->showMessage(QString::fromAscii(buf),3000);
getMainWindow()->showMessage(QString::fromLatin1(buf),3000);
if (Gui::Selection().setPreselect(documentName.c_str()
,objectName.c_str()
@@ -470,7 +470,7 @@ SoFCUnifiedSelection::handleEvent(SoHandleEventAction * action)
,pp->getPoint()[1]
,pp->getPoint()[2]);
getMainWindow()->showMessage(QString::fromAscii(buf),3000);
getMainWindow()->showMessage(QString::fromLatin1(buf),3000);
}
}
}
@@ -508,7 +508,7 @@ SoFCUnifiedSelection::handleEvent(SoHandleEventAction * action)
,pp->getPoint()[1]
,pp->getPoint()[2]);
getMainWindow()->showMessage(QString::fromAscii(buf),3000);
getMainWindow()->showMessage(QString::fromLatin1(buf),3000);
}
}
+2 -2
View File
@@ -209,7 +209,7 @@ void SoTextLabel::GLRender(SoGLRenderAction *action)
// The font name is of the form "family:style". If 'style' is given it can be
// 'Bold', 'Italic' or 'Bold Italic'.
QFont font;
QString fn = QString::fromAscii(fontname.getString());
QString fn = QString::fromLatin1(fontname.getString());
int pos = fn.indexOf(QLatin1Char(':'));
if (pos > -1) {
if (fn.indexOf(QLatin1String("Bold"),pos,Qt::CaseInsensitive) > pos)
@@ -434,7 +434,7 @@ void SoFrameLabel::drawImage()
return;
}
QFont font(QString::fromAscii(name.getValue()), size.getValue());
QFont font(QString::fromLatin1(name.getValue()), size.getValue());
QFontMetrics fm(font);
int w = 0;
int h = fm.height() * num;
+15 -15
View File
@@ -157,9 +157,9 @@ UIntSpinBox::UIntSpinBox (QWidget* parent)
iconLabel->setCursor(Qt::ArrowCursor);
QPixmap pixmap = getIcon(":/icons/bound-expression-unset.svg", QSize(iconHeight, iconHeight));
iconLabel->setPixmap(pixmap);
iconLabel->setStyleSheet(QString::fromAscii("QLabel { border: none; padding: 0px; padding-top: %2px; width: %1px; height: %1px }").arg(iconHeight).arg(frameWidth/2));
iconLabel->setStyleSheet(QString::fromLatin1("QLabel { border: none; padding: 0px; padding-top: %2px; width: %1px; height: %1px }").arg(iconHeight).arg(frameWidth/2));
iconLabel->hide();
lineEdit()->setStyleSheet(QString::fromAscii("QLineEdit { padding-right: %1px } ").arg(iconHeight+frameWidth));
lineEdit()->setStyleSheet(QString::fromLatin1("QLineEdit { padding-right: %1px } ").arg(iconHeight+frameWidth));
QObject::connect(iconLabel, SIGNAL(clicked()), this, SLOT(openFormulaDialog()));
}
@@ -255,7 +255,7 @@ void UIntSpinBox::bind(const App::ObjectIdentifier &_path)
ExpressionBinding::bind(_path);
int frameWidth = style()->pixelMetric(QStyle::PM_SpinBoxFrameWidth);
lineEdit()->setStyleSheet(QString::fromAscii("QLineEdit { padding-right: %1px } ").arg(iconLabel->sizeHint().width() + frameWidth + 1));
lineEdit()->setStyleSheet(QString::fromLatin1("QLineEdit { padding-right: %1px } ").arg(iconLabel->sizeHint().width() + frameWidth + 1));
iconLabel->show();
}
@@ -272,7 +272,7 @@ void UIntSpinBox::setExpression(boost::shared_ptr<Expression> expr)
QPalette p(lineEdit()->palette());
p.setColor(QPalette::Active, QPalette::Text, Qt::red);
lineEdit()->setPalette(p);
iconLabel->setToolTip(QString::fromAscii(e.what()));
iconLabel->setToolTip(QString::fromLatin1(e.what()));
}
}
@@ -362,7 +362,7 @@ void UIntSpinBox::resizeEvent(QResizeEvent * event)
QPalette p(lineEdit()->palette());
p.setColor(QPalette::Active, QPalette::Text, Qt::red);
lineEdit()->setPalette(p);
iconLabel->setToolTip(QString::fromAscii(e.what()));
iconLabel->setToolTip(QString::fromLatin1(e.what()));
}
}
@@ -419,9 +419,9 @@ IntSpinBox::IntSpinBox(QWidget* parent) : QSpinBox(parent) {
iconLabel->setCursor(Qt::ArrowCursor);
QPixmap pixmap = getIcon(":/icons/bound-expression-unset.svg", QSize(iconHeight, iconHeight));
iconLabel->setPixmap(pixmap);
iconLabel->setStyleSheet(QString::fromAscii("QLabel { border: none; padding: 0px; padding-top: %2px; width: %1px; height: %1px }").arg(iconHeight).arg(frameWidth/2));
iconLabel->setStyleSheet(QString::fromLatin1("QLabel { border: none; padding: 0px; padding-top: %2px; width: %1px; height: %1px }").arg(iconHeight).arg(frameWidth/2));
iconLabel->hide();
lineEdit()->setStyleSheet(QString::fromAscii("QLineEdit { padding-right: %1px } ").arg(iconHeight+frameWidth));
lineEdit()->setStyleSheet(QString::fromLatin1("QLineEdit { padding-right: %1px } ").arg(iconHeight+frameWidth));
QObject::connect(iconLabel, SIGNAL(clicked()), this, SLOT(openFormulaDialog()));
}
@@ -446,7 +446,7 @@ void IntSpinBox::bind(const ObjectIdentifier& _path) {
ExpressionBinding::bind(_path);
int frameWidth = style()->pixelMetric(QStyle::PM_SpinBoxFrameWidth);
lineEdit()->setStyleSheet(QString::fromAscii("QLineEdit { padding-right: %1px } ").arg(iconLabel->sizeHint().width() + frameWidth + 1));
lineEdit()->setStyleSheet(QString::fromLatin1("QLineEdit { padding-right: %1px } ").arg(iconLabel->sizeHint().width() + frameWidth + 1));
iconLabel->show();
}
@@ -463,7 +463,7 @@ void IntSpinBox::setExpression(boost::shared_ptr<Expression> expr)
QPalette p(lineEdit()->palette());
p.setColor(QPalette::Active, QPalette::Text, Qt::red);
lineEdit()->setPalette(p);
iconLabel->setToolTip(QString::fromAscii(e.what()));
iconLabel->setToolTip(QString::fromLatin1(e.what()));
}
}
@@ -537,7 +537,7 @@ void IntSpinBox::resizeEvent(QResizeEvent * event)
QPalette p(lineEdit()->palette());
p.setColor(QPalette::Active, QPalette::Text, Qt::red);
lineEdit()->setPalette(p);
iconLabel->setToolTip(QString::fromAscii(e.what()));
iconLabel->setToolTip(QString::fromLatin1(e.what()));
}
}
@@ -594,9 +594,9 @@ DoubleSpinBox::DoubleSpinBox(QWidget* parent): QDoubleSpinBox(parent) {
iconLabel->setCursor(Qt::ArrowCursor);
QPixmap pixmap = getIcon(":/icons/bound-expression-unset.svg", QSize(iconHeight, iconHeight));
iconLabel->setPixmap(pixmap);
iconLabel->setStyleSheet(QString::fromAscii("QLabel { border: none; padding: 0px; padding-top: %2px; width: %1px; height: %1px }").arg(iconHeight).arg(frameWidth/2));
iconLabel->setStyleSheet(QString::fromLatin1("QLabel { border: none; padding: 0px; padding-top: %2px; width: %1px; height: %1px }").arg(iconHeight).arg(frameWidth/2));
iconLabel->hide();
lineEdit()->setStyleSheet(QString::fromAscii("QLineEdit { padding-right: %1px } ").arg(iconHeight+frameWidth));
lineEdit()->setStyleSheet(QString::fromLatin1("QLineEdit { padding-right: %1px } ").arg(iconHeight+frameWidth));
QObject::connect(iconLabel, SIGNAL(clicked()), this, SLOT(openFormulaDialog()));
}
@@ -621,7 +621,7 @@ void DoubleSpinBox::bind(const ObjectIdentifier& _path) {
ExpressionBinding::bind(_path);
int frameWidth = style()->pixelMetric(QStyle::PM_SpinBoxFrameWidth);
lineEdit()->setStyleSheet(QString::fromAscii("QLineEdit { padding-right: %1px } ").arg(iconLabel->sizeHint().width() + frameWidth + 1));
lineEdit()->setStyleSheet(QString::fromLatin1("QLineEdit { padding-right: %1px } ").arg(iconLabel->sizeHint().width() + frameWidth + 1));
iconLabel->show();
}
@@ -638,7 +638,7 @@ void DoubleSpinBox::setExpression(boost::shared_ptr<Expression> expr)
QPalette p(lineEdit()->palette());
p.setColor(QPalette::Active, QPalette::Text, Qt::red);
lineEdit()->setPalette(p);
iconLabel->setToolTip(QString::fromAscii(e.what()));
iconLabel->setToolTip(QString::fromLatin1(e.what()));
}
}
@@ -712,7 +712,7 @@ void DoubleSpinBox::resizeEvent(QResizeEvent * event)
QPalette p(lineEdit()->palette());
p.setColor(QPalette::Active, QPalette::Text, Qt::red);
lineEdit()->setPalette(p);
iconLabel->setToolTip(QString::fromAscii(e.what()));
iconLabel->setToolTip(QString::fromLatin1(e.what()));
}
}
+43 -43
View File
@@ -61,7 +61,7 @@ public:
const std::map<std::string,std::string>& cfg = App::GetApplication().Config();
std::map<std::string,std::string>::const_iterator al = cfg.find("SplashAlignment");
if (al != cfg.end()) {
QString alt = QString::fromAscii(al->second.c_str());
QString alt = QString::fromLatin1(al->second.c_str());
int align=0;
if (alt.startsWith(QLatin1String("VCenter")))
align = Qt::AlignVCenter;
@@ -83,7 +83,7 @@ public:
// choose text color
std::map<std::string,std::string>::const_iterator tc = cfg.find("SplashTextColor");
if (tc != cfg.end()) {
QColor col; col.setNamedColor(QString::fromAscii(tc->second.c_str()));
QColor col; col.setNamedColor(QString::fromLatin1(tc->second.c_str()));
if (col.isValid())
textColor = col;
}
@@ -242,51 +242,51 @@ static QString getOperatingSystem()
switch(QSysInfo::windowsVersion())
{
case QSysInfo::WV_NT:
return QString::fromAscii("Windows NT");
return QString::fromLatin1("Windows NT");
case QSysInfo::WV_2000:
return QString::fromAscii("Windows 2000");
return QString::fromLatin1("Windows 2000");
case QSysInfo::WV_XP:
return QString::fromAscii("Windows XP");
return QString::fromLatin1("Windows XP");
case QSysInfo::WV_2003:
return QString::fromAscii("Windows Server 2003");
return QString::fromLatin1("Windows Server 2003");
case QSysInfo::WV_VISTA:
return QString::fromAscii("Windows Vista");
return QString::fromLatin1("Windows Vista");
case QSysInfo::WV_WINDOWS7:
return QString::fromAscii("Windows 7");
return QString::fromLatin1("Windows 7");
#if QT_VERSION >= 0x040800
case QSysInfo::WV_WINDOWS8:
return QString::fromAscii("Windows 8");
return QString::fromLatin1("Windows 8");
#endif
#if ((QT_VERSION >= 0x050200) || (QT_VERSION >= 0x040806 && QT_VERSION < 0x050000))
case QSysInfo::WV_WINDOWS8_1:
return QString::fromAscii("Windows 8.1");
return QString::fromLatin1("Windows 8.1");
#endif
default:
return QString::fromAscii("Windows");
return QString::fromLatin1("Windows");
}
#elif defined (Q_OS_MAC)
switch(QSysInfo::MacVersion())
{
case QSysInfo::MV_10_3:
return QString::fromAscii("Mac OS X 10.3");
return QString::fromLatin1("Mac OS X 10.3");
case QSysInfo::MV_10_4:
return QString::fromAscii("Mac OS X 10.4");
return QString::fromLatin1("Mac OS X 10.4");
case QSysInfo::MV_10_5:
return QString::fromAscii("Mac OS X 10.5");
return QString::fromLatin1("Mac OS X 10.5");
#if QT_VERSION >= 0x040700
case QSysInfo::MV_10_6:
return QString::fromAscii("Mac OS X 10.6");
return QString::fromLatin1("Mac OS X 10.6");
#endif
#if QT_VERSION >= 0x040800
case QSysInfo::MV_10_7:
return QString::fromAscii("Mac OS X 10.7");
return QString::fromLatin1("Mac OS X 10.7");
case QSysInfo::MV_10_8:
return QString::fromAscii("Mac OS X 10.8");
return QString::fromLatin1("Mac OS X 10.8");
case QSysInfo::MV_10_9:
return QString::fromAscii("Mac OS X 10.9");
return QString::fromLatin1("Mac OS X 10.9");
#endif
default:
return QString::fromAscii("Mac OS X");
return QString::fromLatin1("Mac OS X");
}
#elif defined (Q_OS_LINUX)
QString exe(QLatin1String("lsb_release"));
@@ -298,12 +298,12 @@ static QString getOperatingSystem()
if (proc.waitForStarted() && proc.waitForFinished()) {
QByteArray info = proc.readAll();
info.replace('\n',"");
return QString::fromAscii((const char*)info);
return QString::fromLatin1((const char*)info);
}
return QString::fromAscii("Linux");
return QString::fromLatin1("Linux");
#elif defined (Q_OS_UNIX)
return QString::fromAscii("UNIX");
return QString::fromLatin1("UNIX");
#else
return QString();
#endif
@@ -390,7 +390,7 @@ void AboutDialog::setupLabels()
#endif
//avoid overriding user set style sheet
if (qApp->styleSheet().isEmpty()) {
setStyleSheet(QString::fromAscii("Gui--Dialog--AboutDialog QLabel {font-size: %1pt;}").arg(fontSize));
setStyleSheet(QString::fromLatin1("Gui--Dialog--AboutDialog QLabel {font-size: %1pt;}").arg(fontSize));
}
QString exeName = qApp->applicationName();
@@ -398,44 +398,44 @@ void AboutDialog::setupLabels()
std::map<std::string,std::string>::iterator it;
QString banner = QString::fromUtf8(config["CopyrightInfo"].c_str());
banner = banner.left( banner.indexOf(QLatin1Char('\n')) );
QString major = QString::fromAscii(config["BuildVersionMajor"].c_str());
QString minor = QString::fromAscii(config["BuildVersionMinor"].c_str());
QString build = QString::fromAscii(config["BuildRevision"].c_str());
QString disda = QString::fromAscii(config["BuildRevisionDate"].c_str());
QString mturl = QString::fromAscii(config["MaintainerUrl"].c_str());
QString major = QString::fromLatin1(config["BuildVersionMajor"].c_str());
QString minor = QString::fromLatin1(config["BuildVersionMinor"].c_str());
QString build = QString::fromLatin1(config["BuildRevision"].c_str());
QString disda = QString::fromLatin1(config["BuildRevisionDate"].c_str());
QString mturl = QString::fromLatin1(config["MaintainerUrl"].c_str());
QString author = ui->labelAuthor->text();
author.replace(QString::fromAscii("Unknown Application"), exeName);
author.replace(QString::fromAscii("(c) Unknown Author"), banner);
author.replace(QString::fromLatin1("Unknown Application"), exeName);
author.replace(QString::fromLatin1("(c) Unknown Author"), banner);
ui->labelAuthor->setText(author);
ui->labelAuthor->setUrl(mturl);
QString version = ui->labelBuildVersion->text();
version.replace(QString::fromAscii("Unknown"), QString::fromAscii("%1.%2").arg(major).arg(minor));
version.replace(QString::fromLatin1("Unknown"), QString::fromLatin1("%1.%2").arg(major).arg(minor));
ui->labelBuildVersion->setText(version);
QString revision = ui->labelBuildRevision->text();
revision.replace(QString::fromAscii("Unknown"), build);
revision.replace(QString::fromLatin1("Unknown"), build);
ui->labelBuildRevision->setText(revision);
QString date = ui->labelBuildDate->text();
date.replace(QString::fromAscii("Unknown"), disda);
date.replace(QString::fromLatin1("Unknown"), disda);
ui->labelBuildDate->setText(date);
QString os = ui->labelBuildOS->text();
os.replace(QString::fromAscii("Unknown"), SystemInfo::getOperatingSystem());
os.replace(QString::fromLatin1("Unknown"), SystemInfo::getOperatingSystem());
ui->labelBuildOS->setText(os);
QString platform = ui->labelBuildPlatform->text();
platform.replace(QString::fromAscii("Unknown"),
QString::fromAscii("%1-bit").arg(QSysInfo::WordSize));
platform.replace(QString::fromLatin1("Unknown"),
QString::fromLatin1("%1-bit").arg(QSysInfo::WordSize));
ui->labelBuildPlatform->setText(platform);
// branch name
it = config.find("BuildRevisionBranch");
if (it != config.end()) {
QString branch = ui->labelBuildBranch->text();
branch.replace(QString::fromAscii("Unknown"), QString::fromAscii(it->second.c_str()));
branch.replace(QString::fromLatin1("Unknown"), QString::fromLatin1(it->second.c_str()));
ui->labelBuildBranch->setText(branch);
}
else {
@@ -447,7 +447,7 @@ void AboutDialog::setupLabels()
it = config.find("BuildRevisionHash");
if (it != config.end()) {
QString hash = ui->labelBuildHash->text();
hash.replace(QString::fromAscii("Unknown"), QString::fromAscii(it->second.c_str()));
hash.replace(QString::fromLatin1("Unknown"), QString::fromLatin1(it->second.c_str()));
ui->labelBuildHash->setText(hash);
}
else {
@@ -466,7 +466,7 @@ public:
{
QString info;
#ifdef _USE_3DCONNEXION_SDK
info = QString::fromAscii(
info = QString::fromLatin1(
"3D Mouse Support:\n"
"Development tools and related technology provided under license from 3Dconnexion.\n"
"(c) 1992 - 2012 3Dconnexion. All rights reserved");
@@ -512,11 +512,11 @@ void AboutDialog::on_copyButton_clicked()
QTextStream str(&data);
std::map<std::string, std::string>& config = App::Application::Config();
std::map<std::string,std::string>::iterator it;
QString exe = QString::fromAscii(App::GetApplication().getExecutableName());
QString exe = QString::fromLatin1(App::GetApplication().getExecutableName());
QString major = QString::fromAscii(config["BuildVersionMajor"].c_str());
QString minor = QString::fromAscii(config["BuildVersionMinor"].c_str());
QString build = QString::fromAscii(config["BuildRevision"].c_str());
QString major = QString::fromLatin1(config["BuildVersionMajor"].c_str());
QString minor = QString::fromLatin1(config["BuildVersionMinor"].c_str());
QString build = QString::fromLatin1(config["BuildRevision"].c_str());
str << "OS: " << SystemInfo::getOperatingSystem() << endl;
int wordSize = SystemInfo::getWordSizeOfOS();
if (wordSize > 0) {
+4 -4
View File
@@ -114,8 +114,8 @@ void AbstractSplitView::OnChange(ParameterGrp::SubjectType &rCaller,ParameterGrp
}
else if (strcmp(Reason,"HeadlightDirection") == 0) {
std::string pos = rGrp.GetASCII("HeadlightDirection");
QString flt = QString::fromAscii("([-+]?[0-9]+\\.?[0-9]+)");
QRegExp rx(QString::fromAscii("^\\(%1,%1,%1\\)$").arg(flt));
QString flt = QString::fromLatin1("([-+]?[0-9]+\\.?[0-9]+)");
QRegExp rx(QString::fromLatin1("^\\(%1,%1,%1\\)$").arg(flt));
if (rx.indexIn(QLatin1String(pos.c_str())) > -1) {
float x = rx.cap(1).toFloat();
float y = rx.cap(2).toFloat();
@@ -143,8 +143,8 @@ void AbstractSplitView::OnChange(ParameterGrp::SubjectType &rCaller,ParameterGrp
}
else if (strcmp(Reason,"BacklightDirection") == 0) {
std::string pos = rGrp.GetASCII("BacklightDirection");
QString flt = QString::fromAscii("([-+]?[0-9]+\\.?[0-9]+)");
QRegExp rx(QString::fromAscii("^\\(%1,%1,%1\\)$").arg(flt));
QString flt = QString::fromLatin1("([-+]?[0-9]+\\.?[0-9]+)");
QRegExp rx(QString::fromLatin1("^\\(%1,%1,%1\\)$").arg(flt));
if (rx.indexIn(QLatin1String(pos.c_str())) > -1) {
float x = rx.cap(1).toFloat();
float y = rx.cap(2).toFloat();
+1 -1
View File
@@ -231,7 +231,7 @@ void TaskAppearance::setDisplayModes(const std::vector<Gui::ViewProvider*>& view
App::Property* prop = (*it)->getPropertyByName("DisplayMode");
if (prop && prop->getTypeId() == App::PropertyEnumeration::getClassTypeId()) {
App::PropertyEnumeration* display = static_cast<App::PropertyEnumeration*>(prop);
QString activeMode = QString::fromAscii(display->getValueAsString());
QString activeMode = QString::fromLatin1(display->getValueAsString());
int index = ui->changeMode->findText(activeMode);
if (index != -1) {
ui->changeMode->setCurrentIndex(index);
+1 -1
View File
@@ -219,7 +219,7 @@ void TaskSelectLinkProperty::OnChange(Gui::SelectionSingleton::SubjectType &rCal
temp += "::";
temp += it->SubName;
}
new QListWidgetItem(QString::fromAscii(temp.c_str()), ui->listWidget);
new QListWidgetItem(QString::fromLatin1(temp.c_str()), ui->listWidget);
}
checkSelectionStatus();
}
+3 -3
View File
@@ -332,7 +332,7 @@ void TextEditor::keyPressEvent (QKeyEvent * e)
int indent = hPrefGrp->GetInt( "IndentSize", 4 );
bool space = hPrefGrp->GetBool( "Spaces", false );
QString ch = space ? QString(indent, QLatin1Char(' '))
: QString::fromAscii("\t");
: QString::fromLatin1("\t");
QTextCursor cursor = textCursor();
if (!cursor.hasSelection()) {
@@ -421,12 +421,12 @@ void TextEditor::OnChange(Base::Subject<const char*> &rCaller,const char* sReaso
#else
int fontSize = hPrefGrp->GetInt("FontSize", 10);
#endif
QString fontFamily = QString::fromAscii(hPrefGrp->GetASCII( "Font", "Courier" ).c_str());
QString fontFamily = QString::fromLatin1(hPrefGrp->GetASCII( "Font", "Courier" ).c_str());
QFont font(fontFamily, fontSize);
setFont(font);
} else {
QMap<QString, QColor>::ConstIterator it = d->colormap.find(QString::fromAscii(sReason));
QMap<QString, QColor>::ConstIterator it = d->colormap.find(QString::fromLatin1(sReason));
if (it != d->colormap.end()) {
QColor color = it.value();
unsigned long col = (color.red() << 24) | (color.green() << 16) | (color.blue() << 8);
+1 -1
View File
@@ -59,7 +59,7 @@ TextureMapping::TextureMapping(QWidget* parent, Qt::WFlags fl)
QStringList formats;
QList<QByteArray> qtformats = QImageReader::supportedImageFormats();
for (QList<QByteArray>::Iterator it = qtformats.begin(); it != qtformats.end(); ++it) {
formats << QString::fromAscii("*.%1").arg(QLatin1String(*it));
formats << QString::fromLatin1("*.%1").arg(QLatin1String(*it));
}
ui->fileChooser->setFilter(tr("Image files (%1)").arg(formats.join(QLatin1String(" "))));
+1 -1
View File
@@ -108,7 +108,7 @@ void Thumbnail::SaveDocFile (Base::Writer &writer) const
if (!px.isNull()) {
// according to specification add some meta-information to the image
uint mt = QDateTime::currentDateTime().toTime_t();
QString mtime = QString::fromAscii("%1").arg(mt);
QString mtime = QString::fromLatin1("%1").arg(mt);
img.setText(QLatin1String("Software"), qApp->applicationName());
img.setText(QLatin1String("Thumb::Mimetype"), QLatin1String("application/x-extension-fcstd"));
img.setText(QLatin1String("Thumb::MTime"), mtime);
+2 -2
View File
@@ -260,7 +260,7 @@ void ToolBarManager::setup(ToolBarItem* item, QToolBar* toolbar) const
QList<QAction*> actions = toolbar->actions();
for (QList<ToolBarItem*>::ConstIterator it = items.begin(); it != items.end(); ++it) {
// search for the action item
QAction* action = findAction(actions, QString::fromAscii((*it)->command().c_str()));
QAction* action = findAction(actions, QString::fromLatin1((*it)->command().c_str()));
if (!action) {
if ((*it)->command() == "Separator") {
action = toolbar->addSeparator();
@@ -271,7 +271,7 @@ void ToolBarManager::setup(ToolBarItem* item, QToolBar* toolbar) const
}
// set the tool button user data
if (action) action->setData(QString::fromAscii((*it)->command().c_str()));
if (action) action->setData(QString::fromLatin1((*it)->command().c_str()));
} else {
// Note: For toolbars we do not remove and readd the actions
// because this causes flicker effects. So, it could happen that the order of
+1 -1
View File
@@ -89,7 +89,7 @@ void ToolBoxManager::setup( ToolBarItem* toolBar ) const
bar->setOrientation(Qt::Vertical);
bar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
std::string toolbarName = (*item)->command();
bar->setObjectName(QString::fromAscii((*item)->command().c_str()));
bar->setObjectName(QString::fromLatin1((*item)->command().c_str()));
bar->setWindowTitle(QObject::trUtf8(toolbarName.c_str())); // i18n
_toolBox->addItem( bar, bar->windowTitle() );
+7 -7
View File
@@ -221,9 +221,9 @@ void TreeWidget::onCreateGroup()
if (this->contextItem->type() == DocumentType) {
DocumentItem* docitem = static_cast<DocumentItem*>(this->contextItem);
App::Document* doc = docitem->document()->getDocument();
QString cmd = QString::fromAscii("App.getDocument(\"%1\").addObject"
QString cmd = QString::fromLatin1("App.getDocument(\"%1\").addObject"
"(\"App::DocumentObjectGroup\",\"%2\")")
.arg(QString::fromAscii(doc->getName())).arg(name);
.arg(QString::fromLatin1(doc->getName())).arg(name);
Gui::Document* gui = Gui::Application::Instance->getDocument(doc);
gui->openCommand("Create group");
Gui::Application::Instance->runPythonCode(cmd.toUtf8());
@@ -234,10 +234,10 @@ void TreeWidget::onCreateGroup()
(this->contextItem);
App::DocumentObject* obj = objitem->object()->getObject();
App::Document* doc = obj->getDocument();
QString cmd = QString::fromAscii("App.getDocument(\"%1\").getObject(\"%2\")"
QString cmd = QString::fromLatin1("App.getDocument(\"%1\").getObject(\"%2\")"
".newObject(\"App::DocumentObjectGroup\",\"%3\")")
.arg(QString::fromAscii(doc->getName()))
.arg(QString::fromAscii(obj->getNameInDocument()))
.arg(QString::fromLatin1(doc->getName()))
.arg(QString::fromLatin1(obj->getNameInDocument()))
.arg(name);
Gui::Document* gui = Gui::Application::Instance->getDocument(doc);
gui->openCommand("Create group");
@@ -1364,9 +1364,9 @@ void DocumentObjectItem::displayStatusInfo()
{
App::DocumentObject* Obj = viewObject->getObject();
QString info = QString::fromAscii(Obj->getStatusString());
QString info = QString::fromLatin1(Obj->getStatusString());
if ( Obj->mustExecute() == 1 )
info += QString::fromAscii(" (but must be executed)");
info += QString::fromLatin1(" (but must be executed)");
getMainWindow()->showMessage( info );
if (Obj->isError()) {
+4 -4
View File
@@ -253,8 +253,8 @@ void View3DInventor::OnChange(ParameterGrp::SubjectType &rCaller,ParameterGrp::M
}
else if (strcmp(Reason,"HeadlightDirection") == 0) {
std::string pos = rGrp.GetASCII("HeadlightDirection");
QString flt = QString::fromAscii("([-+]?[0-9]+\\.?[0-9]+)");
QRegExp rx(QString::fromAscii("^\\(%1,%1,%1\\)$").arg(flt));
QString flt = QString::fromLatin1("([-+]?[0-9]+\\.?[0-9]+)");
QRegExp rx(QString::fromLatin1("^\\(%1,%1,%1\\)$").arg(flt));
if (rx.indexIn(QLatin1String(pos.c_str())) > -1) {
float x = rx.cap(1).toFloat();
float y = rx.cap(2).toFloat();
@@ -278,8 +278,8 @@ void View3DInventor::OnChange(ParameterGrp::SubjectType &rCaller,ParameterGrp::M
}
else if (strcmp(Reason,"BacklightDirection") == 0) {
std::string pos = rGrp.GetASCII("BacklightDirection");
QString flt = QString::fromAscii("([-+]?[0-9]+\\.?[0-9]+)");
QRegExp rx(QString::fromAscii("^\\(%1,%1,%1\\)$").arg(flt));
QString flt = QString::fromLatin1("([-+]?[0-9]+\\.?[0-9]+)");
QRegExp rx(QString::fromLatin1("^\\(%1,%1,%1\\)$").arg(flt));
if (rx.indexIn(QLatin1String(pos.c_str())) > -1) {
float x = rx.cap(1).toFloat();
float y = rx.cap(2).toFloat();
+2 -2
View File
@@ -1541,7 +1541,7 @@ void View3DInventorViewer::printDimension()
unit = QLatin1String("nm");
}
QString dim = QString::fromAscii("%1 x %2 %3")
QString dim = QString::fromLatin1("%1 x %2 %3")
.arg(fWidth / fFac,0,'f',2)
.arg(fHeight / fFac,0,'f',2)
.arg(unit);
@@ -2625,7 +2625,7 @@ SoPath* View3DInventorViewer::pickFilterCB(void* viewer, const SoPickedPoint* pp
,pp->getPoint()[1]
,pp->getPoint()[2]);
getMainWindow()->showMessage(QString::fromAscii(buf),3000);
getMainWindow()->showMessage(QString::fromLatin1(buf),3000);
}
return pp->getPath();
+1 -1
View File
@@ -455,7 +455,7 @@ void ViewProviderAnnotationLabel::drawImage(const std::vector<std::string>& s)
return;
}
QFont font(QString::fromAscii(this->FontName.getValue()), (int)this->FontSize.getValue());
QFont font(QString::fromLatin1(this->FontName.getValue()), (int)this->FontSize.getValue());
QFontMetrics fm(font);
int w = 0;
int h = fm.height() * s.size();
+5 -5
View File
@@ -676,8 +676,8 @@ Py::Object UiLoaderPy::createWidget(const Py::Tuple& args)
}
}
QWidget* widget = loader.createWidget(QString::fromAscii(className.c_str()), parent,
QString::fromAscii(objectName.c_str()));
QWidget* widget = loader.createWidget(QString::fromLatin1(className.c_str()), parent,
QString::fromLatin1(objectName.c_str()));
if (!widget) {
std::string err = "No such widget class '";
err += className;
@@ -1041,7 +1041,7 @@ bool PyResource::connect(const char* sender, const char* signal, PyObject* cb)
QList<QWidget*> list = myDlg->findChildren<QWidget*>();
QList<QWidget*>::const_iterator it = list.begin();
QObject *obj;
QString sigStr = QString::fromAscii("2%1").arg(QString::fromAscii(signal));
QString sigStr = QString::fromLatin1("2%1").arg(QString::fromLatin1(signal));
while ( it != list.end() ) {
obj = *it;
@@ -1209,7 +1209,7 @@ PyObject *PyResource::setValue(PyObject *args)
QVariant v;
if (PyString_Check(psValue)) {
v = QString::fromAscii(PyString_AsString(psValue));
v = QString::fromLatin1(PyString_AsString(psValue));
}
else if (PyInt_Check(psValue)) {
int val = PyInt_AsLong(psValue);
@@ -1231,7 +1231,7 @@ PyObject *PyResource::setValue(PyObject *args)
continue;
char* pItem = PyString_AsString(item);
str.append(QString::fromAscii(pItem));
str.append(QString::fromLatin1(pItem));
}
v = str;
+3 -3
View File
@@ -85,7 +85,7 @@ void CommandIconView::startDrag ( Qt::DropActions supportedActions )
}
QMimeData *mimeData = new QMimeData;
mimeData->setData(QString::fromAscii("text/x-action-items"), itemData);
mimeData->setData(QString::fromLatin1("text/x-action-items"), itemData);
QDrag *drag = new QDrag(this);
drag->setMimeData(mimeData);
@@ -405,7 +405,7 @@ void AccelLineEdit::keyPressEvent ( QKeyEvent * e)
txtLine.clear();
break;
default:
txtLine += QString::fromAscii(",");
txtLine += QString::fromLatin1(",");
break;
}
@@ -712,7 +712,7 @@ void ColorButton::onRejected()
UrlLabel::UrlLabel(QWidget * parent, Qt::WFlags f)
: QLabel(parent, f)
{
_url = QString::fromAscii("http://localhost");
_url = QString::fromLatin1("http://localhost");
setToolTip(this->_url);
}
+56 -56
View File
@@ -249,26 +249,26 @@ QString PropertyItem::pythonIdentifier(const App::Property* prop) const
App::PropertyContainer* parent = prop->getContainer();
if (parent->getTypeId() == App::Document::getClassTypeId()) {
App::Document* doc = static_cast<App::Document*>(parent);
QString docName = QString::fromAscii(App::GetApplication().getDocumentName(doc));
QString propName = QString::fromAscii(parent->getPropertyName(prop));
return QString::fromAscii("FreeCAD.getDocument(\"%1\").%2").arg(docName).arg(propName);
QString docName = QString::fromLatin1(App::GetApplication().getDocumentName(doc));
QString propName = QString::fromLatin1(parent->getPropertyName(prop));
return QString::fromLatin1("FreeCAD.getDocument(\"%1\").%2").arg(docName).arg(propName);
}
if (parent->getTypeId().isDerivedFrom(App::DocumentObject::getClassTypeId())) {
App::DocumentObject* obj = static_cast<App::DocumentObject*>(parent);
App::Document* doc = obj->getDocument();
QString docName = QString::fromAscii(App::GetApplication().getDocumentName(doc));
QString objName = QString::fromAscii(obj->getNameInDocument());
QString propName = QString::fromAscii(parent->getPropertyName(prop));
return QString::fromAscii("FreeCAD.getDocument(\"%1\").getObject(\"%2\").%3")
QString docName = QString::fromLatin1(App::GetApplication().getDocumentName(doc));
QString objName = QString::fromLatin1(obj->getNameInDocument());
QString propName = QString::fromLatin1(parent->getPropertyName(prop));
return QString::fromLatin1("FreeCAD.getDocument(\"%1\").getObject(\"%2\").%3")
.arg(docName).arg(objName).arg(propName);
}
if (parent->getTypeId().isDerivedFrom(Gui::ViewProviderDocumentObject::getClassTypeId())) {
App::DocumentObject* obj = static_cast<Gui::ViewProviderDocumentObject*>(parent)->getObject();
App::Document* doc = obj->getDocument();
QString docName = QString::fromAscii(App::GetApplication().getDocumentName(doc));
QString objName = QString::fromAscii(obj->getNameInDocument());
QString propName = QString::fromAscii(parent->getPropertyName(prop));
return QString::fromAscii("FreeCADGui.getDocument(\"%1\").getObject(\"%2\").%3")
QString docName = QString::fromLatin1(App::GetApplication().getDocumentName(doc));
QString objName = QString::fromLatin1(obj->getNameInDocument());
QString propName = QString::fromLatin1(parent->getPropertyName(prop));
return QString::fromLatin1("FreeCADGui.getDocument(\"%1\").getObject(\"%2\").%3")
.arg(docName).arg(objName).arg(propName);
}
return QString();
@@ -319,7 +319,7 @@ void PropertyItem::setPropertyValue(const QString& value)
it != propertyItems.end(); ++it) {
App::PropertyContainer* parent = (*it)->getContainer();
if (parent && !parent->isReadOnly(*it) && !(*it)->testStatus(App::Property::ReadOnly)) {
QString cmd = QString::fromAscii("%1 = %2").arg(pythonIdentifier(*it)).arg(value);
QString cmd = QString::fromLatin1("%1 = %2").arg(pythonIdentifier(*it)).arg(value);
Gui::Application::Instance->runPythonCode((const char*)cmd.toUtf8());
}
}
@@ -441,7 +441,7 @@ void PropertyStringItem::setValue(const QVariant& value)
if (!value.canConvert(QVariant::String))
return;
QString val = value.toString();
QString data = QString::fromAscii("\"%1\"").arg(val);
QString data = QString::fromLatin1("\"%1\"").arg(val);
setPropertyValue(data);
}
@@ -487,7 +487,7 @@ void PropertyFontItem::setValue(const QVariant& value)
if (!value.canConvert(QVariant::String))
return;
QString val = value.toString();
QString data = QString::fromAscii("\"%1\"").arg(val);
QString data = QString::fromLatin1("\"%1\"").arg(val);
setPropertyValue(data);
}
@@ -548,7 +548,7 @@ void PropertyIntegerItem::setValue(const QVariant& value)
if (!value.canConvert(QVariant::Int))
return;
int val = value.toInt();
QString data = QString::fromAscii("%1").arg(val);
QString data = QString::fromLatin1("%1").arg(val);
setPropertyValue(data);
}
}
@@ -586,7 +586,7 @@ QVariant PropertyIntegerItem::toString(const QVariant& v) const {
QString string(PropertyItem::toString(v).toString());
if(hasExpression())
string += QString::fromAscii(" ( %1 )").arg(QString::fromStdString(getExpressionString()));
string += QString::fromLatin1(" ( %1 )").arg(QString::fromStdString(getExpressionString()));
return QVariant(string);
}
@@ -615,7 +615,7 @@ void PropertyIntegerConstraintItem::setValue(const QVariant& value)
if (!value.canConvert(QVariant::Int))
return;
int val = value.toInt();
QString data = QString::fromAscii("%1").arg(val);
QString data = QString::fromLatin1("%1").arg(val);
setPropertyValue(data);
}
}
@@ -665,7 +665,7 @@ QVariant PropertyIntegerConstraintItem::toString(const QVariant& v) const {
QString string(PropertyItem::toString(v).toString());
if(hasExpression())
string += QString::fromAscii(" ( %1 )").arg(QString::fromStdString(getExpressionString()));
string += QString::fromLatin1(" ( %1 )").arg(QString::fromStdString(getExpressionString()));
return QVariant(string);
}
@@ -685,7 +685,7 @@ QVariant PropertyFloatItem::toString(const QVariant& prop) const
QString data = QLocale::system().toString(value, 'f', decimals());
if(hasExpression())
data += QString::fromAscii(" ( %1 )").arg(QString::fromStdString(getExpressionString()));
data += QString::fromLatin1(" ( %1 )").arg(QString::fromStdString(getExpressionString()));
return QVariant(data);
}
@@ -705,7 +705,7 @@ void PropertyFloatItem::setValue(const QVariant& value)
if (!value.canConvert(QVariant::Double))
return;
double val = value.toDouble();
QString data = QString::fromAscii("%1").arg(val,0,'f',decimals());
QString data = QString::fromLatin1("%1").arg(val,0,'f',decimals());
setPropertyValue(data);
}
}
@@ -753,7 +753,7 @@ QVariant PropertyUnitItem::toString(const QVariant& prop) const
const Base::Quantity& unit = prop.value<Base::Quantity>();
QString string = unit.getUserString();
if(hasExpression())
string += QString::fromAscii(" ( %1 )").arg(QString::fromStdString(getExpressionString()));
string += QString::fromLatin1(" ( %1 )").arg(QString::fromStdString(getExpressionString()));
return QVariant(string);
}
@@ -877,7 +877,7 @@ void PropertyFloatConstraintItem::setValue(const QVariant& value)
if (!value.canConvert(QVariant::Double))
return;
double val = value.toDouble();
QString data = QString::fromAscii("%1").arg(val,0,'f',decimals());
QString data = QString::fromLatin1("%1").arg(val,0,'f',decimals());
setPropertyValue(data);
}
}
@@ -1038,7 +1038,7 @@ PropertyVectorItem::PropertyVectorItem()
QVariant PropertyVectorItem::toString(const QVariant& prop) const
{
const Base::Vector3d& value = prop.value<Base::Vector3d>();
QString data = QString::fromAscii("[%1 %2 %3]")
QString data = QString::fromLatin1("[%1 %2 %3]")
.arg(QLocale::system().toString(value.x, 'f', 2))
.arg(QLocale::system().toString(value.y, 'f', 2))
.arg(QLocale::system().toString(value.z, 'f', 2));
@@ -1058,7 +1058,7 @@ void PropertyVectorItem::setValue(const QVariant& value)
if (!value.canConvert<Base::Vector3d>())
return;
const Base::Vector3d& val = value.value<Base::Vector3d>();
QString data = QString::fromAscii("(%1, %2, %3)")
QString data = QString::fromLatin1("(%1, %2, %3)")
.arg(val.x,0,'f',decimals())
.arg(val.y,0,'f',decimals())
.arg(val.z,0,'f',decimals());
@@ -1077,7 +1077,7 @@ void PropertyVectorItem::setEditorData(QWidget *editor, const QVariant& data) co
{
QLineEdit* le = qobject_cast<QLineEdit*>(editor);
const Base::Vector3d& value = data.value<Base::Vector3d>();
QString text = QString::fromAscii("[%1 %2 %3]")
QString text = QString::fromLatin1("[%1 %2 %3]")
.arg(QLocale::system().toString(value.x, 'f', 2))
.arg(QLocale::system().toString(value.y, 'f', 2))
.arg(QLocale::system().toString(value.z, 'f', 2));
@@ -1151,10 +1151,10 @@ PropertyVectorDistanceItem::PropertyVectorDistanceItem()
QVariant PropertyVectorDistanceItem::toString(const QVariant& prop) const
{
const Base::Vector3d& value = prop.value<Base::Vector3d>();
QString data = QString::fromAscii("[") +
Base::Quantity(value.x, Base::Unit::Length).getUserString() + QString::fromAscii(" ") +
Base::Quantity(value.y, Base::Unit::Length).getUserString() + QString::fromAscii(" ") +
Base::Quantity(value.z, Base::Unit::Length).getUserString() + QString::fromAscii("]");
QString data = QString::fromLatin1("[") +
Base::Quantity(value.x, Base::Unit::Length).getUserString() + QString::fromLatin1(" ") +
Base::Quantity(value.y, Base::Unit::Length).getUserString() + QString::fromLatin1(" ") +
Base::Quantity(value.z, Base::Unit::Length).getUserString() + QString::fromLatin1("]");
return QVariant(data);
}
@@ -1176,7 +1176,7 @@ void PropertyVectorDistanceItem::setValue(const QVariant& variant)
Base::Quantity x = Base::Quantity(value.x, Base::Unit::Length);
Base::Quantity y = Base::Quantity(value.y, Base::Unit::Length);
Base::Quantity z = Base::Quantity(value.z, Base::Unit::Length);
QString data = QString::fromAscii("(%1, %2, %3)")
QString data = QString::fromLatin1("(%1, %2, %3)")
.arg(x.getValue())
.arg(y.getValue())
.arg(z.getValue());
@@ -1335,7 +1335,7 @@ PropertyMatrixItem::PropertyMatrixItem()
QVariant PropertyMatrixItem::toString(const QVariant& prop) const
{
const Base::Matrix4D& value = prop.value<Base::Matrix4D>();
QString text = QString::fromAscii("[%1 %2 %3 %4 %5 %6 %7 %8 %9 %10 %11 %12 %13 %14 %15 %16]")
QString text = QString::fromLatin1("[%1 %2 %3 %4 %5 %6 %7 %8 %9 %10 %11 %12 %13 %14 %15 %16]")
.arg(QLocale::system().toString(value[0][0], 'f', 2)) //(unsigned short usNdx)
.arg(QLocale::system().toString(value[0][1], 'f', 2))
.arg(QLocale::system().toString(value[0][2], 'f', 2))
@@ -1377,7 +1377,7 @@ void PropertyMatrixItem::setValue(const QVariant& value)
return;
const Base::Matrix4D& val = value.value<Base::Matrix4D>();
const int decimals=16;
QString data = QString::fromAscii("FreeCAD.Matrix(%1, %2, %3, %4, %5, %6, %7, %8, %9, %10, %11, %12, %13, %14, %15, %16)")
QString data = QString::fromLatin1("FreeCAD.Matrix(%1, %2, %3, %4, %5, %6, %7, %8, %9, %10, %11, %12, %13, %14, %15, %16)")
.arg(val[0][0],0, 'f', decimals)
.arg(val[0][1],0, 'f', decimals)
.arg(val[0][2],0, 'f', decimals)
@@ -1409,7 +1409,7 @@ void PropertyMatrixItem::setEditorData(QWidget *editor, const QVariant& data) co
{
QLineEdit* le = qobject_cast<QLineEdit*>(editor);
const Base::Matrix4D& value = data.value<Base::Matrix4D>();
QString text = QString::fromAscii("[%1 %2 %3 %4 %5 %6 %7 %8 %9 %10 %11 %12 %13 %14 %15 %16]")
QString text = QString::fromLatin1("[%1 %2 %3 %4 %5 %6 %7 %8 %9 %10 %11 %12 %13 %14 %15 %16]")
.arg(QLocale::system().toString(value[0][0], 'f', 2)) //(unsigned short usNdx)
.arg(QLocale::system().toString(value[0][1], 'f', 2))
.arg(QLocale::system().toString(value[0][2], 'f', 2))
@@ -1836,7 +1836,7 @@ void PropertyPlacementItem::setValue(const QVariant& value)
const Base::Placement& val = value.value<Base::Placement>();
Base::Vector3d pos = val.getPosition();
QString data = QString::fromAscii("App.Placement("
QString data = QString::fromLatin1("App.Placement("
"App.Vector(%1,%2,%3),"
"App.Rotation(App.Vector(%4,%5,%6),%7))")
.arg(pos.x)
@@ -1911,7 +1911,7 @@ void PropertyEnumItem::setValue(const QVariant& value)
QStringList items = value.toStringList();
if (!items.isEmpty()) {
QString val = items.front();
QString data = QString::fromAscii("\"%1\"").arg(val);
QString data = QString::fromLatin1("\"%1\"").arg(val);
setPropertyValue(data);
}
}
@@ -1989,14 +1989,14 @@ void PropertyStringListItem::setEditorData(QWidget *editor, const QVariant& data
{
Gui::LabelEditor *le = qobject_cast<Gui::LabelEditor*>(editor);
QStringList list = data.toStringList();
le->setText(list.join(QChar::fromAscii('\n')));
le->setText(list.join(QChar::fromLatin1('\n')));
}
QVariant PropertyStringListItem::editorData(QWidget *editor) const
{
Gui::LabelEditor *le = qobject_cast<Gui::LabelEditor*>(editor);
QString complete = le->text();
QStringList list = complete.split(QChar::fromAscii('\n'));
QStringList list = complete.split(QChar::fromLatin1('\n'));
return QVariant(list);
}
@@ -2062,14 +2062,14 @@ void PropertyFloatListItem::setEditorData(QWidget *editor, const QVariant& data)
{
Gui::LabelEditor *le = qobject_cast<Gui::LabelEditor*>(editor);
QStringList list = data.toStringList();
le->setText(list.join(QChar::fromAscii('\n')));
le->setText(list.join(QChar::fromLatin1('\n')));
}
QVariant PropertyFloatListItem::editorData(QWidget *editor) const
{
Gui::LabelEditor *le = qobject_cast<Gui::LabelEditor*>(editor);
QString complete = le->text();
QStringList list = complete.split(QChar::fromAscii('\n'));
QStringList list = complete.split(QChar::fromLatin1('\n'));
return QVariant(list);
}
@@ -2135,14 +2135,14 @@ void PropertyIntegerListItem::setEditorData(QWidget *editor, const QVariant& dat
{
Gui::LabelEditor *le = qobject_cast<Gui::LabelEditor*>(editor);
QStringList list = data.toStringList();
le->setText(list.join(QChar::fromAscii('\n')));
le->setText(list.join(QChar::fromLatin1('\n')));
}
QVariant PropertyIntegerListItem::editorData(QWidget *editor) const
{
Gui::LabelEditor *le = qobject_cast<Gui::LabelEditor*>(editor);
QString complete = le->text();
QStringList list = complete.split(QChar::fromAscii('\n'));
QStringList list = complete.split(QChar::fromLatin1('\n'));
return QVariant(list);
}
@@ -2209,7 +2209,7 @@ QVariant PropertyColorItem::decoration(const App::Property* prop) const
QVariant PropertyColorItem::toString(const QVariant& prop) const
{
QColor value = prop.value<QColor>();
QString color = QString::fromAscii("[%1, %2, %3]")
QString color = QString::fromLatin1("[%1, %2, %3]")
.arg(value.red()).arg(value.green()).arg(value.blue());
return QVariant(color);
}
@@ -2231,7 +2231,7 @@ void PropertyColorItem::setValue(const QVariant& value)
val.r = (float)col.red()/255.0f;
val.g = (float)col.green()/255.0f;
val.b = (float)col.blue()/255.0f;
QString data = QString::fromAscii("(%1,%2,%3)")
QString data = QString::fromLatin1("(%1,%2,%3)")
.arg(val.r,0,'f',decimals())
.arg(val.g,0,'f',decimals())
.arg(val.b,0,'f',decimals());
@@ -2282,7 +2282,7 @@ void PropertyFileItem::setValue(const QVariant& value)
if (!value.canConvert(QVariant::String))
return;
QString val = value.toString();
QString data = QString::fromAscii("\"%1\"").arg(val);
QString data = QString::fromLatin1("\"%1\"").arg(val);
setPropertyValue(data);
}
@@ -2333,7 +2333,7 @@ void PropertyPathItem::setValue(const QVariant& value)
if (!value.canConvert(QVariant::String))
return;
QString val = value.toString();
QString data = QString::fromAscii("\"%1\"").arg(val);
QString data = QString::fromLatin1("\"%1\"").arg(val);
setPropertyValue(data);
}
@@ -2385,7 +2385,7 @@ void PropertyTransientFileItem::setValue(const QVariant& value)
if (!value.canConvert(QVariant::String))
return;
QString val = value.toString();
QString data = QString::fromAscii("\"%1\"").arg(val);
QString data = QString::fromLatin1("\"%1\"").arg(val);
setPropertyValue(data);
}
@@ -2450,7 +2450,7 @@ void LinkLabel::setPropertyLink(const QStringList& o)
{
link = o;
QString text = QString::fromAscii(
QString text = QString::fromLatin1(
"<html><head><style type=\"text/css\">"
"p, li { white-space: pre-wrap; }"
"</style></head><body>"
@@ -2509,8 +2509,8 @@ QVariant PropertyLinkItem::value(const App::Property* prop) const
App::DocumentObject* obj = prop_link->getValue();
QStringList list;
if (obj) {
list << QString::fromAscii(obj->getDocument()->getName());
list << QString::fromAscii(obj->getNameInDocument());
list << QString::fromLatin1(obj->getDocument()->getName());
list << QString::fromLatin1(obj->getNameInDocument());
list << QString::fromUtf8(obj->Label.getValue());
}
else {
@@ -2518,24 +2518,24 @@ QVariant PropertyLinkItem::value(const App::Property* prop) const
// the document name
if (c->getTypeId().isDerivedFrom(App::DocumentObject::getClassTypeId())) {
App::DocumentObject* obj = static_cast<App::DocumentObject*>(c);
list << QString::fromAscii(obj->getDocument()->getName());
list << QString::fromLatin1(obj->getDocument()->getName());
}
else {
list << QString::fromAscii("");
list << QString::fromLatin1("");
}
// the internal object name
list << QString::fromAscii("Null");
list << QString::fromLatin1("Null");
// the object label
list << QString::fromAscii("");
list << QString::fromLatin1("");
}
// the name of this object
if (c->getTypeId().isDerivedFrom(App::DocumentObject::getClassTypeId())) {
App::DocumentObject* obj = static_cast<App::DocumentObject*>(c);
list << QString::fromAscii(obj->getNameInDocument());
list << QString::fromLatin1(obj->getNameInDocument());
}
else {
list << QString::fromAscii("Null");
list << QString::fromLatin1("Null");
}
return QVariant(list);
@@ -2549,7 +2549,7 @@ void PropertyLinkItem::setValue(const QVariant& value)
if (items.size() > 1) {
QString d = items[0];
QString o = items[1];
QString data = QString::fromAscii("App.getDocument('%1').getObject('%2')").arg(d).arg(o);
QString data = QString::fromLatin1("App.getDocument('%1').getObject('%2')").arg(d).arg(o);
setPropertyValue(data);
}
}
+5 -5
View File
@@ -229,13 +229,13 @@ void PropertyModel::buildUp(const PropertyModel::PropertyList& props)
PropertyItem* group = static_cast<PropertyItem*>(PropertySeparatorItem::create());
group->setParent(rootItem);
rootItem->appendChild(group);
group->setPropertyName(QString::fromAscii(kt->first.c_str()));
group->setPropertyName(QString::fromLatin1(kt->first.c_str()));
// setup the items for the properties
std::vector<std::vector<App::Property*> >::const_iterator it;
for (it = kt->second.begin(); it != kt->second.end(); ++it) {
App::Property* prop = it->front();
QString editor = QString::fromAscii(prop->getEditorName());
QString editor = QString::fromLatin1(prop->getEditorName());
if (!editor.isEmpty()) {
Base::BaseClass* item = 0;
try {
@@ -252,7 +252,7 @@ void PropertyModel::buildUp(const PropertyModel::PropertyList& props)
PropertyItem* child = (PropertyItem*)item;
child->setParent(rootItem);
rootItem->appendChild(child);
child->setPropertyName(QString::fromAscii(prop->getName()));
child->setPropertyName(QString::fromLatin1(prop->getName()));
child->setPropertyData(*it);
}
}
@@ -282,7 +282,7 @@ void PropertyModel::updateProperty(const App::Property& prop)
void PropertyModel::appendProperty(const App::Property& prop)
{
QString editor = QString::fromAscii(prop.getEditorName());
QString editor = QString::fromLatin1(prop.getEditorName());
if (!editor.isEmpty()) {
Base::BaseClass* item = 0;
try {
@@ -302,7 +302,7 @@ void PropertyModel::appendProperty(const App::Property& prop)
PropertyItem* child = static_cast<PropertyItem*>(item);
child->setParent(rootItem);
rootItem->appendChild(child);
child->setPropertyName(QString::fromAscii(prop.getName()));
child->setPropertyName(QString::fromLatin1(prop.getName()));
std::vector<App::Property*> data;
data.push_back(const_cast<App::Property*>(&prop));
child->setPropertyData(data);
+2 -2
View File
@@ -270,7 +270,7 @@ QWidget* setupMainWindow()
if (!appName.isEmpty())
mw->setWindowTitle(appName);
else
mw->setWindowTitle(QString::fromAscii(App::Application::Config()["ExeName"].c_str()));
mw->setWindowTitle(QString::fromLatin1(App::Application::Config()["ExeName"].c_str()));
if (!SoDB::isInitialized()) {
// init the Inventor subsystem
@@ -302,7 +302,7 @@ QWidget* setupMainWindow()
// if the auto workbench is not visible then force to use the default workbech
// and replace the wrong entry in the parameters
QStringList wb = Gui::Application::Instance->workbenches();
if (!wb.contains(QString::fromAscii(start.c_str()))) {
if (!wb.contains(QString::fromLatin1(start.c_str()))) {
start = App::Application::Config()["StartWorkbench"];
App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/General")->
SetASCII("AutoloadModule", start.c_str());
+7 -7
View File
@@ -175,16 +175,16 @@ int main( int argc, char ** argv )
}
catch (const Base::UnknownProgramOption& e) {
QApplication app(argc,argv);
QString appName = QString::fromAscii(App::Application::Config()["ExeName"].c_str());
QString msg = QString::fromAscii(e.what());
QString appName = QString::fromLatin1(App::Application::Config()["ExeName"].c_str());
QString msg = QString::fromLatin1(e.what());
QString s = QLatin1String("<pre>") + msg + QLatin1String("</pre>");
QMessageBox::critical(0, appName, s);
exit(1);
}
catch (const Base::ProgramInformation& e) {
QApplication app(argc,argv);
QString appName = QString::fromAscii(App::Application::Config()["ExeName"].c_str());
QString msg = QString::fromAscii(e.what());
QString appName = QString::fromLatin1(App::Application::Config()["ExeName"].c_str());
QString msg = QString::fromLatin1(e.what());
QString s = QLatin1String("<pre>") + msg + QLatin1String("</pre>");
QMessageBox::information(0, appName, s);
exit(0);
@@ -192,13 +192,13 @@ int main( int argc, char ** argv )
catch (const Base::Exception& e) {
// Popup an own dialog box instead of that one of Windows
QApplication app(argc,argv);
QString appName = QString::fromAscii(App::Application::Config()["ExeName"].c_str());
QString appName = QString::fromLatin1(App::Application::Config()["ExeName"].c_str());
QString msg;
msg = QObject::tr("While initializing %1 the following exception occurred: '%2'\n\n"
"Python is searching for its files in the following directories:\n%3\n\n"
"Python version information:\n%4\n")
.arg(appName).arg(QString::fromUtf8(e.what()))
.arg(QString::fromUtf8(Py_GetPath())).arg(QString::fromAscii(Py_GetVersion()));
.arg(QString::fromUtf8(Py_GetPath())).arg(QString::fromLatin1(Py_GetVersion()));
const char* pythonhome = getenv("PYTHONHOME");
if (pythonhome) {
msg += QObject::tr("\nThe environment variable PYTHONHOME is set to '%1'.")
@@ -215,7 +215,7 @@ int main( int argc, char ** argv )
catch (...) {
// Popup an own dialog box instead of that one of Windows
QApplication app(argc,argv);
QString appName = QString::fromAscii(App::Application::Config()["ExeName"].c_str());
QString appName = QString::fromLatin1(App::Application::Config()["ExeName"].c_str());
QString msg = QObject::tr("Unknown runtime error occurred while initializing %1.\n\n"
"Please contact the application's support team for more information.\n\n").arg(appName);
QMessageBox::critical(0, QObject::tr("Initialization of %1 failed").arg(appName), msg);
+1 -1
View File
@@ -28,7 +28,7 @@
#include <Gui/Workbench.h>
#define QSTRING(x) QString::fromAscii(x)
#define QSTRING(x) QString::fromLatin1(x)
extern QList<QString> mods;
+4 -4
View File
@@ -132,9 +132,9 @@ Gui::Action * CmdDrawingNewPage::createAction(void)
std::string path = App::Application::getResourceDir();
path += "Mod/Drawing/Templates/";
QDir dir(QString::fromUtf8(path.c_str()), QString::fromAscii("*.svg"));
QDir dir(QString::fromUtf8(path.c_str()), QString::fromLatin1("*.svg"));
for (unsigned int i=0; i<dir.count(); i++ ) {
QRegExp rx(QString::fromAscii("(A|B|C|D|E)(\\d)_(Landscape|Portrait)(_.*\\.|\\.)svg$"));
QRegExp rx(QString::fromLatin1("(A|B|C|D|E)(\\d)_(Landscape|Portrait)(_.*\\.|\\.)svg$"));
if (rx.indexIn(dir[i]) > -1) {
QString paper = rx.cap(1);
int id = rx.cap(2).toInt();
@@ -160,10 +160,10 @@ Gui::Action * CmdDrawingNewPage::createAction(void)
lastPaper = paper;
lastId = id;
QFile file(QString::fromAscii(":/icons/actions/drawing-landscape-A0.svg"));
QFile file(QString::fromLatin1(":/icons/actions/drawing-landscape-A0.svg"));
QAction* a = pcAction->addAction(QString());
if (file.open(QFile::ReadOnly)) {
QString s = QString::fromAscii("style=\"font-size:22px\">%1%2</tspan></text>").arg(paper).arg(id);
QString s = QString::fromLatin1("style=\"font-size:22px\">%1%2</tspan></text>").arg(paper).arg(id);
QByteArray data = file.readAll();
data.replace("style=\"font-size:22px\">A0</tspan></text>", s.toLatin1());
a->setIcon(Gui::BitmapFactory().pixmapFromSvg(data, QSize(64,64)));
+1 -1
View File
@@ -193,7 +193,7 @@ bool TaskDlgFemConstraint::accept()
Gui::Command::commitCommand();
}
catch (const Base::Exception& e) {
QMessageBox::warning(parameter, tr("Input error"), QString::fromAscii(e.what()));
QMessageBox::warning(parameter, tr("Input error"), QString::fromLatin1(e.what()));
return false;
}
+1 -1
View File
@@ -348,7 +348,7 @@ bool TaskDlgFemConstraintBearing::accept()
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.AxialFree = %s", name.c_str(), parameterBearing->getAxial() ? "True" : "False");
}
catch (const Base::Exception& e) {
QMessageBox::warning(parameter, tr("Input error"), QString::fromAscii(e.what()));
QMessageBox::warning(parameter, tr("Input error"), QString::fromLatin1(e.what()));
return false;
}
+1 -1
View File
@@ -369,7 +369,7 @@ bool TaskDlgFemConstraintForce::accept()
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Reversed = %s", name.c_str(), parameterForce->getReverse() ? "True" : "False");
}
catch (const Base::Exception& e) {
QMessageBox::warning(parameter, tr("Input error"), QString::fromAscii(e.what()));
QMessageBox::warning(parameter, tr("Input error"), QString::fromLatin1(e.what()));
return false;
}
+1 -1
View File
@@ -307,7 +307,7 @@ bool TaskDlgFemConstraintGear::accept()
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.ForceAngle = %f",name.c_str(), parameterGear->getForceAngle());
}
catch (const Base::Exception& e) {
QMessageBox::warning(parameter, tr("Input error"), QString::fromAscii(e.what()));
QMessageBox::warning(parameter, tr("Input error"), QString::fromLatin1(e.what()));
return false;
}
@@ -257,7 +257,7 @@ bool TaskDlgFemConstraintPressure::accept()
name.c_str(), parameterPressure->getReverse() ? "True" : "False");
}
catch (const Base::Exception& e) {
QMessageBox::warning(parameter, tr("Input error"), QString::fromAscii(e.what()));
QMessageBox::warning(parameter, tr("Input error"), QString::fromLatin1(e.what()));
return false;
}
+1 -1
View File
@@ -201,7 +201,7 @@ bool TaskDlgFemConstraintPulley::accept()
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.TensionForce = %f",name.c_str(), parameterPulley->getTensionForce());
}
catch (const Base::Exception& e) {
QMessageBox::warning(parameter, tr("Input error"), QString::fromAscii(e.what()));
QMessageBox::warning(parameter, tr("Input error"), QString::fromLatin1(e.what()));
return false;
}
+1 -1
View File
@@ -63,7 +63,7 @@ TaskObjectName::TaskObjectName(App::DocumentObject *pcObject,QWidget *parent)
if(strcmp(pcObject->Label.getValue(),"") != 0)
ui->lineEdit_ObjectName->setText(QString::fromUtf8(pcObject->Label.getValue()));
else
ui->lineEdit_ObjectName->setText(QString::fromAscii(pcObject->getNameInDocument()));
ui->lineEdit_ObjectName->setText(QString::fromLatin1(pcObject->getNameInDocument()));
}
+10 -10
View File
@@ -497,12 +497,12 @@ QString ImageView::createStatusBarText()
{
double grey_value;
if (_pGLImageBox->getImageSample(pixX, pixY, 0, grey_value) == 0)
txt = QString::fromAscii("x,y = %1,%2 | %3 = %4 | %5 = %6")
txt = QString::fromLatin1("x,y = %1,%2 | %3 = %4 | %5 = %6")
.arg(icX,0,'f',2).arg(icY,0,'f',2)
.arg(tr("grey")).arg((int)grey_value)
.arg(tr("zoom")).arg(zoomFactor,0,'f',1);
else
txt = QString::fromAscii("x,y = %1 | %2 = %3")
txt = QString::fromLatin1("x,y = %1 | %2 = %3")
.arg(tr("outside image")).arg(tr("zoom")).arg(zoomFactor,0,'f',1);
}
else if ((colorFormat == IB_CF_RGB24) ||
@@ -512,10 +512,10 @@ QString ImageView::createStatusBarText()
if ((_pGLImageBox->getImageSample(pixX, pixY, 0, red) != 0) ||
(_pGLImageBox->getImageSample(pixX, pixY, 1, green) != 0) ||
(_pGLImageBox->getImageSample(pixX, pixY, 2, blue) != 0))
txt = QString::fromAscii("x,y = %1 | %2 = %3")
txt = QString::fromLatin1("x,y = %1 | %2 = %3")
.arg(tr("outside image")).arg(tr("zoom")).arg(zoomFactor,0,'f',1);
else
txt = QString::fromAscii("x,y = %1,%2 | rgb = %3,%4,%5 | %6 = %7")
txt = QString::fromLatin1("x,y = %1,%2 | rgb = %3,%4,%5 | %6 = %7")
.arg(icX,0,'f',2).arg(icY,0,'f',2)
.arg((int)red).arg((int)green).arg((int)blue)
.arg(tr("zoom")).arg(zoomFactor,0,'f',1);
@@ -527,10 +527,10 @@ QString ImageView::createStatusBarText()
if ((_pGLImageBox->getImageSample(pixX, pixY, 0, blue) != 0) ||
(_pGLImageBox->getImageSample(pixX, pixY, 1, green) != 0) ||
(_pGLImageBox->getImageSample(pixX, pixY, 2, red) != 0))
txt = QString::fromAscii("x,y = %1 | %2 = %3")
txt = QString::fromLatin1("x,y = %1 | %2 = %3")
.arg(tr("outside image")).arg(tr("zoom")).arg(zoomFactor,0,'f',1);
else
txt = QString::fromAscii("x,y = %1,%2 | rgb = %3,%4,%5 | %6 = %7")
txt = QString::fromLatin1("x,y = %1,%2 | rgb = %3,%4,%5 | %6 = %7")
.arg(icX,0,'f',2).arg(icY,0,'f',2)
.arg((int)red).arg((int)green).arg((int)blue)
.arg(tr("zoom")).arg(zoomFactor,0,'f',1);
@@ -543,10 +543,10 @@ QString ImageView::createStatusBarText()
(_pGLImageBox->getImageSample(pixX, pixY, 1, green) != 0) ||
(_pGLImageBox->getImageSample(pixX, pixY, 2, blue) != 0) ||
(_pGLImageBox->getImageSample(pixX, pixY, 3, alpha) != 0))
txt = QString::fromAscii("x,y = %1 | %2 = %3")
txt = QString::fromLatin1("x,y = %1 | %2 = %3")
.arg(tr("outside image")).arg(tr("zoom")).arg(zoomFactor,0,'f',1);
else
txt = QString::fromAscii("x,y = %1,%2 | rgba = %3,%4,%5,%6 | %7 = %8")
txt = QString::fromLatin1("x,y = %1,%2 | rgba = %3,%4,%5,%6 | %7 = %8")
.arg(icX,0,'f',2).arg(icY,0,'f',2)
.arg((int)red).arg((int)green).arg((int)blue).arg((int)alpha)
.arg(tr("zoom")).arg(zoomFactor,0,'f',1);
@@ -559,10 +559,10 @@ QString ImageView::createStatusBarText()
(_pGLImageBox->getImageSample(pixX, pixY, 1, green) != 0) ||
(_pGLImageBox->getImageSample(pixX, pixY, 2, red) != 0) ||
(_pGLImageBox->getImageSample(pixX, pixY, 3, alpha) != 0))
txt = QString::fromAscii("x,y = %1 | %2 = %3")
txt = QString::fromLatin1("x,y = %1 | %2 = %3")
.arg(tr("outside image")).arg(tr("zoom")).arg(zoomFactor,0,'f',1);
else
txt = QString::fromAscii("x,y = %1,%2 | rgba = %3,%4,%5,%6 | %7 = %8")
txt = QString::fromLatin1("x,y = %1,%2 | rgba = %3,%4,%5,%6 | %7 = %8")
.arg(icX,0,'f',2).arg(icY,0,'f',2)
.arg((int)red).arg((int)green).arg((int)blue).arg((int)alpha)
.arg(tr("zoom")).arg(zoomFactor,0,'f',1);
+5 -5
View File
@@ -381,14 +381,14 @@ void OCAFBrowser::load(QTreeWidget* theTree)
root->setIcon(0, myGroupIcon);
theTree->addTopLevelItem(root);
load(pDoc->GetData()->Root(), root, QString::fromAscii("0"));
load(pDoc->GetData()->Root(), root, QString::fromLatin1("0"));
}
void OCAFBrowser::load(const TDF_Label& label, QTreeWidgetItem* item, const QString& s)
{
Handle(TDataStd_Name) name;
if (label.FindAttribute(TDataStd_Name::GetID(),name)) {
QString text = QString::fromAscii("%1 %2").arg(s).arg(QString::fromUtf8(toString(name->Get()).c_str()));
QString text = QString::fromLatin1("%1 %2").arg(s).arg(QString::fromUtf8(toString(name->Get()).c_str()));
item->setText(0, text);
}
@@ -468,13 +468,13 @@ void OCAFBrowser::load(const TDF_Label& label, QTreeWidgetItem* item, const QStr
// //if (node->HasFather())
// // ;
// QTreeWidgetItem* child = new QTreeWidgetItem();
// child->setText(0, QString::fromAscii("TDataStd_TreeNode"));
// child->setText(0, QString::fromLatin1("TDataStd_TreeNode"));
// item->addChild(child);
//}
int i=1;
for (TDF_ChildIterator it(label); it.More(); it.Next(),i++) {
QString text = QString::fromAscii("%1:%2").arg(s).arg(i);
QString text = QString::fromLatin1("%1:%2").arg(s).arg(i);
QTreeWidgetItem* child = new QTreeWidgetItem();
child->setText(0, text);
child->setIcon(0, myGroupIcon);
@@ -546,7 +546,7 @@ static PyObject * ocaf(PyObject *self, PyObject *args)
if (!dlg) {
dlg = new QDialog(Gui::getMainWindow());
QTreeWidget* tree = new QTreeWidget();
tree->setHeaderLabel(QString::fromAscii("OCAF Browser"));
tree->setHeaderLabel(QString::fromLatin1("OCAF Browser"));
QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(tree);
+2 -2
View File
@@ -118,13 +118,13 @@ VisualInspection::VisualInspection(QWidget* parent, Qt::WFlags fl)
QIcon px = view->getIcon();
SingleSelectionItem* item1 = new SingleSelectionItem(ui->treeWidgetActual);
item1->setText(0, QString::fromUtf8((*it)->Label.getValue()));
item1->setData(0, Qt::UserRole, QString::fromAscii((*it)->getNameInDocument()));
item1->setData(0, Qt::UserRole, QString::fromLatin1((*it)->getNameInDocument()));
item1->setCheckState(0, Qt::Unchecked);
item1->setIcon(0, px);
SingleSelectionItem* item2 = new SingleSelectionItem(ui->treeWidgetNominal);
item2->setText(0, QString::fromUtf8((*it)->Label.getValue()));
item2->setData(0, Qt::UserRole, QString::fromAscii((*it)->getNameInDocument()));
item2->setData(0, Qt::UserRole, QString::fromLatin1((*it)->getNameInDocument()));
item2->setCheckState(0, Qt::Unchecked);
item2->setIcon(0, px);
+2 -2
View File
@@ -1311,10 +1311,10 @@ void CmdMeshEvaluateSolid::activated(int iMsg)
QString msg;
if (mesh->Mesh.getValue().getKernel().HasOpenEdges())
msg = QObject::tr("The mesh '%1' is not a solid.")
.arg(QString::fromAscii(mesh->Label.getValue()));
.arg(QString::fromLatin1(mesh->Label.getValue()));
else
msg = QObject::tr("The mesh '%1' is a solid.")
.arg(QString::fromAscii(mesh->Label.getValue()));
.arg(QString::fromLatin1(mesh->Label.getValue()));
QMessageBox::information(Gui::getMainWindow(), QObject::tr("Solid Mesh"), msg);
}
}
+8 -8
View File
@@ -101,7 +101,7 @@ void DlgEvaluateMeshImp::slotCreatedObject(const App::DocumentObject& Obj)
// add new mesh object to the list
if (Obj.getTypeId().isDerivedFrom(Mesh::Feature::getClassTypeId())) {
QString label = QString::fromUtf8(Obj.Label.getValue());
QString name = QString::fromAscii(Obj.getNameInDocument());
QString name = QString::fromLatin1(Obj.getNameInDocument());
meshNameButton->addItem(label, name);
}
}
@@ -110,7 +110,7 @@ void DlgEvaluateMeshImp::slotDeletedObject(const App::DocumentObject& Obj)
{
// remove mesh objects from the list
if (Obj.getTypeId().isDerivedFrom(Mesh::Feature::getClassTypeId())) {
int index = meshNameButton->findData(QString::fromAscii(Obj.getNameInDocument()));
int index = meshNameButton->findData(QString::fromLatin1(Obj.getNameInDocument()));
if (index > 0) {
meshNameButton->removeItem(index);
meshNameButton->setDisabled(meshNameButton->count() < 2);
@@ -141,7 +141,7 @@ void DlgEvaluateMeshImp::slotChangedObject(const App::DocumentObject& Obj, const
if (Prop.getTypeId() == App::PropertyString::getClassTypeId() &&
strcmp(Prop.getName(), "Label") == 0) {
QString label = QString::fromUtf8(Obj.Label.getValue());
QString name = QString::fromAscii(Obj.getNameInDocument());
QString name = QString::fromLatin1(Obj.getNameInDocument());
int index = meshNameButton->findData(name);
meshNameButton->setItemText(index, label);
}
@@ -225,7 +225,7 @@ void DlgEvaluateMeshImp::setMesh(Mesh::Feature* m)
refreshList();
int ct = meshNameButton->count();
QString objName = QString::fromAscii(m->getNameInDocument());
QString objName = QString::fromLatin1(m->getNameInDocument());
for (int i=1; i<ct; i++) {
if (meshNameButton->itemData(i).toString() == objName) {
meshNameButton->setCurrentIndex(i);
@@ -298,7 +298,7 @@ void DlgEvaluateMeshImp::refreshList()
std::vector<App::DocumentObject*> objs = this->getDocument()->getObjectsOfType(Mesh::Feature::getClassTypeId());
for (std::vector<App::DocumentObject*>::iterator it = objs.begin(); it != objs.end(); ++it) {
items.push_back(qMakePair(QString::fromUtf8((*it)->Label.getValue()),
QString::fromAscii((*it)->getNameInDocument())));
QString::fromLatin1((*it)->getNameInDocument())));
}
}
@@ -323,9 +323,9 @@ void DlgEvaluateMeshImp::showInformation()
analyzeAllTogether->setEnabled(true);
const MeshKernel& rMesh = d->meshFeature->Mesh.getValue().getKernel();
textLabel4->setText(QString::fromAscii("%1").arg(rMesh.CountFacets()));
textLabel5->setText(QString::fromAscii("%1").arg(rMesh.CountEdges()));
textLabel6->setText(QString::fromAscii("%1").arg(rMesh.CountPoints()));
textLabel4->setText(QString::fromLatin1("%1").arg(rMesh.CountFacets()));
textLabel5->setText(QString::fromLatin1("%1").arg(rMesh.CountEdges()));
textLabel6->setText(QString::fromLatin1("%1").arg(rMesh.CountPoints()));
}
void DlgEvaluateMeshImp::cleanInformation()
+2 -2
View File
@@ -520,7 +520,7 @@ void ViewProviderMeshCurvature::curvatureInfoCallback(void * ud, SoEventCallback
int index2 = facedetail->getPoint(1)->getCoordinateIndex();
int index3 = facedetail->getPoint(2)->getCoordinateIndex();
std::string info = self->curvatureInfo(true, index1, index2, index3);
QString text = QString::fromAscii(info.c_str());
QString text = QString::fromLatin1(info.c_str());
if (addflag) {
SbVec3f pt = point->getPoint();
SbVec3f nl = point->getNormal();
@@ -555,7 +555,7 @@ void ViewProviderMeshCurvature::curvatureInfoCallback(void * ud, SoEventCallback
int index2 = facedetail->getPoint(1)->getCoordinateIndex();
int index3 = facedetail->getPoint(2)->getCoordinateIndex();
std::string info = that->curvatureInfo(false, index1, index2, index3);
Gui::getMainWindow()->setPaneText(1,QString::fromAscii(info.c_str()));
Gui::getMainWindow()->setPaneText(1,QString::fromLatin1(info.c_str()));
}
}
}
+12 -12
View File
@@ -63,25 +63,25 @@ public:
MeshInfoWatcher() : TaskWatcher(0)
{
labelPoints = new QLabel();
labelPoints->setText(QString::fromAscii("Number of points:"));
labelPoints->setText(QString::fromLatin1("Number of points:"));
labelFacets = new QLabel();
labelFacets->setText(QString::fromAscii("Number of facets:"));
labelFacets->setText(QString::fromLatin1("Number of facets:"));
numPoints = new QLabel();
numFacets = new QLabel();
labelMin = new QLabel();
labelMin->setText(QString::fromAscii("Minumum bound:"));
labelMin->setText(QString::fromLatin1("Minumum bound:"));
labelMax = new QLabel();
labelMax->setText(QString::fromAscii("Maximum bound:"));
labelMax->setText(QString::fromLatin1("Maximum bound:"));
numMin = new QLabel();
numMax = new QLabel();
QGroupBox* box = new QGroupBox();
box->setTitle(QString::fromAscii("Mesh info box"));
box->setTitle(QString::fromLatin1("Mesh info box"));
//box->setAutoFillBackground(true);
QGridLayout* grid = new QGridLayout(box);
grid->addWidget(labelPoints, 0, 0);
@@ -95,7 +95,7 @@ public:
grid->addWidget(numMax, 3, 1);
Gui::TaskView::TaskBox* taskbox = new Gui::TaskView::TaskBox(
QPixmap(), QString::fromAscii("Mesh info"), false, 0);
QPixmap(), QString::fromLatin1("Mesh info"), false, 0);
taskbox->groupLayout()->addWidget(box);
Content.push_back(taskbox);
}
@@ -117,16 +117,16 @@ public:
if (countPoints > 0) {
numPoints->setText(QString::number(countPoints));
numFacets->setText(QString::number(countFacets));
numMin->setText(QString::fromAscii("X: %1\tY: %2\tZ: %3")
numMin->setText(QString::fromLatin1("X: %1\tY: %2\tZ: %3")
.arg(bbox.MinX).arg(bbox.MinX).arg(bbox.MinX));
numMax->setText(QString::fromAscii("X: %1\tY: %2\tZ: %3")
numMax->setText(QString::fromLatin1("X: %1\tY: %2\tZ: %3")
.arg(bbox.MaxX).arg(bbox.MaxX).arg(bbox.MaxX));
}
else {
numPoints->setText(QString::fromAscii(""));
numFacets->setText(QString::fromAscii(""));
numMin->setText(QString::fromAscii(""));
numMax->setText(QString::fromAscii(""));
numPoints->setText(QString::fromLatin1(""));
numFacets->setText(QString::fromLatin1(""));
numMin->setText(QString::fromLatin1(""));
numMax->setText(QString::fromLatin1(""));
}
}
+6 -6
View File
@@ -173,7 +173,7 @@ void Tessellation::findShapes()
Gui::Document* activeGui = Gui::Application::Instance->getDocument(activeDoc);
if (!activeGui) return;
this->document = QString::fromAscii(activeDoc->getName());
this->document = QString::fromLatin1(activeDoc->getName());
std::vector<Part::Feature*> objs = activeDoc->getObjectsOfType<Part::Feature>();
double edgeLen = 0;
@@ -194,7 +194,7 @@ void Tessellation::findShapes()
edgeLen = std::max<double>(edgeLen, bbox.LengthY());
edgeLen = std::max<double>(edgeLen, bbox.LengthZ());
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);
@@ -246,7 +246,7 @@ bool Tessellation::accept()
QString cmd;
if (method == 0) { // Standard
double devFace = ui->spinSurfaceDeviation->value();
cmd = QString::fromAscii(
cmd = QString::fromLatin1(
"__doc__=FreeCAD.getDocument(\"%1\")\n"
"__mesh__=__doc__.addObject(\"Mesh::Feature\",\"Mesh\")\n"
"__mesh__.Mesh=Mesh.Mesh(__doc__.getObject(\"%2\").Shape.tessellate(%3))\n"
@@ -262,7 +262,7 @@ bool Tessellation::accept()
double maxEdge = ui->spinMaximumEdgeLength->value();
if (!ui->spinMaximumEdgeLength->isEnabled())
maxEdge = 0;
cmd = QString::fromAscii(
cmd = QString::fromLatin1(
"__doc__=FreeCAD.getDocument(\"%1\")\n"
"__mesh__=__doc__.addObject(\"Mesh::Feature\",\"Mesh\")\n"
"__mesh__.Mesh=MeshPart.meshFromShape(Shape=__doc__.getObject(\"%2\").Shape,MaxLength=%3)\n"
@@ -283,7 +283,7 @@ bool Tessellation::accept()
bool optimize = ui->checkOptimizeSurface->isChecked();
bool allowquad = ui->checkQuadDominated->isChecked();
if (fineness < 5) {
cmd = QString::fromAscii(
cmd = QString::fromLatin1(
"__doc__=FreeCAD.getDocument(\"%1\")\n"
"__mesh__=__doc__.addObject(\"Mesh::Feature\",\"Mesh\")\n"
"__mesh__.Mesh=MeshPart.meshFromShape(Shape=__doc__.getObject(\"%2\").Shape,"
@@ -300,7 +300,7 @@ bool Tessellation::accept()
.arg(label);
}
else {
cmd = QString::fromAscii(
cmd = QString::fromLatin1(
"__doc__=FreeCAD.getDocument(\"%1\")\n"
"__mesh__=__doc__.addObject(\"Mesh::Feature\",\"Mesh\")\n"
"__mesh__.Mesh=MeshPart.meshFromShape(Shape=__doc__.getObject(\"%2\").Shape,"

Some files were not shown because too many files have changed in this diff Show More