diff --git a/src/App/Application.cpp b/src/App/Application.cpp index 1f091340b0..9d42905065 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -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) { diff --git a/src/App/Branding.cpp b/src/App/Branding.cpp index 173ba0f464..8a4a8c4682 100644 --- a/src/App/Branding.cpp +++ b/src/App/Branding.cpp @@ -82,7 +82,7 @@ Branding::XmlConfig Branding::getUserDefines() const if (!root.isNull()) { child = root.firstChildElement(); while (!child.isNull()) { - std::string name = (const char*)child.localName().toAscii(); + std::string name = (const char*)child.localName().toLatin1(); std::string value = (const char*)child.text().toUtf8(); if (std::find(filter.begin(), filter.end(), name) != filter.end()) cfg[name] = value; diff --git a/src/App/FeatureCustom.h b/src/App/FeatureCustom.h index 5e7adab48f..7d19a374b8 100644 --- a/src/App/FeatureCustom.h +++ b/src/App/FeatureCustom.h @@ -161,6 +161,12 @@ protected: virtual void onChanged(const Property* prop) { FeatureT::onChanged(prop); } + virtual void onDocumentRestored() { + FeatureT::onDocumentRestored(); + } + virtual void onSettingDocument() { + FeatureT::onSettingDocument(); + } private: DynamicProperty* props; diff --git a/src/App/FeaturePython.cpp b/src/App/FeaturePython.cpp index 582b760f0a..bcd06b459e 100644 --- a/src/App/FeaturePython.cpp +++ b/src/App/FeaturePython.cpp @@ -154,6 +154,35 @@ void FeaturePythonImp::onChanged(const Property* prop) } } +void FeaturePythonImp::onDocumentRestored() +{ + // Run the execute method of the proxy object. + Base::PyGILStateLocker lock; + try { + Property* proxy = object->getPropertyByName("Proxy"); + if (proxy && proxy->getTypeId() == PropertyPythonObject::getClassTypeId()) { + Py::Object feature = static_cast(proxy)->getValue(); + if (feature.hasAttr(std::string("onDocumentRestored"))) { + if (feature.hasAttr("__object__")) { + Py::Callable method(feature.getAttr(std::string("onDocumentRestored"))); + Py::Tuple args; + method.apply(args); + } + else { + Py::Callable method(feature.getAttr(std::string("onDocumentRestored"))); + Py::Tuple args(1); + args.setItem(0, Py::Object(object->getPyObject(), true)); + method.apply(args); + } + } + } + } + catch (Py::Exception&) { + Base::PyException e; // extract the Python error text + e.ReportException(); + } +} + PyObject *FeaturePythonImp::getPyObject(void) { // ref counter is set to 1 diff --git a/src/App/FeaturePython.h b/src/App/FeaturePython.h index 1c706848c1..113a5befe7 100644 --- a/src/App/FeaturePython.h +++ b/src/App/FeaturePython.h @@ -47,6 +47,7 @@ public: bool execute(); void onBeforeChange(const Property* prop); void onChanged(const Property* prop); + void onDocumentRestored(); PyObject *getPyObject(void); private: @@ -200,6 +201,10 @@ protected: imp->onChanged(prop); FeatureT::onChanged(prop); } + virtual void onDocumentRestored() { + imp->onDocumentRestored(); + FeatureT::onDocumentRestored(); + } private: FeaturePythonImp* imp; diff --git a/src/Base/FileInfo.h b/src/Base/FileInfo.h index e4289b30ee..a457e9878c 100644 --- a/src/Base/FileInfo.h +++ b/src/Base/FileInfo.h @@ -70,9 +70,9 @@ public: /// Convert the path name into a UCS-2 encoded wide string format. std::wstring toStdWString() const; /** Returns the file's extension name. - * If complete is TRUE (the default), extension() returns the string of all + * If complete is true (the default), extension() returns the string of all * characters in the file name after (but not including) the first '.' character. - * If complete is FALSE, extension() returns the string of all characters in + * If complete is false, extension() returns the string of all characters in * the file name after (but not including) the last '.' character. * Example: *@code @@ -111,7 +111,7 @@ public: /** @name Directory management*/ //@{ - /// Creates a directory. Returns TRUE if successful; otherwise returns FALSE. + /// Creates a directory. Returns true if successful; otherwise returns false. bool createDirectory( void ) const; /// Get a list of the directory content std::vector getDirectoryContent(void) const; diff --git a/src/Base/Tools2D.cpp b/src/Base/Tools2D.cpp index e65871756c..dafc605d3d 100644 --- a/src/Base/Tools2D.cpp +++ b/src/Base/Tools2D.cpp @@ -107,16 +107,16 @@ bool BoundBox2D::Intersect(const Line2D &rclLine) const bool BoundBox2D::Intersect(const BoundBox2D &rclBB) const { //// compare bb2-points to this -//if (Contains (Vector2D (rclBB.fMinX, rclBB.fMinY))) return TRUE; -//if (Contains (Vector2D (rclBB.fMaxX, rclBB.fMinY))) return TRUE; -//if (Contains (Vector2D (rclBB.fMaxX, rclBB.fMaxY))) return TRUE; -//if (Contains (Vector2D (rclBB.fMinX, rclBB.fMaxY))) return TRUE; +//if (Contains (Vector2D (rclBB.fMinX, rclBB.fMinY))) return true; +//if (Contains (Vector2D (rclBB.fMaxX, rclBB.fMinY))) return true; +//if (Contains (Vector2D (rclBB.fMaxX, rclBB.fMaxY))) return true; +//if (Contains (Vector2D (rclBB.fMinX, rclBB.fMaxY))) return true; // //// compare this-points to bb2 -//if (rclBB.Contains (Vector2D (fMinX, fMinY))) return TRUE; -//if (rclBB.Contains (Vector2D (fMaxX, fMinY))) return TRUE; -//if (rclBB.Contains (Vector2D (fMaxX, fMaxY))) return TRUE; -//if (rclBB.Contains (Vector2D (fMinX, fMaxY))) return TRUE; +//if (rclBB.Contains (Vector2D (fMinX, fMinY))) return true; +//if (rclBB.Contains (Vector2D (fMaxX, fMinY))) return true; +//if (rclBB.Contains (Vector2D (fMaxX, fMaxY))) return true; +//if (rclBB.Contains (Vector2D (fMinX, fMaxY))) return true; if (fMinX < rclBB.fMaxX && rclBB.fMinX < fMaxX && @@ -222,7 +222,7 @@ bool Line2D::Intersect (const Line2D& rclLine, Vector2D &rclV) const rclV.fY = m1 * rclV.fX + b1; } - return true; /*** RETURN TRUE (intersection) **********/ + return true; /*** RETURN true (intersection) **********/ } bool Line2D::Intersect (const Vector2D &rclV, double eps) const diff --git a/src/Base/UnitsApi.cpp b/src/Base/UnitsApi.cpp index 465d451a51..ca619f0b4c 100644 --- a/src/Base/UnitsApi.cpp +++ b/src/Base/UnitsApi.cpp @@ -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) diff --git a/src/Base/Uuid.cpp b/src/Base/Uuid.cpp index b5d77cee1d..c75b5fa2ab 100644 --- a/src/Base/Uuid.cpp +++ b/src/Base/Uuid.cpp @@ -68,21 +68,21 @@ std::string Uuid::createUuid(void) QString uuid = QUuid::createUuid().toString(); uuid = uuid.mid(1); uuid.chop(1); - Uuid = (const char*)uuid.toAscii(); + Uuid = (const char*)uuid.toLatin1(); return Uuid; } 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 QString id = uuid.toString(); id = id.mid(1); id.chop(1); - _uuid = (const char*)id.toAscii(); + _uuid = (const char*)id.toLatin1(); } } diff --git a/src/Gui/Action.cpp b/src/Gui/Action.cpp index 3e0adde729..1915e1c7a4 100644 --- a/src/Gui/Action.cpp +++ b/src/Gui/Action.cpp @@ -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 workbenches = _group->actions(); for (QList::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 workbenches = _group->actions(); for (QList::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(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)); @@ -719,7 +719,7 @@ void RecentFilesAction::activateFile(int id) // invokes appendFile() SelectModule::Dict dict = SelectModule::importHandler(filename); for (SelectModule::Dict::iterator it = dict.begin(); it != dict.end(); ++it) { - Application::Instance->open(it.key().toUtf8(), it.value().toAscii()); + Application::Instance->open(it.key().toUtf8(), it.value().toLatin1()); break; } } @@ -769,11 +769,11 @@ void RecentFilesAction::save() QList recentFiles = _group->actions(); int num = std::min(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; - hGrp->SetASCII(key.toAscii(), value.toUtf8()); + hGrp->SetASCII(key.toLatin1(), value.toUtf8()); } } diff --git a/src/Gui/Application.cpp b/src/Gui/Application.cpp index bafc23e982..6eb8f14b26 100644 --- a/src/Gui/Application.cpp +++ b/src/Gui/Application.cpp @@ -336,7 +336,7 @@ Application::Application(bool GUIenabled) ParameterGrp::handle hPGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp"); hPGrp = hPGrp->GetGroup("Preferences")->GetGroup("General"); QString lang = QLocale::languageToString(QLocale::system().language()); - Translator::instance()->activateLanguage(hPGrp->GetASCII("Language", (const char*)lang.toAscii()).c_str()); + Translator::instance()->activateLanguage(hPGrp->GetASCII("Language", (const char*)lang.toLatin1()).c_str()); GetWidgetFactorySupplier(); ParameterGrp::handle hUnits = App::GetApplication().GetParameterGroupByPath @@ -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 '' prefixes rx.setPattern(QLatin1String("^\\s*:\\s*")); @@ -1105,7 +1105,7 @@ bool Application::activateWorkbench(const char* name) pos = rx.indexIn(msg); } - Base::Console().Error("%s\n", (const char*)msg.toAscii()); + Base::Console().Error("%s\n", (const char*)msg.toLatin1()); Base::Console().Log("%s\n", e.getStackTrace().c_str()); if (!d->startingUp) { wc.restoreCursor(); @@ -1122,7 +1122,7 @@ QPixmap Application::workbenchIcon(const QString& wb) const { Base::PyGILStateLocker lock; // get the python workbench object from the dictionary - PyObject* pcWorkbench = PyDict_GetItemString(_pcWorkbenchDictionary, wb.toAscii()); + PyObject* pcWorkbench = PyDict_GetItemString(_pcWorkbenchDictionary, wb.toLatin1()); // test if the workbench exists if (pcWorkbench) { // make a unique icon name @@ -1196,7 +1196,7 @@ QString Application::workbenchToolTip(const QString& wb) const { // get the python workbench object from the dictionary Base::PyGILStateLocker lock; - PyObject* pcWorkbench = PyDict_GetItemString(_pcWorkbenchDictionary, wb.toAscii()); + PyObject* pcWorkbench = PyDict_GetItemString(_pcWorkbenchDictionary, wb.toLatin1()); // test if the workbench exists if (pcWorkbench) { // get its ToolTip member if possible @@ -1220,7 +1220,7 @@ QString Application::workbenchMenuText(const QString& wb) const { // get the python workbench object from the dictionary Base::PyGILStateLocker lock; - PyObject* pcWorkbench = PyDict_GetItemString(_pcWorkbenchDictionary, wb.toAscii()); + PyObject* pcWorkbench = PyDict_GetItemString(_pcWorkbenchDictionary, wb.toLatin1()); // test if the workbench exists if (pcWorkbench) { // get its ToolTip member if possible @@ -1251,13 +1251,13 @@ QStringList Application::workbenches(void) const const char* start = (st != config.end() ? st->second.c_str() : ""); 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 restoreDocFiles; - QString exeName = QString::fromAscii(App::GetApplication().getExecutableName()); + QString exeName = QString::fromLatin1(App::GetApplication().getExecutableName()); QList locks = tmp.entryInfoList(); for (QList::iterator it = locks.begin(); it != locks.end(); ++it) { QString bn = it->baseName(); diff --git a/src/Gui/BitmapFactory.cpp b/src/Gui/BitmapFactory.cpp index 57d5c1ec4a..da7a9a9f4e 100644 --- a/src/Gui/BitmapFactory.cpp +++ b/src/Gui/BitmapFactory.cpp @@ -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 formats = QImageReader::supportedImageFormats(); for (QList::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::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 diff --git a/src/Gui/BlenderNavigationStyle.cpp b/src/Gui/BlenderNavigationStyle.cpp index 28bb6cfe05..948acc6db3 100644 --- a/src/Gui/BlenderNavigationStyle.cpp +++ b/src/Gui/BlenderNavigationStyle.cpp @@ -53,7 +53,7 @@ using namespace Gui; TYPESYSTEM_SOURCE(Gui::BlenderNavigationStyle, Gui::UserNavigationStyle); -BlenderNavigationStyle::BlenderNavigationStyle() : lockButton1(FALSE) +BlenderNavigationStyle::BlenderNavigationStyle() : lockButton1(false) { } @@ -98,11 +98,11 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev) this->lastmouseposition = posn; - // Set to TRUE if any event processing happened. Note that it is not + // Set to true if any event processing happened. Note that it is not // necessary to restrict ourselves to only do one "action" for an // event, we only need this flag to see if any processing happened // at all. - SbBool processed = FALSE; + SbBool processed = false; const ViewerMode curmode = this->currentmode; ViewerMode newmode = curmode; @@ -123,13 +123,13 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev) if (!processed && !viewer->isEditing()) { processed = handleEventInForeground(ev); if (processed) - return TRUE; + return true; } // Keyboard handling if (type.isDerivedFrom(SoKeyboardEvent::getClassTypeId())) { const SoKeyboardEvent * const event = (const SoKeyboardEvent *) ev; - const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE; + const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false; switch (event->getKey()) { case SoKeyboardEvent::LEFT_CONTROL: case SoKeyboardEvent::RIGHT_CONTROL: @@ -144,7 +144,7 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev) this->altdown = press; break; case SoKeyboardEvent::H: - processed = TRUE; + processed = true; viewer->saveHomePosition(); break; case SoKeyboardEvent::S: @@ -165,37 +165,37 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev) if (type.isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) { const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev; const int button = event->getButton(); - const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE; + const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false; //SoDebugError::postInfo("processSoEvent", "button = %d", button); switch (button) { case SoMouseButtonEvent::BUTTON1: - this->lockrecenter = TRUE; + this->lockrecenter = true; this->button1down = press; if (press && (this->currentmode == NavigationStyle::SEEK_WAIT_MODE)) { newmode = NavigationStyle::SEEK_MODE; this->seekToPoint(pos); // implicitly calls interactiveCountInc() - processed = TRUE; + processed = true; } //else if (press && (this->currentmode == NavigationStyle::IDLE)) { // this->setViewing(true); - // processed = TRUE; + // processed = true; //} else if (press && (this->currentmode == NavigationStyle::PANNING || this->currentmode == NavigationStyle::ZOOMING)) { newmode = NavigationStyle::DRAGGING; saveCursorPosition(ev); this->centerTime = ev->getTime(); - processed = TRUE; + processed = true; } else if (viewer->isEditing() && (this->currentmode == NavigationStyle::SPINNING)) { - processed = TRUE; + processed = true; } break; case SoMouseButtonEvent::BUTTON2: // If we are in edit mode then simply ignore the RMB events // to pass the event to the base class. - this->lockrecenter = TRUE; + this->lockrecenter = true; if (!viewer->isEditing()) { // If we are in zoom or pan mode ignore RMB events otherwise // the canvas doesn't get any release events @@ -215,7 +215,7 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev) newmode = NavigationStyle::DRAGGING; saveCursorPosition(ev); this->centerTime = ev->getTime(); - processed = TRUE; + processed = true; } this->button2down = press; break; @@ -225,7 +225,7 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev) float ratio = vp.getViewportAspectRatio(); SbViewVolume vv = viewer->getSoRenderManager()->getCamera()->getViewVolume(ratio); this->panningplane = vv.getPlane(viewer->getSoRenderManager()->getCamera()->focalDistance.getValue()); - this->lockrecenter = FALSE; + this->lockrecenter = false; } else { SbTime tmp = (ev->getTime() - this->centerTime); @@ -236,18 +236,18 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev) panToCenter(panningplane, posn); this->interactiveCountDec(); } - processed = TRUE; + processed = true; } } this->button3down = press; break; case SoMouseButtonEvent::BUTTON4: - doZoom(viewer->getSoRenderManager()->getCamera(), TRUE, posn); - processed = TRUE; + doZoom(viewer->getSoRenderManager()->getCamera(), true, posn); + processed = true; break; case SoMouseButtonEvent::BUTTON5: - doZoom(viewer->getSoRenderManager()->getCamera(), FALSE, posn); - processed = TRUE; + doZoom(viewer->getSoRenderManager()->getCamera(), false, posn); + processed = true; break; default: break; @@ -256,22 +256,22 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev) // Mouse Movement handling if (type.isDerivedFrom(SoLocation2Event::getClassTypeId())) { - this->lockrecenter = TRUE; + this->lockrecenter = true; const SoLocation2Event * const event = (const SoLocation2Event *) ev; if (this->currentmode == NavigationStyle::ZOOMING) { this->zoomByCursor(posn, prevnormalized); - processed = TRUE; + processed = true; } else if (this->currentmode == NavigationStyle::PANNING) { float ratio = vp.getViewportAspectRatio(); panCamera(viewer->getSoRenderManager()->getCamera(), ratio, this->panningplane, posn, prevnormalized); - processed = TRUE; + processed = true; } else if (this->currentmode == NavigationStyle::DRAGGING) { this->addToLog(event->getPosition(), event->getTime()); this->spin(posn); moveCursorPosition(); - processed = TRUE; + processed = true; } } @@ -280,7 +280,7 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev) const SoMotion3Event * const event = static_cast(ev); if (event) this->processMotionEvent(event); - processed = TRUE; + processed = true; } enum { @@ -304,8 +304,8 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev) // The left mouse button has been released right now but // we want to avoid that the event is procesed elsewhere if (this->lockButton1) { - this->lockButton1 = FALSE; - processed = TRUE; + this->lockButton1 = false; + processed = true; } //if (curmode == NavigationStyle::DRAGGING) { @@ -351,14 +351,14 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev) // but then button 3 is relaesed we shouldn't switch // into selection mode. if (this->button1down && this->button3down) - this->lockButton1 = TRUE; + this->lockButton1 = true; // If not handled in this class, pass on upwards in the inheritance // hierarchy. if (/*(curmode == NavigationStyle::SELECTION || viewer->isEditing()) && */!processed) processed = inherited::processSoEvent(ev); else - return TRUE; + return true; return processed; } diff --git a/src/Gui/CADNavigationStyle.cpp b/src/Gui/CADNavigationStyle.cpp index 7140e42454..a5a6db968e 100644 --- a/src/Gui/CADNavigationStyle.cpp +++ b/src/Gui/CADNavigationStyle.cpp @@ -53,7 +53,7 @@ using namespace Gui; TYPESYSTEM_SOURCE(Gui::CADNavigationStyle, Gui::UserNavigationStyle); -CADNavigationStyle::CADNavigationStyle() : lockButton1(FALSE) +CADNavigationStyle::CADNavigationStyle() : lockButton1(false) { } @@ -102,11 +102,11 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev) this->lastmouseposition = posn; - // Set to TRUE if any event processing happened. Note that it is not + // Set to true if any event processing happened. Note that it is not // necessary to restrict ourselves to only do one "action" for an // event, we only need this flag to see if any processing happened // at all. - SbBool processed = FALSE; + SbBool processed = false; const ViewerMode curmode = this->currentmode; ViewerMode newmode = curmode; @@ -127,13 +127,13 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev) if (!processed && !viewer->isEditing()) { processed = handleEventInForeground(ev); if (processed) - return TRUE; + return true; } // Keyboard handling if (type.isDerivedFrom(SoKeyboardEvent::getClassTypeId())) { const SoKeyboardEvent * const event = (const SoKeyboardEvent *) ev; - const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE; + const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false; switch (event->getKey()) { case SoKeyboardEvent::LEFT_CONTROL: case SoKeyboardEvent::RIGHT_CONTROL: @@ -148,7 +148,7 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev) this->altdown = press; break; case SoKeyboardEvent::H: - processed = TRUE; + processed = true; viewer->saveHomePosition(); break; case SoKeyboardEvent::S: @@ -169,12 +169,12 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev) if (type.isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) { const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev; const int button = event->getButton(); - const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE; + const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false; // SoDebugError::postInfo("processSoEvent", "button = %d", button); switch (button) { case SoMouseButtonEvent::BUTTON1: - this->lockrecenter = TRUE; + this->lockrecenter = true; this->button1down = press; #if 0 // disable to avoid interferences where this key combination is used, too if (press && ev->wasShiftDown() && @@ -183,7 +183,7 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev) float ratio = vp.getViewportAspectRatio(); SbViewVolume vv = viewer->getCamera()->getViewVolume(ratio); this->panningplane = vv.getPlane(viewer->getCamera()->focalDistance.getValue()); - this->lockrecenter = FALSE; + this->lockrecenter = false; } else if (!press && ev->wasShiftDown() && (this->currentmode != NavigationStyle::SELECTION)) { @@ -195,7 +195,7 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev) panToCenter(panningplane, posn); this->interactiveCountDec(); } - processed = TRUE; + processed = true; } } else @@ -203,18 +203,18 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev) if (press && (this->currentmode == NavigationStyle::SEEK_WAIT_MODE)) { newmode = NavigationStyle::SEEK_MODE; this->seekToPoint(pos); // implicitly calls interactiveCountInc() - processed = TRUE; + processed = true; } //else if (press && (this->currentmode == NavigationStyle::IDLE)) { // this->setViewing(true); - // processed = TRUE; + // processed = true; //} else if (press && (this->currentmode == NavigationStyle::PANNING || this->currentmode == NavigationStyle::ZOOMING)) { newmode = NavigationStyle::DRAGGING; saveCursorPosition(ev); this->centerTime = ev->getTime(); - processed = TRUE; + processed = true; } else if (!press && (this->currentmode == NavigationStyle::DRAGGING)) { SbTime tmp = (ev->getTime() - this->centerTime); @@ -222,16 +222,16 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev) if (tmp.getValue() < dci) { newmode = NavigationStyle::ZOOMING; } - processed = TRUE; + processed = true; } else if (viewer->isEditing() && (this->currentmode == NavigationStyle::SPINNING)) { - processed = TRUE; + processed = true; } break; case SoMouseButtonEvent::BUTTON2: // If we are in edit mode then simply ignore the RMB events // to pass the event to the base class. - this->lockrecenter = TRUE; + this->lockrecenter = true; if (!viewer->isEditing()) { // If we are in zoom or pan mode ignore RMB events otherwise // the canvas doesn't get any release events @@ -251,7 +251,7 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev) newmode = NavigationStyle::DRAGGING; saveCursorPosition(ev); this->centerTime = ev->getTime(); - processed = TRUE; + processed = true; } else if (!press && (this->currentmode == NavigationStyle::DRAGGING)) { SbTime tmp = (ev->getTime() - this->centerTime); @@ -259,7 +259,7 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev) if (tmp.getValue() < dci) { newmode = NavigationStyle::ZOOMING; } - processed = TRUE; + processed = true; } this->button2down = press; break; @@ -269,7 +269,7 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev) float ratio = vp.getViewportAspectRatio(); SbViewVolume vv = viewer->getSoRenderManager()->getCamera()->getViewVolume(ratio); this->panningplane = vv.getPlane(viewer->getSoRenderManager()->getCamera()->focalDistance.getValue()); - this->lockrecenter = FALSE; + this->lockrecenter = false; } else { SbTime tmp = (ev->getTime() - this->centerTime); @@ -280,18 +280,18 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev) panToCenter(panningplane, posn); this->interactiveCountDec(); } - processed = TRUE; + processed = true; } } this->button3down = press; break; case SoMouseButtonEvent::BUTTON4: - doZoom(viewer->getSoRenderManager()->getCamera(), TRUE, posn); - processed = TRUE; + doZoom(viewer->getSoRenderManager()->getCamera(), true, posn); + processed = true; break; case SoMouseButtonEvent::BUTTON5: - doZoom(viewer->getSoRenderManager()->getCamera(), FALSE, posn); - processed = TRUE; + doZoom(viewer->getSoRenderManager()->getCamera(), false, posn); + processed = true; break; default: break; @@ -300,22 +300,22 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev) // Mouse Movement handling if (type.isDerivedFrom(SoLocation2Event::getClassTypeId())) { - this->lockrecenter = TRUE; + this->lockrecenter = true; const SoLocation2Event * const event = (const SoLocation2Event *) ev; if (this->currentmode == NavigationStyle::ZOOMING) { this->zoomByCursor(posn, prevnormalized); - processed = TRUE; + processed = true; } else if (this->currentmode == NavigationStyle::PANNING) { float ratio = vp.getViewportAspectRatio(); panCamera(viewer->getSoRenderManager()->getCamera(), ratio, this->panningplane, posn, prevnormalized); - processed = TRUE; + processed = true; } else if (this->currentmode == NavigationStyle::DRAGGING) { this->addToLog(event->getPosition(), event->getTime()); this->spin(posn); moveCursorPosition(); - processed = TRUE; + processed = true; } } @@ -324,7 +324,7 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev) const SoMotion3Event * const event = static_cast(ev); if (event) this->processMotionEvent(event); - processed = TRUE; + processed = true; } enum { @@ -348,8 +348,8 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev) // The left mouse button has been released right now but // we want to avoid that the event is procesed elsewhere if (this->lockButton1) { - this->lockButton1 = FALSE; - processed = TRUE; + this->lockButton1 = false; + processed = true; } //if (curmode == NavigationStyle::DRAGGING) { @@ -424,14 +424,14 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev) // but then button 3 is relaesed we shouldn't switch // into selection mode. if (this->button1down && this->button3down) - this->lockButton1 = TRUE; + this->lockButton1 = true; // If not handled in this class, pass on upwards in the inheritance // hierarchy. if (/*(curmode == NavigationStyle::SELECTION || viewer->isEditing()) && */!processed) processed = inherited::processSoEvent(ev); else - return TRUE; + return true; return processed; } diff --git a/src/Gui/CallTips.cpp b/src/Gui/CallTips.cpp index e7e7b539a4..066c09433e 100644 --- a/src/Gui/CallTips.cpp +++ b/src/Gui/CallTips.cpp @@ -182,7 +182,7 @@ QString CallTipsList::extractContext(const QString& line) const int index = len-1; for (int i=0; i= 48 && ch <= 57) || // Numbers (ch >= 65 && ch <= 90) || // Uppercase letters (ch >= 97 && ch <= 122) || // Lowercase letters @@ -208,13 +208,13 @@ QMap CallTipsList::extractTips(const QString& context) const Py::Dict dict = module.getDict(); QString modname = items.front(); items.pop_front(); - if (!dict.hasKey(std::string(modname.toAscii()))) + if (!dict.hasKey(std::string(modname.toLatin1()))) return tips; // unknown object // get the Python object we need - Py::Object obj = dict.getItem(std::string(modname.toAscii())); + Py::Object obj = dict.getItem(std::string(modname.toLatin1())); while (!items.isEmpty()) { - QByteArray name = items.front().toAscii(); + QByteArray name = items.front().toLatin1(); std::string attr = name.constData(); items.pop_front(); if (obj.hasAttr(attr)) @@ -321,7 +321,7 @@ void CallTipsList::extractTipsFromObject(Py::Object& obj, Py::List& list, QMap::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)); diff --git a/src/Gui/Command.cpp b/src/Gui/Command.cpp index a6c3b650e5..f6c1e1b1bb 100644 --- a/src/Gui/Command.cpp +++ b/src/Gui/Command.cpp @@ -623,7 +623,7 @@ const char* Command::keySequenceToAccel(int sk) const QKeySequence::StandardKey type = (QKeySequence::StandardKey)sk; QKeySequence ks(type); QString qs = ks.toString(); - QByteArray data = qs.toAscii(); + QByteArray data = qs.toLatin1(); #if defined (_MSC_VER) return _strdup((const char*)data); #else @@ -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"))); diff --git a/src/Gui/CommandDoc.cpp b/src/Gui/CommandDoc.cpp index 2d23ea2618..618495f0e4 100644 --- a/src/Gui/CommandDoc.cpp +++ b/src/Gui/CommandDoc.cpp @@ -145,7 +145,7 @@ void StdCmdOpen::activated(int iMsg) } else { for (SelectModule::Dict::iterator it = dict.begin(); it != dict.end(); ++it) { - getGuiApplication()->open(it.key().toUtf8(), it.value().toAscii()); + getGuiApplication()->open(it.key().toUtf8(), it.value().toLatin1()); } } } @@ -215,7 +215,7 @@ void StdCmdImport::activated(int iMsg) for (SelectModule::Dict::iterator it = dict.begin(); it != dict.end(); ++it) { getGuiApplication()->importFrom(it.key().toUtf8(), getActiveGuiDocument()->getDocument()->getName(), - it.value().toAscii()); + it.value().toLatin1()); } if (emptyDoc) { @@ -288,7 +288,7 @@ void StdCmdExport::activated(int iMsg) for (SelectModule::Dict::iterator it = dict.begin(); it != dict.end(); ++it) { getGuiApplication()->exportTo(it.key().toUtf8(), getActiveGuiDocument()->getDocument()->getName(), - it.value().toAscii()); + it.value().toLatin1()); } } } @@ -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)); diff --git a/src/Gui/CommandStd.cpp b/src/Gui/CommandStd.cpp index 46802c3b9b..b0214b1cd6 100644 --- a/src/Gui/CommandStd.cpp +++ b/src/Gui/CommandStd.cpp @@ -90,7 +90,7 @@ void StdCmdWorkbench::activated(int i) try { Workbench* w = WorkbenchManager::instance()->active(); QList items = static_cast(_pcAction)->actions(); - std::string switch_to = (const char*)items[i]->objectName().toAscii(); + std::string switch_to = (const char*)items[i]->objectName().toLatin1(); if (w) { std::string current_w = w->name(); if (switch_to == current_w) @@ -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); diff --git a/src/Gui/CommandTest.cpp b/src/Gui/CommandTest.cpp index 49ce61f956..3f4cc9b1e6 100644 --- a/src/Gui/CommandTest.cpp +++ b/src/Gui/CommandTest.cpp @@ -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 i18n = qApp->findChildren(); diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index d6328294bc..5ccdc2d797 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -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; iaddAction(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,8 +286,8 @@ void StdCmdFreezeViews::activated(int iMsg) // Activate a view QList acts = pcAction->actions(); QString data = acts[iMsg]->toolTip(); - QString send = QString::fromAscii("SetCamera %1").arg(data); - getGuiApplication()->sendMsgToActiveView(send.toAscii()); + QString send = QString::fromLatin1("SetCamera %1").arg(data); + getGuiApplication()->sendMsgToActiveView(send.toLatin1()); } } @@ -316,14 +316,14 @@ 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(" ")); } } - str << " " << endl; + str << " " << endl; } str << " " << endl; @@ -364,7 +364,7 @@ void StdCmdFreezeViews::onRestoreViews() if (!xmlDocument.setContent(&file, true, &errorStr, &errorLine, &errorColumn)) { std::cerr << "Parse error in XML content at line " << errorLine << ", column " << errorColumn << ": " - << (const char*)errorStr.toAscii() << std::endl; + << (const char*)errorStr.toLatin1() << std::endl; return; } @@ -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 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(); @@ -1520,7 +1520,7 @@ void StdViewScreenShot::activated(int iMsg) } } - hExt->SetASCII("OffscreenImageFormat", (const char*)format.toAscii()); + hExt->SetASCII("OffscreenImageFormat", (const char*)format.toLatin1()); // which background chosen const char* background; @@ -2147,7 +2147,7 @@ static void selectionCallback(void * ud, SoEventCallback * cb) Gui::View3DInventorViewer* view = reinterpret_cast(cb->getUserData()); view->removeEventCallback(SoMouseButtonEvent::getClassTypeId(), selectionCallback, ud); SoNode* root = view->getSceneGraph(); - static_cast(root)->selectionRole.setValue(TRUE); + static_cast(root)->selectionRole.setValue(true); std::vector picked = view->getGLPolygon(); SoCamera* cam = view->getSoRenderManager()->getCamera(); @@ -2202,7 +2202,7 @@ void StdBoxSelection::activated(int iMsg) viewer->startSelection(View3DInventorViewer::Rubberband); viewer->addEventCallback(SoMouseButtonEvent::getClassTypeId(), selectionCallback); SoNode* root = viewer->getSceneGraph(); - static_cast(root)->selectionRole.setValue(FALSE); + static_cast(root)->selectionRole.setValue(false); } } } diff --git a/src/Gui/DemoMode.cpp b/src/Gui/DemoMode.cpp index f877d1a814..901992ebd2 100644 --- a/src/Gui/DemoMode.cpp +++ b/src/Gui/DemoMode.cpp @@ -45,7 +45,7 @@ using namespace Gui::Dialog; /* TRANSLATOR Gui::Dialog::DemoMode */ -DemoMode::DemoMode(QWidget* parent, Qt::WFlags fl) +DemoMode::DemoMode(QWidget* parent, Qt::WindowFlags fl) : QDialog(0, fl|Qt::WindowStaysOnTopHint), viewAxis(0,0,-1), ui(new Ui_DemoMode) { // create widgets diff --git a/src/Gui/DemoMode.h b/src/Gui/DemoMode.h index 1f4fb67ead..e08c91926e 100644 --- a/src/Gui/DemoMode.h +++ b/src/Gui/DemoMode.h @@ -44,7 +44,7 @@ class GuiExport DemoMode : public QDialog Q_OBJECT public: - DemoMode(QWidget* parent = 0, Qt::WFlags fl = 0); + DemoMode(QWidget* parent = 0, Qt::WindowFlags fl = 0); ~DemoMode(); void accept(); diff --git a/src/Gui/DlgActionsImp.cpp b/src/Gui/DlgActionsImp.cpp index cec41036c2..6bce69c4a2 100644 --- a/src/Gui/DlgActionsImp.cpp +++ b/src/Gui/DlgActionsImp.cpp @@ -53,7 +53,7 @@ using namespace Gui::Dialog; * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ DlgCustomActionsImp::DlgCustomActionsImp( QWidget* parent ) : CustomizeActionPage(parent), bShown( false ) @@ -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(); @@ -226,7 +226,7 @@ void DlgCustomActionsImp::on_buttonAddAction_clicked() } // search for the command in the manager - QByteArray actionName = newActionName().toAscii(); + QByteArray actionName = newActionName().toLatin1(); CommandManager& rclMan = Application::Instance->commandManager(); MacroCommand* macro = new MacroCommand(actionName); rclMan.addCommand( macro ); @@ -260,12 +260,12 @@ void DlgCustomActionsImp::on_buttonAddAction_clicked() actionStatus->clear(); if (!m_sPixmap.isEmpty()) - macro->setPixmap(m_sPixmap.toAscii()); + macro->setPixmap(m_sPixmap.toLatin1()); pixmapLabel->clear(); m_sPixmap = QString::null; if (!actionAccel->text().isEmpty()) { - macro->setAccel(actionAccel->text().toAscii()); + macro->setAccel(actionAccel->text().toLatin1()); } actionAccel->clear(); @@ -315,12 +315,12 @@ void DlgCustomActionsImp::on_buttonReplaceAction_clicked() actionStatus->clear(); if (!m_sPixmap.isEmpty()) - macro->setPixmap(m_sPixmap.toAscii()); + macro->setPixmap(m_sPixmap.toLatin1()); pixmapLabel->clear(); m_sPixmap = QString::null; if (!actionAccel->text().isEmpty()) { - macro->setAccel(actionAccel->text().toAscii()); + macro->setAccel(actionAccel->text().toLatin1()); } actionAccel->clear(); @@ -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 formats = QImageReader::supportedImageFormats(); for (QList::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::iterator it; for ( it = aclCurMacros.begin(); it!= aclCurMacros.end(); ++it ) diff --git a/src/Gui/DlgActivateWindowImp.cpp b/src/Gui/DlgActivateWindowImp.cpp index cdd0054577..6ee7d5e4f4 100644 --- a/src/Gui/DlgActivateWindowImp.cpp +++ b/src/Gui/DlgActivateWindowImp.cpp @@ -42,9 +42,9 @@ using namespace Gui::Dialog; * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ -DlgActivateWindowImp::DlgActivateWindowImp(QWidget* parent, Qt::WFlags fl) +DlgActivateWindowImp::DlgActivateWindowImp(QWidget* parent, Qt::WindowFlags fl) : QDialog(parent, fl), ui(new Ui_DlgActivateWindow) { // create widgets diff --git a/src/Gui/DlgActivateWindowImp.h b/src/Gui/DlgActivateWindowImp.h index 454f1ed6ea..6017394a31 100644 --- a/src/Gui/DlgActivateWindowImp.h +++ b/src/Gui/DlgActivateWindowImp.h @@ -40,7 +40,7 @@ class DlgActivateWindowImp : public QDialog Q_OBJECT public: - DlgActivateWindowImp(QWidget* parent = 0, Qt::WFlags fl = 0); + DlgActivateWindowImp(QWidget* parent = 0, Qt::WindowFlags fl = 0); ~DlgActivateWindowImp(); protected: diff --git a/src/Gui/DlgCommandsImp.cpp b/src/Gui/DlgCommandsImp.cpp index 8a169d5cfb..7c6de872ed 100644 --- a/src/Gui/DlgCommandsImp.cpp +++ b/src/Gui/DlgCommandsImp.cpp @@ -58,7 +58,7 @@ struct GroupMap_find { * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ DlgCustomCommandsImp::DlgCustomCommandsImp( QWidget* parent ) : CustomizeActionPage(parent) @@ -146,7 +146,7 @@ void DlgCustomCommandsImp::onGroupActivated(QTreeWidgetItem* item) commandTreeWidget->clear(); CommandManager & cCmdMgr = Application::Instance->commandManager(); - std::vector aCmds = cCmdMgr.getGroupCommands(group.toAscii()); + std::vector aCmds = cCmdMgr.getGroupCommands(group.toLatin1()); if (group == QLatin1String("Macros")) { for (std::vector::iterator it = aCmds.begin(); it != aCmds.end(); ++it) { QTreeWidgetItem* item = new QTreeWidgetItem(commandTreeWidget); diff --git a/src/Gui/DlgCustomizeImp.cpp b/src/Gui/DlgCustomizeImp.cpp index 54284f36f8..c28997c1a3 100644 --- a/src/Gui/DlgCustomizeImp.cpp +++ b/src/Gui/DlgCustomizeImp.cpp @@ -44,9 +44,9 @@ QList DlgCustomizeImp::_pages; * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ -DlgCustomizeImp::DlgCustomizeImp(QWidget* parent, Qt::WFlags fl) +DlgCustomizeImp::DlgCustomizeImp(QWidget* parent, Qt::WindowFlags fl) : QDialog(parent, fl) { setModal(false); diff --git a/src/Gui/DlgCustomizeImp.h b/src/Gui/DlgCustomizeImp.h index 41a04752dc..a5e2454037 100644 --- a/src/Gui/DlgCustomizeImp.h +++ b/src/Gui/DlgCustomizeImp.h @@ -51,7 +51,7 @@ class DlgCustomizeImp : public QDialog Q_OBJECT public: - DlgCustomizeImp(QWidget* parent = 0, Qt::WFlags fl = 0); + DlgCustomizeImp(QWidget* parent = 0, Qt::WindowFlags fl = 0); ~DlgCustomizeImp(); static void addPage(const char* className); diff --git a/src/Gui/DlgCustomizeSpaceball.cpp b/src/Gui/DlgCustomizeSpaceball.cpp index 6c962c9927..d649ef559b 100644 --- a/src/Gui/DlgCustomizeSpaceball.cpp +++ b/src/Gui/DlgCustomizeSpaceball.cpp @@ -116,7 +116,7 @@ void ButtonModel::insertButtonRows(int number) { QString groupName; groupName.setNum(index); - Base::Reference newGroup = spaceballButtonGroup()->GetGroup(groupName.toAscii());//builds the group. + Base::Reference newGroup = spaceballButtonGroup()->GetGroup(groupName.toLatin1());//builds the group. newGroup->SetASCII("Command", ""); } endInsertRows(); @@ -126,14 +126,14 @@ void ButtonModel::insertButtonRows(int number) void ButtonModel::setCommand(int row, QString command) { GroupVector groupVector = spaceballButtonGroup()->GetGroups(); - groupVector.at(row)->SetASCII("Command", command.toAscii()); + groupVector.at(row)->SetASCII("Command", command.toLatin1()); } void ButtonModel::goButtonPress(int number) { QString numberString; numberString.setNum(number); - if (!spaceballButtonGroup()->HasGroup(numberString.toAscii())) + if (!spaceballButtonGroup()->HasGroup(numberString.toLatin1())) insertButtonRows(number); } @@ -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 ¯oName) { - 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 ¯oName) //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 ¯oName) void CommandModel::goRemoveMacro(const QByteArray ¯oName) { - 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; @@ -439,7 +439,7 @@ void CommandModel::groupCommands(const QString& groupName) CommandNode *parentNode = new CommandNode(CommandNode::GroupType); parentNode->parent = rootNode; rootNode->children.push_back(parentNode); - std::vector commands = Application::Instance->commandManager().getGroupCommands(groupName.toAscii()); + std::vector commands = Application::Instance->commandManager().getGroupCommands(groupName.toLatin1()); for (std::vector ::iterator it = commands.begin(); it != commands.end(); ++it) { CommandNode *childNode = new CommandNode(CommandNode::CommandType); @@ -455,7 +455,7 @@ QStringList CommandModel::orderedGroups() std::vector commands = Application::Instance->commandManager().getAllCommands(); for (std::vector ::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; } diff --git a/src/Gui/DlgDisplayPropertiesImp.cpp b/src/Gui/DlgDisplayPropertiesImp.cpp index 7338ba6e7c..fdbcbc559d 100644 --- a/src/Gui/DlgDisplayPropertiesImp.cpp +++ b/src/Gui/DlgDisplayPropertiesImp.cpp @@ -62,9 +62,9 @@ using namespace std; * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ -DlgDisplayPropertiesImp::DlgDisplayPropertiesImp( QWidget* parent, Qt::WFlags fl ) +DlgDisplayPropertiesImp::DlgDisplayPropertiesImp( QWidget* parent, Qt::WindowFlags fl ) : QDialog( parent, fl ) { this->setupUi(this); @@ -274,14 +274,14 @@ void DlgDisplayPropertiesImp::on_changeMode_activated(const QString& s) App::Property* prop = (*It)->getPropertyByName("DisplayMode"); if (prop && prop->getTypeId() == App::PropertyEnumeration::getClassTypeId()) { App::PropertyEnumeration* Display = (App::PropertyEnumeration*)prop; - Display->setValue((const char*)s.toAscii()); + Display->setValue((const char*)s.toLatin1()); } } } void DlgDisplayPropertiesImp::on_changePlot_activated(const QString&s) { - Base::Console().Log("Plot = %s\n",(const char*)s.toAscii()); + Base::Console().Log("Plot = %s\n",(const char*)s.toLatin1()); } /** @@ -406,7 +406,7 @@ void DlgDisplayPropertiesImp::setDisplayModes(const std::vectorgetPropertyByName("DisplayMode"); if (prop && prop->getTypeId() == App::PropertyEnumeration::getClassTypeId()) { App::PropertyEnumeration* display = static_cast(prop); - QString activeMode = QString::fromAscii(display->getValueAsString()); + QString activeMode = QString::fromLatin1(display->getValueAsString()); int index = changeMode->findText(activeMode); if (index != -1) { changeMode->setCurrentIndex(index); diff --git a/src/Gui/DlgDisplayPropertiesImp.h b/src/Gui/DlgDisplayPropertiesImp.h index 76a7ce8b4f..0bdda40b9a 100644 --- a/src/Gui/DlgDisplayPropertiesImp.h +++ b/src/Gui/DlgDisplayPropertiesImp.h @@ -55,7 +55,7 @@ class DlgDisplayPropertiesImp : public QDialog, public Ui_DlgDisplayProperties, Q_OBJECT public: - DlgDisplayPropertiesImp( QWidget* parent = 0, Qt::WFlags fl = 0 ); + DlgDisplayPropertiesImp( QWidget* parent = 0, Qt::WindowFlags fl = 0 ); ~DlgDisplayPropertiesImp(); /// Observer message from the Selection void OnChange(Gui::SelectionSingleton::SubjectType &rCaller, diff --git a/src/Gui/DlgEditFileIncludeProptertyExternal.cpp b/src/Gui/DlgEditFileIncludeProptertyExternal.cpp index 9d62ec5d56..5d1fe762bc 100644 --- a/src/Gui/DlgEditFileIncludeProptertyExternal.cpp +++ b/src/Gui/DlgEditFileIncludeProptertyExternal.cpp @@ -41,11 +41,11 @@ using namespace Gui::Dialog; * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ DlgEditFileIncludePropertyExternal:: DlgEditFileIncludePropertyExternal(App::PropertyFileIncluded& Prop, - QWidget* parent, Qt::WFlags fl) + QWidget* parent, Qt::WindowFlags fl) : DlgRunExternal(parent, fl), Prop(Prop) { diff --git a/src/Gui/DlgEditFileIncludeProptertyExternal.h b/src/Gui/DlgEditFileIncludeProptertyExternal.h index 33449e4a3d..4823682839 100644 --- a/src/Gui/DlgEditFileIncludeProptertyExternal.h +++ b/src/Gui/DlgEditFileIncludeProptertyExternal.h @@ -39,7 +39,7 @@ class GuiExport DlgEditFileIncludePropertyExternal : public DlgRunExternal Q_OBJECT public: - DlgEditFileIncludePropertyExternal( App::PropertyFileIncluded& Prop, QWidget* parent = 0, Qt::WFlags fl = 0 ); + DlgEditFileIncludePropertyExternal( App::PropertyFileIncluded& Prop, QWidget* parent = 0, Qt::WindowFlags fl = 0 ); virtual ~DlgEditFileIncludePropertyExternal(); int Do(void); diff --git a/src/Gui/DlgEditorImp.cpp b/src/Gui/DlgEditorImp.cpp index c4d1d283df..b2c5def749 100644 --- a/src/Gui/DlgEditorImp.cpp +++ b/src/Gui/DlgEditorImp.cpp @@ -51,7 +51,7 @@ struct DlgSettingsEditorP * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ DlgSettingsEditorImp::DlgSettingsEditorImp( QWidget* parent ) : PreferencePage( parent ) @@ -62,70 +62,70 @@ 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::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::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::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::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::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::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::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::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::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::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::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::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::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::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::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); this->displayItems->header()->hide(); for (QVector >::ConstIterator it = d->colormap.begin(); it != d->colormap.end(); ++it) { QTreeWidgetItem* item = new QTreeWidgetItem(this->displayItems); - item->setText(0, tr((*it).first.toAscii())); + item->setText(0, tr((*it).first.toLatin1())); } pythonSyntax = new PythonSyntaxHighlighter(textEdit1); pythonSyntax->setDocument(textEdit1->document()); @@ -173,10 +173,10 @@ void DlgSettingsEditorImp::saveSettings() // Saves the color map ParameterGrp::handle hGrp = WindowParameter::getDefaultParameter()->GetGroup("Editor"); for (QVector >::ConstIterator it = d->colormap.begin(); it != d->colormap.end(); ++it) - hGrp->SetUnsigned((*it).first.toAscii(), (*it).second); + hGrp->SetUnsigned((*it).first.toLatin1(), (*it).second); hGrp->SetInt( "FontSize", fontSize->value() ); - hGrp->SetASCII( "Font", fontFamily->currentText().toAscii() ); + hGrp->SetASCII( "Font", fontFamily->currentText().toLatin1() ); } void DlgSettingsEditorImp::loadSettings() @@ -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" @@ -203,7 +203,7 @@ void DlgSettingsEditorImp::loadSettings() // Restores the color map ParameterGrp::handle hGrp = WindowParameter::getDefaultParameter()->GetGroup("Editor"); for (QVector >::Iterator it = d->colormap.begin(); it != d->colormap.end(); ++it){ - unsigned long col = hGrp->GetUnsigned((*it).first.toAscii(), (*it).second); + unsigned long col = hGrp->GetUnsigned((*it).first.toLatin1(), (*it).second); (*it).second = col; QColor color; color.setRgb((col >> 24) & 0xff, (col >> 16) & 0xff, (col >> 8) & 0xff); @@ -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(); @@ -234,7 +234,7 @@ void DlgSettingsEditorImp::changeEvent(QEvent *e) if (e->type() == QEvent::LanguageChange) { int index = 0; for (QVector >::ConstIterator it = d->colormap.begin(); it != d->colormap.end(); ++it) - this->displayItems->topLevelItem(index++)->setText(0, tr((*it).first.toAscii())); + this->displayItems->topLevelItem(index++)->setText(0, tr((*it).first.toLatin1())); this->retranslateUi(this); } else { QWidget::changeEvent(e); diff --git a/src/Gui/DlgGeneralImp.cpp b/src/Gui/DlgGeneralImp.cpp index 80bc3380a8..7cab8a575c 100644 --- a/src/Gui/DlgGeneralImp.cpp +++ b/src/Gui/DlgGeneralImp.cpp @@ -46,7 +46,7 @@ using namespace Gui::Dialog; * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ DlgGeneralImp::DlgGeneralImp( QWidget* parent ) : PreferencePage( parent ), watched(0) @@ -121,7 +121,7 @@ void DlgGeneralImp::saveSettings() QVariant data = AutoloadModuleCombo->itemData(index); QString startWbName = data.toString(); App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/General")-> - SetASCII("AutoloadModule", startWbName.toAscii()); + SetASCII("AutoloadModule", startWbName.toLatin1()); AutoloadTabCombo->onSave(); RecentFiles->onSave(); @@ -133,7 +133,7 @@ void DlgGeneralImp::saveSettings() setRecentFileSize(); ParameterGrp::handle hGrp = WindowParameter::getDefaultParameter()->GetGroup("General"); QString lang = QLocale::languageToString(QLocale::system().language()); - QByteArray language = hGrp->GetASCII("Language", (const char*)lang.toAscii()).c_str(); + QByteArray language = hGrp->GetASCII("Language", (const char*)lang.toLatin1()).c_str(); QByteArray current = Languages->itemData(Languages->currentIndex()).toByteArray(); if (current != language) { @@ -216,14 +216,14 @@ void DlgGeneralImp::loadSettings() // search for the language files ParameterGrp::handle hGrp = WindowParameter::getDefaultParameter()->GetGroup("General"); QString lang = QLocale::languageToString(QLocale::system().language()); - QByteArray language = hGrp->GetASCII("Language", (const char*)lang.toAscii()).c_str(); + 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 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::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); } diff --git a/src/Gui/DlgInputDialogImp.cpp b/src/Gui/DlgInputDialogImp.cpp index e71f389793..9be19d6dbd 100644 --- a/src/Gui/DlgInputDialogImp.cpp +++ b/src/Gui/DlgInputDialogImp.cpp @@ -39,7 +39,7 @@ using namespace Gui::Dialog; * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ DlgInputDialogImp::DlgInputDialogImp( const QString& labelTxt, QWidget* parent, bool modal, Type type ) : QDialog( parent ) @@ -66,7 +66,7 @@ DlgInputDialogImp::~DlgInputDialogImp() void DlgInputDialogImp::textChanged( const QString &s ) { - bool on = TRUE; + bool on = true; if (lineEdit->validator()) { QString str = lineEdit->text(); diff --git a/src/Gui/DlgInputDialogImp.h b/src/Gui/DlgInputDialogImp.h index 4dfcc298de..58d69441cd 100644 --- a/src/Gui/DlgInputDialogImp.h +++ b/src/Gui/DlgInputDialogImp.h @@ -43,7 +43,7 @@ class GuiExport DlgInputDialogImp : public QDialog, public Ui_DlgInputDialog public: enum Type { LineEdit, SpinBox, UIntBox, FloatSpinBox, ComboBox }; - DlgInputDialogImp( const QString& label, QWidget* parent = 0, bool modal = TRUE, Type = LineEdit ); + DlgInputDialogImp( const QString& label, QWidget* parent = 0, bool modal = true, Type = LineEdit ); ~DlgInputDialogImp(); void setType( Type t ); diff --git a/src/Gui/DlgKeyboardImp.cpp b/src/Gui/DlgKeyboardImp.cpp index 29391a7cd4..a79ba7c776 100644 --- a/src/Gui/DlgKeyboardImp.cpp +++ b/src/Gui/DlgKeyboardImp.cpp @@ -61,7 +61,7 @@ struct GroupMap_find { * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ DlgCustomKeyboardImp::DlgCustomKeyboardImp( QWidget* parent ) : CustomizeActionPage(parent), firstShow(true) @@ -141,22 +141,22 @@ 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()) accelLineEditShortcut->setText( tr("none") ); else - accelLineEditShortcut->setText(ks); + accelLineEditShortcut->setText(ks.toString(QKeySequence::NativeText)); 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 - accelLineEditShortcut->setText(ks); + accelLineEditShortcut->setText(ks.toString(QKeySequence::NativeText)); buttonAssign->setEnabled(false); buttonReset->setEnabled(false); } @@ -177,7 +177,7 @@ void DlgCustomKeyboardImp::on_categoryBox_activated(int index) editShortcut->clear(); CommandManager & cCmdMgr = Application::Instance->commandManager(); - std::vector aCmds = cCmdMgr.getGroupCommands( group.toAscii() ); + std::vector aCmds = cCmdMgr.getGroupCommands( group.toLatin1() ); if (group == QLatin1String("Macros")) { for (std::vector::iterator it = aCmds.begin(); it != aCmds.end(); ++it) { @@ -218,7 +218,7 @@ void DlgCustomKeyboardImp::on_buttonAssign_clicked() if (cmd && cmd->getAction()) { Action* action = cmd->getAction(); QKeySequence shortcut = editShortcut->text(); - action->setShortcut(shortcut); + action->setShortcut(shortcut.toString(QKeySequence::NativeText)); accelLineEditShortcut->setText(editShortcut->text()); editShortcut->clear(); @@ -273,8 +273,8 @@ 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())); - QString txt = cmd->getAction()->shortcut(); + cmd->getAction()->setShortcut(QString::fromLatin1(cmd->getAccel())); + QString txt = cmd->getAction()->shortcut().toString(QKeySequence::NativeText); accelLineEditShortcut->setText((txt.isEmpty() ? tr("none") : txt)); ParameterGrp::handle hGrp = WindowParameter::getDefaultParameter()->GetGroup("Shortcut"); hGrp->RemoveASCII(name.constData()); @@ -290,7 +290,8 @@ void DlgCustomKeyboardImp::on_buttonResetAll_clicked() std::vector cmds = cCmdMgr.getAllCommands(); for (std::vector::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())) + .toString(QKeySequence::NativeText)); } } @@ -332,7 +333,7 @@ void DlgCustomKeyboardImp::on_editShortcut_textChanged(const QString& sc) for (QList::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); diff --git a/src/Gui/DlgMacroExecuteImp.cpp b/src/Gui/DlgMacroExecuteImp.cpp index 52bb17163c..ae1609d968 100644 --- a/src/Gui/DlgMacroExecuteImp.cpp +++ b/src/Gui/DlgMacroExecuteImp.cpp @@ -52,9 +52,9 @@ using namespace Gui::Dialog; * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ -DlgMacroExecuteImp::DlgMacroExecuteImp( QWidget* parent, Qt::WFlags fl ) +DlgMacroExecuteImp::DlgMacroExecuteImp( QWidget* parent, Qt::WindowFlags fl ) : QDialog( parent, fl ), WindowParameter( "Macro" ) { this->setupUi(this); @@ -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(); diff --git a/src/Gui/DlgMacroExecuteImp.h b/src/Gui/DlgMacroExecuteImp.h index 6a8dac4dcc..a8561d7f31 100644 --- a/src/Gui/DlgMacroExecuteImp.h +++ b/src/Gui/DlgMacroExecuteImp.h @@ -40,7 +40,7 @@ class DlgMacroExecuteImp : public QDialog, public Ui_DlgMacroExecute, public Gui Q_OBJECT public: - DlgMacroExecuteImp( QWidget* parent = 0, Qt::WFlags fl = 0 ); + DlgMacroExecuteImp( QWidget* parent = 0, Qt::WindowFlags fl = 0 ); ~DlgMacroExecuteImp(); void accept(); diff --git a/src/Gui/DlgMacroRecordImp.cpp b/src/Gui/DlgMacroRecordImp.cpp index af40b1ed96..cf90f1ddbb 100644 --- a/src/Gui/DlgMacroRecordImp.cpp +++ b/src/Gui/DlgMacroRecordImp.cpp @@ -45,9 +45,9 @@ using namespace Gui::Dialog; * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ -DlgMacroRecordImp::DlgMacroRecordImp( QWidget* parent, Qt::WFlags fl ) +DlgMacroRecordImp::DlgMacroRecordImp( QWidget* parent, Qt::WindowFlags fl ) : QDialog(parent, fl), WindowParameter("Macro") { this->setupUi(this); diff --git a/src/Gui/DlgMacroRecordImp.h b/src/Gui/DlgMacroRecordImp.h index a7f9f8b2a1..e9a95eb57f 100644 --- a/src/Gui/DlgMacroRecordImp.h +++ b/src/Gui/DlgMacroRecordImp.h @@ -41,7 +41,7 @@ class DlgMacroRecordImp : public QDialog, public Ui_DlgMacroRecord, public Gui:: Q_OBJECT public: - DlgMacroRecordImp( QWidget* parent = 0, Qt::WFlags fl = 0 ); + DlgMacroRecordImp( QWidget* parent = 0, Qt::WindowFlags fl = 0 ); virtual ~DlgMacroRecordImp(); protected Q_SLOTS: diff --git a/src/Gui/DlgMaterialPropertiesImp.cpp b/src/Gui/DlgMaterialPropertiesImp.cpp index 5dcf0dfddf..f18fd1103a 100644 --- a/src/Gui/DlgMaterialPropertiesImp.cpp +++ b/src/Gui/DlgMaterialPropertiesImp.cpp @@ -41,9 +41,9 @@ using namespace Gui::Dialog; * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ -DlgMaterialPropertiesImp::DlgMaterialPropertiesImp(const std::string& mat, QWidget* parent, Qt::WFlags fl) +DlgMaterialPropertiesImp::DlgMaterialPropertiesImp(const std::string& mat, QWidget* parent, Qt::WindowFlags fl) : QDialog(parent, fl), material(mat) { this->setupUi(this); diff --git a/src/Gui/DlgMaterialPropertiesImp.h b/src/Gui/DlgMaterialPropertiesImp.h index 9d921b652a..f4413602d2 100644 --- a/src/Gui/DlgMaterialPropertiesImp.h +++ b/src/Gui/DlgMaterialPropertiesImp.h @@ -37,7 +37,7 @@ class DlgMaterialPropertiesImp : public QDialog, public Ui_DlgMaterialProperties Q_OBJECT public: - DlgMaterialPropertiesImp(const std::string& mat, QWidget* parent = 0, Qt::WFlags fl = 0); + DlgMaterialPropertiesImp(const std::string& mat, QWidget* parent = 0, Qt::WindowFlags fl = 0); ~DlgMaterialPropertiesImp(); void setViewProviders(const std::vector&); diff --git a/src/Gui/DlgOnlineHelpImp.cpp b/src/Gui/DlgOnlineHelpImp.cpp index 33ee537b7a..60a7dc7236 100644 --- a/src/Gui/DlgOnlineHelpImp.cpp +++ b/src/Gui/DlgOnlineHelpImp.cpp @@ -42,7 +42,7 @@ using namespace Gui::Dialog; * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ DlgOnlineHelpImp::DlgOnlineHelpImp( QWidget* parent ) : PreferencePage(parent) diff --git a/src/Gui/DlgParameterImp.cpp b/src/Gui/DlgParameterImp.cpp index d9391b3c16..6914bae4ad 100644 --- a/src/Gui/DlgParameterImp.cpp +++ b/src/Gui/DlgParameterImp.cpp @@ -54,9 +54,9 @@ using namespace Gui::Dialog; * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ -DlgParameterImp::DlgParameterImp( QWidget* parent, Qt::WFlags fl ) +DlgParameterImp::DlgParameterImp( QWidget* parent, Qt::WindowFlags fl ) : QDialog( parent, fl|Qt::WindowMinMaxButtonsHint ) { this->setupUi(this); @@ -313,7 +313,7 @@ bool validateInput(QWidget* parent, const QString& input) if (input.isEmpty()) return false; for (int i=0; i '9') && // Numbers (c < 'A' || c > 'Z') && // Uppercase letters (c < 'a' || c > 'z') && // Lowercase letters @@ -393,7 +393,7 @@ void ParameterGroup::onDeleteSelectedItem() int index = parent->indexOfChild(sel); parent->takeChild(index); ParameterGroupItem* para = static_cast(parent); - para->_hcGrp->RemoveGrp(sel->text(0).toAscii()); + para->_hcGrp->RemoveGrp(sel->text(0).toLatin1()); delete sel; } } @@ -425,14 +425,14 @@ void ParameterGroup::onCreateSubgroup() ParameterGroupItem* para = static_cast(item); Base::Reference hGrp = para->_hcGrp; - if ( hGrp->HasGroup( name.toAscii() ) ) + if ( hGrp->HasGroup( name.toLatin1() ) ) { QMessageBox::critical( this, tr("Existing sub-group"), tr("The sub-group '%1' already exists.").arg( name ) ); return; } - hGrp = hGrp->GetGroup( name.toAscii() ); + hGrp = hGrp->GetGroup( name.toLatin1() ); (void)new ParameterGroupItem(para,hGrp); expandItem(para); } @@ -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 ) @@ -822,7 +822,7 @@ void ParameterGroupItem::setData ( int column, int role, const QVariant & value QObject::tr("The group '%1' cannot be renamed.").arg( oldName ) ); return; } - if ( item->_hcGrp->HasGroup( newName.toAscii() ) ) + if ( item->_hcGrp->HasGroup( newName.toLatin1() ) ) { QMessageBox::critical( treeWidget(), QObject::tr("Existing group"), QObject::tr("The group '%1' already exists.").arg( newName ) ); @@ -831,10 +831,10 @@ void ParameterGroupItem::setData ( int column, int role, const QVariant & value else { // rename the group by adding a new group, copy the content and remove the old group - Base::Reference hOldGrp = item->_hcGrp->GetGroup( oldName.toAscii() ); - Base::Reference hNewGrp = item->_hcGrp->GetGroup( newName.toAscii() ); + Base::Reference hOldGrp = item->_hcGrp->GetGroup( oldName.toLatin1() ); + Base::Reference hNewGrp = item->_hcGrp->GetGroup( newName.toLatin1() ); hOldGrp->copyTo( hNewGrp ); - item->_hcGrp->RemoveGrp( oldName.toAscii() ); + item->_hcGrp->RemoveGrp( oldName.toLatin1() ); } } @@ -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)); } @@ -907,25 +907,25 @@ void ParameterText::changeValue() if ( ok ) { setText( 2, txt ); - _hcGrp->SetASCII(text(0).toAscii(), txt.toUtf8()); + _hcGrp->SetASCII(text(0).toLatin1(), txt.toUtf8()); } } void ParameterText::removeFromGroup () { - _hcGrp->RemoveASCII(text(0).toAscii()); + _hcGrp->RemoveASCII(text(0).toLatin1()); } void ParameterText::replace( const QString& oldName, const QString& newName ) { - std::string val = _hcGrp->GetASCII(oldName.toAscii()); - _hcGrp->RemoveASCII(oldName.toAscii()); - _hcGrp->SetASCII(newName.toAscii(), val.c_str()); + std::string val = _hcGrp->GetASCII(oldName.toLatin1()); + _hcGrp->RemoveASCII(oldName.toLatin1()); + _hcGrp->SetASCII(newName.toLatin1(), val.c_str()); } void ParameterText::appendToGroup() { - _hcGrp->SetASCII(text(0).toAscii(), text(2).toUtf8()); + _hcGrp->SetASCII(text(0).toLatin1(), text(2).toUtf8()); } // -------------------------------------------------------------------- @@ -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,26 +950,26 @@ void ParameterInt::changeValue() text(2).toInt(), -2147483647, 2147483647, 1, &ok); if ( ok ) { - setText(2, QString::fromAscii("%1").arg(num)); - _hcGrp->SetInt(text(0).toAscii(), (long)num); + setText(2, QString::fromLatin1("%1").arg(num)); + _hcGrp->SetInt(text(0).toLatin1(), (long)num); } } void ParameterInt::removeFromGroup () { - _hcGrp->RemoveInt(text(0).toAscii()); + _hcGrp->RemoveInt(text(0).toLatin1()); } void ParameterInt::replace( const QString& oldName, const QString& newName ) { - long val = _hcGrp->GetInt(oldName.toAscii()); - _hcGrp->RemoveInt(oldName.toAscii()); - _hcGrp->SetInt(newName.toAscii(), val); + long val = _hcGrp->GetInt(oldName.toLatin1()); + _hcGrp->RemoveInt(oldName.toLatin1()); + _hcGrp->SetInt(newName.toLatin1(), val); } void ParameterInt::appendToGroup() { - _hcGrp->SetInt(text(0).toAscii(), text(2).toLong()); + _hcGrp->SetInt(text(0).toLatin1(), text(2).toLong()); } // -------------------------------------------------------------------- @@ -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,27 +1002,27 @@ void ParameterUInt::changeValue() if ( ok ) { - setText(2, QString::fromAscii("%1").arg(num)); - _hcGrp->SetUnsigned(text(0).toAscii(), (unsigned long)num); + setText(2, QString::fromLatin1("%1").arg(num)); + _hcGrp->SetUnsigned(text(0).toLatin1(), (unsigned long)num); } } } void ParameterUInt::removeFromGroup () { - _hcGrp->RemoveUnsigned(text(0).toAscii()); + _hcGrp->RemoveUnsigned(text(0).toLatin1()); } void ParameterUInt::replace( const QString& oldName, const QString& newName ) { - unsigned long val = _hcGrp->GetUnsigned(oldName.toAscii()); - _hcGrp->RemoveUnsigned(oldName.toAscii()); - _hcGrp->SetUnsigned(newName.toAscii(), val); + unsigned long val = _hcGrp->GetUnsigned(oldName.toLatin1()); + _hcGrp->RemoveUnsigned(oldName.toLatin1()); + _hcGrp->SetUnsigned(newName.toLatin1(), val); } void ParameterUInt::appendToGroup() { - _hcGrp->SetUnsigned(text(0).toAscii(), text(2).toULong()); + _hcGrp->SetUnsigned(text(0).toLatin1(), text(2).toULong()); } // -------------------------------------------------------------------- @@ -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,26 +1047,26 @@ void ParameterFloat::changeValue() text(2).toDouble(), -2147483647, 2147483647, 12, &ok); if ( ok ) { - setText(2, QString::fromAscii("%1").arg(num)); - _hcGrp->SetFloat(text(0).toAscii(), num); + setText(2, QString::fromLatin1("%1").arg(num)); + _hcGrp->SetFloat(text(0).toLatin1(), num); } } void ParameterFloat::removeFromGroup () { - _hcGrp->RemoveFloat(text(0).toAscii()); + _hcGrp->RemoveFloat(text(0).toLatin1()); } void ParameterFloat::replace( const QString& oldName, const QString& newName ) { - double val = _hcGrp->GetFloat(oldName.toAscii()); - _hcGrp->RemoveFloat(oldName.toAscii()); - _hcGrp->SetFloat(newName.toAscii(), val); + double val = _hcGrp->GetFloat(oldName.toLatin1()); + _hcGrp->RemoveFloat(oldName.toLatin1()); + _hcGrp->SetFloat(newName.toLatin1(), val); } void ParameterFloat::appendToGroup() { - _hcGrp->SetFloat(text(0).toAscii(), text(2).toDouble()); + _hcGrp->SetFloat(text(0).toLatin1(), text(2).toDouble()); } // -------------------------------------------------------------------- @@ -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:"), @@ -1096,26 +1096,26 @@ void ParameterBool::changeValue() if ( ok ) { setText( 2, txt ); - _hcGrp->SetBool(text(0).toAscii(), (txt == list[0] ? true : false) ); + _hcGrp->SetBool(text(0).toLatin1(), (txt == list[0] ? true : false) ); } } void ParameterBool::removeFromGroup () { - _hcGrp->RemoveBool(text(0).toAscii()); + _hcGrp->RemoveBool(text(0).toLatin1()); } void ParameterBool::replace( const QString& oldName, const QString& newName ) { - bool val = _hcGrp->GetBool(oldName.toAscii()); - _hcGrp->RemoveBool(oldName.toAscii()); - _hcGrp->SetBool(newName.toAscii(), val); + bool val = _hcGrp->GetBool(oldName.toLatin1()); + _hcGrp->RemoveBool(oldName.toLatin1()); + _hcGrp->SetBool(newName.toLatin1(), val); } void ParameterBool::appendToGroup() { bool val = (text(2) == QLatin1String("true") ? true : false); - _hcGrp->SetBool(text(0).toAscii(), val); + _hcGrp->SetBool(text(0).toLatin1(), val); } #include "moc_DlgParameterImp.cpp" diff --git a/src/Gui/DlgParameterImp.h b/src/Gui/DlgParameterImp.h index b4f2631d06..42ae8f4adc 100644 --- a/src/Gui/DlgParameterImp.h +++ b/src/Gui/DlgParameterImp.h @@ -42,7 +42,7 @@ class DlgParameterImp : public QDialog, public Ui_DlgParameter Q_OBJECT public: - DlgParameterImp( QWidget* parent = 0, Qt::WFlags fl = 0 ); + DlgParameterImp( QWidget* parent = 0, Qt::WindowFlags fl = 0 ); ~DlgParameterImp(); void accept(); diff --git a/src/Gui/DlgPreferencesImp.cpp b/src/Gui/DlgPreferencesImp.cpp index 5c32e8659f..5d1ea8134a 100644 --- a/src/Gui/DlgPreferencesImp.cpp +++ b/src/Gui/DlgPreferencesImp.cpp @@ -56,9 +56,9 @@ std::list DlgPreferencesImp::_pages; * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ -DlgPreferencesImp::DlgPreferencesImp( QWidget* parent, Qt::WFlags fl ) +DlgPreferencesImp::DlgPreferencesImp( QWidget* parent, Qt::WindowFlags fl ) : QDialog(parent, fl), ui(new Ui_DlgPreferences), canEmbedScrollArea(true) { ui->setupUi(this); @@ -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; } } diff --git a/src/Gui/DlgPreferencesImp.h b/src/Gui/DlgPreferencesImp.h index 23b7ae4fd8..d5c1578f8f 100644 --- a/src/Gui/DlgPreferencesImp.h +++ b/src/Gui/DlgPreferencesImp.h @@ -112,7 +112,7 @@ public: static void addPage(const std::string& className, const std::string& group); static void removePage(const std::string& className, const std::string& group); - DlgPreferencesImp(QWidget* parent = 0, Qt::WFlags fl = 0); + DlgPreferencesImp(QWidget* parent = 0, Qt::WindowFlags fl = 0); ~DlgPreferencesImp(); void accept(); diff --git a/src/Gui/DlgProjectInformationImp.cpp b/src/Gui/DlgProjectInformationImp.cpp index 273bf9d90a..6477b951f2 100644 --- a/src/Gui/DlgProjectInformationImp.cpp +++ b/src/Gui/DlgProjectInformationImp.cpp @@ -44,9 +44,9 @@ using namespace Gui::Dialog; * name 'name' and widget flags set to 'fl'. * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ -DlgProjectInformationImp::DlgProjectInformationImp(App::Document* doc, QWidget* parent, Qt::WFlags fl) +DlgProjectInformationImp::DlgProjectInformationImp(App::Document* doc, QWidget* parent, Qt::WindowFlags fl) : QDialog(parent, fl), _doc(doc), ui(new Ui_DlgProjectInformation) { ui->setupUi(this); @@ -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())); diff --git a/src/Gui/DlgProjectInformationImp.h b/src/Gui/DlgProjectInformationImp.h index 016ea8ae78..452121bdb4 100644 --- a/src/Gui/DlgProjectInformationImp.h +++ b/src/Gui/DlgProjectInformationImp.h @@ -40,7 +40,7 @@ class DlgProjectInformationImp : public QDialog Q_OBJECT public: - DlgProjectInformationImp(App::Document* doc, QWidget* parent = 0, Qt::WFlags fl = 0); + DlgProjectInformationImp(App::Document* doc, QWidget* parent = 0, Qt::WindowFlags fl = 0); ~DlgProjectInformationImp(); void accept(); diff --git a/src/Gui/DlgProjectUtility.cpp b/src/Gui/DlgProjectUtility.cpp index 70cd3dcf79..aeb6902e60 100644 --- a/src/Gui/DlgProjectUtility.cpp +++ b/src/Gui/DlgProjectUtility.cpp @@ -108,7 +108,7 @@ std::string DlgProjectUtility::doctools = /* TRANSLATOR Gui::Dialog::DlgProjectUtility */ -DlgProjectUtility::DlgProjectUtility(QWidget* parent, Qt::WFlags fl) +DlgProjectUtility::DlgProjectUtility(QWidget* parent, Qt::WindowFlags fl) : QDialog(parent, fl), ui(new Ui_DlgProjectUtility) { ui->setupUi(this); diff --git a/src/Gui/DlgProjectUtility.h b/src/Gui/DlgProjectUtility.h index 40373f81a9..6721b8f776 100644 --- a/src/Gui/DlgProjectUtility.h +++ b/src/Gui/DlgProjectUtility.h @@ -35,7 +35,7 @@ class DlgProjectUtility : public QDialog Q_OBJECT public: - DlgProjectUtility(QWidget* parent = 0, Qt::WFlags fl = 0); + DlgProjectUtility(QWidget* parent = 0, Qt::WindowFlags fl = 0); ~DlgProjectUtility(); private Q_SLOTS: diff --git a/src/Gui/DlgPropertyLink.cpp b/src/Gui/DlgPropertyLink.cpp index b246a47a8b..3c21e93ca8 100644 --- a/src/Gui/DlgPropertyLink.cpp +++ b/src/Gui/DlgPropertyLink.cpp @@ -44,7 +44,7 @@ using namespace Gui::Dialog; /* TRANSLATOR Gui::Dialog::DlgPropertyLink */ -DlgPropertyLink::DlgPropertyLink(const QStringList& list, QWidget* parent, Qt::WFlags fl) +DlgPropertyLink::DlgPropertyLink(const QStringList& list, QWidget* parent, Qt::WindowFlags fl) : QDialog(parent, fl), link(list), ui(new Ui_DlgPropertyLink) { #ifdef FC_DEBUG diff --git a/src/Gui/DlgPropertyLink.h b/src/Gui/DlgPropertyLink.h index 0a9fca65b1..baf0b59be9 100644 --- a/src/Gui/DlgPropertyLink.h +++ b/src/Gui/DlgPropertyLink.h @@ -34,7 +34,7 @@ class DlgPropertyLink : public QDialog Q_OBJECT public: - DlgPropertyLink(const QStringList& list, QWidget* parent = 0, Qt::WFlags fl = 0); + DlgPropertyLink(const QStringList& list, QWidget* parent = 0, Qt::WindowFlags fl = 0); ~DlgPropertyLink(); void accept(); diff --git a/src/Gui/DlgReportViewImp.cpp b/src/Gui/DlgReportViewImp.cpp index 0a07a37054..ead132d5c9 100644 --- a/src/Gui/DlgReportViewImp.cpp +++ b/src/Gui/DlgReportViewImp.cpp @@ -39,7 +39,7 @@ using namespace Gui::Dialog; * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ DlgReportViewImp::DlgReportViewImp( QWidget* parent ) : PreferencePage(parent) diff --git a/src/Gui/DlgRunExternal.cpp b/src/Gui/DlgRunExternal.cpp index d11f2870ce..948051c177 100644 --- a/src/Gui/DlgRunExternal.cpp +++ b/src/Gui/DlgRunExternal.cpp @@ -44,9 +44,9 @@ using namespace Gui::Dialog; * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ -DlgRunExternal::DlgRunExternal( QWidget* parent, Qt::WFlags fl ) +DlgRunExternal::DlgRunExternal( QWidget* parent, Qt::WindowFlags fl ) : QDialog(parent, fl),process(this),advancedHidden(true) { ui = new Ui_DlgRunExternal(); diff --git a/src/Gui/DlgRunExternal.h b/src/Gui/DlgRunExternal.h index 232b854596..d75c1149d5 100644 --- a/src/Gui/DlgRunExternal.h +++ b/src/Gui/DlgRunExternal.h @@ -41,7 +41,7 @@ class GuiExport DlgRunExternal : public QDialog Q_OBJECT public: - DlgRunExternal(QWidget* parent = 0, Qt::WFlags fl = 0); + DlgRunExternal(QWidget* parent = 0, Qt::WindowFlags fl = 0); virtual ~DlgRunExternal(); int Do(void); diff --git a/src/Gui/DlgSettings3DViewImp.cpp b/src/Gui/DlgSettings3DViewImp.cpp index d3eb4c5282..b4ba514159 100644 --- a/src/Gui/DlgSettings3DViewImp.cpp +++ b/src/Gui/DlgSettings3DViewImp.cpp @@ -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 ns(static_cast(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("

")); - ui.selectionLabel->setText(QString::fromAscii("%1").arg(descr)); + ui.selectionLabel->setText(QString::fromLatin1("%1").arg(descr)); descr = qApp->translate((const char*)data.toByteArray(),ns->mouseButtons(NavigationStyle::PANNING)); descr.replace(QLatin1String("\n"), QLatin1String("

")); - ui.panningLabel->setText(QString::fromAscii("%1").arg(descr)); + ui.panningLabel->setText(QString::fromLatin1("%1").arg(descr)); descr = qApp->translate((const char*)data.toByteArray(),ns->mouseButtons(NavigationStyle::DRAGGING)); descr.replace(QLatin1String("\n"), QLatin1String("

")); - ui.rotationLabel->setText(QString::fromAscii("%1").arg(descr)); + ui.rotationLabel->setText(QString::fromLatin1("%1").arg(descr)); descr = qApp->translate((const char*)data.toByteArray(),ns->mouseButtons(NavigationStyle::ZOOMING)); descr.replace(QLatin1String("\n"), QLatin1String("

")); - ui.zoomingLabel->setText(QString::fromAscii("%1").arg(descr)); + ui.zoomingLabel->setText(QString::fromLatin1("%1").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::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)); diff --git a/src/Gui/DlgSettingsColorGradientImp.cpp b/src/Gui/DlgSettingsColorGradientImp.cpp index bf272fda63..1665652869 100644 --- a/src/Gui/DlgSettingsColorGradientImp.cpp +++ b/src/Gui/DlgSettingsColorGradientImp.cpp @@ -43,7 +43,7 @@ using namespace Gui::Dialog; * Constructs a DlgSettingsColorGradientImp as a child of 'parent', with the * name 'name' and widget flags set to 'f'. */ -DlgSettingsColorGradientImp::DlgSettingsColorGradientImp( QWidget* parent, Qt::WFlags fl ) +DlgSettingsColorGradientImp::DlgSettingsColorGradientImp( QWidget* parent, Qt::WindowFlags fl ) : QDialog( parent, fl ) { this->setupUi(this); diff --git a/src/Gui/DlgSettingsColorGradientImp.h b/src/Gui/DlgSettingsColorGradientImp.h index 10f0ee875a..562a1dbdcf 100644 --- a/src/Gui/DlgSettingsColorGradientImp.h +++ b/src/Gui/DlgSettingsColorGradientImp.h @@ -41,7 +41,7 @@ class DlgSettingsColorGradientImp : public QDialog, public Ui_DlgSettingsColorGr Q_OBJECT public: - DlgSettingsColorGradientImp( QWidget* parent = 0, Qt::WFlags fl = 0 ); + DlgSettingsColorGradientImp( QWidget* parent = 0, Qt::WindowFlags fl = 0 ); ~DlgSettingsColorGradientImp(); void accept(); diff --git a/src/Gui/DlgSettingsDocumentImp.cpp b/src/Gui/DlgSettingsDocumentImp.cpp index cf95f8ed9d..3250964ac9 100644 --- a/src/Gui/DlgSettingsDocumentImp.cpp +++ b/src/Gui/DlgSettingsDocumentImp.cpp @@ -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(); diff --git a/src/Gui/DlgTipOfTheDayImp.cpp b/src/Gui/DlgTipOfTheDayImp.cpp index 5a4b8d1643..9085faefe6 100644 --- a/src/Gui/DlgTipOfTheDayImp.cpp +++ b/src/Gui/DlgTipOfTheDayImp.cpp @@ -48,9 +48,9 @@ using namespace Gui::Dialog; * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ -DlgTipOfTheDayImp::DlgTipOfTheDayImp( QWidget* parent, Qt::WFlags fl ) +DlgTipOfTheDayImp::DlgTipOfTheDayImp( QWidget* parent, Qt::WindowFlags fl ) : QDialog( parent, fl | Qt::WindowTitleHint | Qt::WindowSystemMenuHint ), WindowParameter("General") { @@ -104,7 +104,7 @@ void DlgTipOfTheDayImp::onResponseHeaderReceived(const QHttpResponseHeader & res { if (responseHeader.statusCode() != 200) { QString msg = tr("Download failed: %1\n").arg(responseHeader.reasonPhrase()); - Base::Console().Log(msg.toAscii()); + Base::Console().Log(msg.toLatin1()); _http->abort(); } } @@ -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("

You find the latest information.+

")); if (rx.indexIn(text) > -1) { // the text of interest @@ -143,7 +143,7 @@ void DlgTipOfTheDayImp::onStateChanged (int state) break; case QHttp::Closing: case QHttp::Unconnected: - Base::Console().Log("%s\n",(const char*)_http->errorString().toAscii()); + Base::Console().Log("%s\n",(const char*)_http->errorString().toLatin1()); break; default: break; diff --git a/src/Gui/DlgTipOfTheDayImp.h b/src/Gui/DlgTipOfTheDayImp.h index 8329069733..70860fba03 100644 --- a/src/Gui/DlgTipOfTheDayImp.h +++ b/src/Gui/DlgTipOfTheDayImp.h @@ -55,7 +55,7 @@ class DlgTipOfTheDayImp : public QDialog, public Ui_DlgTipOfTheDay, public Windo Q_OBJECT public: - DlgTipOfTheDayImp( QWidget* parent = 0, Qt::WFlags fl = 0 ); + DlgTipOfTheDayImp( QWidget* parent = 0, Qt::WindowFlags fl = 0 ); ~DlgTipOfTheDayImp(); void reload(); diff --git a/src/Gui/DlgToolbarsImp.cpp b/src/Gui/DlgToolbarsImp.cpp index 4d75ddd226..8ce87cfd76 100644 --- a/src/Gui/DlgToolbarsImp.cpp +++ b/src/Gui/DlgToolbarsImp.cpp @@ -64,7 +64,7 @@ struct GroupMap_find { * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ DlgCustomToolbars::DlgCustomToolbars(DlgCustomToolbars::Type t, QWidget* parent) : CustomizeActionPage(parent), type(t) @@ -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); } @@ -185,7 +185,7 @@ void DlgCustomToolbars::hideEvent(QHideEvent * event) { QVariant data = workbenchBox->itemData(workbenchBox->currentIndex(), Qt::UserRole); QString workbench = data.toString(); - exportCustomToolbars(workbench.toAscii()); + exportCustomToolbars(workbench.toLatin1()); CustomizeActionPage::hideEvent(event); } @@ -197,7 +197,7 @@ void DlgCustomToolbars::on_categoryBox_activated(int index) commandTreeWidget->clear(); CommandManager & cCmdMgr = Application::Instance->commandManager(); - std::vector aCmds = cCmdMgr.getGroupCommands(group.toAscii()); + std::vector aCmds = cCmdMgr.getGroupCommands(group.toLatin1()); // Create a separator item QTreeWidgetItem* sepitem = new QTreeWidgetItem(commandTreeWidget); @@ -235,7 +235,7 @@ void DlgCustomToolbars::on_workbenchBox_activated(int index) QString workbench = data.toString(); toolbarTreeWidget->clear(); - QByteArray workbenchname = workbench.toAscii(); + QByteArray workbenchname = workbench.toLatin1(); importCustomToolbars(workbenchname); } @@ -301,9 +301,9 @@ void DlgCustomToolbars::exportCustomToolbars(const QByteArray& workbench) CommandManager& rMgr = Application::Instance->commandManager(); for (int i=0; itopLevelItemCount(); 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.toAscii()); + ParameterGrp::handle hToolGrp = hGrp->GetGroup(groupName.toLatin1()); hToolGrp->SetASCII("Name", toolbarName.constData()); hToolGrp->SetBool("Active", toplevel->checkState(0) == Qt::Checked); @@ -352,7 +352,7 @@ void DlgCustomToolbars::on_moveActionRightButton_clicked() QVariant data = workbenchBox->itemData(workbenchBox->currentIndex(), Qt::UserRole); QString workbench = data.toString(); - exportCustomToolbars(workbench.toAscii()); + exportCustomToolbars(workbench.toLatin1()); } /** Removes an action */ @@ -386,7 +386,7 @@ void DlgCustomToolbars::on_moveActionLeftButton_clicked() QVariant data = workbenchBox->itemData(workbenchBox->currentIndex(), Qt::UserRole); QString workbench = data.toString(); - exportCustomToolbars(workbench.toAscii()); + exportCustomToolbars(workbench.toLatin1()); } /** Moves up an action */ @@ -424,7 +424,7 @@ void DlgCustomToolbars::on_moveActionUpButton_clicked() QVariant data = workbenchBox->itemData(workbenchBox->currentIndex(), Qt::UserRole); QString workbench = data.toString(); - exportCustomToolbars(workbench.toAscii()); + exportCustomToolbars(workbench.toLatin1()); } /** Moves down an action */ @@ -462,13 +462,13 @@ void DlgCustomToolbars::on_moveActionDownButton_clicked() QVariant data = workbenchBox->itemData(workbenchBox->currentIndex(), Qt::UserRole); QString workbench = data.toString(); - exportCustomToolbars(workbench.toAscii()); + exportCustomToolbars(workbench.toLatin1()); } 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 @@ -488,7 +488,7 @@ void DlgCustomToolbars::on_newButton_clicked() QVariant data = workbenchBox->itemData(workbenchBox->currentIndex(), Qt::UserRole); QString workbench = data.toString(); - exportCustomToolbars(workbench.toAscii()); + exportCustomToolbars(workbench.toLatin1()); addCustomToolbar(text); } } @@ -505,7 +505,7 @@ void DlgCustomToolbars::on_deleteButton_clicked() QVariant data = workbenchBox->itemData(workbenchBox->currentIndex(), Qt::UserRole); QString workbench = data.toString(); - exportCustomToolbars(workbench.toAscii()); + exportCustomToolbars(workbench.toLatin1()); } void DlgCustomToolbars::on_renameButton_clicked() @@ -537,7 +537,7 @@ void DlgCustomToolbars::on_renameButton_clicked() if (renamed) { QVariant data = workbenchBox->itemData(workbenchBox->currentIndex(), Qt::UserRole); QString workbench = data.toString(); - exportCustomToolbars(workbench.toAscii()); + exportCustomToolbars(workbench.toLatin1()); } } @@ -645,7 +645,7 @@ void DlgCustomToolbars::changeEvent(QEvent *e) * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ DlgCustomToolbarsImp::DlgCustomToolbarsImp( QWidget* parent ) : DlgCustomToolbars(DlgCustomToolbars::Toolbar, parent) @@ -894,7 +894,7 @@ void DlgCustomToolbarsImp::changeEvent(QEvent *e) * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ DlgCustomToolBoxbarsImp::DlgCustomToolBoxbarsImp( QWidget* parent ) : DlgCustomToolbars(DlgCustomToolbars::Toolboxbar, parent) diff --git a/src/Gui/DlgUnitsCalculatorImp.cpp b/src/Gui/DlgUnitsCalculatorImp.cpp index a2eefde939..5fa46410d1 100644 --- a/src/Gui/DlgUnitsCalculatorImp.cpp +++ b/src/Gui/DlgUnitsCalculatorImp.cpp @@ -40,9 +40,9 @@ using namespace Gui::Dialog; * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ -DlgUnitsCalculator::DlgUnitsCalculator( QWidget* parent, Qt::WFlags fl ) +DlgUnitsCalculator::DlgUnitsCalculator( QWidget* parent, Qt::WindowFlags fl ) : QDialog( parent, fl ) { // create widgets @@ -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(); } } diff --git a/src/Gui/DlgUnitsCalculatorImp.h b/src/Gui/DlgUnitsCalculatorImp.h index 32fe80debd..6afbc66ce0 100644 --- a/src/Gui/DlgUnitsCalculatorImp.h +++ b/src/Gui/DlgUnitsCalculatorImp.h @@ -38,7 +38,7 @@ class DlgUnitsCalculator : public QDialog, public Ui_DlgUnitCalculator Q_OBJECT public: - DlgUnitsCalculator( QWidget* parent = 0, Qt::WFlags fl = 0 ); + DlgUnitsCalculator( QWidget* parent = 0, Qt::WindowFlags fl = 0 ); ~DlgUnitsCalculator(); protected: diff --git a/src/Gui/DlgWorkbenchesImp.cpp b/src/Gui/DlgWorkbenchesImp.cpp index 5fcc31330b..7a04d12bbe 100644 --- a/src/Gui/DlgWorkbenchesImp.cpp +++ b/src/Gui/DlgWorkbenchesImp.cpp @@ -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,22 +237,22 @@ 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.toAscii()); + hGrp->SetASCII("Enabled", enabled_wbs.toLatin1()); 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.toAscii()); + hGrp->SetASCII("Disabled", disabled_wbs.toLatin1()); } #include "moc_DlgWorkbenchesImp.cpp" diff --git a/src/Gui/DockWindowManager.cpp b/src/Gui/DockWindowManager.cpp index 919abf84f5..608d856898 100644 --- a/src/Gui/DockWindowManager.cpp +++ b/src/Gui/DockWindowManager.cpp @@ -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; @@ -243,7 +243,7 @@ void DockWindowManager::removeDockWindow(QWidget* widget) void DockWindowManager::retranslate() { for (QList::Iterator it = d->_dockedWindows.begin(); it != d->_dockedWindows.end(); ++it) { - (*it)->setWindowTitle(QDockWidget::tr((*it)->objectName().toAscii())); + (*it)->setWindowTitle(QDockWidget::tr((*it)->objectName().toLatin1())); } } @@ -290,7 +290,7 @@ void DockWindowManager::setup(DockWindowItems* items) QList areas[4]; for (QList::ConstIterator it = dws.begin(); it != dws.end(); ++it) { QDockWidget* dw = findDockWidget(docked, it->name); - QByteArray dockName = it->name.toAscii(); + QByteArray dockName = it->name.toLatin1(); bool visible = hPref->GetBool(dockName.constData(), it->visibility); if (!dw) { diff --git a/src/Gui/Document.cpp b/src/Gui/Document.cpp index 27baf802ec..b0391a1ef8 100644 --- a/src/Gui/Document.cpp +++ b/src/Gui/Document.cpp @@ -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(" ")); @@ -891,7 +891,7 @@ void Document::SaveDocFile (Base::Writer &writer) const writer.incInd(); // indentation for camera settings writer.Stream() << writer.ind() << "" << std::endl; + << (const char*)viewPos.toLatin1() <<"\"/>" << std::endl; writer.decInd(); // indentation for camera settings writer.Stream() << "" << std::endl; } @@ -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); diff --git a/src/Gui/DownloadDialog.cpp b/src/Gui/DownloadDialog.cpp index 708a726bfa..07f3424c44 100644 --- a/src/Gui/DownloadDialog.cpp +++ b/src/Gui/DownloadDialog.cpp @@ -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); diff --git a/src/Gui/DownloadItem.cpp b/src/Gui/DownloadItem.cpp index b1d15ec7df..60a2dbfab0 100644 --- a/src/Gui/DownloadItem.cpp +++ b/src/Gui/DownloadItem.cpp @@ -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 hPath = App::GetApplication().GetUserParameter().GetGroup("BaseApp") @@ -367,12 +367,12 @@ void DownloadItem::open() if (doc) { for (SelectModule::Dict::iterator it = dict.begin(); it != dict.end(); ++it) { Gui::Application::Instance->importFrom(it.key().toUtf8(), - doc->getDocument()->getName(), it.value().toAscii()); + doc->getDocument()->getName(), it.value().toLatin1()); } } else { for (SelectModule::Dict::iterator it = dict.begin(); it != dict.end(); ++it) { - Gui::Application::Instance->open(it.key().toUtf8(), it.value().toAscii()); + Gui::Application::Instance->open(it.key().toUtf8(), it.value().toLatin1()); } } } diff --git a/src/Gui/EditorView.cpp b/src/Gui/EditorView.cpp index 5b25121bc8..d1737a3131 100644 --- a/src/Gui/EditorView.cpp +++ b/src/Gui/EditorView.cpp @@ -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); diff --git a/src/Gui/ExpressionBinding.cpp b/src/Gui/ExpressionBinding.cpp index e6719ce18c..fded5e08d3 100644 --- a/src/Gui/ExpressionBinding.cpp +++ b/src/Gui/ExpressionBinding.cpp @@ -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; diff --git a/src/Gui/ExpressionCompleter.cpp b/src/Gui/ExpressionCompleter.cpp index c98b6b9a74..fca8ca9d52 100644 --- a/src/Gui/ExpressionCompleter.cpp +++ b/src/Gui/ExpressionCompleter.cpp @@ -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); } diff --git a/src/Gui/FileDialog.cpp b/src/Gui/FileDialog.cpp index 9ce080fdd0..81ac72747a 100644 --- a/src/Gui/FileDialog.cpp +++ b/src/Gui/FileDialog.cpp @@ -366,7 +366,7 @@ void FileDialog::setWorkingDirectory(const QString& dir) /* TRANSLATOR Gui::FileOptionsDialog */ -FileOptionsDialog::FileOptionsDialog( QWidget* parent, Qt::WFlags fl ) +FileOptionsDialog::FileOptionsDialog( QWidget* parent, Qt::WindowFlags fl ) : QFileDialog( parent, fl ) { extensionButton = new QPushButton( this ); @@ -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::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; } @@ -799,19 +799,19 @@ SelectModule::Dict SelectModule::exportHandler(const QStringList& fileNames, con for (QStringList::const_iterator it = fileNames.begin(); it != fileNames.end(); ++it) { QFileInfo fi(*it); QString ext = fi.completeSuffix().toLower(); - std::map filters = App::GetApplication().getExportFilters(ext.toAscii()); + std::map filters = App::GetApplication().getExportFilters(ext.toLatin1()); if (filters.empty()) { ext = fi.suffix().toLower(); - filters = App::GetApplication().getExportFilters(ext.toAscii()); + filters = App::GetApplication().getExportFilters(ext.toLatin1()); } fileExtension[ext].push_back(*it); for (std::map::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::const_iterator it = filetypeHandler.begin(); @@ -846,7 +846,7 @@ SelectModule::Dict SelectModule::importHandler(const QStringList& fileNames, con std::map::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; } @@ -861,19 +861,19 @@ SelectModule::Dict SelectModule::importHandler(const QStringList& fileNames, con for (QStringList::const_iterator it = fileNames.begin(); it != fileNames.end(); ++it) { QFileInfo fi(*it); QString ext = fi.completeSuffix().toLower(); - std::map filters = App::GetApplication().getImportFilters(ext.toAscii()); + std::map filters = App::GetApplication().getImportFilters(ext.toLatin1()); if (filters.empty()) { ext = fi.suffix().toLower(); - filters = App::GetApplication().getImportFilters(ext.toAscii()); + filters = App::GetApplication().getImportFilters(ext.toLatin1()); } fileExtension[ext].push_back(*it); for (std::map::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::const_iterator it = filetypeHandler.begin(); diff --git a/src/Gui/FileDialog.h b/src/Gui/FileDialog.h index 4d2c119b7c..ca98b14be9 100644 --- a/src/Gui/FileDialog.h +++ b/src/Gui/FileDialog.h @@ -88,7 +88,7 @@ public: ExtensionBottom = 1 }; - FileOptionsDialog ( QWidget* parent, Qt::WFlags ); + FileOptionsDialog ( QWidget* parent, Qt::WindowFlags ); virtual ~FileOptionsDialog(); void accept(); diff --git a/src/Gui/GestureNavigationStyle.cpp b/src/Gui/GestureNavigationStyle.cpp index efafd26076..37baea4a67 100644 --- a/src/Gui/GestureNavigationStyle.cpp +++ b/src/Gui/GestureNavigationStyle.cpp @@ -192,7 +192,7 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev) const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev; const int button = event->getButton(); const SbBool press //the button was pressed (if false -> released) - = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE; + = event->getState() == SoButtonEvent::DOWN ? true : false; switch (button) { case SoMouseButtonEvent::BUTTON1: this->button1down = press; @@ -268,7 +268,7 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev) //----------all this were preparations. Now comes the event handling! ---------- - SbBool processed = FALSE;//a return value for the BlahblahblahNavigationStyle::processSoEvent + SbBool processed = false;//a return value for the BlahblahblahNavigationStyle::processSoEvent bool propagated = false;//an internal flag indicating that the event has been already passed to inherited, to suppress the automatic doing of this at the end. //goto finalize = return processed. Might be important to do something before done (none now). @@ -282,10 +282,10 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev) // Mode-independent keyboard handling if (evIsKeyboard) { const SoKeyboardEvent * const event = (const SoKeyboardEvent *) ev; - const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE; + const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false; switch (event->getKey()) { case SoKeyboardEvent::H: - processed = TRUE; + processed = true; if(!press){ SbBool ret = NavigationStyle::lookAtPoint(event->getPosition()); if(!ret){ @@ -306,7 +306,7 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev) const SoMotion3Event * const event = static_cast(ev); if (event) this->processMotionEvent(event); - processed = TRUE; + processed = true; } if (processed) goto finalize; @@ -321,7 +321,7 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev) //keyboard if (evIsKeyboard) { const SoKeyboardEvent * const event = (const SoKeyboardEvent *) ev; - const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE; + const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false; switch(event->getKey()){ case SoKeyboardEvent::S: @@ -335,15 +335,15 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev) break; case SoKeyboardEvent::PAGE_UP: if(press){ - doZoom(viewer->getSoRenderManager()->getCamera(), TRUE, posn); + doZoom(viewer->getSoRenderManager()->getCamera(), true, posn); } - processed = TRUE; + processed = true; break; case SoKeyboardEvent::PAGE_DOWN: if(press){ - doZoom(viewer->getSoRenderManager()->getCamera(), FALSE, posn); + doZoom(viewer->getSoRenderManager()->getCamera(), false, posn); } - processed = TRUE; + processed = true; break; default: break; @@ -358,7 +358,7 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev) const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev; const int button = event->getButton(); const SbBool press //the button was pressed (if false -> released) - = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE; + = event->getState() == SoButtonEvent::DOWN ? true : false; switch(button){ case SoMouseButtonEvent::BUTTON1: case SoMouseButtonEvent::BUTTON2: @@ -399,7 +399,7 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev) } break; case SoMouseButtonEvent::BUTTON3://press the wheel - processed = TRUE; + processed = true; if(press){ SbBool ret = NavigationStyle::lookAtPoint(event->getPosition()); if(!ret){ @@ -409,12 +409,12 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev) } break; case SoMouseButtonEvent::BUTTON4: //(wheel?) - doZoom(viewer->getSoRenderManager()->getCamera(), TRUE, posn); - processed = TRUE; + doZoom(viewer->getSoRenderManager()->getCamera(), true, posn); + processed = true; break; case SoMouseButtonEvent::BUTTON5: //(wheel?) - doZoom(viewer->getSoRenderManager()->getCamera(), FALSE, posn); - processed = TRUE; + doZoom(viewer->getSoRenderManager()->getCamera(), false, posn); + processed = true; break; } } @@ -479,7 +479,7 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev) const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev; const int button = event->getButton(); //const SbBool press //the button was pressed (if false -> released) - // = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE; + // = event->getState() == SoButtonEvent::DOWN ? true : false; switch(button){ case SoMouseButtonEvent::BUTTON1: case SoMouseButtonEvent::BUTTON2: @@ -502,23 +502,23 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev) //const SoLocation2Event * const event = (const SoLocation2Event *) ev; if (curmode == NavigationStyle::ZOOMING) {//doesn't happen this->zoomByCursor(posn, prevnormalized); - processed = TRUE; + processed = true; } else if (curmode == NavigationStyle::PANNING) { panCamera(viewer->getSoRenderManager()->getCamera(), ratio, this->panningplane, posn, prevnormalized); - processed = TRUE; + processed = true; } else if (curmode == NavigationStyle::DRAGGING) { if (comboAfter & BUTTON1DOWN && comboAfter & BUTTON2DOWN) { //two mouse buttons down - tilting! NavigationStyle::doRotate(viewer->getSoRenderManager()->getCamera(), (posn - prevnormalized)[0]*(-2), SbVec2f(0.5,0.5)); - processed = TRUE; + processed = true; } else {//one mouse button - normal spinning //this will also handle the single-finger drag (there's no gesture used, pseudomouse is enough) //this->addToLog(event->getPosition(), event->getTime()); this->spin_simplified(viewer->getSoRenderManager()->getCamera(), posn, prevnormalized); - processed = TRUE; + processed = true; } } } @@ -564,7 +564,7 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev) if (evIsButton) { const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev; const int button = event->getButton(); - const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE; + const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false; if (button == SoMouseButtonEvent::BUTTON1 && press) { this->seekToPoint(pos); // implicitly calls interactiveCountInc() this->setViewingMode(NavigationStyle::SEEK_MODE); diff --git a/src/Gui/GraphvizView.cpp b/src/Gui/GraphvizView.cpp index bd7bf39c79..a0d5e8ea33 100644 --- a/src/Gui/GraphvizView.cpp +++ b/src/Gui/GraphvizView.cpp @@ -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); diff --git a/src/Gui/HelpView.cpp b/src/Gui/HelpView.cpp index bd4773afe4..0a86d3ad1b 100644 --- a/src/Gui/HelpView.cpp +++ b/src/Gui/HelpView.cpp @@ -95,8 +95,8 @@ TextBrowser::TextBrowser(QWidget * parent) setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - setAcceptDrops( TRUE ); - viewport()->setAcceptDrops( TRUE ); + setAcceptDrops( true ); + viewport()->setAcceptDrops( true ); connect( d->http, SIGNAL(done(bool)), this, SLOT(done(bool))); connect( d->http, SIGNAL(stateChanged(int)), this, SLOT(onStateChanged(int))); @@ -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( "" "" "" @@ -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( "" "" "" @@ -469,12 +469,12 @@ void TextBrowser::dropEvent(QDropEvent * e) dataStream >> action; CommandManager& rclMan = Application::Instance->commandManager(); - Command* pCmd = rclMan.getCommandByName(action.toAscii()); + Command* pCmd = rclMan.getCommandByName(action.toLatin1()); if ( pCmd ) { QString info = pCmd->getAction()->whatsThis(); if ( !info.isEmpty() ) { // cannot show help to this command - info = QString::fromAscii( + info = QString::fromLatin1( "" "" "" @@ -482,7 +482,7 @@ void TextBrowser::dropEvent(QDropEvent * e) "" "" ).arg( info ); } else { - info = QString::fromAscii( + info = QString::fromLatin1( "" "" "" diff --git a/src/Gui/InputField.cpp b/src/Gui/InputField.cpp index 2d3b2bb575..122e324368 100644 --- a/src/Gui/InputField.cpp +++ b/src/Gui/InputField.cpp @@ -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); diff --git a/src/Gui/InputVector.cpp b/src/Gui/InputVector.cpp index 21eb36f6d7..ca267b405a 100644 --- a/src/Gui/InputVector.cpp +++ b/src/Gui/InputVector.cpp @@ -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); @@ -219,7 +219,7 @@ void LocationWidget::on_direction_activated(int index) // ---------------------------------------------------------------------------- -LocationDialog::LocationDialog(QWidget* parent, Qt::WFlags fl) +LocationDialog::LocationDialog(QWidget* parent, Qt::WindowFlags fl) : QDialog(parent, fl) { } diff --git a/src/Gui/InputVector.h b/src/Gui/InputVector.h index bd9d41f99b..484c2c2dd1 100644 --- a/src/Gui/InputVector.h +++ b/src/Gui/InputVector.h @@ -80,7 +80,7 @@ class GuiExport LocationDialog : public QDialog Q_OBJECT protected: - LocationDialog(QWidget* parent = 0, Qt::WFlags fl = 0); + LocationDialog(QWidget* parent = 0, Qt::WindowFlags fl = 0); virtual ~LocationDialog(); protected: @@ -113,7 +113,7 @@ template class LocationInterface : public LocationDialog, public Ui { public: - LocationInterface(QWidget* parent = 0, Qt::WFlags fl = 0) : LocationDialog(parent, fl) + LocationInterface(QWidget* parent = 0, Qt::WindowFlags fl = 0) : LocationDialog(parent, fl) { this->setupUi(this); this->retranslate(); @@ -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); @@ -359,7 +359,7 @@ template class LocationDialogComp : public LocationDialog { public: - LocationDialogComp(QWidget* parent = 0, Qt::WFlags fl = 0) + LocationDialogComp(QWidget* parent = 0, Qt::WindowFlags fl = 0) : LocationDialog(parent, fl), ui(this) { } diff --git a/src/Gui/InventorNavigationStyle.cpp b/src/Gui/InventorNavigationStyle.cpp index f50f001395..12aed4c390 100644 --- a/src/Gui/InventorNavigationStyle.cpp +++ b/src/Gui/InventorNavigationStyle.cpp @@ -98,11 +98,11 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev) this->lastmouseposition = posn; - // Set to TRUE if any event processing happened. Note that it is not + // Set to true if any event processing happened. Note that it is not // necessary to restrict ourselves to only do one "action" for an // event, we only need this flag to see if any processing happened // at all. - SbBool processed = FALSE; + SbBool processed = false; const ViewerMode curmode = this->currentmode; ViewerMode newmode = curmode; @@ -123,13 +123,13 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev) if (!processed && !viewer->isEditing()) { processed = handleEventInForeground(ev); if (processed) - return TRUE; + return true; } // Keyboard handling if (type.isDerivedFrom(SoKeyboardEvent::getClassTypeId())) { const SoKeyboardEvent * const event = (const SoKeyboardEvent *) ev; - const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE; + const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false; switch (event->getKey()) { case SoKeyboardEvent::LEFT_CONTROL: case SoKeyboardEvent::RIGHT_CONTROL: @@ -144,7 +144,7 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev) this->altdown = press; break; case SoKeyboardEvent::H: - processed = TRUE; + processed = true; viewer->saveHomePosition(); break; case SoKeyboardEvent::S: @@ -165,7 +165,7 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev) if (type.isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) { const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev; const int button = event->getButton(); - const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE; + const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false; // SoDebugError::postInfo("processSoEvent", "button = %d", button); switch (button) { @@ -177,7 +177,7 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev) float ratio = vp.getViewportAspectRatio(); SbViewVolume vv = viewer->getSoRenderManager()->getCamera()->getViewVolume(ratio); this->panningplane = vv.getPlane(viewer->getSoRenderManager()->getCamera()->focalDistance.getValue()); - this->lockrecenter = FALSE; + this->lockrecenter = false; } else if (!press && ev->wasShiftDown() && (this->currentmode != NavigationStyle::SELECTION)) { @@ -189,34 +189,34 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev) panToCenter(panningplane, posn); this->interactiveCountDec(); } - processed = TRUE; + processed = true; } } else if (press && (this->currentmode == NavigationStyle::SEEK_WAIT_MODE)) { newmode = NavigationStyle::SEEK_MODE; this->seekToPoint(pos); // implicitly calls interactiveCountInc() - processed = TRUE; - this->lockrecenter = TRUE; + processed = true; + this->lockrecenter = true; } else if (press && (this->currentmode == NavigationStyle::IDLE)) { this->setViewing(true); - processed = TRUE; - this->lockrecenter = TRUE; + processed = true; + this->lockrecenter = true; } else if (!press && (this->currentmode == NavigationStyle::DRAGGING)) { this->setViewing(false); - processed = TRUE; - this->lockrecenter = TRUE; + processed = true; + this->lockrecenter = true; } else if (viewer->isEditing() && (this->currentmode == NavigationStyle::SPINNING)) { - processed = TRUE; - this->lockrecenter = TRUE; + processed = true; + this->lockrecenter = true; } break; case SoMouseButtonEvent::BUTTON2: // If we are in edit mode then simply ignore the RMB events // to pass the event to the base class. - this->lockrecenter = TRUE; + this->lockrecenter = true; if (!viewer->isEditing()) { // If we are in zoom or pan mode ignore RMB events otherwise // the canvas doesn't get any release events @@ -237,7 +237,7 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev) float ratio = vp.getViewportAspectRatio(); SbViewVolume vv = viewer->getSoRenderManager()->getCamera()->getViewVolume(ratio); this->panningplane = vv.getPlane(viewer->getSoRenderManager()->getCamera()->focalDistance.getValue()); - this->lockrecenter = FALSE; + this->lockrecenter = false; } else { SbTime tmp = (ev->getTime() - this->centerTime); @@ -248,18 +248,18 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev) panToCenter(panningplane, posn); this->interactiveCountDec(); } - processed = TRUE; + processed = true; } } this->button3down = press; break; case SoMouseButtonEvent::BUTTON4: - doZoom(viewer->getSoRenderManager()->getCamera(), TRUE, posn); - processed = TRUE; + doZoom(viewer->getSoRenderManager()->getCamera(), true, posn); + processed = true; break; case SoMouseButtonEvent::BUTTON5: - doZoom(viewer->getSoRenderManager()->getCamera(), FALSE, posn); - processed = TRUE; + doZoom(viewer->getSoRenderManager()->getCamera(), false, posn); + processed = true; break; default: break; @@ -268,22 +268,22 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev) // Mouse Movement handling if (type.isDerivedFrom(SoLocation2Event::getClassTypeId())) { - this->lockrecenter = TRUE; + this->lockrecenter = true; const SoLocation2Event * const event = (const SoLocation2Event *) ev; if (this->currentmode == NavigationStyle::ZOOMING) { this->zoomByCursor(posn, prevnormalized); - processed = TRUE; + processed = true; } else if (this->currentmode == NavigationStyle::PANNING) { float ratio = vp.getViewportAspectRatio(); panCamera(viewer->getSoRenderManager()->getCamera(), ratio, this->panningplane, posn, prevnormalized); - processed = TRUE; + processed = true; } else if (this->currentmode == NavigationStyle::DRAGGING) { this->addToLog(event->getPosition(), event->getTime()); this->spin(posn); moveCursorPosition(); - processed = TRUE; + processed = true; } } @@ -292,7 +292,7 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev) const SoMotion3Event * const event = static_cast(ev); if (event) this->processMotionEvent(event); - processed = TRUE; + processed = true; } enum { @@ -370,7 +370,7 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev) viewer->isEditing()) && !processed) processed = inherited::processSoEvent(ev); else - return TRUE; + return true; return processed; } diff --git a/src/Gui/Language/Translator.cpp b/src/Gui/Language/Translator.cpp index 101701eb31..b6dce1885a 100644 --- a/src/Gui/Language/Translator.cpp +++ b/src/Gui/Language/Translator.cpp @@ -171,7 +171,7 @@ TStringList Translator::supportedLanguages() const QDir dir(QLatin1String(":/translations")); for (std::map::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::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; diff --git a/src/Gui/MDIView.cpp b/src/Gui/MDIView.cpp index 3d32ddc44f..9bf3cb0d5d 100644 --- a/src/Gui/MDIView.cpp +++ b/src/Gui/MDIView.cpp @@ -44,7 +44,7 @@ using namespace Gui; TYPESYSTEM_SOURCE_ABSTRACT(Gui::MDIView,Gui::BaseView); -MDIView::MDIView(Gui::Document* pcDocument,QWidget* parent, Qt::WFlags wflags) +MDIView::MDIView(Gui::Document* pcDocument,QWidget* parent, Qt::WindowFlags wflags) : QMainWindow(parent, wflags), BaseView(pcDocument),currentMode(Child), wstate(Qt::WindowNoState) { setAttribute(Qt::WA_DeleteOnClose); @@ -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); } } diff --git a/src/Gui/MDIView.h b/src/Gui/MDIView.h index 4012f1e06e..5892169c10 100644 --- a/src/Gui/MDIView.h +++ b/src/Gui/MDIView.h @@ -60,7 +60,7 @@ public: * the view will attach to the active document. Be aware, there isn't * always an active document. */ - MDIView(Gui::Document* pcDocument, QWidget* parent, Qt::WFlags wflags=0); + MDIView(Gui::Document* pcDocument, QWidget* parent, Qt::WindowFlags wflags=0); /** View destructor * Detach the view from the document, if attached. */ diff --git a/src/Gui/Macro.cpp b/src/Gui/Macro.cpp index d077cafbd5..4489607a45 100644 --- a/src/Gui/Macro.cpp +++ b/src/Gui/Macro.cpp @@ -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))); } } diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp index 6d4767aa1f..2c6649f65d 100644 --- a/src/Gui/MainWindow.cpp +++ b/src/Gui/MainWindow.cpp @@ -236,7 +236,7 @@ protected: /* TRANSLATOR Gui::MainWindow */ -MainWindow::MainWindow(QWidget * parent, Qt::WFlags f) +MainWindow::MainWindow(QWidget * parent, Qt::WindowFlags f) : QMainWindow( parent, f/*WDestructiveClose*/ ) { d = new MainWindowP; @@ -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 - (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::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); @@ -1444,10 +1444,10 @@ void MainWindow::loadUrls(App::Document* doc, const QList& url) if (info.isSymLink()) info.setFile(info.readLink()); std::vector module = App::GetApplication() - .getImportModules(info.completeSuffix().toAscii()); + .getImportModules(info.completeSuffix().toLatin1()); if (module.empty()) { module = App::GetApplication() - .getImportModules(info.suffix().toAscii()); + .getImportModules(info.suffix().toLatin1()); } if (!module.empty()) { // ok, we support files with this extension @@ -1483,7 +1483,7 @@ void MainWindow::loadUrls(App::Document* doc, const QList& url) // load the files with the associated modules for (SelectModule::Dict::iterator it = dict.begin(); it != dict.end(); ++it) { // if the passed document name doesn't exist the module should create it, if needed - Application::Instance->importFrom(it.key().toUtf8(), docName, it.value().toAscii()); + Application::Instance->importFrom(it.key().toUtf8(), docName, it.value().toLatin1()); } } @@ -1576,7 +1576,7 @@ void MainWindow::customEvent(QEvent* e) if (d) { ViewProviderExtern *view = new ViewProviderExtern(); try { - view->setModeByString("1",msg.toAscii().constData()); + view->setModeByString("1",msg.toLatin1().constData()); d->setAnnotationViewProvider("Vdbg",view); } catch (...) { @@ -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 &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("%2").arg(this->msg).arg(QString::fromUtf8(m)); + QString txt = QString::fromLatin1("%2").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("%2").arg(this->wrn).arg(QString::fromUtf8(m)); + QString txt = QString::fromLatin1("%2").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("%2").arg(this->err).arg(QString::fromUtf8(m)); + QString txt = QString::fromLatin1("%2").arg(this->err).arg(QString::fromUtf8(m)); CustomMessageEvent* ev = new CustomMessageEvent(CustomMessageEvent::Err, txt); QApplication::postEvent(getMainWindow(), ev); } diff --git a/src/Gui/MainWindow.h b/src/Gui/MainWindow.h index 1c0fc6904e..0409a78e19 100644 --- a/src/Gui/MainWindow.h +++ b/src/Gui/MainWindow.h @@ -68,7 +68,7 @@ public: * Constructs an empty main window. For default \a parent is 0, as there usually is * no toplevel window there. */ - MainWindow(QWidget * parent = 0, Qt::WFlags f = Qt::Window); + MainWindow(QWidget * parent = 0, Qt::WindowFlags f = Qt::Window); /** Destroys the object and frees any allocated resources. */ ~MainWindow(); /** diff --git a/src/Gui/ManualAlignment.cpp b/src/Gui/ManualAlignment.cpp index b673aeddb6..b7bfb1a01c 100644 --- a/src/Gui/ManualAlignment.cpp +++ b/src/Gui/ManualAlignment.cpp @@ -332,7 +332,7 @@ class AlignmentView : public Gui::AbstractSplitView public: QLabel* myLabel; - AlignmentView(Gui::Document* pcDocument, QWidget* parent, QGLWidget* shareWidget=0, Qt::WFlags wflags=0) + AlignmentView(Gui::Document* pcDocument, QWidget* parent, QGLWidget* shareWidget=0, Qt::WindowFlags wflags=0) : AbstractSplitView(pcDocument, parent, wflags) { QSplitter* mainSplitter=0; @@ -489,7 +489,7 @@ public: rot_cam1 = rot; // copy the values - cam2->enableNotify(FALSE); + cam2->enableNotify(false); cam2->nearDistance = cam1->nearDistance; cam2->farDistance = cam1->farDistance; cam2->focalDistance = cam1->focalDistance; @@ -512,7 +512,7 @@ public: static_cast(cam1)->height; } - cam2->enableNotify(TRUE); + cam2->enableNotify(true); } static void syncCameraCB(void * data, SoSensor * s) diff --git a/src/Gui/MayaGestureNavigationStyle.cpp b/src/Gui/MayaGestureNavigationStyle.cpp index 1661d976f3..a2c5e1ee4a 100644 --- a/src/Gui/MayaGestureNavigationStyle.cpp +++ b/src/Gui/MayaGestureNavigationStyle.cpp @@ -202,7 +202,7 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev) const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev; const int button = event->getButton(); const SbBool press //the button was pressed (if false -> released) - = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE; + = event->getState() == SoButtonEvent::DOWN ? true : false; switch (button) { case SoMouseButtonEvent::BUTTON1: this->button1down = press; @@ -278,7 +278,7 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev) //----------all this were preparations. Now comes the event handling! ---------- - SbBool processed = FALSE;//a return value for the BlahblahblahNavigationStyle::processSoEvent + SbBool processed = false;//a return value for the BlahblahblahNavigationStyle::processSoEvent bool propagated = false;//an internal flag indicating that the event has been already passed to inherited, to suppress the automatic doing of this at the end. //goto finalize = return processed. Might be important to do something before done (none now). @@ -292,10 +292,10 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev) // Mode-independent keyboard handling if (evIsKeyboard) { const SoKeyboardEvent * const event = (const SoKeyboardEvent *) ev; - const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE; + const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false; switch (event->getKey()) { case SoKeyboardEvent::H: - processed = TRUE; + processed = true; if(!press){ SbBool ret = NavigationStyle::lookAtPoint(event->getPosition()); if(!ret){ @@ -316,7 +316,7 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev) const SoMotion3Event * const event = static_cast(ev); if (event) this->processMotionEvent(event); - processed = TRUE; + processed = true; } if (processed) goto finalize; @@ -331,7 +331,7 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev) //keyboard if (evIsKeyboard) { const SoKeyboardEvent * const event = (const SoKeyboardEvent *) ev; - const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE; + const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false; switch(event->getKey()){ case SoKeyboardEvent::S: @@ -345,15 +345,15 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev) break; case SoKeyboardEvent::PAGE_UP: if(press){ - doZoom(viewer->getSoRenderManager()->getCamera(), TRUE, posn); + doZoom(viewer->getSoRenderManager()->getCamera(), true, posn); } - processed = TRUE; + processed = true; break; case SoKeyboardEvent::PAGE_DOWN: if(press){ - doZoom(viewer->getSoRenderManager()->getCamera(), FALSE, posn); + doZoom(viewer->getSoRenderManager()->getCamera(), false, posn); } - processed = TRUE; + processed = true; break; default: break; @@ -368,7 +368,7 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev) const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev; const int button = event->getButton(); const SbBool press //the button was pressed (if false -> released) - = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE; + = event->getState() == SoButtonEvent::DOWN ? true : false; switch(button){ case SoMouseButtonEvent::BUTTON1: case SoMouseButtonEvent::BUTTON2: @@ -420,15 +420,15 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev) "No object under cursor! Can't set new center of rotation.\n"); } } - processed = TRUE; + processed = true; break; case SoMouseButtonEvent::BUTTON4: //(wheel?) - doZoom(viewer->getSoRenderManager()->getCamera(), TRUE, posn); - processed = TRUE; + doZoom(viewer->getSoRenderManager()->getCamera(), true, posn); + processed = true; break; case SoMouseButtonEvent::BUTTON5: //(wheel?) - doZoom(viewer->getSoRenderManager()->getCamera(), FALSE, posn); - processed = TRUE; + doZoom(viewer->getSoRenderManager()->getCamera(), false, posn); + processed = true; break; } } @@ -516,23 +516,23 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev) if (evIsLoc2 && ! this->inGesture && this->mouseMoveThresholdBroken) { if (curmode == NavigationStyle::ZOOMING) {//doesn't happen this->zoomByCursor(posn, prevnormalized); - processed = TRUE; + processed = true; } else if (curmode == NavigationStyle::PANNING) { panCamera(viewer->getSoRenderManager()->getCamera(), ratio, this->panningplane, posn, prevnormalized); - processed = TRUE; + processed = true; } else if (curmode == NavigationStyle::DRAGGING) { if (comboAfter & BUTTON1DOWN && comboAfter & BUTTON2DOWN) { //two mouse buttons down - tilting! NavigationStyle::doRotate(viewer->getSoRenderManager()->getCamera(), (posn - prevnormalized)[0]*(-2), SbVec2f(0.5,0.5)); - processed = TRUE; + processed = true; } else {//one mouse button - normal spinning //this will also handle the single-finger drag (there's no gesture used, pseudomouse is enough) //this->addToLog(event->getPosition(), event->getTime()); this->spin_simplified(viewer->getSoRenderManager()->getCamera(), posn, prevnormalized); - processed = TRUE; + processed = true; } } } @@ -578,7 +578,7 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev) if (evIsButton) { const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev; const int button = event->getButton(); - const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE; + const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false; if (button == SoMouseButtonEvent::BUTTON1 && press) { this->seekToPoint(pos); // implicitly calls interactiveCountInc() this->setViewingMode(NavigationStyle::SEEK_MODE); diff --git a/src/Gui/MenuManager.cpp b/src/Gui/MenuManager.cpp index 3d01a2497c..2163562115 100644 --- a/src/Gui/MenuManager.cpp +++ b/src/Gui/MenuManager.cpp @@ -198,7 +198,7 @@ void MenuManager::setup(MenuItem* menuItems) const for (QList::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 actions = menu->actions(); for (QList::ConstIterator it = items.begin(); it != items.end(); ++it) { // search for the menu item - QList used_actions = findActions(actions, QString::fromAscii((*it)->command().c_str())); + QList 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); } } diff --git a/src/Gui/MouseSelection.cpp b/src/Gui/MouseSelection.cpp index e391ef6918..9887ab026f 100644 --- a/src/Gui/MouseSelection.cpp +++ b/src/Gui/MouseSelection.cpp @@ -90,7 +90,7 @@ int AbstractMouseSelection::handleEvent(const SoEvent* const ev, const SbViewpor if (ev->getTypeId().isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) { const SoMouseButtonEvent* const event = (const SoMouseButtonEvent*) ev; - const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE; + const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false; if (press) { _clPoly.push_back(ev->getPosition()); @@ -311,7 +311,7 @@ int PolyPickerSelection::popupMenu() int PolyPickerSelection::mouseButtonEvent(const SoMouseButtonEvent* const e, const QPoint& pos) { const int button = e->getButton(); - const SbBool press = e->getState() == SoButtonEvent::DOWN ? TRUE : FALSE; + const SbBool press = e->getState() == SoButtonEvent::DOWN ? true : false; if (press) { switch(button) @@ -501,7 +501,7 @@ int BrushSelection::popupMenu() int BrushSelection::mouseButtonEvent(const SoMouseButtonEvent* const e, const QPoint& pos) { const int button = e->getButton(); - const SbBool press = e->getState() == SoButtonEvent::DOWN ? TRUE : FALSE; + const SbBool press = e->getState() == SoButtonEvent::DOWN ? true : false; if (press) { switch(button) @@ -658,7 +658,7 @@ void RubberbandSelection::draw() int RubberbandSelection::mouseButtonEvent(const SoMouseButtonEvent* const e, const QPoint& pos) { const int button = e->getButton(); - const SbBool press = e->getState() == SoButtonEvent::DOWN ? TRUE : FALSE; + const SbBool press = e->getState() == SoButtonEvent::DOWN ? true : false; int ret = Continue; diff --git a/src/Gui/NavigationStyle.cpp b/src/Gui/NavigationStyle.cpp index 66c65ddec0..0e3eaa5151 100644 --- a/src/Gui/NavigationStyle.cpp +++ b/src/Gui/NavigationStyle.cpp @@ -64,9 +64,9 @@ struct NavigationStyleP { { this->animationsteps = 0; this->sensitivity = 2.0f; - this->resetcursorpos = FALSE; - this->dragPointFound = FALSE; - this->dragAtCursor = FALSE; + this->resetcursorpos = false; + this->dragPointFound = false; + this->dragAtCursor = false; } static void viewAnimationCB(void * data, SoSensor * sensor); }; @@ -81,7 +81,7 @@ public: Trackball }; - FCSphereSheetProjector(const SbSphere & sph, const SbBool orienttoeye = TRUE) + FCSphereSheetProjector(const SbSphere & sph, const SbBool orienttoeye = true) : SbSphereSheetProjector(sph, orienttoeye), orbit(Trackball) { } @@ -205,7 +205,7 @@ void NavigationStyle::initialize() { this->currentmode = NavigationStyle::IDLE; this->prevRedrawTime = SbTime::getTimeOfDay(); - this->spinanimatingallowed = TRUE; + this->spinanimatingallowed = true; this->spinsamplecounter = 0; this->spinincrement = SbRotation::identity(); this->spinRotation.setValue(SbVec3f(0, 0, -1), 0); @@ -223,13 +223,13 @@ void NavigationStyle::initialize() this->log.time = new SbTime [ 16 ]; this->log.historysize = 0; - this->menuenabled = TRUE; - this->button1down = FALSE; - this->button2down = FALSE; - this->button3down = FALSE; - this->ctrldown = FALSE; - this->shiftdown = FALSE; - this->altdown = FALSE; + this->menuenabled = true; + this->button1down = false; + this->button2down = false; + this->button3down = false; + this->ctrldown = false; + this->shiftdown = false; + this->altdown = false; this->invertZoom = App::GetApplication().GetParameterGroupByPath ("User parameter:BaseApp/Preferences/View")->GetBool("InvertZoom",true); this->zoomAtCursor = App::GetApplication().GetParameterGroupByPath @@ -305,7 +305,7 @@ void NavigationStyle::seekToPoint(const SbVec3f& scenepos) SbBool NavigationStyle::lookAtPoint(const SbVec2s screenpos) { SoCamera* cam = viewer->getSoRenderManager()->getCamera(); - if (cam == 0) return FALSE; + if (cam == 0) return false; SoRayPickAction rpaction(viewer->getSoRenderManager()->getViewportRegion()); rpaction.setPoint(screenpos); @@ -315,20 +315,20 @@ SbBool NavigationStyle::lookAtPoint(const SbVec2s screenpos) SoPickedPoint * picked = rpaction.getPickedPoint(); if (!picked) { this->interactiveCountInc(); - return FALSE; + return false; } SbVec3f hitpoint; hitpoint = picked->getPoint(); lookAtPoint(hitpoint); - return TRUE; + return true; } void NavigationStyle::lookAtPoint(const SbVec3f& pos) { SoCamera* cam = viewer->getSoRenderManager()->getCamera(); if (cam == 0) return; - PRIVATE(this)->dragPointFound = FALSE; + PRIVATE(this)->dragPointFound = false; // Find global coordinates of focal point. SbVec3f direction; @@ -661,7 +661,7 @@ void NavigationStyle::panToCenter(const SbPlane & pplane, const SbVec2f & currpo const SbViewportRegion & vp = viewer->getSoRenderManager()->getViewportRegion(); float ratio = vp.getViewportAspectRatio(); panCamera(viewer->getSoRenderManager()->getCamera(), ratio, pplane, SbVec2f(0.5,0.5), currpos); - PRIVATE(this)->dragPointFound = FALSE; + PRIVATE(this)->dragPointFound = false; } /** Dependent on the camera type this will either shrink or expand the @@ -693,12 +693,12 @@ void NavigationStyle::zoom(SoCamera * cam, float diffvalue) // frustum (similar to glFrustum()) if (!t.isDerivedFrom(SoPerspectiveCamera::getClassTypeId()) && tname != "FrustumCamera") { - /* static SbBool first = TRUE; + /* static SbBool first = true; if (first) { SoDebugError::postWarning("SoGuiFullViewerP::zoom", "Unknown camera type, " "will zoom by moving position, but this might not be correct."); - first = FALSE; + first = false; }*/ } @@ -975,12 +975,12 @@ SbBool NavigationStyle::doSpin() rot.getValue(axis, radians); if ((radians > 0.01f) && (deltatime < 0.300)) { this->spinRotation = rot; - return TRUE; + return true; } } } - return FALSE; + return false; } void NavigationStyle::saveCursorPosition(const SoEvent * const ev) @@ -997,7 +997,7 @@ void NavigationStyle::saveCursorPosition(const SoEvent * const ev) SoPickedPoint * picked = rpaction.getPickedPoint(); if (picked) { - PRIVATE(this)->dragPointFound = TRUE; + PRIVATE(this)->dragPointFound = true; PRIVATE(this)->startDragPoint = picked->getPoint(); } } @@ -1064,7 +1064,7 @@ SbBool NavigationStyle::handleEventInForeground(const SoEvent* const e) Decide if it should be possible to start a spin animation of the model in the viewer by releasing the mouse button while dragging. - If the \a enable flag is \c FALSE and we're currently animating, the + If the \a enable flag is \c false and we're currently animating, the spin will be stopped. */ void @@ -1219,7 +1219,7 @@ void NavigationStyle::stopSelection() SbBool NavigationStyle::isSelecting() const { - return (mouseSelection ? TRUE : FALSE); + return (mouseSelection ? true : false); } const std::vector& NavigationStyle::getPolygon(SbBool* clip_inner) const @@ -1332,7 +1332,7 @@ SbBool NavigationStyle::processEvent(const SoEvent * const ev) int hd=mouseSelection->handleEvent(ev,viewer->getSoRenderManager()->getViewportRegion()); if (hd==AbstractMouseSelection::Continue|| hd==AbstractMouseSelection::Restart) { - return TRUE; + return true; } else if (hd==AbstractMouseSelection::Finish) { pcPolygon = mouseSelection->getPositions(); @@ -1353,7 +1353,7 @@ SbBool NavigationStyle::processEvent(const SoEvent * const ev) const ViewerMode curmode = this->currentmode; - SbBool processed = FALSE; + SbBool processed = false; processed = this->processSoEvent(ev); // check for left click without selecting something @@ -1399,7 +1399,7 @@ void NavigationStyle::syncWithEvent(const SoEvent * const ev) // Keyboard handling if (type.isDerivedFrom(SoKeyboardEvent::getClassTypeId())) { const SoKeyboardEvent * const event = (const SoKeyboardEvent *) ev; - const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE; + const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false; switch (event->getKey()) { case SoKeyboardEvent::LEFT_CONTROL: case SoKeyboardEvent::RIGHT_CONTROL: @@ -1422,7 +1422,7 @@ void NavigationStyle::syncWithEvent(const SoEvent * const ev) if (type.isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) { const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev; const int button = event->getButton(); - const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE; + const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false; // SoDebugError::postInfo("processSoEvent", "button = %d", button); switch (button) { @@ -1445,7 +1445,7 @@ SbBool NavigationStyle::processMotionEvent(const SoMotion3Event * const ev) { SoCamera * const camera = viewer->getSoRenderManager()->getCamera(); if (!camera) - return FALSE; + return false; SbViewVolume volume(camera->getViewVolume()); SbVec3f center(volume.getSightPoint(camera->focalDistance.getValue())); @@ -1469,7 +1469,7 @@ SbBool NavigationStyle::processMotionEvent(const SoMotion3Event * const ev) camera->orientation.getValue().multVec(dir,dir); camera->position = newPosition + (dir * translationFactor); - return TRUE; + return true; } void NavigationStyle::setPopupMenuEnabled(const SbBool on) @@ -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 types; Base::Type::getAllDerivedFrom(UserNavigationStyle::getClassTypeId(), types); for (std::vector::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)); diff --git a/src/Gui/NetworkRetriever.cpp b/src/Gui/NetworkRetriever.cpp index bb224c4154..68749e7a58 100644 --- a/src/Gui/NetworkRetriever.cpp +++ b/src/Gui/NetworkRetriever.cpp @@ -118,7 +118,7 @@ void NetworkRetriever::testFailure() if ( wget->state() == QProcess::Running ) { d->fail = false; - Base::Console().Message( tr("Download started...\n").toAscii() ); + Base::Console().Message( tr("Download started...\n").toLatin1() ); } } @@ -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); } @@ -264,7 +264,7 @@ bool NetworkRetriever::startDownload( const QString& startUrl ) { if ( dir.mkdir( d->dir ) == false) { - Base::Console().Error("Directory '%s' could not be created.", (const char*)d->dir.toAscii()); + Base::Console().Error("Directory '%s' could not be created.", (const char*)d->dir.toLatin1()); return true; // please, no error message } } @@ -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,9 +487,9 @@ 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.toAscii() ).c_str()); + path = QString::fromUtf8(hURLGrp->GetASCII( "DownloadLocation", path.toLatin1() ).c_str()); while (loop > 0) { loop--; @@ -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 ) diff --git a/src/Gui/OnlineDocumentation.cpp b/src/Gui/OnlineDocumentation.cpp index d19c0f843f..d43f074f0e 100644 --- a/src/Gui/OnlineDocumentation.cpp +++ b/src/Gui/OnlineDocumentation.cpp @@ -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( "" "" "Python: Index of Modules" @@ -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(""); - header += QString::fromAscii("%2
").arg(file).arg(file); + header += QString::fromLatin1(""); + header += QString::fromLatin1("%2
").arg(file).arg(file); } } - header += QString::fromAscii( + header += QString::fromLatin1( "

" //"

" //"" @@ -146,7 +146,7 @@ QByteArray OnlineDocumentation::loadResource(const QString& filename) const std::string path = App::GetApplication().getHomePath(); path += "/doc/docs.zip"; zipios::ZipFile zip(path); - zipios::ConstEntryPointer entry = zip.getEntry((const char*)fn.toAscii()); + zipios::ConstEntryPointer entry = zip.getEntry((const char*)fn.toLatin1()); std::istream* str = zip.getInputStream(entry); // set size of the array so that no re-allocation is needed when reading from the stream @@ -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" "Error" "" @@ -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" "Error" "" @@ -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())); diff --git a/src/Gui/OpenCascadeNavigationStyle.cpp b/src/Gui/OpenCascadeNavigationStyle.cpp index 60e73f3393..a343426d0a 100644 --- a/src/Gui/OpenCascadeNavigationStyle.cpp +++ b/src/Gui/OpenCascadeNavigationStyle.cpp @@ -98,11 +98,11 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev) this->lastmouseposition = posn; - // Set to TRUE if any event processing happened. Note that it is not + // Set to true if any event processing happened. Note that it is not // necessary to restrict ourselves to only do one "action" for an // event, we only need this flag to see if any processing happened // at all. - SbBool processed = FALSE; + SbBool processed = false; const ViewerMode curmode = this->currentmode; ViewerMode newmode = curmode; @@ -123,13 +123,13 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev) if (!processed && !viewer->isEditing()) { processed = handleEventInForeground(ev); if (processed) - return TRUE; + return true; } // Keyboard handling if (type.isDerivedFrom(SoKeyboardEvent::getClassTypeId())) { const SoKeyboardEvent * const event = (const SoKeyboardEvent *) ev; - const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE; + const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false; switch (event->getKey()) { case SoKeyboardEvent::LEFT_CONTROL: case SoKeyboardEvent::RIGHT_CONTROL: @@ -144,7 +144,7 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev) this->altdown = press; break; case SoKeyboardEvent::H: - processed = TRUE; + processed = true; viewer->saveHomePosition(); break; case SoKeyboardEvent::S: @@ -165,33 +165,33 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev) if (type.isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) { const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev; const int button = event->getButton(); - const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE; + const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false; switch (button) { case SoMouseButtonEvent::BUTTON1: - this->lockrecenter = TRUE; + this->lockrecenter = true; this->button1down = press; if (press && (this->currentmode == NavigationStyle::SEEK_WAIT_MODE)) { newmode = NavigationStyle::SEEK_MODE; this->seekToPoint(pos); // implicitly calls interactiveCountInc() - processed = TRUE; + processed = true; } else if (!press && (this->currentmode == NavigationStyle::ZOOMING)) { newmode = NavigationStyle::IDLE; - processed = TRUE; + processed = true; } else if (!press && (this->currentmode == NavigationStyle::DRAGGING)) { this->setViewing(false); - processed = TRUE; + processed = true; } else if (viewer->isEditing() && (this->currentmode == NavigationStyle::SPINNING)) { - processed = TRUE; + processed = true; } break; case SoMouseButtonEvent::BUTTON2: // If we are in edit mode then simply ignore the RMB events // to pass the event to the base class. - this->lockrecenter = TRUE; + this->lockrecenter = true; if (!viewer->isEditing()) { // If we are in zoom or pan mode ignore RMB events otherwise // the canvas doesn't get any release events @@ -211,11 +211,11 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev) newmode = NavigationStyle::DRAGGING; saveCursorPosition(ev); this->centerTime = ev->getTime(); - processed = TRUE; + processed = true; } else if (!press && (this->currentmode == NavigationStyle::DRAGGING)) { newmode = NavigationStyle::IDLE; - processed = TRUE; + processed = true; } this->button2down = press; break; @@ -225,18 +225,18 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev) float ratio = vp.getViewportAspectRatio(); SbViewVolume vv = viewer->getSoRenderManager()->getCamera()->getViewVolume(ratio); this->panningplane = vv.getPlane(viewer->getSoRenderManager()->getCamera()->focalDistance.getValue()); - this->lockrecenter = FALSE; + this->lockrecenter = false; } else if (!press && (this->currentmode == NavigationStyle::PANNING)) { newmode = NavigationStyle::IDLE; - processed = TRUE; + processed = true; } this->button3down = press; break; case SoMouseButtonEvent::BUTTON4: case SoMouseButtonEvent::BUTTON5: doZoom(viewer->getSoRenderManager()->getCamera(), button == SoMouseButtonEvent::BUTTON4, posn); - processed = TRUE; + processed = true; break; default: break; @@ -259,7 +259,7 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev) // Mouse Movement handling if (type.isDerivedFrom(SoLocation2Event::getClassTypeId())) { - this->lockrecenter = TRUE; + this->lockrecenter = true; const SoLocation2Event * const event = (const SoLocation2Event *) ev; if (this->currentmode == NavigationStyle::ZOOMING) { // OCCT uses horizontal mouse position, not vertical @@ -268,18 +268,18 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev) if (this->invertZoom) value = -value; zoom(viewer->getSoRenderManager()->getCamera(), value); - processed = TRUE; + processed = true; } else if (this->currentmode == NavigationStyle::PANNING) { float ratio = vp.getViewportAspectRatio(); panCamera(viewer->getSoRenderManager()->getCamera(), ratio, this->panningplane, posn, prevnormalized); - processed = TRUE; + processed = true; } else if (this->currentmode == NavigationStyle::DRAGGING) { this->addToLog(event->getPosition(), event->getTime()); this->spin(posn); moveCursorPosition(); - processed = TRUE; + processed = true; } else if (combo == (CTRLDOWN|BUTTON1DOWN)) { newmode = NavigationStyle::ZOOMING; @@ -291,7 +291,7 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev) const SoMotion3Event * const event = static_cast(ev); if (event) this->processMotionEvent(event); - processed = TRUE; + processed = true; } switch (combo) { @@ -327,7 +327,7 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev) if (/*(curmode == NavigationStyle::SELECTION || viewer->isEditing()) && */!processed) processed = inherited::processSoEvent(ev); else - return TRUE; + return true; return processed; } diff --git a/src/Gui/Placement.cpp b/src/Gui/Placement.cpp index 0902f0dbaf..e4faec97ba 100644 --- a/src/Gui/Placement.cpp +++ b/src/Gui/Placement.cpp @@ -76,7 +76,7 @@ public: /* TRANSLATOR Gui::Dialog::Placement */ -Placement::Placement(QWidget* parent, Qt::WFlags fl) +Placement::Placement(QWidget* parent, Qt::WindowFlags fl) : Gui::LocationDialog(parent, fl) { propertyName = "Placement"; // default name @@ -217,20 +217,20 @@ 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())) .arg(data); } - Application::Instance->runPythonCode((const char*)cmd.toAscii()); + Application::Instance->runPythonCode((const char*)cmd.toLatin1()); } } @@ -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()) @@ -492,7 +492,7 @@ void Placement::changeEvent(QEvent *e) /* TRANSLATOR Gui::Dialog::DockablePlacement */ -DockablePlacement::DockablePlacement(QWidget* parent, Qt::WFlags fl) : Placement(parent, fl) +DockablePlacement::DockablePlacement(QWidget* parent, Qt::WindowFlags fl) : Placement(parent, fl) { Gui::DockWindowManager* pDockMgr = Gui::DockWindowManager::instance(); QDockWidget* dw = pDockMgr->addDockWindow(QT_TR_NOOP("Placement"), diff --git a/src/Gui/Placement.h b/src/Gui/Placement.h index fd14919779..ec2d19e6c0 100644 --- a/src/Gui/Placement.h +++ b/src/Gui/Placement.h @@ -45,7 +45,7 @@ class GuiExport Placement : public Gui::LocationDialog Q_OBJECT public: - Placement(QWidget* parent = 0, Qt::WFlags fl = 0); + Placement(QWidget* parent = 0, Qt::WindowFlags fl = 0); ~Placement(); void accept(); void reject(); @@ -98,7 +98,7 @@ class GuiExport DockablePlacement : public Placement Q_OBJECT public: - DockablePlacement(QWidget* parent = 0, Qt::WFlags fl = 0); + DockablePlacement(QWidget* parent = 0, Qt::WindowFlags fl = 0); ~DockablePlacement(); void accept(); diff --git a/src/Gui/PrefWidgets.cpp b/src/Gui/PrefWidgets.cpp index ead1e0cef4..614798cc25 100644 --- a/src/Gui/PrefWidgets.cpp +++ b/src/Gui/PrefWidgets.cpp @@ -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(); diff --git a/src/Gui/ProgressBar.cpp b/src/Gui/ProgressBar.cpp index 5fd5be65bc..67f1df74e1 100644 --- a/src/Gui/ProgressBar.cpp +++ b/src/Gui/ProgressBar.cpp @@ -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", diff --git a/src/Gui/PythonConsole.cpp b/src/Gui/PythonConsole.cpp index 35f096231f..63a42840fe 100644 --- a/src/Gui/PythonConsole.cpp +++ b/src/Gui/PythonConsole.cpp @@ -316,11 +316,11 @@ 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 toAscii() - bool more = runSource(source.toAscii()); + // Source is already UTF-8, so we can use toLatin1() + bool more = runSource(source.toLatin1()); if (!more) d->buffer.clear(); return more; @@ -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 &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 &rCaller,const char* sR int width = metric.width(QLatin1String("0000")); setTabStopWidth(width); } else { - QMap::ConstIterator it = d->colormap.find(QString::fromAscii(sReason)); + QMap::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> 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! } // --------------------------------------------------------------------- diff --git a/src/Gui/PythonConsolePy.cpp b/src/Gui/PythonConsolePy.cpp index 63419026c8..67496549fe 100644 --- a/src/Gui/PythonConsolePy.cpp +++ b/src/Gui/PythonConsolePy.cpp @@ -344,5 +344,5 @@ Py::Object PythonStdin::repr() Py::Object PythonStdin::readline(const Py::Tuple& args) { - return Py::String( (const char *)pyConsole->readline().toAscii() ); + return Py::String( (const char *)pyConsole->readline().toLatin1() ); } diff --git a/src/Gui/QListWidgetCustom.cpp b/src/Gui/QListWidgetCustom.cpp index 316fdf6290..fc7cb1546c 100644 --- a/src/Gui/QListWidgetCustom.cpp +++ b/src/Gui/QListWidgetCustom.cpp @@ -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(); diff --git a/src/Gui/QuantitySpinBox.cpp b/src/Gui/QuantitySpinBox.cpp index 6b6a92ef1a..e2af8c1d21 100644 --- a/src/Gui/QuantitySpinBox.cpp +++ b/src/Gui/QuantitySpinBox.cpp @@ -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 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())); } } diff --git a/src/Gui/Quarter/ContextMenu.cpp b/src/Gui/Quarter/ContextMenu.cpp index ce17050b9f..dc28d9500b 100644 --- a/src/Gui/Quarter/ContextMenu.cpp +++ b/src/Gui/Quarter/ContextMenu.cpp @@ -33,7 +33,7 @@ #include "ContextMenu.h" -#include +#include #include #include diff --git a/src/Gui/Quarter/DragDropHandler.cpp b/src/Gui/Quarter/DragDropHandler.cpp index 28950b8c53..55b4d9ee43 100644 --- a/src/Gui/Quarter/DragDropHandler.cpp +++ b/src/Gui/Quarter/DragDropHandler.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include diff --git a/src/Gui/Quarter/ImageReader.cpp b/src/Gui/Quarter/ImageReader.cpp index aec789e460..9d8336e261 100644 --- a/src/Gui/Quarter/ImageReader.cpp +++ b/src/Gui/Quarter/ImageReader.cpp @@ -66,9 +66,9 @@ ImageReader::readImage(const SbString & filename, SbImage & sbimage) const } QtCoinCompatibility::QImageToSbImage(image,sbimage); - return TRUE; + return true; } - return FALSE; + return false; } diff --git a/src/Gui/Quarter/KeyboardP.cpp b/src/Gui/Quarter/KeyboardP.cpp index e51e08e9ba..6854ffae7d 100644 --- a/src/Gui/Quarter/KeyboardP.cpp +++ b/src/Gui/Quarter/KeyboardP.cpp @@ -83,7 +83,7 @@ KeyboardP::keyEvent(QKeyEvent * qevent) //Need to use a temporary to avoid reference becoming deleted before //we get a hold of it. - QByteArray tmp = qevent->text().toAscii(); + QByteArray tmp = qevent->text().toLatin1(); const char * printable = tmp.constData(); this->keyboard->setPrintableCharacter(*printable); this->keyboard->setKey(sokey); diff --git a/src/Gui/Quarter/QuarterWidget.cpp b/src/Gui/Quarter/QuarterWidget.cpp index 6532cc64f5..08c3001726 100644 --- a/src/Gui/Quarter/QuarterWidget.cpp +++ b/src/Gui/Quarter/QuarterWidget.cpp @@ -57,7 +57,7 @@ #include #include #include -#include +#include #include #include @@ -205,7 +205,7 @@ QuarterWidget::constructor(const QGLFormat & format, const QGLWidget * sharewidg // set up a cache context for the default SoGLRenderAction PRIVATE(this)->sorendermanager->getGLRenderAction()->setCacheContext(this->getCacheContextId()); - this->setMouseTracking(TRUE); + this->setMouseTracking(true); // Qt::StrongFocus means the widget will accept keyboard focus by // both tabbing and clicking @@ -720,7 +720,7 @@ void QuarterWidget::paintEvent(QPaintEvent* event) // processing the sensors might trigger a redraw in another // context. Release this context temporarily w->doneCurrent(); - SoDB::getSensorManager()->processDelayQueue(FALSE); + SoDB::getSensorManager()->processDelayQueue(false); w->makeCurrent(); } diff --git a/src/Gui/Quarter/QuarterWidget.h b/src/Gui/Quarter/QuarterWidget.h index 07c67bd1d5..bc8483f944 100644 --- a/src/Gui/Quarter/QuarterWidget.h +++ b/src/Gui/Quarter/QuarterWidget.h @@ -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); diff --git a/src/Gui/Quarter/QuarterWidgetP.cpp b/src/Gui/Quarter/QuarterWidgetP.cpp index 45f328ceb3..af05bdac03 100644 --- a/src/Gui/Quarter/QuarterWidgetP.cpp +++ b/src/Gui/Quarter/QuarterWidgetP.cpp @@ -38,9 +38,9 @@ #pragma warning(disable : 4267) #endif -#include +#include #include -#include +#include #include #include diff --git a/src/Gui/Quarter/SensorManager.cpp b/src/Gui/Quarter/SensorManager.cpp index e2fd5ae34a..59d2d13b55 100644 --- a/src/Gui/Quarter/SensorManager.cpp +++ b/src/Gui/Quarter/SensorManager.cpp @@ -68,7 +68,7 @@ SensorManager::SensorManager(void) this->timerEpsilon = 1.0 / 5000.0; SoDB::setRealTimeInterval(1.0 / 25.0); - SoRenderManager::enableRealTimeUpdate(FALSE); + SoRenderManager::enableRealTimeUpdate(false); } SensorManager::~SensorManager() @@ -147,7 +147,7 @@ void SensorManager::idleTimeout(void) { SoDB::getSensorManager()->processTimerQueue(); - SoDB::getSensorManager()->processDelayQueue(TRUE); + SoDB::getSensorManager()->processDelayQueue(true); this->sensorQueueChanged(); } @@ -162,7 +162,7 @@ void SensorManager::delayTimeout(void) { SoDB::getSensorManager()->processTimerQueue(); - SoDB::getSensorManager()->processDelayQueue(FALSE); + SoDB::getSensorManager()->processDelayQueue(false); this->sensorQueueChanged(); } diff --git a/src/Gui/Quarter/SoQTQuarterAdaptor.cpp b/src/Gui/Quarter/SoQTQuarterAdaptor.cpp index 26c12a7fb3..15bb0595e4 100644 --- a/src/Gui/Quarter/SoQTQuarterAdaptor.cpp +++ b/src/Gui/Quarter/SoQTQuarterAdaptor.cpp @@ -158,9 +158,9 @@ void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::init() { m_interactionnesting = 0; m_seekdistance = 50.0f; - m_seekdistanceabs = FALSE; + m_seekdistanceabs = false; m_seekperiod = 2.0f; - m_inseekmode = FALSE; + m_inseekmode = false; m_storedcamera = 0; m_seeksensor = new SoTimerSensor(SoQTQuarterAdaptor::seeksensorCB, (void*)this); @@ -363,7 +363,7 @@ SbBool SIM::Coin3D::Quarter::SoQTQuarterAdaptor::isSeekMode(void) const SbBool SIM::Coin3D::Quarter::SoQTQuarterAdaptor::isSeekValuePercentage(void) const { - return m_seekdistanceabs ? FALSE : TRUE; + return m_seekdistanceabs ? false : true; } SbBool SIM::Coin3D::Quarter::SoQTQuarterAdaptor::seekToPoint(const SbVec2s screenpos) @@ -377,16 +377,16 @@ SbBool SIM::Coin3D::Quarter::SoQTQuarterAdaptor::seekToPoint(const SbVec2s scree SoPickedPoint* picked = rpaction.getPickedPoint(); if(!picked) { - this->interactiveCountInc(); // decremented in setSeekMode(FALSE) - this->setSeekMode(FALSE); - return FALSE; + this->interactiveCountInc(); // decremented in setSeekMode(false) + this->setSeekMode(false); + return false; } SbVec3f hitpoint; hitpoint = picked->getPoint(); this->seekToPoint(hitpoint); - return TRUE; + return true; } void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::seekToPoint(const SbVec3f& scenepos) @@ -455,13 +455,13 @@ void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::setSeekTime(const float seconds) void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::setSeekValueAsPercentage(const SbBool on) { - m_seekdistanceabs = on ? FALSE : TRUE; + m_seekdistanceabs = on ? false : true; } void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::getCameraCoordinateSystem(SoCamera* camera, SoNode* root, SbMatrix& matrix, SbMatrix& inverse) { searchaction.reset(); - searchaction.setSearchingAll(TRUE); + searchaction.setSearchingAll(true); searchaction.setInterest(SoSearchAction::FIRST); searchaction.setNode(camera); searchaction.apply(root); @@ -500,7 +500,7 @@ void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::seeksensorCB(void* data, SoSensor thisp->m_cameraendorient, t); - if(end) thisp->setSeekMode(FALSE); + if(end) thisp->setSeekMode(false); } void SIM::Coin3D::Quarter::SoQTQuarterAdaptor::saveHomePosition(void) @@ -643,19 +643,19 @@ bool SIM::Coin3D::Quarter::SoQTQuarterAdaptor::processSoEvent(const SoEvent* eve case SoKeyboardEvent::LEFT_ARROW: moveCameraScreen(SbVec2f(-0.1f, 0.0f)); - return TRUE; + return true; case SoKeyboardEvent::UP_ARROW: moveCameraScreen(SbVec2f(0.0f, 0.1f)); - return TRUE; + return true; case SoKeyboardEvent::RIGHT_ARROW: moveCameraScreen(SbVec2f(0.1f, 0.0f)); - return TRUE; + return true; case SoKeyboardEvent::DOWN_ARROW: moveCameraScreen(SbVec2f(0.0f, -0.1f)); - return TRUE; + return true; default: break; diff --git a/src/Gui/Quarter/SpaceNavigatorDevice.cpp b/src/Gui/Quarter/SpaceNavigatorDevice.cpp index b6c2d29fe8..42292df5ef 100644 --- a/src/Gui/Quarter/SpaceNavigatorDevice.cpp +++ b/src/Gui/Quarter/SpaceNavigatorDevice.cpp @@ -36,8 +36,8 @@ #include -#include -#include +#include +#include #include #include diff --git a/src/Gui/ReportView.cpp b/src/Gui/ReportView.cpp index 2fb6ef48d3..ce5600b076 100644 --- a/src/Gui/ReportView.cpp +++ b/src/Gui/ReportView.cpp @@ -552,7 +552,7 @@ void ReportOutput::OnChange(Base::Subject &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); diff --git a/src/Gui/SceneInspector.cpp b/src/Gui/SceneInspector.cpp index 3a1957d6df..e36a91f736 100644 --- a/src/Gui/SceneInspector.cpp +++ b/src/Gui/SceneInspector.cpp @@ -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(node); // insert SoGroup icon @@ -96,7 +96,7 @@ void SceneModel::setNode(QModelIndex index, SoNode* node) for (int i=0; igetNumChildren();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 @@ -106,7 +106,7 @@ void SceneModel::setNode(QModelIndex index, SoNode* node) /* TRANSLATOR Gui::Dialog::DlgInspector */ -DlgInspector::DlgInspector(QWidget* parent, Qt::WFlags fl) +DlgInspector::DlgInspector(QWidget* parent, Qt::WindowFlags fl) : QDialog(parent, fl), ui(new Ui_SceneInspector()) { ui->setupUi(this); diff --git a/src/Gui/SceneInspector.h b/src/Gui/SceneInspector.h index 8298ed6a8b..a7b187c71d 100644 --- a/src/Gui/SceneInspector.h +++ b/src/Gui/SceneInspector.h @@ -66,7 +66,7 @@ class DlgInspector : public QDialog Q_OBJECT public: - DlgInspector(QWidget* parent = 0, Qt::WFlags fl = 0); + DlgInspector(QWidget* parent = 0, Qt::WindowFlags fl = 0); ~DlgInspector(); void setNode(SoNode* node); diff --git a/src/Gui/Selection.cpp b/src/Gui/Selection.cpp index 9859734c36..bcbfbead15 100644 --- a/src/Gui/Selection.cpp +++ b/src/Gui/Selection.cpp @@ -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); } diff --git a/src/Gui/SelectionView.cpp b/src/Gui/SelectionView.cpp index 7ed1a9b7f9..f62302e57b 100644 --- a/src/Gui/SelectionView.cpp +++ b/src/Gui/SelectionView.cpp @@ -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,14 +190,14 @@ 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].toAscii(),elements[1].toAscii(),0); - QString cmd = QString::fromAscii("Gui.Selection.addSelection(App.getDocument(\"%1\").getObject(\"%2\"))").arg(elements[0]).arg(elements[1]); - Gui::Command::runCommand(Gui::Command::Gui,cmd.toAscii()); + //Gui::Selection().addSelection(elements[0].toLatin1(),elements[1].toLatin1(),0); + 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()); } void SelectionView::deselect(void) @@ -205,12 +205,12 @@ 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]; - //Gui::Selection().rmvSelection(elements[0].toAscii(),elements[1].toAscii(),0); - QString cmd = QString::fromAscii("Gui.Selection.removeSelection(App.getDocument(\"%1\").getObject(\"%2\"))").arg(elements[0]).arg(elements[1]); - Gui::Command::runCommand(Gui::Command::Gui,cmd.toAscii()); + elements[1] = elements[1].split(QString::fromLatin1(" "))[0]; + //Gui::Selection().rmvSelection(elements[0].toLatin1(),elements[1].toLatin1(),0); + 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()); } void SelectionView::zoom(void) @@ -230,19 +230,19 @@ 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]); - Gui::Command::runCommand(Gui::Command::Gui,cmd.toAscii()); + 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]); - Gui::Command::runCommand(Gui::Command::Gui,cmd.toAscii()); - cmd = QString::fromAscii("elt = App.getDocument(\"%1\").getObject(\"%2\").Shape.%3").arg(elements[0]).arg(elements[1]).arg(elements[2]); - Gui::Command::runCommand(Gui::Command::Gui,cmd.toAscii()); + 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::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)); } diff --git a/src/Gui/SoAxisCrossKit.cpp b/src/Gui/SoAxisCrossKit.cpp index f0e6a3df77..2c493e5dcc 100644 --- a/src/Gui/SoAxisCrossKit.cpp +++ b/src/Gui/SoAxisCrossKit.cpp @@ -67,12 +67,12 @@ SoShapeScale::SoShapeScale(void) { SO_KIT_CONSTRUCTOR(SoShapeScale); - SO_KIT_ADD_FIELD(active, (TRUE)); + SO_KIT_ADD_FIELD(active, (true)); SO_KIT_ADD_FIELD(scaleFactor, (1.0f)); - SO_KIT_ADD_CATALOG_ENTRY(topSeparator, SoSeparator, FALSE, this, "", FALSE); - SO_KIT_ADD_CATALOG_ABSTRACT_ENTRY(shape, SoNode, SoCube, TRUE, topSeparator, "", TRUE); - SO_KIT_ADD_CATALOG_ENTRY(scale, SoScale, FALSE, topSeparator, shape, FALSE); + SO_KIT_ADD_CATALOG_ENTRY(topSeparator, SoSeparator, false, this, "", false); + SO_KIT_ADD_CATALOG_ABSTRACT_ENTRY(shape, SoNode, SoCube, true, topSeparator, "", true); + SO_KIT_ADD_CATALOG_ENTRY(scale, SoScale, false, topSeparator, shape, false); SO_KIT_INIT_INSTANCE(); } @@ -93,7 +93,7 @@ SoShapeScale::GLRender(SoGLRenderAction * action) { SoState * state = action->getState(); - SoScale * scale = static_cast(this->getAnyPart(SbName("scale"), TRUE)); + SoScale * scale = static_cast(this->getAnyPart(SbName("scale"), true)); if (!this->active.getValue()) { SbVec3f v(1.0f, 1.0f, 1.0f); if (scale->scaleFactor.getValue() != v) @@ -130,17 +130,17 @@ SoAxisCrossKit::SoAxisCrossKit() // Add the parts to the catalog... SO_KIT_ADD_CATALOG_ENTRY(xAxis, SoShapeKit, - TRUE, this,"", TRUE); + true, this,"", true); SO_KIT_ADD_CATALOG_ENTRY(xHead, SoShapeKit, - TRUE, this,"", TRUE); + true, this,"", true); SO_KIT_ADD_CATALOG_ENTRY(yAxis, SoShapeKit, - TRUE, this,"", TRUE); + true, this,"", true); SO_KIT_ADD_CATALOG_ENTRY(yHead, SoShapeKit, - TRUE, this,"", TRUE); + true, this,"", true); SO_KIT_ADD_CATALOG_ENTRY(zAxis, SoShapeKit, - TRUE, this,"", TRUE); + true, this,"", true); SO_KIT_ADD_CATALOG_ENTRY(zHead, SoShapeKit, - TRUE, this,"", TRUE); + true, this,"", true); SO_KIT_INIT_INSTANCE(); @@ -156,7 +156,7 @@ SoAxisCrossKit::~SoAxisCrossKit() SbBool SoAxisCrossKit::affectsState() const { - return FALSE; + return false; } void SoAxisCrossKit::addWriteReference(SoOutput * out, SbBool isfromfield) @@ -168,7 +168,7 @@ void SoAxisCrossKit::getBoundingBox(SoGetBoundingBoxAction * action) { inherited::getBoundingBox(action); action->resetCenter(); - action->setCenter(SbVec3f(0,0,0), FALSE); + action->setCenter(SbVec3f(0,0,0), false); } // Set up parts for default configuration of the jumping jack @@ -294,7 +294,7 @@ void SoRegPoint::GLRender(SoGLRenderAction *action) SoState* state = action->getState(); state->push(); SoMaterialBundle mb(action); - SoTextureCoordinateBundle tb(action, TRUE, FALSE); + SoTextureCoordinateBundle tb(action, true, false); SoLazyElement::setLightModel(state, SoLazyElement::BASE_COLOR); mb.sendFirst(); // make sure we have the correct material diff --git a/src/Gui/SoAxisCrossKit.h b/src/Gui/SoAxisCrossKit.h index f7f65c2b45..c5543e66d7 100644 --- a/src/Gui/SoAxisCrossKit.h +++ b/src/Gui/SoAxisCrossKit.h @@ -77,7 +77,7 @@ public: // Overrides default method. All the parts are shapeKits, // so this node will not affect the state. virtual SbBool affectsState() const; - virtual void addWriteReference(SoOutput * out, SbBool isfromfield = FALSE); + virtual void addWriteReference(SoOutput * out, SbBool isfromfield = false); virtual void getBoundingBox(SoGetBoundingBoxAction * action); static void initClass(); diff --git a/src/Gui/SoFCBoundingBox.cpp b/src/Gui/SoFCBoundingBox.cpp index add299a2ef..c67b96d8e6 100644 --- a/src/Gui/SoFCBoundingBox.cpp +++ b/src/Gui/SoFCBoundingBox.cpp @@ -77,8 +77,8 @@ SoFCBoundingBox::SoFCBoundingBox () SO_NODE_ADD_FIELD(minBounds, (-1.0, -1.0, -1.0)); SO_NODE_ADD_FIELD(maxBounds, ( 1.0, 1.0, 1.0)); - SO_NODE_ADD_FIELD(coordsOn, (TRUE)); - SO_NODE_ADD_FIELD(dimensionsOn, (TRUE)); + SO_NODE_ADD_FIELD(coordsOn, (true)); + SO_NODE_ADD_FIELD(dimensionsOn, (true)); root = new SoSeparator(); SoSeparator *bboxSep = new SoSeparator(); diff --git a/src/Gui/SoFCDB.cpp b/src/Gui/SoFCDB.cpp index 4ee13e4433..b51f2720d1 100644 --- a/src/Gui/SoFCDB.cpp +++ b/src/Gui/SoFCDB.cpp @@ -61,7 +61,7 @@ using namespace Gui; using namespace Gui::Inventor; using namespace Gui::PropertyEditor; -static SbBool init_done = FALSE; +static SbBool init_done = false; SbBool Gui::SoFCDB::isInitialized(void) { @@ -155,7 +155,7 @@ void Gui::SoFCDB::init() qRegisterMetaType("Base::Vector3d"); qRegisterMetaType("Base::Quantity"); qRegisterMetaType >("Base::QuantityList"); - init_done = TRUE; + init_done = true; } void Gui::SoFCDB::finish() @@ -230,7 +230,7 @@ bool Gui::SoFCDB::writeToVRML(SoNode* node, const char* filename, bool binary) // We want to write compressed VRML but Coin 2.4.3 doesn't do it even though // SoOutput::getAvailableCompressionMethods() delivers a string list that // contains 'GZIP'. setCompression() was called directly after opening the file, - // returned TRUE and no error message appeared but anyway it didn't work. + // returned true and no error message appeared but anyway it didn't work. // Strange is that reading GZIPped VRML files works. // So, we do the compression on our own. Base::ofstream str(fi, std::ios::out | std::ios::binary); diff --git a/src/Gui/SoFCInteractiveElement.cpp b/src/Gui/SoFCInteractiveElement.cpp index 34b0fb92f3..5e414fb577 100644 --- a/src/Gui/SoFCInteractiveElement.cpp +++ b/src/Gui/SoFCInteractiveElement.cpp @@ -113,7 +113,7 @@ void SoGLWidgetElement::pop(SoState * state, const SoElement * prevTopElement) SbBool SoGLWidgetElement::matches(const SoElement * element) const { - return TRUE; + return true; } SoElement * SoGLWidgetElement::copyMatchInfo(void) const @@ -168,7 +168,7 @@ void SoGLRenderActionElement::pop(SoState * state, const SoElement * prevTopElem SbBool SoGLRenderActionElement::matches(const SoElement * element) const { - return TRUE; + return true; } SoElement * SoGLRenderActionElement::copyMatchInfo(void) const diff --git a/src/Gui/SoFCOffscreenRenderer.cpp b/src/Gui/SoFCOffscreenRenderer.cpp index 90a9ddd1eb..57151a3d6d 100644 --- a/src/Gui/SoFCOffscreenRenderer.cpp +++ b/src/Gui/SoFCOffscreenRenderer.cpp @@ -286,7 +286,7 @@ std::string SoFCOffscreenRenderer::createMIBA(const SbMatrix& mat) const com << " \n" ; com << " \n" ; com << " Unknown\n" ; - com << " " << QDateTime::currentDateTime().toString().toAscii().constData() << "\n" ; + com << " " << QDateTime::currentDateTime().toString().toLatin1().constData() << "\n" ; com << " " << App::GetApplication().getExecutableName() << " " << major << "." << minor << "\n" ; com << " Unknown\n"; com << " 1.0\n"; @@ -400,7 +400,7 @@ void SoQtOffscreenRenderer::init(const SbViewportRegion & vpr, this->renderaction->setTransparencyType(SoGLRenderAction::SORTED_OBJECT_BLEND); } - this->didallocation = glrenderaction ? FALSE : TRUE; + this->didallocation = glrenderaction ? false : true; this->viewport = vpr; this->pixelbuffer = NULL; // constructed later @@ -492,7 +492,7 @@ SoQtOffscreenRenderer::setGLRenderAction(SoGLRenderAction * action) if (PRIVATE(this)->didallocation) { delete PRIVATE(this)->renderaction; } PRIVATE(this)->renderaction = action; - PRIVATE(this)->didallocation = FALSE; + PRIVATE(this)->didallocation = false; } /*! @@ -534,7 +534,7 @@ void SoQtOffscreenRenderer::pre_render_cb(void * userdata, SoGLRenderAction * action) { glClear(GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT); - action->setRenderingIsRemote(FALSE); + action->setRenderingIsRemote(false); } void @@ -632,7 +632,7 @@ SoQtOffscreenRenderer::renderFromBase(SoBase * base) else if (base->isOfType(SoPath::getClassTypeId())) this->renderaction->apply((SoPath *)base); else { - assert(FALSE && "Cannot apply to anything else than an SoNode or an SoPath"); + assert(false && "Cannot apply to anything else than an SoNode or an SoPath"); } this->renderaction->removePreRenderCallback(pre_render_cb, NULL); @@ -646,7 +646,7 @@ SoQtOffscreenRenderer::renderFromBase(SoBase * base) this->renderaction->setCacheContext(oldcontext); // restore old - return TRUE; + return true; } /*! diff --git a/src/Gui/SoFCSelection.cpp b/src/Gui/SoFCSelection.cpp index 9ecb857c98..27e9397904 100644 --- a/src/Gui/SoFCSelection.cpp +++ b/src/Gui/SoFCSelection.cpp @@ -107,9 +107,9 @@ SoFCSelection::SoFCSelection() SO_NODE_DEFINE_ENUM_VALUE(Selected, SELECTED); SO_NODE_SET_SF_ENUM_TYPE(selected, Selected); - highlighted = FALSE; - bShift = FALSE; - bCtrl = FALSE; + highlighted = false; + bShift = false; + bCtrl = false; selected = NOTSELECTED; } @@ -332,9 +332,9 @@ SoFCSelection::handleEvent(SoHandleEventAction * action) SoFCSelection::turnoffcurrent(action); SoFCSelection::currenthighlight = (SoFullPath*)action->getCurPath()->copy(); SoFCSelection::currenthighlight->ref(); - highlighted = TRUE; + highlighted = true; this->touch(); // force scene redraw - this->redrawHighlighted(action, TRUE); + this->redrawHighlighted(action, true); } } @@ -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) { @@ -353,7 +353,7 @@ SoFCSelection::handleEvent(SoHandleEventAction * action) SoFCSelection::turnoffcurrent(action); //FIXME: I think we should set 'highlighted' to false whenever no point is picked //else - highlighted = FALSE; + highlighted = false; Gui::Selection().rmvPreselect(); } } @@ -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); } } @@ -465,17 +465,17 @@ SoFCSelection::handleEvent(SoHandleEventAction * action) // if (event->isOfType(SoLocation2Event::getClassTypeId())) { // check to see if the mouse is over our geometry... - SbBool underTheMouse = FALSE; + SbBool underTheMouse = false; const SoPickedPoint * pp = this->getPickedPoint(action); SoFullPath *pPath = (pp != NULL) ? (SoFullPath *) pp->getPath() : NULL; if (pPath && pPath->containsPath(action->getCurPath())) { // Make sure I'm the lowest LocHL in the pick path! - underTheMouse = TRUE; + underTheMouse = true; for (int i = 0; i < pPath->getLength(); i++) { SoNode *node = pPath->getNodeFromTail(i); if (node->isOfType(SoFCSelection::getClassTypeId())) { if (node != this) - underTheMouse = FALSE; + underTheMouse = false; break; // found the lowest LocHL - look no further } } @@ -485,7 +485,7 @@ SoFCSelection::handleEvent(SoHandleEventAction * action) if (! underTheMouse) { // re-draw the object with it's normal color //if(mymode != OFF) - redrawHighlighted(action, FALSE); + redrawHighlighted(action, false); Gui::Selection().rmvPreselect(); } else { @@ -502,7 +502,7 @@ SoFCSelection::handleEvent(SoHandleEventAction * action) if (underTheMouse) { // draw this object highlighted if (mymode != OFF) - redrawHighlighted(action, TRUE); + redrawHighlighted(action, true); //const SoPickedPoint * pp = action->getPickedPoint(); Gui::Selection().setPreselect(documentName.getValue().getString() ,objectName.getValue().getString() @@ -513,10 +513,10 @@ SoFCSelection::handleEvent(SoHandleEventAction * action) } } //if(selected == SELECTED){ - // redrawHighlighted(action, TRUE); + // redrawHighlighted(action, true); //} //if(selectionCleared ){ - // redrawHighlighted(action, FALSE); + // redrawHighlighted(action, false); // selectionCleared = false; //} } @@ -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); } } @@ -696,7 +696,7 @@ SoFCSelection::preRender(SoGLRenderAction *action, GLint &oldDepthFunc) { // If not performing locate highlighting, just return. if (highlightMode.getValue() == OFF) - return FALSE; + return false; SoState *state = action->getState(); @@ -718,12 +718,12 @@ SoFCSelection::preRender(SoGLRenderAction *action, GLint &oldDepthFunc) // Emissive Color SoLazyElement::setEmissive(state, &col); - SoOverrideElement::setEmissiveColorOverride(state, this, TRUE); + SoOverrideElement::setEmissiveColorOverride(state, this, true); // Diffuse Color if (style.getValue() == EMISSIVE_DIFFUSE) { SoLazyElement::setDiffuse(state, this, 1, &col, &colorpacker); - SoOverrideElement::setDiffuseColorOverride(state, this, TRUE); + SoOverrideElement::setDiffuseColorOverride(state, this, true); } } @@ -759,7 +759,7 @@ SoFCSelection::redrawHighlighted(SoAction * action , SbBool doHighlight ) SoNode *tail = currenthighlight->getTail(); if (tail->isOfType( SoFCSelection::getClassTypeId())) - ((SoFCSelection *)tail)->redrawHighlighted(action, FALSE); + ((SoFCSelection *)tail)->redrawHighlighted(action, false); else { // Just get rid of the path. It's no longer valid for redraw. currenthighlight->unref(); @@ -823,9 +823,9 @@ SoFCSelection::redrawHighlighted(SoAction * action , SbBool doHighlight ) if (whichBuffer != GL_FRONT) glDrawBuffer(GL_FRONT); - highlighted = TRUE; + highlighted = true; glAction->apply(pathToRender); - highlighted = FALSE; + highlighted = false; // restore the buffering type if (whichBuffer != GL_FRONT) @@ -855,7 +855,7 @@ SoFCSelection::setOverride(SoGLRenderAction * action) SoLazyElement::setEmissive(state, &this->colorSelection.getValue()); else SoLazyElement::setEmissive(state, &this->colorHighlight.getValue()); - SoOverrideElement::setEmissiveColorOverride(state, this, TRUE); + SoOverrideElement::setEmissiveColorOverride(state, this, true); Styles mystyle = (Styles) this->style.getValue(); if (mystyle == SoFCSelection::EMISSIVE_DIFFUSE) { @@ -863,7 +863,7 @@ SoFCSelection::setOverride(SoGLRenderAction * action) SoLazyElement::setDiffuse(state, this,1, &this->colorSelection.getValue(),&colorpacker); else SoLazyElement::setDiffuse(state, this,1, &this->colorHighlight.getValue(),&colorpacker); - SoOverrideElement::setDiffuseColorOverride(state, this, TRUE); + SoOverrideElement::setDiffuseColorOverride(state, this, true); } } @@ -876,9 +876,9 @@ SoFCSelection::turnoffcurrent(SoAction * action) SoFCSelection::currenthighlight->getLength()) { SoNode * tail = SoFCSelection::currenthighlight->getTail(); if (tail->isOfType(SoFCSelection::getClassTypeId())) { - ((SoFCSelection*)tail)->highlighted = FALSE; + ((SoFCSelection*)tail)->highlighted = false; ((SoFCSelection*)tail)->touch(); // force scene redraw - if (action) ((SoFCSelection*)tail)->redrawHighlighted(action, FALSE); + if (action) ((SoFCSelection*)tail)->redrawHighlighted(action, false); } } if (SoFCSelection::currenthighlight) { @@ -896,7 +896,7 @@ SoFCSelection::turnoffcurrent(SoAction * action) // (processing events during render abort might cause this) SoState *state = action->getState(); if (state && state->getDepth() == 1) - ((SoFCSelection *)tail)->redrawHighlighted(action, FALSE); + ((SoFCSelection *)tail)->redrawHighlighted(action, false); } else { // Just get rid of the path. It's no longer valid for redraw. diff --git a/src/Gui/SoFCSelectionAction.cpp b/src/Gui/SoFCSelectionAction.cpp index a692728e84..14a798c92d 100644 --- a/src/Gui/SoFCSelectionAction.cpp +++ b/src/Gui/SoFCSelectionAction.cpp @@ -645,7 +645,7 @@ void SoFCDocumentObjectAction::finish() atexit_cleanup(); } -SoFCDocumentObjectAction::SoFCDocumentObjectAction () : _handled(FALSE) +SoFCDocumentObjectAction::SoFCDocumentObjectAction () : _handled(false) { SO_ACTION_CONSTRUCTOR(SoFCDocumentObjectAction); } @@ -666,7 +666,7 @@ void SoFCDocumentObjectAction::callDoAction(SoAction *action,SoNode *node) void SoFCDocumentObjectAction::setHandled() { - this->_handled = TRUE; + this->_handled = true; } SbBool SoFCDocumentObjectAction::isHandled() const @@ -715,7 +715,7 @@ void SoGLSelectAction::initClass() SoGLSelectAction::SoGLSelectAction (const SbViewportRegion& region, const SbViewportRegion& select) - : vpregion(region), vpselect(select), _handled(FALSE) + : vpregion(region), vpselect(select), _handled(false) { SO_ACTION_CONSTRUCTOR(SoGLSelectAction); } @@ -742,7 +742,7 @@ void SoGLSelectAction::callDoAction(SoAction *action,SoNode *node) void SoGLSelectAction::setHandled() { - this->_handled = TRUE; + this->_handled = true; } SbBool SoGLSelectAction::isHandled() const @@ -790,7 +790,7 @@ void SoVisibleFaceAction::initClass() SO_ACTION_ADD_METHOD(SoFCSelection,callDoAction); } -SoVisibleFaceAction::SoVisibleFaceAction () : _handled(FALSE) +SoVisibleFaceAction::SoVisibleFaceAction () : _handled(false) { SO_ACTION_CONSTRUCTOR(SoVisibleFaceAction); } @@ -811,7 +811,7 @@ void SoVisibleFaceAction::callDoAction(SoAction *action,SoNode *node) void SoVisibleFaceAction::setHandled() { - this->_handled = TRUE; + this->_handled = true; } SbBool SoVisibleFaceAction::isHandled() const @@ -976,7 +976,7 @@ SoBoxSelectionRenderAction::constructorCommon(void) // Initialize local variables PRIVATE(this)->initBoxGraph(); - this->hlVisible = TRUE; + this->hlVisible = true; PRIVATE(this)->basecolor->rgb.setValue(1.0f, 0.0f, 0.0f); PRIVATE(this)->drawstyle->linePattern = 0xffff; diff --git a/src/Gui/SoFCSelectionAction.h b/src/Gui/SoFCSelectionAction.h index 08ca6a6d0b..37ab54a21c 100644 --- a/src/Gui/SoFCSelectionAction.h +++ b/src/Gui/SoFCSelectionAction.h @@ -300,7 +300,7 @@ public: virtual void apply(SoNode * node); virtual void apply(SoPath * path); - virtual void apply(const SoPathList & pathlist, SbBool obeysrules = FALSE); + virtual void apply(const SoPathList & pathlist, SbBool obeysrules = false); void setVisible(SbBool b) { hlVisible = b; } SbBool isVisible() const { return hlVisible; } void setColor(const SbColor & color); diff --git a/src/Gui/SoFCUnifiedSelection.cpp b/src/Gui/SoFCUnifiedSelection.cpp index f8aae4b9e4..d5fa61b9a4 100644 --- a/src/Gui/SoFCUnifiedSelection.cpp +++ b/src/Gui/SoFCUnifiedSelection.cpp @@ -100,14 +100,14 @@ SoFCUnifiedSelection::SoFCUnifiedSelection() : pcDocument(0) SO_NODE_ADD_FIELD(colorSelection, (SbColor(0.1f, 0.8f, 0.1f))); SO_NODE_ADD_FIELD(highlightMode, (AUTO)); SO_NODE_ADD_FIELD(selectionMode, (ON)); - SO_NODE_ADD_FIELD(selectionRole, (TRUE)); + SO_NODE_ADD_FIELD(selectionRole, (true)); SO_NODE_DEFINE_ENUM_VALUE(HighlightModes, AUTO); SO_NODE_DEFINE_ENUM_VALUE(HighlightModes, ON); SO_NODE_DEFINE_ENUM_VALUE(HighlightModes, OFF); SO_NODE_SET_SF_ENUM_TYPE (highlightMode, HighlightModes); - highlighted = FALSE; + highlighted = false; preSelection = -1; } @@ -176,7 +176,7 @@ void SoFCUnifiedSelection::write(SoWriteAction * action) SoOutput * out = action->getOutput(); if (out->getStage() == SoOutput::WRITE) { // Do not write out the fields of this class - if (this->writeHeader(out, TRUE, FALSE)) return; + if (this->writeHeader(out, true, false)) return; SoGroup::doAction((SoAction *)action); this->writeFooter(out); } @@ -358,7 +358,7 @@ SoFCUnifiedSelection::handleEvent(SoHandleEventAction * action) vpd = static_cast(vp); //SbBool old_state = highlighted; - highlighted = FALSE; + highlighted = false; if (vpd && vpd->useNewSelectionModel() && vpd->isSelectable()) { std::string documentName = vpd->getObject()->getDocument()->getName(); std::string objectName = vpd->getObject()->getNameInDocument(); @@ -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() @@ -386,10 +386,10 @@ SoFCUnifiedSelection::handleEvent(SoHandleEventAction * action) sa.setNode(vp->getRoot()); sa.apply(vp->getRoot()); if (sa.getPath()) { - highlighted = TRUE; + highlighted = true; if (currenthighlight && currenthighlight->getTail() != sa.getPath()->getTail()) { SoHighlightElementAction action; - action.setHighlighted(FALSE); + action.setHighlighted(false); action.apply(currenthighlight); currenthighlight->unref(); currenthighlight = 0; @@ -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); } } @@ -570,7 +570,7 @@ void SoHighlightElementAction::initClass() SO_ACTION_ADD_METHOD(SoPointSet,callDoAction); } -SoHighlightElementAction::SoHighlightElementAction () : _highlight(FALSE), _det(0) +SoHighlightElementAction::SoHighlightElementAction () : _highlight(false), _det(0) { SO_ACTION_CONSTRUCTOR(SoHighlightElementAction); } diff --git a/src/Gui/SoNavigationDragger.cpp b/src/Gui/SoNavigationDragger.cpp index 483f5e122e..5d36a6dddc 100644 --- a/src/Gui/SoNavigationDragger.cpp +++ b/src/Gui/SoNavigationDragger.cpp @@ -61,30 +61,30 @@ RotTransDragger::RotTransDragger() // Don't create "surroundScale" by default. It's only put // to use if this dragger is used within a manipulator. - SO_KIT_ADD_CATALOG_ENTRY(surroundScale, SoSurroundScale, TRUE, - topSeparator, geomSeparator, TRUE); + SO_KIT_ADD_CATALOG_ENTRY(surroundScale, SoSurroundScale, true, + topSeparator, geomSeparator, true); // Create an anti-squish node by default. - SO_KIT_ADD_CATALOG_ENTRY(antiSquish, SoAntiSquish, FALSE, - topSeparator, geomSeparator, TRUE); + SO_KIT_ADD_CATALOG_ENTRY(antiSquish, SoAntiSquish, false, + topSeparator, geomSeparator, true); SO_KIT_ADD_CATALOG_ENTRY(translator, SoTranslate1Dragger, - TRUE, topSeparator, geomSeparator, - TRUE); - SO_KIT_ADD_CATALOG_ENTRY(XRotatorSep, SoSeparator, FALSE, - topSeparator, geomSeparator, FALSE); - SO_KIT_ADD_CATALOG_ENTRY(XRotatorRot, SoRotation, TRUE, - XRotatorSep,0 , FALSE); + true, topSeparator, geomSeparator, + true); + SO_KIT_ADD_CATALOG_ENTRY(XRotatorSep, SoSeparator, false, + topSeparator, geomSeparator, false); + SO_KIT_ADD_CATALOG_ENTRY(XRotatorRot, SoRotation, true, + XRotatorSep,0 , false); SO_KIT_ADD_CATALOG_ENTRY(XRotator,SoRotateCylindricalDragger, - TRUE, XRotatorSep, 0,TRUE); + true, XRotatorSep, 0,true); SO_KIT_ADD_CATALOG_ENTRY(YRotator, SoRotateCylindricalDragger, - TRUE, topSeparator, geomSeparator, TRUE); + true, topSeparator, geomSeparator, true); - SO_KIT_ADD_CATALOG_ENTRY(ZRotatorSep, SoSeparator, FALSE, - topSeparator, geomSeparator, FALSE); - SO_KIT_ADD_CATALOG_ENTRY(ZRotatorRot, SoRotation, TRUE, - ZRotatorSep,0 ,FALSE); + SO_KIT_ADD_CATALOG_ENTRY(ZRotatorSep, SoSeparator, false, + topSeparator, geomSeparator, false); + SO_KIT_ADD_CATALOG_ENTRY(ZRotatorRot, SoRotation, true, + ZRotatorSep,0 ,false); SO_KIT_ADD_CATALOG_ENTRY(ZRotator, SoRotateCylindricalDragger, - TRUE, ZRotatorSep, 0,TRUE); + true, ZRotatorSep, 0,true); // Read geometry resources. Only do this the first time we // construct one. 'geomBuffer' contains our compiled in @@ -165,7 +165,7 @@ RotTransDragger::RotTransDragger() &RotTransDragger::fieldSensorCB,this); translFieldSensor->setPriority(0); - setUpConnections(TRUE, TRUE); + setUpConnections(true, true); } RotTransDragger::~RotTransDragger() @@ -201,7 +201,7 @@ RotTransDragger::setUpConnections(SbBool onOff, SbBool doItAlways) // will be transferred into motion of the entire // dragger. SoDragger *tD = - (SoDragger *) getAnyPart("translator", FALSE); + (SoDragger *) getAnyPart("translator", false); // [a] Set up the parts in the child dragger... tD->setPartAsDefault("translator", "rotTransTranslatorTranslator"); @@ -219,7 +219,7 @@ RotTransDragger::setUpConnections(SbBool onOff, SbBool doItAlways) registerChildDragger(tD); SoDragger *XD = - (SoDragger *) getAnyPart("XRotator", FALSE); + (SoDragger *) getAnyPart("XRotator", false); // [a] Set up the parts in the child dragger... XD->setPartAsDefault("rotator", "rotTransRotatorRotator"); @@ -237,7 +237,7 @@ RotTransDragger::setUpConnections(SbBool onOff, SbBool doItAlways) registerChildDragger(XD); SoDragger *YD = - (SoDragger *) getAnyPart("YRotator", FALSE); + (SoDragger *) getAnyPart("YRotator", false); // [a] Set up the parts in the child dragger... YD->setPartAsDefault("rotator", "rotTransRotatorRotator"); @@ -255,7 +255,7 @@ RotTransDragger::setUpConnections(SbBool onOff, SbBool doItAlways) registerChildDragger(YD); SoDragger *ZD = - (SoDragger *) getAnyPart("ZRotator", FALSE); + (SoDragger *) getAnyPart("ZRotator", false); // [a] Set up the parts in the child dragger... ZD->setPartAsDefault("rotator", "rotTransRotatorRotator"); @@ -288,7 +288,7 @@ RotTransDragger::setUpConnections(SbBool onOff, SbBool doItAlways) // Remove the callbacks from the child draggers, // and unregister them as children. SoDragger *tD = - (SoDragger *) getAnyPart("translator", FALSE); + (SoDragger *) getAnyPart("translator", false); tD->removeStartCallback( &RotTransDragger::invalidateSurroundScaleCB, this); tD->removeFinishCallback( @@ -296,7 +296,7 @@ RotTransDragger::setUpConnections(SbBool onOff, SbBool doItAlways) unregisterChildDragger(tD); SoDragger *XD = - (SoDragger *) getAnyPart("XRotator", FALSE); + (SoDragger *) getAnyPart("XRotator", false); XD->removeStartCallback( &RotTransDragger::invalidateSurroundScaleCB, this); XD->removeFinishCallback( @@ -304,7 +304,7 @@ RotTransDragger::setUpConnections(SbBool onOff, SbBool doItAlways) unregisterChildDragger(XD); SoDragger *YD = - (SoDragger *) getAnyPart("YRotator", FALSE); + (SoDragger *) getAnyPart("YRotator", false); YD->removeStartCallback( &RotTransDragger::invalidateSurroundScaleCB, this); YD->removeFinishCallback( @@ -312,7 +312,7 @@ RotTransDragger::setUpConnections(SbBool onOff, SbBool doItAlways) unregisterChildDragger(YD); SoDragger *ZD = - (SoDragger *) getAnyPart("ZRotator", FALSE); + (SoDragger *) getAnyPart("ZRotator", false); ZD->removeStartCallback( &RotTransDragger::invalidateSurroundScaleCB, this); ZD->removeFinishCallback( @@ -389,8 +389,8 @@ RotTransDragger::setDefaultOnNonWritingFields() // The nodes pointed to by these part-fields may // change after construction, but we // don't want to write them out. - surroundScale.setDefault(TRUE); - antiSquish.setDefault(TRUE); + surroundScale.setDefault(true); + antiSquish.setDefault(true); SoDragger::setDefaultOnNonWritingFields(); } diff --git a/src/Gui/SoNavigationDragger.h b/src/Gui/SoNavigationDragger.h index 32d4ac7a5d..5698cbf1b5 100644 --- a/src/Gui/SoNavigationDragger.h +++ b/src/Gui/SoNavigationDragger.h @@ -106,7 +106,7 @@ class RotTransDragger : public SoDragger // and on the new copy at the start/end of SoBaseKit::copy() // Returns the state of the node when this was called. virtual SbBool setUpConnections( SbBool onOff, - SbBool doItAlways = FALSE); + SbBool doItAlways = false); // This allows us to specify that certain parts do not // write out. We'll use this on the antiSquish and diff --git a/src/Gui/SoTextLabel.cpp b/src/Gui/SoTextLabel.cpp index 71b29852c5..c074389a51 100644 --- a/src/Gui/SoTextLabel.cpp +++ b/src/Gui/SoTextLabel.cpp @@ -105,7 +105,7 @@ SoTextLabel::SoTextLabel() { SO_NODE_CONSTRUCTOR(SoTextLabel); SO_NODE_ADD_FIELD(backgroundColor, (SbVec3f(1.0f,1.0f,1.0f))); - SO_NODE_ADD_FIELD(background, (TRUE)); + SO_NODE_ADD_FIELD(background, (true)); SO_NODE_ADD_FIELD(frameSize, (10.0f)); } @@ -131,7 +131,7 @@ void SoTextLabel::GLRender(SoGLRenderAction *action) SbVec3f center; this->computeBBox(action, box, center); - if (!SoCullElement::cullTest(state, box, TRUE)) { + if (!SoCullElement::cullTest(state, box, true)) { SoMaterialBundle mb(action); mb.sendFirst(); const SbMatrix & mat = SoModelMatrixElement::get(state); @@ -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) @@ -254,11 +254,11 @@ void SoTextLabel::GLRender(SoGLRenderAction *action) state->push(); // disable textures for all units - SoGLTextureEnabledElement::set(state, this, FALSE); + SoGLTextureEnabledElement::set(state, this, false); #if COIN_MAJOR_VERSION > 3 - SoMultiTextureEnabledElement::set(state, this, FALSE); + SoMultiTextureEnabledElement::set(state, this, false); #else - SoGLTexture3EnabledElement::set(state, this, FALSE); + SoGLTexture3EnabledElement::set(state, this, false); #endif glPushAttrib(GL_ENABLE_BIT | GL_PIXEL_MODE_BIT | GL_COLOR_BUFFER_BIT); @@ -406,7 +406,7 @@ SoFrameLabel::SoFrameLabel() SO_NODE_ADD_FIELD(justification, (LEFT)); SO_NODE_ADD_FIELD(name, ("Helvetica")); SO_NODE_ADD_FIELD(size, (12)); - SO_NODE_ADD_FIELD(frame, (TRUE)); + SO_NODE_ADD_FIELD(frame, (true)); //SO_NODE_ADD_FIELD(image, (SbVec2s(0,0), 0, NULL)); } @@ -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; diff --git a/src/Gui/SpinBox.cpp b/src/Gui/SpinBox.cpp index da53f1535f..775066e2a6 100644 --- a/src/Gui/SpinBox.cpp +++ b/src/Gui/SpinBox.cpp @@ -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 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 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 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())); } } diff --git a/src/Gui/Splashscreen.cpp b/src/Gui/Splashscreen.cpp index 81d1e3dfc2..87ee588137 100644 --- a/src/Gui/Splashscreen.cpp +++ b/src/Gui/Splashscreen.cpp @@ -61,7 +61,7 @@ public: const std::map& cfg = App::GetApplication().Config(); std::map::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::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; } @@ -150,7 +150,7 @@ private: /** * Constructs a splash screen that will display the pixmap. */ -SplashScreen::SplashScreen( const QPixmap & pixmap , Qt::WFlags f ) +SplashScreen::SplashScreen( const QPixmap & pixmap , Qt::WindowFlags f ) : QSplashScreen(pixmap, f) { // write the messages to splasher @@ -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 @@ -317,9 +317,9 @@ static int getWordSizeOfOS() // determine if 32-bit process running on 64-bit windows in WOW64 emulation // or 32-bit process running on 32-bit windows - // default bIsWow64 to FALSE for 32-bit process on 32-bit windows + // default bIsWow64 to false for 32-bit process on 32-bit windows - BOOL bIsWow64 = FALSE; // must default to FALSE + BOOL bIsWow64 = false; // must default to false typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL); LPFN_ISWOW64PROCESS fnIsWow64Process = (LPFN_ISWOW64PROCESS) GetProcAddress( @@ -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::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& config = App::Application::Config(); std::map::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) { diff --git a/src/Gui/Splashscreen.h b/src/Gui/Splashscreen.h index 0f07e8d2be..006efccbed 100644 --- a/src/Gui/Splashscreen.h +++ b/src/Gui/Splashscreen.h @@ -40,7 +40,7 @@ class SplashScreen : public QSplashScreen Q_OBJECT public: - SplashScreen( const QPixmap & pixmap = QPixmap ( ), Qt::WFlags f = 0 ); + SplashScreen( const QPixmap & pixmap = QPixmap ( ), Qt::WindowFlags f = 0 ); ~SplashScreen(); protected: diff --git a/src/Gui/SplitView3DInventor.cpp b/src/Gui/SplitView3DInventor.cpp index 61b5a5de98..5b7bfe8314 100644 --- a/src/Gui/SplitView3DInventor.cpp +++ b/src/Gui/SplitView3DInventor.cpp @@ -43,7 +43,7 @@ using namespace Gui; TYPESYSTEM_SOURCE_ABSTRACT(Gui::AbstractSplitView,Gui::MDIView); -AbstractSplitView::AbstractSplitView(Gui::Document* pcDocument, QWidget* parent, Qt::WFlags wflags) +AbstractSplitView::AbstractSplitView(Gui::Document* pcDocument, QWidget* parent, Qt::WindowFlags wflags) : MDIView(pcDocument,parent, wflags) { // important for highlighting @@ -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(); @@ -371,7 +371,7 @@ void AbstractSplitView::setOverrideCursor(const QCursor& aCursor) TYPESYSTEM_SOURCE_ABSTRACT(Gui::SplitView3DInventor, Gui::AbstractSplitView); -SplitView3DInventor::SplitView3DInventor(int views, Gui::Document* pcDocument, QWidget* parent, Qt::WFlags wflags) +SplitView3DInventor::SplitView3DInventor(int views, Gui::Document* pcDocument, QWidget* parent, Qt::WindowFlags wflags) : AbstractSplitView(pcDocument,parent, wflags) { QSplitter* mainSplitter=0; diff --git a/src/Gui/SplitView3DInventor.h b/src/Gui/SplitView3DInventor.h index 2a3373e946..bb01c76279 100644 --- a/src/Gui/SplitView3DInventor.h +++ b/src/Gui/SplitView3DInventor.h @@ -41,7 +41,7 @@ class GuiExport AbstractSplitView : public MDIView, public ParameterGrp::Observe TYPESYSTEM_HEADER(); public: - AbstractSplitView(Gui::Document* pcDocument, QWidget* parent, Qt::WFlags wflags=0); + AbstractSplitView(Gui::Document* pcDocument, QWidget* parent, Qt::WindowFlags wflags=0); ~AbstractSplitView(); virtual const char *getName(void) const; @@ -74,7 +74,7 @@ class GuiExport SplitView3DInventor : public AbstractSplitView TYPESYSTEM_HEADER(); public: - SplitView3DInventor(int views, Gui::Document* pcDocument, QWidget* parent, Qt::WFlags wflags=0); + SplitView3DInventor(int views, Gui::Document* pcDocument, QWidget* parent, Qt::WindowFlags wflags=0); ~SplitView3DInventor(); }; diff --git a/src/Gui/TaskView/TaskAppearance.cpp b/src/Gui/TaskView/TaskAppearance.cpp index 85b208f894..868e062a6a 100644 --- a/src/Gui/TaskView/TaskAppearance.cpp +++ b/src/Gui/TaskView/TaskAppearance.cpp @@ -142,14 +142,14 @@ void TaskAppearance::on_changeMode_activated(const QString& s) App::Property* prop = (*It)->getPropertyByName("DisplayMode"); if (prop && prop->getTypeId() == App::PropertyEnumeration::getClassTypeId()) { App::PropertyEnumeration* Display = (App::PropertyEnumeration*)prop; - Display->setValue((const char*)s.toAscii()); + Display->setValue((const char*)s.toLatin1()); } } } void TaskAppearance::on_changePlot_activated(const QString&s) { - Base::Console().Log("Plot = %s\n",(const char*)s.toAscii()); + Base::Console().Log("Plot = %s\n",(const char*)s.toLatin1()); } /** @@ -231,7 +231,7 @@ void TaskAppearance::setDisplayModes(const std::vector& view App::Property* prop = (*it)->getPropertyByName("DisplayMode"); if (prop && prop->getTypeId() == App::PropertyEnumeration::getClassTypeId()) { App::PropertyEnumeration* display = static_cast(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); diff --git a/src/Gui/TaskView/TaskSelectLinkProperty.cpp b/src/Gui/TaskView/TaskSelectLinkProperty.cpp index f7c8b19e40..54971028f0 100644 --- a/src/Gui/TaskView/TaskSelectLinkProperty.cpp +++ b/src/Gui/TaskView/TaskSelectLinkProperty.cpp @@ -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(); } diff --git a/src/Gui/TextEdit.cpp b/src/Gui/TextEdit.cpp index 2bb69905e9..a3291d2d70 100644 --- a/src/Gui/TextEdit.cpp +++ b/src/Gui/TextEdit.cpp @@ -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 &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::ConstIterator it = d->colormap.find(QString::fromAscii(sReason)); + QMap::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); diff --git a/src/Gui/TextureMapping.cpp b/src/Gui/TextureMapping.cpp index d8fb94bc94..1d1cc02f93 100644 --- a/src/Gui/TextureMapping.cpp +++ b/src/Gui/TextureMapping.cpp @@ -48,7 +48,7 @@ using namespace Gui::Dialog; /* TRANSLATOR Gui::Dialog::TextureMapping */ -TextureMapping::TextureMapping(QWidget* parent, Qt::WFlags fl) +TextureMapping::TextureMapping(QWidget* parent, Qt::WindowFlags fl) : QDialog(parent, fl), grp(0), tex(0), env(0) { ui = new Ui_TextureMapping(); @@ -59,7 +59,7 @@ TextureMapping::TextureMapping(QWidget* parent, Qt::WFlags fl) QStringList formats; QList qtformats = QImageReader::supportedImageFormats(); for (QList::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(" ")))); diff --git a/src/Gui/TextureMapping.h b/src/Gui/TextureMapping.h index 77f32f1d2d..58927f6434 100644 --- a/src/Gui/TextureMapping.h +++ b/src/Gui/TextureMapping.h @@ -39,7 +39,7 @@ class GuiExport TextureMapping : public QDialog Q_OBJECT public: - TextureMapping(QWidget* parent = 0, Qt::WFlags fl = 0); + TextureMapping(QWidget* parent = 0, Qt::WindowFlags fl = 0); ~TextureMapping(); void accept(); void reject(); diff --git a/src/Gui/Thumbnail.cpp b/src/Gui/Thumbnail.cpp index 034715d5c7..1172505664 100644 --- a/src/Gui/Thumbnail.cpp +++ b/src/Gui/Thumbnail.cpp @@ -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); diff --git a/src/Gui/ToolBarManager.cpp b/src/Gui/ToolBarManager.cpp index b539f98f6e..31aac6af46 100644 --- a/src/Gui/ToolBarManager.cpp +++ b/src/Gui/ToolBarManager.cpp @@ -260,7 +260,7 @@ void ToolBarManager::setup(ToolBarItem* item, QToolBar* toolbar) const QList actions = toolbar->actions(); for (QList::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 diff --git a/src/Gui/ToolBox.cpp b/src/Gui/ToolBox.cpp index ce24d4b0f3..e27677f8b9 100644 --- a/src/Gui/ToolBox.cpp +++ b/src/Gui/ToolBox.cpp @@ -100,7 +100,7 @@ void ToolBox::removeItem ( int index ) } /** - * If \a enabled is TRUE then the item at position \a index is enabled; otherwise item \a index is disabled. + * If \a enabled is true then the item at position \a index is enabled; otherwise item \a index is disabled. */ void ToolBox::setItemEnabled ( int index, bool enabled ) { @@ -108,7 +108,7 @@ void ToolBox::setItemEnabled ( int index, bool enabled ) } /** - * Returns TRUE if the item at position \a index is enabled; otherwise returns FALSE. + * Returns true if the item at position \a index is enabled; otherwise returns false. */ bool ToolBox::isItemEnabled ( int index ) const { diff --git a/src/Gui/ToolBoxManager.cpp b/src/Gui/ToolBoxManager.cpp index 846c4ce140..a4cfb165bc 100644 --- a/src/Gui/ToolBoxManager.cpp +++ b/src/Gui/ToolBoxManager.cpp @@ -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() ); diff --git a/src/Gui/TouchpadNavigationStyle.cpp b/src/Gui/TouchpadNavigationStyle.cpp index 8f3060a406..db3b304061 100644 --- a/src/Gui/TouchpadNavigationStyle.cpp +++ b/src/Gui/TouchpadNavigationStyle.cpp @@ -98,11 +98,11 @@ SbBool TouchpadNavigationStyle::processSoEvent(const SoEvent * const ev) this->lastmouseposition = posn; - // Set to TRUE if any event processing happened. Note that it is not + // Set to true if any event processing happened. Note that it is not // necessary to restrict ourselves to only do one "action" for an // event, we only need this flag to see if any processing happened // at all. - SbBool processed = FALSE; + SbBool processed = false; const ViewerMode curmode = this->currentmode; ViewerMode newmode = curmode; @@ -123,13 +123,13 @@ SbBool TouchpadNavigationStyle::processSoEvent(const SoEvent * const ev) if (!processed && !viewer->isEditing()) { processed = handleEventInForeground(ev); if (processed) - return TRUE; + return true; } // Keyboard handling if (type.isDerivedFrom(SoKeyboardEvent::getClassTypeId())) { const SoKeyboardEvent * const event = (const SoKeyboardEvent *) ev; - const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE; + const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false; switch (event->getKey()) { case SoKeyboardEvent::LEFT_CONTROL: case SoKeyboardEvent::RIGHT_CONTROL: @@ -144,7 +144,7 @@ SbBool TouchpadNavigationStyle::processSoEvent(const SoEvent * const ev) this->altdown = press; break; case SoKeyboardEvent::H: - processed = TRUE; + processed = true; viewer->saveHomePosition(); break; case SoKeyboardEvent::S: @@ -157,12 +157,12 @@ SbBool TouchpadNavigationStyle::processSoEvent(const SoEvent * const ev) this->setViewing(true); break; case SoKeyboardEvent::PAGE_UP: - doZoom(viewer->getSoRenderManager()->getCamera(), TRUE, posn); - processed = TRUE; + doZoom(viewer->getSoRenderManager()->getCamera(), true, posn); + processed = true; break; case SoKeyboardEvent::PAGE_DOWN: - doZoom(viewer->getSoRenderManager()->getCamera(), FALSE, posn); - processed = TRUE; + doZoom(viewer->getSoRenderManager()->getCamera(), false, posn); + processed = true; break; default: break; @@ -173,33 +173,33 @@ SbBool TouchpadNavigationStyle::processSoEvent(const SoEvent * const ev) if (type.isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) { const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev; const int button = event->getButton(); - const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE; + const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false; // SoDebugError::postInfo("processSoEvent", "button = %d", button); switch (button) { case SoMouseButtonEvent::BUTTON1: - this->lockrecenter = TRUE; + this->lockrecenter = true; this->button1down = press; if (press && (this->currentmode == NavigationStyle::SEEK_WAIT_MODE)) { newmode = NavigationStyle::SEEK_MODE; this->seekToPoint(pos); // implicitly calls interactiveCountInc() - processed = TRUE; + processed = true; } else if (press && (this->currentmode == NavigationStyle::PANNING || this->currentmode == NavigationStyle::ZOOMING)) { newmode = NavigationStyle::DRAGGING; saveCursorPosition(ev); this->centerTime = ev->getTime(); - processed = TRUE; + processed = true; } else if (viewer->isEditing() && (this->currentmode == NavigationStyle::SPINNING)) { - processed = TRUE; + processed = true; } break; case SoMouseButtonEvent::BUTTON2: // If we are in edit mode then simply ignore the RMB events // to pass the event to the base class. - this->lockrecenter = TRUE; + this->lockrecenter = true; if (!viewer->isEditing()) { // If we are in zoom or pan mode ignore RMB events otherwise // the canvas doesn't get any release events @@ -219,17 +219,17 @@ SbBool TouchpadNavigationStyle::processSoEvent(const SoEvent * const ev) newmode = NavigationStyle::DRAGGING; saveCursorPosition(ev); this->centerTime = ev->getTime(); - processed = TRUE; + processed = true; } this->button2down = press; break; case SoMouseButtonEvent::BUTTON4: - doZoom(viewer->getSoRenderManager()->getCamera(), TRUE, posn); - processed = TRUE; + doZoom(viewer->getSoRenderManager()->getCamera(), true, posn); + processed = true; break; case SoMouseButtonEvent::BUTTON5: - doZoom(viewer->getSoRenderManager()->getCamera(), FALSE, posn); - processed = TRUE; + doZoom(viewer->getSoRenderManager()->getCamera(), false, posn); + processed = true; break; default: break; @@ -238,22 +238,22 @@ SbBool TouchpadNavigationStyle::processSoEvent(const SoEvent * const ev) // Mouse Movement handling if (type.isDerivedFrom(SoLocation2Event::getClassTypeId())) { - this->lockrecenter = TRUE; + this->lockrecenter = true; const SoLocation2Event * const event = (const SoLocation2Event *) ev; if (this->currentmode == NavigationStyle::ZOOMING) { this->zoomByCursor(posn, prevnormalized); - processed = TRUE; + processed = true; } else if (this->currentmode == NavigationStyle::PANNING) { float ratio = vp.getViewportAspectRatio(); panCamera(viewer->getSoRenderManager()->getCamera(), ratio, this->panningplane, posn, prevnormalized); - processed = TRUE; + processed = true; } else if (this->currentmode == NavigationStyle::DRAGGING) { this->addToLog(event->getPosition(), event->getTime()); this->spin(posn); moveCursorPosition(); - processed = TRUE; + processed = true; } } @@ -262,7 +262,7 @@ SbBool TouchpadNavigationStyle::processSoEvent(const SoEvent * const ev) const SoMotion3Event * const event = static_cast(ev); if (event) this->processMotionEvent(event); - processed = TRUE; + processed = true; } enum { @@ -320,7 +320,7 @@ SbBool TouchpadNavigationStyle::processSoEvent(const SoEvent * const ev) if (!processed) processed = inherited::processSoEvent(ev); else - return TRUE; + return true; return processed; } diff --git a/src/Gui/Transform.cpp b/src/Gui/Transform.cpp index 9500741b6e..299a67f1b9 100644 --- a/src/Gui/Transform.cpp +++ b/src/Gui/Transform.cpp @@ -301,7 +301,7 @@ void DefaultTransformStrategy::onSelectionChanged(const Gui::SelectionChanges& m /* TRANSLATOR Gui::Dialog::Transform */ -Transform::Transform(QWidget* parent, Qt::WFlags fl) +Transform::Transform(QWidget* parent, Qt::WindowFlags fl) : Gui::LocationDialog(parent, fl), strategy(0) { ui = new Ui_TransformComp(this); diff --git a/src/Gui/Transform.h b/src/Gui/Transform.h index 042d4f6919..f73b1a9059 100644 --- a/src/Gui/Transform.h +++ b/src/Gui/Transform.h @@ -71,7 +71,7 @@ class GuiExport Transform : public Gui::LocationDialog Q_OBJECT public: - Transform(QWidget* parent = 0, Qt::WFlags fl = 0); + Transform(QWidget* parent = 0, Qt::WindowFlags fl = 0); ~Transform(); void accept(); void reject(); diff --git a/src/Gui/Tree.cpp b/src/Gui/Tree.cpp index d1495c9ad1..dba94c0df9 100644 --- a/src/Gui/Tree.cpp +++ b/src/Gui/Tree.cpp @@ -221,9 +221,9 @@ void TreeWidget::onCreateGroup() if (this->contextItem->type() == DocumentType) { DocumentItem* docitem = static_cast(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()) { diff --git a/src/Gui/View3DInventor.cpp b/src/Gui/View3DInventor.cpp index 2ed23dd6b4..3b229c1f44 100644 --- a/src/Gui/View3DInventor.cpp +++ b/src/Gui/View3DInventor.cpp @@ -105,7 +105,7 @@ void GLOverlayWidget::paintEvent(QPaintEvent* ev) TYPESYSTEM_SOURCE_ABSTRACT(Gui::View3DInventor,Gui::MDIView); View3DInventor::View3DInventor(Gui::Document* pcDocument, QWidget* parent, - const QGLWidget* sharewidget, Qt::WFlags wflags) + const QGLWidget* sharewidget, Qt::WindowFlags wflags) : MDIView(pcDocument, parent, wflags), _viewerPy(0) { stack = new QStackedWidget(this); @@ -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(); diff --git a/src/Gui/View3DInventor.h b/src/Gui/View3DInventor.h index b0053e9063..1af621d8cc 100644 --- a/src/Gui/View3DInventor.h +++ b/src/Gui/View3DInventor.h @@ -68,7 +68,7 @@ class GuiExport View3DInventor : public MDIView, public ParameterGrp::ObserverTy TYPESYSTEM_HEADER(); public: - View3DInventor(Gui::Document* pcDocument, QWidget* parent, const QGLWidget* sharewidget = 0, Qt::WFlags wflags=0); + View3DInventor(Gui::Document* pcDocument, QWidget* parent, const QGLWidget* sharewidget = 0, Qt::WindowFlags wflags=0); ~View3DInventor(); /// Message handler diff --git a/src/Gui/View3DInventorExamples.cpp b/src/Gui/View3DInventorExamples.cpp index 9102681b8c..7343c31616 100644 --- a/src/Gui/View3DInventorExamples.cpp +++ b/src/Gui/View3DInventorExamples.cpp @@ -300,7 +300,7 @@ void LightManip(SoSeparator * root) for (int i = 0; i < 3; i++) { sa.setName( pointlightnames[i] ); sa.setInterest( SoSearchAction::FIRST ); - sa.setSearchingAll( FALSE ); + sa.setSearchingAll( false ); sa.apply( root ); SoPath * path = sa.getPath(); if ( path == NULL) return; // Shouldn't happen. @@ -379,7 +379,7 @@ texture() static void timersensorcallback(void * data, SoSensor *) { - static SbBool direction = FALSE; + static SbBool direction = false; SoTexture2 * texnode = (SoTexture2*) data; diff --git a/src/Gui/View3DInventorViewer.cpp b/src/Gui/View3DInventorViewer.cpp index 952ec0b235..4037449575 100644 --- a/src/Gui/View3DInventorViewer.cpp +++ b/src/Gui/View3DInventorViewer.cpp @@ -332,16 +332,16 @@ public: // ************************************************************************* View3DInventorViewer::View3DInventorViewer(QWidget* parent, const QGLWidget* sharewidget) : Quarter::SoQTQuarterAdaptor(parent, sharewidget), editViewProvider(0), navigation(0), - renderType(Native), framebuffer(0), axisCross(0), axisGroup(0), editing(FALSE), redirected(FALSE), - allowredir(FALSE), overrideMode("As Is"), _viewerPy(0) + renderType(Native), framebuffer(0), axisCross(0), axisGroup(0), editing(false), redirected(false), + allowredir(false), overrideMode("As Is"), _viewerPy(0) { init(); } View3DInventorViewer::View3DInventorViewer(const QGLFormat& format, QWidget* parent, const QGLWidget* sharewidget) : Quarter::SoQTQuarterAdaptor(format, parent, sharewidget), editViewProvider(0), navigation(0), - renderType(Native), framebuffer(0), axisCross(0), axisGroup(0), editing(FALSE), redirected(FALSE), - allowredir(FALSE), overrideMode("As Is"), _viewerPy(0) + renderType(Native), framebuffer(0), axisCross(0), axisGroup(0), editing(false), redirected(false), + allowredir(false), overrideMode("As Is"), _viewerPy(0) { init(); } @@ -352,7 +352,7 @@ void View3DInventorViewer::init() // Coin should not clear the pixel-buffer, so the background image // is not removed. - this->setClearWindow(FALSE); + this->setClearWindow(false); // setting up the defaults for the spin rotation initialize(); @@ -369,7 +369,7 @@ void View3DInventorViewer::init() backlight->ref(); backlight->setName("backlight"); backlight->direction.setValue(-hl->direction.getValue()); - backlight->on.setValue(FALSE); // by default off + backlight->on.setValue(false); // by default off // Set up background scenegraph with image in it. backgroundroot = new SoSeparator; @@ -574,7 +574,7 @@ void View3DInventorViewer::initialize() navigation = new CADNavigationStyle(); navigation->setViewer(this); - this->axiscrossEnabled = TRUE; + this->axiscrossEnabled = true; this->axiscrossSize = 10; } @@ -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); @@ -2123,7 +2123,7 @@ void View3DInventorViewer::viewSelection() Decide if it should be possible to start a spin animation of the model in the viewer by releasing the mouse button while dragging. - If the \a enable flag is \c FALSE and we're currently animating, the + If the \a enable flag is \c false and we're currently animating, the spin will be stopped. */ void @@ -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(); diff --git a/src/Gui/View3DInventorViewer.h b/src/Gui/View3DInventorViewer.h index 2141a128bb..48d815c80c 100644 --- a/src/Gui/View3DInventorViewer.h +++ b/src/Gui/View3DInventorViewer.h @@ -299,7 +299,7 @@ public: /** * Set the camera's orientation. If isAnimationEnabled() returns - * \a TRUE the reorientation is animated, otherwise its directly + * \a true the reorientation is animated, otherwise its directly * set. */ void setCameraOrientation(const SbRotation& rot, SbBool moveTocenter=false); diff --git a/src/Gui/ViewProvider.cpp b/src/Gui/ViewProvider.cpp index 5d0d7c1d6e..7aaa985c58 100644 --- a/src/Gui/ViewProvider.cpp +++ b/src/Gui/ViewProvider.cpp @@ -155,7 +155,7 @@ void ViewProvider::eventCallback(void * ud, SoEventCallback * node) // Keyboard events if (ev->getTypeId().isDerivedFrom(SoKeyboardEvent::getClassTypeId())) { SoKeyboardEvent * ke = (SoKeyboardEvent *)ev; - const SbBool press = ke->getState() == SoButtonEvent::DOWN ? TRUE : FALSE; + const SbBool press = ke->getState() == SoButtonEvent::DOWN ? true : false; switch (ke->getKey()) { case SoKeyboardEvent::ESCAPE: if (self->keyPressed (press, ke->getKey())) @@ -175,7 +175,7 @@ void ViewProvider::eventCallback(void * ud, SoEventCallback * node) const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev; const int button = event->getButton(); - const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE; + const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false; // call the virtual method if (self->mouseButtonPressed(button,press,ev->getPosition(),viewer)) diff --git a/src/Gui/ViewProviderAnnotation.cpp b/src/Gui/ViewProviderAnnotation.cpp index 9dae716e55..0fb2802e46 100644 --- a/src/Gui/ViewProviderAnnotation.cpp +++ b/src/Gui/ViewProviderAnnotation.cpp @@ -263,7 +263,7 @@ ViewProviderAnnotationLabel::ViewProviderAnnotationLabel() Justification.setEnums(JustificationEnums); QFont fn; ADD_PROPERTY(FontSize,(fn.pointSize())); - ADD_PROPERTY(FontName,((const char*)fn.family().toAscii())); + ADD_PROPERTY(FontName,((const char*)fn.family().toLatin1())); ADD_PROPERTY(Frame,(true)); pColor = new SoBaseColor(); @@ -414,7 +414,7 @@ bool ViewProviderAnnotationLabel::setEdit(int ModNum) { SoSearchAction sa; sa.setInterest(SoSearchAction::FIRST); - sa.setSearchingAll(FALSE); + sa.setSearchingAll(false); sa.setNode(this->pTextTranslation); sa.apply(pcRoot); SoPath * path = sa.getPath(); @@ -455,7 +455,7 @@ void ViewProviderAnnotationLabel::drawImage(const std::vector& 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(); diff --git a/src/Gui/ViewProviderGeometryObject.cpp b/src/Gui/ViewProviderGeometryObject.cpp index d81bc9996c..21626f6dab 100644 --- a/src/Gui/ViewProviderGeometryObject.cpp +++ b/src/Gui/ViewProviderGeometryObject.cpp @@ -227,7 +227,7 @@ bool ViewProviderGeometryObject::setEdit(int ModNum) #if 1 SoSearchAction sa; sa.setInterest(SoSearchAction::FIRST); - sa.setSearchingAll(FALSE); + sa.setSearchingAll(false); sa.setNode(this->pcTransform); sa.apply(pcRoot); SoPath * path = sa.getPath(); @@ -336,7 +336,7 @@ void ViewProviderGeometryObject::setEditViewer(Gui::View3DInventorViewer* viewer { if (ModNum == (int)ViewProvider::Transform) { SoNode* root = viewer->getSceneGraph(); - static_cast(root)->selectionRole.setValue(FALSE); + static_cast(root)->selectionRole.setValue(false); } } @@ -345,7 +345,7 @@ void ViewProviderGeometryObject::unsetEditViewer(Gui::View3DInventorViewer* view int ModNum = this->getEditingMode(); if (ModNum == (int)ViewProvider::Transform) { SoNode* root = viewer->getSceneGraph(); - static_cast(root)->selectionRole.setValue(TRUE); + static_cast(root)->selectionRole.setValue(true); } } @@ -601,7 +601,7 @@ void ViewProviderGeometryObject::setSelectable(bool selectable) { SoSearchAction sa; sa.setInterest(SoSearchAction::ALL); - sa.setSearchingAll(TRUE); + sa.setSearchingAll(true); sa.setType(Gui::SoFCSelection::getClassTypeId()); sa.apply(pcRoot); diff --git a/src/Gui/WidgetFactory.cpp b/src/Gui/WidgetFactory.cpp index 1b22eb993f..4318e169b7 100644 --- a/src/Gui/WidgetFactory.cpp +++ b/src/Gui/WidgetFactory.cpp @@ -549,8 +549,8 @@ QWidget* UiLoader::createWidget(const QString & className, QWidget * parent, if (this->cw.contains(className)) return QUiLoader::createWidget(className, parent, name); QWidget* w = 0; - if (WidgetFactory().CanProduce((const char*)className.toAscii())) - w = WidgetFactory().createWidget((const char*)className.toAscii(), parent); + if (WidgetFactory().CanProduce((const char*)className.toLatin1())) + w = WidgetFactory().createWidget((const char*)className.toLatin1(), parent); if (w) w->setObjectName(name); return w; } @@ -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; @@ -842,14 +842,14 @@ ContainerDialog::ContainerDialog( QWidget* templChild ) setWindowTitle( templChild->objectName() ); setObjectName( templChild->objectName() ); - setSizeGripEnabled( TRUE ); + setSizeGripEnabled( true ); MyDialogLayout = new QGridLayout(this); buttonOk = new QPushButton(this); buttonOk->setObjectName(QLatin1String("buttonOK")); buttonOk->setText( tr( "&OK" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); + buttonOk->setAutoDefault( true ); + buttonOk->setDefault( true ); MyDialogLayout->addWidget( buttonOk, 1, 0 ); QSpacerItem* spacer = new QSpacerItem( 210, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); @@ -858,7 +858,7 @@ ContainerDialog::ContainerDialog( QWidget* templChild ) buttonCancel = new QPushButton(this); buttonCancel->setObjectName(QLatin1String("buttonCancel")); buttonCancel->setText( tr( "&Cancel" ) ); - buttonCancel->setAutoDefault( TRUE ); + buttonCancel->setAutoDefault( true ); MyDialogLayout->addWidget( buttonCancel, 1, 2 ); @@ -1029,8 +1029,8 @@ void PyResource::load( const char* name ) /** * Makes a connection between the sender widget \a sender and its signal \a signal * of the created resource and Python callback function \a cb. - * If the sender widget does not exist or no resource has been loaded this method returns FALSE, - * otherwise it returns TRUE. + * If the sender widget does not exist or no resource has been loaded this method returns false, + * otherwise it returns true. */ bool PyResource::connect(const char* sender, const char* signal, PyObject* cb) { @@ -1041,7 +1041,7 @@ bool PyResource::connect(const char* sender, const char* signal, PyObject* cb) QList list = myDlg->findChildren(); QList::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; @@ -1055,7 +1055,7 @@ bool PyResource::connect(const char* sender, const char* signal, PyObject* cb) if (objS) { SignalConnect* sc = new SignalConnect(this, cb); mySingals.push_back(sc); - return QObject::connect(objS, sigStr.toAscii(), sc, SLOT ( onExecute() ) ); + return QObject::connect(objS, sigStr.toLatin1(), sc, SLOT ( onExecute() ) ); } else qWarning( "'%s' does not exist.\n", sender ); @@ -1165,14 +1165,14 @@ PyObject *PyResource::value(PyObject *args) int nSize = str.count(); PyObject* slist = PyList_New(nSize); for (int i=0; isetData(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; } @@ -444,9 +444,9 @@ void AccelLineEdit::keyPressEvent ( QKeyEvent * e) * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ -CheckListDialog::CheckListDialog( QWidget* parent, Qt::WFlags fl ) +CheckListDialog::CheckListDialog( QWidget* parent, Qt::WindowFlags fl ) : QDialog( parent, fl ) { ui.setupUi(this); @@ -709,10 +709,10 @@ void ColorButton::onRejected() // ------------------------------------------------------------------------------ -UrlLabel::UrlLabel(QWidget * parent, Qt::WFlags f) +UrlLabel::UrlLabel(QWidget * parent, Qt::WindowFlags f) : QLabel(parent, f) { - _url = QString::fromAscii("http://localhost"); + _url = QString::fromLatin1("http://localhost"); setToolTip(this->_url); } @@ -740,7 +740,7 @@ void UrlLabel::mouseReleaseEvent (QMouseEvent *) PyObject* dict = PyModule_GetDict(module); PyObject* func = PyDict_GetItemString(dict, "open"); if (func) { - PyObject* args = Py_BuildValue("(s)", (const char*)this->_url.toAscii()); + PyObject* args = Py_BuildValue("(s)", (const char*)this->_url.toLatin1()); PyObject* result = PyEval_CallObject(func,args); // decrement the args and module reference Py_XDECREF(result); diff --git a/src/Gui/Widgets.h b/src/Gui/Widgets.h index 6f9fe35c2a..097034a4e0 100644 --- a/src/Gui/Widgets.h +++ b/src/Gui/Widgets.h @@ -147,7 +147,7 @@ class GuiExport CheckListDialog : public QDialog Q_OBJECT public: - CheckListDialog( QWidget* parent = 0, Qt::WFlags fl = 0 ); + CheckListDialog( QWidget* parent = 0, Qt::WindowFlags fl = 0 ); ~CheckListDialog(); void setCheckableItems( const QStringList& items ); @@ -225,7 +225,7 @@ class GuiExport UrlLabel : public QLabel Q_PROPERTY( QString url READ url WRITE setUrl) public: - UrlLabel ( QWidget * parent = 0, Qt::WFlags f = 0 ); + UrlLabel ( QWidget * parent = 0, Qt::WindowFlags f = 0 ); virtual ~UrlLabel(); QString url() const; diff --git a/src/Gui/Workbench.cpp b/src/Gui/Workbench.cpp index f29ce1e671..b65917c266 100644 --- a/src/Gui/Workbench.cpp +++ b/src/Gui/Workbench.cpp @@ -324,7 +324,7 @@ void Workbench::setupCustomShortcuts() const // may be UTF-8 encoded QString str = QString::fromUtf8(it->second.c_str()); QKeySequence shortcut = str; - cmd->getAction()->setShortcut(shortcut); + cmd->getAction()->setShortcut(shortcut.toString(QKeySequence::NativeText)); } } } diff --git a/src/Gui/propertyeditor/PropertyItem.cpp b/src/Gui/propertyeditor/PropertyItem.cpp index 8897c2ea9d..554daeeb07 100644 --- a/src/Gui/propertyeditor/PropertyItem.cpp +++ b/src/Gui/propertyeditor/PropertyItem.cpp @@ -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(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(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(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(); 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(); - 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()) return; const Base::Vector3d& val = value.value(); - 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(editor); const Base::Vector3d& value = data.value(); - 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(); - 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(); - 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(); 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(editor); const Base::Matrix4D& value = data.value(); - 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::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(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(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(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(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(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(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(); - 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); } @@ -2428,8 +2428,8 @@ LinkSelection::~LinkSelection() void LinkSelection::select() { Gui::Selection().clearSelection(); - Gui::Selection().addSelection((const char*)link[0].toAscii(), - (const char*)link[1].toAscii()); + Gui::Selection().addSelection((const char*)link[0].toLatin1(), + (const char*)link[1].toLatin1()); this->deleteLater(); } @@ -2450,7 +2450,7 @@ void LinkLabel::setPropertyLink(const QStringList& o) { link = o; - QString text = QString::fromAscii( + QString text = QString::fromLatin1( "" @@ -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(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(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); } } diff --git a/src/Gui/propertyeditor/PropertyModel.cpp b/src/Gui/propertyeditor/PropertyModel.cpp index 7071dcc21d..a1f2f759e1 100644 --- a/src/Gui/propertyeditor/PropertyModel.cpp +++ b/src/Gui/propertyeditor/PropertyModel.cpp @@ -211,6 +211,8 @@ void PropertyModel::buildUp(const PropertyModel::PropertyList& props) // fill up the listview with the properties rootItem->reset(); + beginResetModel(); + // sort the properties into their groups std::map > > propGroup; PropertyModel::PropertyList::const_iterator jt; @@ -229,13 +231,13 @@ void PropertyModel::buildUp(const PropertyModel::PropertyList& props) PropertyItem* group = static_cast(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 >::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,14 +254,15 @@ 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); } } } } - reset(); + endResetModel(); +// reset(); } void PropertyModel::updateProperty(const App::Property& prop) @@ -282,7 +285,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 +305,7 @@ void PropertyModel::appendProperty(const App::Property& prop) PropertyItem* child = static_cast(item); child->setParent(rootItem); rootItem->appendChild(child); - child->setPropertyName(QString::fromAscii(prop.getName())); + child->setPropertyName(QString::fromLatin1(prop.getName())); std::vector data; data.push_back(const_cast(&prop)); child->setPropertyData(data); diff --git a/src/Main/FreeCADGuiPy.cpp b/src/Main/FreeCADGuiPy.cpp index 6cd5d0cf5b..08dc6423b8 100644 --- a/src/Main/FreeCADGuiPy.cpp +++ b/src/Main/FreeCADGuiPy.cpp @@ -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()); diff --git a/src/Main/MainGui.cpp b/src/Main/MainGui.cpp index 5f76a079c0..4ea339dfe7 100644 --- a/src/Main/MainGui.cpp +++ b/src/Main/MainGui.cpp @@ -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("

") + msg + QLatin1String("
"); 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("
") + msg + QLatin1String("
"); 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); @@ -328,7 +328,7 @@ static LONG __stdcall MyCrashHandlerExceptionFilter(EXCEPTION_POINTERS* pEx) MINIDUMP_EXCEPTION_INFORMATION stMDEI; stMDEI.ThreadId = GetCurrentThreadId(); stMDEI.ExceptionPointers = pEx; - stMDEI.ClientPointers = TRUE; + stMDEI.ClientPointers = true; // try to create an miniDump: if (s_pMDWD( GetCurrentProcess(), diff --git a/src/Main/MainPy.cpp b/src/Main/MainPy.cpp index 702238e01d..0bec9afeee 100644 --- a/src/Main/MainPy.cpp +++ b/src/Main/MainPy.cpp @@ -69,7 +69,7 @@ BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserv break; } - return TRUE; + return true; } #elif defined(FC_OS_LINUX) # ifndef GNU_SOURCE diff --git a/src/Mod/Complete/Gui/Workbench.h b/src/Mod/Complete/Gui/Workbench.h index 872a1f8e3b..181d77c596 100644 --- a/src/Mod/Complete/Gui/Workbench.h +++ b/src/Mod/Complete/Gui/Workbench.h @@ -28,7 +28,7 @@ #include -#define QSTRING(x) QString::fromAscii(x) +#define QSTRING(x) QString::fromLatin1(x) extern QList mods; diff --git a/src/Mod/Drawing/Gui/AppDrawingGui.cpp b/src/Mod/Drawing/Gui/AppDrawingGui.cpp index 01423052e5..cf481d2c19 100644 --- a/src/Mod/Drawing/Gui/AppDrawingGui.cpp +++ b/src/Mod/Drawing/Gui/AppDrawingGui.cpp @@ -32,7 +32,6 @@ #include "Workbench.h" #include "ViewProviderPage.h" #include "ViewProviderView.h" -//#include "resources/qrc_Drawing.cpp" // use a different name to CreateCommand() void CreateDrawingCommands(void); diff --git a/src/Mod/Drawing/Gui/Command.cpp b/src/Mod/Drawing/Gui/Command.cpp index 741df37fb5..765096addd 100644 --- a/src/Mod/Drawing/Gui/Command.cpp +++ b/src/Mod/Drawing/Gui/Command.cpp @@ -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 -1) { QString paper = rx.cap(1); int id = rx.cap(2).toInt(); @@ -160,12 +160,12 @@ 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").arg(paper).arg(id); + QString s = QString::fromLatin1("style=\"font-size:22px\">%1%2").arg(paper).arg(id); QByteArray data = file.readAll(); - data.replace("style=\"font-size:22px\">A0", s.toAscii()); + data.replace("style=\"font-size:22px\">A0", s.toLatin1()); a->setIcon(Gui::BitmapFactory().pixmapFromSvg(data, QSize(64,64))); } diff --git a/src/Mod/Fem/Gui/AppFemGui.cpp b/src/Mod/Fem/Gui/AppFemGui.cpp index 3a4aa29c81..85a8603ebe 100644 --- a/src/Mod/Fem/Gui/AppFemGui.cpp +++ b/src/Mod/Fem/Gui/AppFemGui.cpp @@ -52,7 +52,6 @@ #include "ViewProviderFemConstraintPulley.h" #include "ViewProviderResult.h" #include "Workbench.h" -//#include "resources/qrc_Fem.cpp" // use a different name to CreateCommand() void CreateFemCommands(void); diff --git a/src/Mod/Fem/Gui/TaskFemConstraint.cpp b/src/Mod/Fem/Gui/TaskFemConstraint.cpp index 28964733e0..d0dfe54192 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraint.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraint.cpp @@ -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; } diff --git a/src/Mod/Fem/Gui/TaskFemConstraintBearing.cpp b/src/Mod/Fem/Gui/TaskFemConstraintBearing.cpp index eb4fb21419..98fcbda430 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintBearing.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintBearing.cpp @@ -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; } diff --git a/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp b/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp index f492dfce94..e58841bc64 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp @@ -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; } diff --git a/src/Mod/Fem/Gui/TaskFemConstraintGear.cpp b/src/Mod/Fem/Gui/TaskFemConstraintGear.cpp index ed46bc8d6d..3909f6c4cf 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintGear.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintGear.cpp @@ -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; } diff --git a/src/Mod/Fem/Gui/TaskFemConstraintPressure.cpp b/src/Mod/Fem/Gui/TaskFemConstraintPressure.cpp index bbe519e183..995372dea2 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintPressure.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintPressure.cpp @@ -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; } diff --git a/src/Mod/Fem/Gui/TaskFemConstraintPulley.cpp b/src/Mod/Fem/Gui/TaskFemConstraintPulley.cpp index fbc4fbe2e5..adcbb113d7 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintPulley.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintPulley.cpp @@ -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; } diff --git a/src/Mod/Fem/Gui/TaskObjectName.cpp b/src/Mod/Fem/Gui/TaskObjectName.cpp index d8a4a81050..02c8f2c75f 100644 --- a/src/Mod/Fem/Gui/TaskObjectName.cpp +++ b/src/Mod/Fem/Gui/TaskObjectName.cpp @@ -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())); } diff --git a/src/Mod/Image/Gui/GLImageBox.cpp b/src/Mod/Image/Gui/GLImageBox.cpp index a8aa492d7a..dd0403d473 100644 --- a/src/Mod/Image/Gui/GLImageBox.cpp +++ b/src/Mod/Image/Gui/GLImageBox.cpp @@ -50,7 +50,7 @@ bool GLImageBox::haveMesa = false; /* TRANSLATOR ImageGui::GLImageBox */ // Constructor -GLImageBox::GLImageBox(QWidget * parent, const QGLWidget * shareWidget, Qt::WFlags f) +GLImageBox::GLImageBox(QWidget * parent, const QGLWidget * shareWidget, Qt::WindowFlags f) : QGLWidget(parent, shareWidget, f) { // uses default display format for the OpenGL rendering context diff --git a/src/Mod/Image/Gui/GLImageBox.h b/src/Mod/Image/Gui/GLImageBox.h index 0aeb5121bf..32a50644a8 100644 --- a/src/Mod/Image/Gui/GLImageBox.h +++ b/src/Mod/Image/Gui/GLImageBox.h @@ -35,7 +35,7 @@ class ImageGuiExport GLImageBox : public QGLWidget public: - GLImageBox(QWidget * parent = 0, const QGLWidget * shareWidget = 0, Qt::WFlags f = 0); + GLImageBox(QWidget * parent = 0, const QGLWidget * shareWidget = 0, Qt::WindowFlags f = 0); ~GLImageBox(); Image::ImageBase *getImageBasePtr() { return &_image; } diff --git a/src/Mod/Image/Gui/ImageView.cpp b/src/Mod/Image/Gui/ImageView.cpp index 626bacb89f..0da18047d4 100644 --- a/src/Mod/Image/Gui/ImageView.cpp +++ b/src/Mod/Image/Gui/ImageView.cpp @@ -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); diff --git a/src/Mod/Import/Gui/AppImportGuiPy.cpp b/src/Mod/Import/Gui/AppImportGuiPy.cpp index aa45573e07..3321efe1e0 100644 --- a/src/Mod/Import/Gui/AppImportGuiPy.cpp +++ b/src/Mod/Import/Gui/AppImportGuiPy.cpp @@ -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); diff --git a/src/Mod/Inspection/Gui/ViewProviderInspection.cpp b/src/Mod/Inspection/Gui/ViewProviderInspection.cpp index d6de4f329d..a7fa59b3f1 100644 --- a/src/Mod/Inspection/Gui/ViewProviderInspection.cpp +++ b/src/Mod/Inspection/Gui/ViewProviderInspection.cpp @@ -472,7 +472,7 @@ void ViewProviderInspection::inspectCallback(void * ud, SoEventCallback * n) else { // the nearest picked point was not part of the view provider SoRayPickAction action(view->getSoRenderManager()->getViewportRegion()); - action.setPickAll(TRUE); + action.setPickAll(true); action.setPoint(mbe->getPosition()); action.apply(view->getSoRenderManager()->getSceneGraph()); diff --git a/src/Mod/Inspection/Gui/VisualInspection.cpp b/src/Mod/Inspection/Gui/VisualInspection.cpp index f5eb625d46..8ad9580362 100644 --- a/src/Mod/Inspection/Gui/VisualInspection.cpp +++ b/src/Mod/Inspection/Gui/VisualInspection.cpp @@ -76,7 +76,7 @@ private: * Constructs a VisualInspection as a child of 'parent', with the * name 'name' and widget flags set to 'f'. */ -VisualInspection::VisualInspection(QWidget* parent, Qt::WFlags fl) +VisualInspection::VisualInspection(QWidget* parent, Qt::WindowFlags fl) : QDialog(parent, fl), ui(new Ui_VisualInspection) { ui->setupUi(this); @@ -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); @@ -221,15 +221,15 @@ void VisualInspection::accept() if (sel->checkState(0) == Qt::Checked) { QString actualName = sel->data(0, Qt::UserRole).toString(); Gui::Application::Instance->runCommand( - true, "App_activeDocument___InspectionGroup.newObject(\"Inspection::Feature\",\"%s_Inspect\")", (const char*)actualName.toAscii()); + true, "App_activeDocument___InspectionGroup.newObject(\"Inspection::Feature\",\"%s_Inspect\")", (const char*)actualName.toLatin1()); Gui::Application::Instance->runCommand( true, "App.ActiveDocument.ActiveObject.Actual=App.ActiveDocument.%s\n" "App_activeDocument___activeObject___Nominals=list()\n" "App.ActiveDocument.ActiveObject.SearchRadius=%.3f\n" - "App.ActiveDocument.ActiveObject.Thickness=%.3f\n", (const char*)actualName.toAscii(), searchRadius, thickness); + "App.ActiveDocument.ActiveObject.Thickness=%.3f\n", (const char*)actualName.toLatin1(), searchRadius, thickness); for (QStringList::Iterator it = nominalNames.begin(); it != nominalNames.end(); ++it) { Gui::Application::Instance->runCommand( - true, "App_activeDocument___activeObject___Nominals.append(App.ActiveDocument.%s)\n", (const char*)(*it).toAscii()); + true, "App_activeDocument___activeObject___Nominals.append(App.ActiveDocument.%s)\n", (const char*)(*it).toLatin1()); } Gui::Application::Instance->runCommand( true, "App.ActiveDocument.ActiveObject.Nominals=App_activeDocument___activeObject___Nominals\n" @@ -249,7 +249,7 @@ void VisualInspection::accept() if (sel->checkState(0) == Qt::Checked) { Gui::Application::Instance->runCommand( true, "Gui.ActiveDocument.getObject(\"%s\").Visibility=False" - , (const char*)sel->data(0, Qt::UserRole).toString().toAscii()); + , (const char*)sel->data(0, Qt::UserRole).toString().toLatin1()); } } @@ -258,7 +258,7 @@ void VisualInspection::accept() if (sel->checkState(0) == Qt::Checked) { Gui::Application::Instance->runCommand( true, "Gui.ActiveDocument.getObject(\"%s\").Visibility=False" - , (const char*)sel->data(0, Qt::UserRole).toString().toAscii()); + , (const char*)sel->data(0, Qt::UserRole).toString().toLatin1()); } } } diff --git a/src/Mod/Inspection/Gui/VisualInspection.h b/src/Mod/Inspection/Gui/VisualInspection.h index 8057244a23..9c6716c5f0 100644 --- a/src/Mod/Inspection/Gui/VisualInspection.h +++ b/src/Mod/Inspection/Gui/VisualInspection.h @@ -37,7 +37,7 @@ class VisualInspection : public QDialog Q_OBJECT public: - VisualInspection(QWidget* parent = 0, Qt::WFlags fl = 0); + VisualInspection(QWidget* parent = 0, Qt::WindowFlags fl = 0); ~ VisualInspection(); void accept(); diff --git a/src/Mod/Mesh/App/Core/Grid.h b/src/Mod/Mesh/App/Core/Grid.h index 200977f8c2..3841becd92 100644 --- a/src/Mod/Mesh/App/Core/Grid.h +++ b/src/Mod/Mesh/App/Core/Grid.h @@ -459,7 +459,7 @@ inline void MeshFacetGrid::AddFacet (const MeshGeomFacet &rclFacet, unsigned lon { for (ulZ = ulZ1; ulZ <= ulZ2; ulZ++) { - if (CMeshFacetFunc::BBoxContainFacet(GetBoundBox(ulX, ulY, ulZ), rclFacet) == TRUE) + if (CMeshFacetFunc::BBoxContainFacet(GetBoundBox(ulX, ulY, ulZ), rclFacet) == true) _aulGrid[ulX][ulY][ulZ].insert(ulFacetIndex); } } diff --git a/src/Mod/Mesh/App/Core/Helpers.h b/src/Mod/Mesh/App/Core/Helpers.h index 62b4087b8a..404644e171 100644 --- a/src/Mod/Mesh/App/Core/Helpers.h +++ b/src/Mod/Mesh/App/Core/Helpers.h @@ -106,7 +106,7 @@ inline bool MeshHelpPoint::operator < (const MeshHelpPoint &rclObj) const // if (fabs(_clPt.y - rclObj._clPt.y) < MeshDefinitions::_fMinPointDistanceD1) // { // if (fabs(_clPt.z - rclObj._clPt.z) < MeshDefinitions::_fMinPointDistanceD1) -// return FALSE; +// return false; // else // return _clPt.z < rclObj._clPt.z; // } @@ -136,15 +136,15 @@ inline bool MeshHelpPoint::operator == (const MeshHelpPoint &rclObj) const if (fabs(_clPt.y - rclObj._clPt.y) < (MeshDefinitions::_fMinPointDistanceD1 + 1.0e-2f)) { if (fabs(_clPt.z - rclObj._clPt.z) < (MeshDefinitions::_fMinPointDistanceD1 + 1.0e-2f)) - return TRUE; + return true; else - return FALSE; + return false; } else - return FALSE; + return false; } else - return FALSE; + return false; */ } diff --git a/src/Mod/Mesh/App/Core/tritritest.h b/src/Mod/Mesh/App/Core/tritritest.h index a8a3a485e5..12bd28e0a8 100644 --- a/src/Mod/Mesh/App/Core/tritritest.h +++ b/src/Mod/Mesh/App/Core/tritritest.h @@ -31,7 +31,7 @@ if |dv|& rkA, GMatrix& rkInvA); @@ -46,7 +46,7 @@ public: // A[iSize][iSize] coefficient matrix, entries are A[row][col] // B[iSize] vector, entries are B[row] // Output: - // return value is TRUE if successful, FALSE if pivoting failed + // return value is true if successful, false if pivoting failed // X[iSize] is solution X to AX = B bool Solve (const GMatrix& rkA, const Real* afB, Real* afX); @@ -57,7 +57,7 @@ public: // Upper diagonal C[iSize-1] // Right-hand side R[iSize] // Output: - // return value is TRUE if successful, FALSE if pivoting failed + // return value is true if successful, false if pivoting failed // U[iSize] is solution bool SolveTri (int iSize, Real* afA, Real* afB, Real* afC, Real* afR, Real* afU); @@ -69,7 +69,7 @@ public: // Upper diagonal is constant, C // Right-hand side Rr[iSize] // Output: - // return value is TRUE if successful, FALSE if pivoting failed + // return value is true if successful, false if pivoting failed // U[iSize] is solution bool SolveConstTri (int iSize, Real fA, Real fB, Real fC, Real* afR, Real* afU); @@ -102,7 +102,7 @@ public: // A, a banded matrix // B[iSize] vector, entries are B[row] // Output: - // return value is TRUE if successful, FALSE if pivoting failed + // return value is true if successful, false if pivoting failed // X[iSize] is solution X to AX = B bool SolveBanded (const BandedMatrix& rkA, const Real* afB, Real* afX); @@ -111,7 +111,7 @@ public: // Input: // A, a banded matrix // Output: - // return value is TRUE if the inverse exists, FALSE otherwise + // return value is true if the inverse exists, false otherwise // InvA, the inverse of A bool Invert (const BandedMatrix& rkA, GMatrix& rkInvA); diff --git a/src/Mod/Mesh/Gui/Command.cpp b/src/Mod/Mesh/Gui/Command.cpp index 7ad0de47f7..8e766a204d 100644 --- a/src/Mod/Mesh/Gui/Command.cpp +++ b/src/Mod/Mesh/Gui/Command.cpp @@ -468,7 +468,7 @@ void CmdMeshExport::activated(int iMsg) QObject::tr("Export mesh"), dir, filter.join(QLatin1String(";;")), &format); if (!fn.isEmpty()) { QFileInfo fi(fn); - QByteArray extension = fi.suffix().toAscii(); + QByteArray extension = fi.suffix().toLatin1(); for (QList >::iterator it = ext.begin(); it != ext.end(); ++it) { if (it->first == format) { extension = it->second; @@ -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); } } diff --git a/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp b/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp index 92279128b0..06a8c4b310 100644 --- a/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp +++ b/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp @@ -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); } @@ -170,9 +170,9 @@ void DlgEvaluateMeshImp::slotDeletedDocument(const App::Document& Doc) * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ -DlgEvaluateMeshImp::DlgEvaluateMeshImp(QWidget* parent, Qt::WFlags fl) +DlgEvaluateMeshImp::DlgEvaluateMeshImp(QWidget* parent, Qt::WindowFlags fl) : QDialog(parent, fl), d(new Private()) { this->setupUi(this); @@ -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; iitemData(i).toString() == objName) { meshNameButton->setCurrentIndex(i); @@ -298,7 +298,7 @@ void DlgEvaluateMeshImp::refreshList() std::vector objs = this->getDocument()->getObjectsOfType(Mesh::Feature::getClassTypeId()); for (std::vector::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() @@ -1166,7 +1166,7 @@ bool DockEvaluateMeshImp::hasInstance() * Constructs a DockEvaluateMeshImp which is a child of 'parent', with the * name 'name' and widget flags set to 'f' */ -DockEvaluateMeshImp::DockEvaluateMeshImp( QWidget* parent, Qt::WFlags fl ) +DockEvaluateMeshImp::DockEvaluateMeshImp( QWidget* parent, Qt::WindowFlags fl ) : DlgEvaluateMeshImp( parent, fl ) { // embed this dialog into a dockable widget container diff --git a/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.h b/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.h index ca67891a0a..db6b55105d 100644 --- a/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.h +++ b/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.h @@ -66,7 +66,7 @@ class DlgEvaluateMeshImp : public QDialog, public Ui_DlgEvaluateMesh, public App Q_OBJECT public: - DlgEvaluateMeshImp( QWidget* parent = 0, Qt::WFlags fl = 0 ); + DlgEvaluateMeshImp( QWidget* parent = 0, Qt::WindowFlags fl = 0 ); ~DlgEvaluateMeshImp(); void setMesh( Mesh::Feature* ); @@ -143,7 +143,7 @@ class DockEvaluateMeshImp : public DlgEvaluateMeshImp Q_OBJECT protected: - DockEvaluateMeshImp( QWidget* parent = 0, Qt::WFlags fl = 0 ); + DockEvaluateMeshImp( QWidget* parent = 0, Qt::WindowFlags fl = 0 ); ~DockEvaluateMeshImp(); void closeEvent(QCloseEvent* e); diff --git a/src/Mod/Mesh/Gui/DlgRegularSolidImp.cpp b/src/Mod/Mesh/Gui/DlgRegularSolidImp.cpp index bffcfc624b..902e2aa59e 100644 --- a/src/Mod/Mesh/Gui/DlgRegularSolidImp.cpp +++ b/src/Mod/Mesh/Gui/DlgRegularSolidImp.cpp @@ -49,9 +49,9 @@ using namespace MeshGui; * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ -MeshGui::DlgRegularSolidImp::DlgRegularSolidImp(QWidget* parent, Qt::WFlags fl) +MeshGui::DlgRegularSolidImp::DlgRegularSolidImp(QWidget* parent, Qt::WindowFlags fl) : QDialog( parent, fl ) { this->setupUi(this); @@ -202,7 +202,7 @@ void MeshGui::DlgRegularSolidImp::on_createSolidButton_clicked() // Execute the Python block QString solid = tr("Create %1").arg(comboBox1->currentText()); Gui::Application::Instance->activeDocument()->openCommand(solid.toUtf8()); - Gui::Command::doCommand(Gui::Command::Doc, (const char*)cmd.toAscii()); + Gui::Command::doCommand(Gui::Command::Doc, (const char*)cmd.toLatin1()); Gui::Application::Instance->activeDocument()->commitCommand(); Gui::Command::doCommand(Gui::Command::Doc, "App.activeDocument().recompute()"); Gui::Command::doCommand(Gui::Command::Gui, "Gui.SendMsgToActiveView(\"ViewFit\")"); @@ -246,7 +246,7 @@ bool SingleDlgRegularSolidImp::hasInstance() * Constructs a SingleDlgRegularSolidImp which is a child of 'parent', with the * name 'name' and widget flags set to 'f' */ -SingleDlgRegularSolidImp::SingleDlgRegularSolidImp(QWidget* parent, Qt::WFlags fl) +SingleDlgRegularSolidImp::SingleDlgRegularSolidImp(QWidget* parent, Qt::WindowFlags fl) : DlgRegularSolidImp(parent, fl) { } diff --git a/src/Mod/Mesh/Gui/DlgRegularSolidImp.h b/src/Mod/Mesh/Gui/DlgRegularSolidImp.h index 52ee6d92c8..cec7fedff4 100644 --- a/src/Mod/Mesh/Gui/DlgRegularSolidImp.h +++ b/src/Mod/Mesh/Gui/DlgRegularSolidImp.h @@ -32,7 +32,7 @@ class DlgRegularSolidImp : public QDialog, public Ui_DlgRegularSolid Q_OBJECT public: - DlgRegularSolidImp(QWidget* parent = 0, Qt::WFlags fl = 0); + DlgRegularSolidImp(QWidget* parent = 0, Qt::WindowFlags fl = 0); ~DlgRegularSolidImp(); public Q_SLOTS: @@ -49,7 +49,7 @@ protected: class SingleDlgRegularSolidImp : public DlgRegularSolidImp { protected: - SingleDlgRegularSolidImp(QWidget* parent = 0, Qt::WFlags fl = 0); + SingleDlgRegularSolidImp(QWidget* parent = 0, Qt::WindowFlags fl = 0); ~SingleDlgRegularSolidImp(); public: diff --git a/src/Mod/Mesh/Gui/DlgSmoothing.cpp b/src/Mod/Mesh/Gui/DlgSmoothing.cpp index c369e772d6..eed3829b43 100644 --- a/src/Mod/Mesh/Gui/DlgSmoothing.cpp +++ b/src/Mod/Mesh/Gui/DlgSmoothing.cpp @@ -112,7 +112,7 @@ void DlgSmoothing::on_checkBoxSelection_toggled(bool on) // ------------------------------------------------ -SmoothingDialog::SmoothingDialog(QWidget* parent, Qt::WFlags fl) +SmoothingDialog::SmoothingDialog(QWidget* parent, Qt::WindowFlags fl) : QDialog(parent, fl) { widget = new DlgSmoothing(this); diff --git a/src/Mod/Mesh/Gui/DlgSmoothing.h b/src/Mod/Mesh/Gui/DlgSmoothing.h index fafccd3e13..7b035e5475 100644 --- a/src/Mod/Mesh/Gui/DlgSmoothing.h +++ b/src/Mod/Mesh/Gui/DlgSmoothing.h @@ -73,7 +73,7 @@ class MeshGuiExport SmoothingDialog : public QDialog Q_OBJECT public: - SmoothingDialog(QWidget* parent = 0, Qt::WFlags fl = 0); + SmoothingDialog(QWidget* parent = 0, Qt::WindowFlags fl = 0); ~SmoothingDialog(); int iterations() const diff --git a/src/Mod/Mesh/Gui/RemoveComponents.cpp b/src/Mod/Mesh/Gui/RemoveComponents.cpp index a9d869e694..8867c445a4 100644 --- a/src/Mod/Mesh/Gui/RemoveComponents.cpp +++ b/src/Mod/Mesh/Gui/RemoveComponents.cpp @@ -35,7 +35,7 @@ using namespace MeshGui; -RemoveComponents::RemoveComponents(QWidget* parent, Qt::WFlags fl) +RemoveComponents::RemoveComponents(QWidget* parent, Qt::WindowFlags fl) : QWidget(parent, fl) { ui = new Ui_RemoveComponents; @@ -157,7 +157,7 @@ void RemoveComponents::reject() // ------------------------------------------------- -RemoveComponentsDialog::RemoveComponentsDialog(QWidget* parent, Qt::WFlags fl) +RemoveComponentsDialog::RemoveComponentsDialog(QWidget* parent, Qt::WindowFlags fl) : QDialog(parent, fl) { widget = new RemoveComponents(this); diff --git a/src/Mod/Mesh/Gui/RemoveComponents.h b/src/Mod/Mesh/Gui/RemoveComponents.h index 57801811a4..874e21e192 100644 --- a/src/Mod/Mesh/Gui/RemoveComponents.h +++ b/src/Mod/Mesh/Gui/RemoveComponents.h @@ -42,7 +42,7 @@ class MeshGuiExport RemoveComponents : public QWidget Q_OBJECT public: - RemoveComponents(QWidget* parent = 0, Qt::WFlags fl = 0); + RemoveComponents(QWidget* parent = 0, Qt::WindowFlags fl = 0); ~RemoveComponents(); void reject(); void deleteSelection(); @@ -78,7 +78,7 @@ class MeshGuiExport RemoveComponentsDialog : public QDialog Q_OBJECT public: - RemoveComponentsDialog(QWidget* parent = 0, Qt::WFlags fl = 0); + RemoveComponentsDialog(QWidget* parent = 0, Qt::WindowFlags fl = 0); ~RemoveComponentsDialog(); void reject(); diff --git a/src/Mod/Mesh/Gui/Segmentation.cpp b/src/Mod/Mesh/Gui/Segmentation.cpp index de2b81d48e..04a4a0be6d 100644 --- a/src/Mod/Mesh/Gui/Segmentation.cpp +++ b/src/Mod/Mesh/Gui/Segmentation.cpp @@ -41,7 +41,7 @@ using namespace MeshGui; -Segmentation::Segmentation(Mesh::Feature* mesh, QWidget* parent, Qt::WFlags fl) +Segmentation::Segmentation(Mesh::Feature* mesh, QWidget* parent, Qt::WindowFlags fl) : QWidget(parent, fl), myMesh(mesh) { ui = new Ui_Segmentation; diff --git a/src/Mod/Mesh/Gui/Segmentation.h b/src/Mod/Mesh/Gui/Segmentation.h index 95d1411635..23e691c9e9 100644 --- a/src/Mod/Mesh/Gui/Segmentation.h +++ b/src/Mod/Mesh/Gui/Segmentation.h @@ -37,7 +37,7 @@ class Ui_Segmentation; class MeshGuiExport Segmentation : public QWidget { public: - Segmentation(Mesh::Feature* mesh, QWidget* parent = 0, Qt::WFlags fl = 0); + Segmentation(Mesh::Feature* mesh, QWidget* parent = 0, Qt::WindowFlags fl = 0); ~Segmentation(); void accept(); diff --git a/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp b/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp index b3b820a5fb..6da35a4a8d 100644 --- a/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp +++ b/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp @@ -95,7 +95,7 @@ void SoFCIndexedFaceSet::GLRender(SoGLRenderAction *action) SoMaterialBundle mb(action); - SoTextureCoordinateBundle tb(action, TRUE, FALSE); + SoTextureCoordinateBundle tb(action, true, false); SbBool sendNormals = !mb.isColorOnly() || tb.isFunction(); this->getVertexData(state, coords, normals, cindices, @@ -129,14 +129,14 @@ void SoFCIndexedFaceSet::drawCoords(const SoGLCoordinateElement * const vertexli float size = std::min((float)mod,3.0f); glPointSize(size); - SbBool per_face = FALSE; - SbBool per_vert = FALSE; + SbBool per_face = false; + SbBool per_vert = false; switch (binding) { case SoMaterialBindingElement::PER_FACE: - per_face = TRUE; + per_face = true; break; case SoMaterialBindingElement::PER_VERTEX: - per_vert = TRUE; + per_vert = true; break; default: break; @@ -153,10 +153,10 @@ void SoFCIndexedFaceSet::drawCoords(const SoGLCoordinateElement * const vertexli for (int index=0; indexsend(ct, TRUE); + materials->send(ct, true); v1 = *viptr++; index++; if (per_vert) - materials->send(v1, TRUE); + materials->send(v1, true); if (normals) currnormal = &normals[*normalindices++]; glNormal3fv((const GLfloat*)currnormal); @@ -164,7 +164,7 @@ void SoFCIndexedFaceSet::drawCoords(const SoGLCoordinateElement * const vertexli v2 = *viptr++; index++; if (per_vert) - materials->send(v2, TRUE); + materials->send(v2, true); if (normals) currnormal = &normals[*normalindices++]; glNormal3fv((const GLfloat*)currnormal); @@ -172,7 +172,7 @@ void SoFCIndexedFaceSet::drawCoords(const SoGLCoordinateElement * const vertexli v3 = *viptr++; index++; if (per_vert) - materials->send(v3, TRUE); + materials->send(v3, true); if (normals) currnormal = &normals[*normalindices++]; glNormal3fv((const GLfloat*)currnormal); @@ -199,7 +199,7 @@ void SoFCIndexedFaceSet::doAction(SoAction * action) // thus we search there for it. SoSearchAction sa; sa.setInterest(SoSearchAction::FIRST); - sa.setSearchingAll(FALSE); + sa.setSearchingAll(false); sa.setType(SoCoordinate3::getClassTypeId(), 1); sa.apply(node); SoPath * path = sa.getPath(); @@ -221,7 +221,7 @@ void SoFCIndexedFaceSet::doAction(SoAction * action) // thus we search there for it. SoSearchAction sa; sa.setInterest(SoSearchAction::FIRST); - sa.setSearchingAll(FALSE); + sa.setSearchingAll(false); sa.setType(SoCoordinate3::getClassTypeId(), 1); sa.apply(node); SoPath * path = sa.getPath(); diff --git a/src/Mod/Mesh/Gui/SoFCMeshObject.cpp b/src/Mod/Mesh/Gui/SoFCMeshObject.cpp index 61828924c9..b15b39d76c 100644 --- a/src/Mod/Mesh/Gui/SoFCMeshObject.cpp +++ b/src/Mod/Mesh/Gui/SoFCMeshObject.cpp @@ -176,7 +176,7 @@ void SoSFMeshObject::initClass() SO_SFIELD_INIT_CLASS(SoSFMeshObject, SoSField); } -// This reads the value of a field from a file. It returns FALSE if the value could not be read +// This reads the value of a field from a file. It returns false if the value could not be read // successfully. SbBool SoSFMeshObject::readValue(SoInput *in) { @@ -191,7 +191,7 @@ SbBool SoSFMeshObject::readValue(SoInput *in) // during initial scene graph import. this->valueChanged(); - return TRUE; + return true; } int32_t countPt; @@ -235,7 +235,7 @@ SbBool SoSFMeshObject::readValue(SoInput *in) // during initial scene graph import. this->valueChanged(); - return TRUE; + return true; } // This writes the value of a field to a file. @@ -626,9 +626,9 @@ void SoFCMeshObjectShape::GLRender(SoGLRenderAction *action) SbBool needNormals = !mb.isColorOnly()/* || tb.isFunction()*/; mb.sendFirst(); // make sure we have the correct material - SbBool ccw = TRUE; + SbBool ccw = true; if (SoShapeHintsElement::getVertexOrdering(state) == SoShapeHintsElement::CLOCKWISE) - ccw = FALSE; + ccw = false; if (mode == false || mesh->countFacets() <= this->renderTriangleLimit) { if (mbind != OVERALL) @@ -708,16 +708,16 @@ void SoFCMeshObjectShape::drawFaces(const Mesh::MeshObject * mesh, SoMaterialBun n[2] = (v1.x-v0.x)*(v2.y-v0.y)-(v1.y-v0.y)*(v2.x-v0.x); if(perFace) - mb->send(it-rFacets.begin(), TRUE); + mb->send(it-rFacets.begin(), true); glNormal(n); if(perVertex) - mb->send(it->_aulPoints[0], TRUE); + mb->send(it->_aulPoints[0], true); glVertex(v0); if(perVertex) - mb->send(it->_aulPoints[1], TRUE); + mb->send(it->_aulPoints[1], true); glVertex(v1); if(perVertex) - mb->send(it->_aulPoints[2], TRUE); + mb->send(it->_aulPoints[2], true); glVertex(v2); } } @@ -852,7 +852,7 @@ void SoFCMeshObjectShape::doAction(SoAction * action) // thus we search there for it. SoSearchAction sa; sa.setInterest(SoSearchAction::FIRST); - sa.setSearchingAll(FALSE); + sa.setSearchingAll(false); sa.setType(SoFCMeshObjectNode::getClassTypeId(), 1); sa.apply(node); SoPath * path = sa.getPath(); @@ -961,8 +961,8 @@ void SoFCMeshObjectShape::renderSelectionGeometry(const Mesh::MeshObject* mesh) //static SbBool //SoFCMeshObjectShape_ray_intersect(SoRayPickAction * action, const SbBox3f & box) //{ -// if (box.isEmpty()) return FALSE; -// return action->intersect(box, TRUE); +// if (box.isEmpty()) return false; +// return action->intersect(box, true); //} /** @@ -1163,9 +1163,9 @@ void SoFCMeshSegmentShape::GLRender(SoGLRenderAction *action) SbBool needNormals = !mb.isColorOnly()/* || tb.isFunction()*/; mb.sendFirst(); // make sure we have the correct material - SbBool ccw = TRUE; + SbBool ccw = true; if (SoShapeHintsElement::getVertexOrdering(state) == SoShapeHintsElement::CLOCKWISE) - ccw = FALSE; + ccw = false; if (mode == false || mesh->countFacets() <= this->renderTriangleLimit) { if (mbind != OVERALL) @@ -1250,16 +1250,16 @@ void SoFCMeshSegmentShape::drawFaces(const Mesh::MeshObject * mesh, SoMaterialBu n[2] = (v1.x-v0.x)*(v2.y-v0.y)-(v1.y-v0.y)*(v2.x-v0.x); if(perFace) - mb->send(*it, TRUE); + mb->send(*it, true); glNormal(n); if(perVertex) - mb->send(f._aulPoints[0], TRUE); + mb->send(f._aulPoints[0], true); glVertex(v0); if(perVertex) - mb->send(f._aulPoints[1], TRUE); + mb->send(f._aulPoints[1], true); glVertex(v1); if(perVertex) - mb->send(f._aulPoints[2], TRUE); + mb->send(f._aulPoints[2], true); glVertex(v2); } } @@ -1556,7 +1556,7 @@ void SoFCMeshObjectBoundary::GLRender(SoGLRenderAction *action) if (!mesh) return; SoMaterialBundle mb(action); - SoTextureCoordinateBundle tb(action, TRUE, FALSE); + SoTextureCoordinateBundle tb(action, true, false); SoLazyElement::setLightModel(state, SoLazyElement::BASE_COLOR); mb.sendFirst(); // make sure we have the correct material diff --git a/src/Mod/Mesh/Gui/SoPolygon.cpp b/src/Mod/Mesh/Gui/SoPolygon.cpp index 66818d8985..21b6b76625 100644 --- a/src/Mod/Mesh/Gui/SoPolygon.cpp +++ b/src/Mod/Mesh/Gui/SoPolygon.cpp @@ -68,8 +68,8 @@ SoPolygon::SoPolygon() SO_NODE_ADD_FIELD(startIndex, (0)); SO_NODE_ADD_FIELD(numVertices, (0)); - SO_NODE_ADD_FIELD(highlight, (FALSE)); - SO_NODE_ADD_FIELD(render, (TRUE)); + SO_NODE_ADD_FIELD(highlight, (false)); + SO_NODE_ADD_FIELD(render, (true)); } /** @@ -86,7 +86,7 @@ void SoPolygon::GLRender(SoGLRenderAction *action) if (!points) return; SoMaterialBundle mb(action); - SoTextureCoordinateBundle tb(action, TRUE, FALSE); + SoTextureCoordinateBundle tb(action, true, false); SoLazyElement::setLightModel(state, SoLazyElement::BASE_COLOR); mb.sendFirst(); // make sure we have the correct material diff --git a/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp b/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp index 8ce4a3180f..ad0b2b0f6a 100644 --- a/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp +++ b/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp @@ -450,7 +450,7 @@ public: QStringList lines = s.split(QLatin1String("\n")); std::vector text; for (QStringList::Iterator it = lines.begin(); it != lines.end(); ++it) - text.push_back((const char*)it->toAscii()); + text.push_back((const char*)it->toLatin1()); anno->LabelText.setValues(text); std::stringstream str; str << "Curvature info (" << group->Group.getSize() << ")"; @@ -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())); } } } diff --git a/src/Mod/Mesh/Gui/Workbench.cpp b/src/Mod/Mesh/Gui/Workbench.cpp index 87f9457c55..b7f63a97a6 100644 --- a/src/Mod/Mesh/Gui/Workbench.cpp +++ b/src/Mod/Mesh/Gui/Workbench.cpp @@ -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("")); } } diff --git a/src/Mod/MeshPart/App/MeshAlgos.cpp b/src/Mod/MeshPart/App/MeshAlgos.cpp index 44130bf9e6..b5b4d0cb9f 100644 --- a/src/Mod/MeshPart/App/MeshAlgos.cpp +++ b/src/Mod/MeshPart/App/MeshAlgos.cpp @@ -172,8 +172,8 @@ MeshCore::MeshKernel* MeshAlgos::boolean(MeshCore::MeshKernel* pMesh1, MeshCore: GtsSurface * s1, * s2, * s3; GtsSurfaceInter * si; GNode * tree1, * tree2; - gboolean check_self_intersection = FALSE; - gboolean closed = TRUE, is_open1, is_open2; + gboolean check_self_intersection = false; + gboolean closed = true, is_open1, is_open2; // create a GTS surface @@ -224,11 +224,11 @@ MeshCore::MeshKernel* MeshAlgos::boolean(MeshCore::MeshKernel* pMesh1, MeshCore: /* build bounding box tree for first surface */ tree1 = gts_bb_tree_surface (s1); - is_open1 = gts_surface_volume (s1) < 0. ? TRUE : FALSE; + is_open1 = gts_surface_volume (s1) < 0. ? true : false; /* build bounding box tree for second surface */ tree2 = gts_bb_tree_surface (s2); - is_open2 = gts_surface_volume (s2) < 0. ? TRUE : FALSE; + is_open2 = gts_surface_volume (s2) < 0. ? true : false; si = gts_surface_inter_new (gts_surface_inter_class (), s1, s2, tree1, tree2, is_open1, is_open2); @@ -236,8 +236,8 @@ MeshCore::MeshKernel* MeshAlgos::boolean(MeshCore::MeshKernel* pMesh1, MeshCore: if (!closed) { gts_object_destroy (GTS_OBJECT (s1)); gts_object_destroy (GTS_OBJECT (s2)); - gts_bb_tree_destroy (tree1, TRUE); - gts_bb_tree_destroy (tree2, TRUE); + gts_bb_tree_destroy (tree1, true); + gts_bb_tree_destroy (tree2, true); throw"the intersection of 1 and 2 is not a closed curve\n"; } @@ -280,8 +280,8 @@ MeshCore::MeshKernel* MeshAlgos::boolean(MeshCore::MeshKernel* pMesh1, MeshCore: gts_object_destroy (GTS_OBJECT (s2)); gts_object_destroy (GTS_OBJECT (s3)); gts_object_destroy (GTS_OBJECT (si)); - gts_bb_tree_destroy (tree1, TRUE); - gts_bb_tree_destroy (tree2, TRUE); + gts_bb_tree_destroy (tree1, true); + gts_bb_tree_destroy (tree2, true); throw "the resulting surface is self-intersecting\n"; } } @@ -301,8 +301,8 @@ MeshCore::MeshKernel* MeshAlgos::boolean(MeshCore::MeshKernel* pMesh1, MeshCore: // gts_object_destroy (GTS_OBJECT (si)); // destroy bounding box trees (including bounding boxes) -// gts_bb_tree_destroy (tree1, TRUE); -// gts_bb_tree_destroy (tree2, TRUE); +// gts_bb_tree_destroy (tree1, true); +// gts_bb_tree_destroy (tree2, true); #endif return pMesh1; diff --git a/src/Mod/MeshPart/Gui/AppMeshPartGui.cpp b/src/Mod/MeshPart/Gui/AppMeshPartGui.cpp index 9661f091d0..62cca702a1 100644 --- a/src/Mod/MeshPart/Gui/AppMeshPartGui.cpp +++ b/src/Mod/MeshPart/Gui/AppMeshPartGui.cpp @@ -30,7 +30,6 @@ #include #include #include "Workbench.h" -//#include "resources/qrc_MeshPart.cpp" // use a different name to CreateCommand() void CreateMeshPartCommands(void); diff --git a/src/Mod/MeshPart/Gui/Tessellation.cpp b/src/Mod/MeshPart/Gui/Tessellation.cpp index 611898947f..cd43aedbff 100644 --- a/src/Mod/MeshPart/Gui/Tessellation.cpp +++ b/src/Mod/MeshPart/Gui/Tessellation.cpp @@ -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 objs = activeDoc->getObjectsOfType(); double edgeLen = 0; @@ -194,7 +194,7 @@ void Tessellation::findShapes() edgeLen = std::max(edgeLen, bbox.LengthY()); edgeLen = std::max(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); @@ -223,7 +223,7 @@ bool Tessellation::accept() return false; } - App::Document* activeDoc = App::GetApplication().getDocument((const char*)this->document.toAscii()); + App::Document* activeDoc = App::GetApplication().getDocument((const char*)this->document.toLatin1()); if (!activeDoc) { QMessageBox::critical(this, windowTitle(), tr("No such document '%1'.").arg(this->document)); @@ -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," diff --git a/src/Mod/Part/Gui/Command.cpp b/src/Mod/Part/Gui/Command.cpp index 8733ff4dd0..196a70ba17 100644 --- a/src/Mod/Part/Gui/Command.cpp +++ b/src/Mod/Part/Gui/Command.cpp @@ -703,11 +703,11 @@ CmdPartImport::CmdPartImport() void CmdPartImport::activated(int iMsg) { QStringList filter; - filter << QString::fromAscii("STEP (*.stp *.step)"); - filter << QString::fromAscii("STEP with colors (*.stp *.step)"); - filter << QString::fromAscii("IGES (*.igs *.iges)"); - filter << QString::fromAscii("IGES with colors (*.igs *.iges)"); - filter << QString::fromAscii("BREP (*.brp *.brep)"); + filter << QString::fromLatin1("STEP (*.stp *.step)"); + filter << QString::fromLatin1("STEP with colors (*.stp *.step)"); + filter << QString::fromLatin1("IGES (*.igs *.iges)"); + filter << QString::fromLatin1("IGES with colors (*.igs *.iges)"); + filter << QString::fromLatin1("BREP (*.brp *.brep)"); QString select; QString fn = Gui::FileDialog::getOpenFileName(Gui::getMainWindow(), QString(), QString(), filter.join(QLatin1String(";;")), &select); @@ -762,11 +762,11 @@ CmdPartExport::CmdPartExport() void CmdPartExport::activated(int iMsg) { QStringList filter; - filter << QString::fromAscii("STEP (*.stp *.step)"); - filter << QString::fromAscii("STEP with colors (*.stp *.step)"); - filter << QString::fromAscii("IGES (*.igs *.iges)"); - filter << QString::fromAscii("IGES with colors (*.igs *.iges)"); - filter << QString::fromAscii("BREP (*.brp *.brep)"); + filter << QString::fromLatin1("STEP (*.stp *.step)"); + filter << QString::fromLatin1("STEP with colors (*.stp *.step)"); + filter << QString::fromLatin1("IGES (*.igs *.iges)"); + filter << QString::fromLatin1("IGES with colors (*.igs *.iges)"); + filter << QString::fromLatin1("BREP (*.brp *.brep)"); QString select; QString fn = Gui::FileDialog::getSaveFileName(Gui::getMainWindow(), QString(), QString(), filter.join(QLatin1String(";;")), &select); @@ -820,8 +820,8 @@ void CmdPartImportCurveNet::activated(int iMsg) if (!fn.isEmpty()) { QFileInfo fi; fi.setFile(fn); openCommand("Part Import Curve Net"); - doCommand(Doc,"f = App.activeDocument().addObject(\"Part::CurveNet\",\"%s\")", (const char*)fi.baseName().toAscii()); - doCommand(Doc,"f.FileName = \"%s\"",(const char*)fn.toAscii()); + doCommand(Doc,"f = App.activeDocument().addObject(\"Part::CurveNet\",\"%s\")", (const char*)fi.baseName().toLatin1()); + doCommand(Doc,"f.FileName = \"%s\"",(const char*)fn.toLatin1()); commitCommand(); updateActive(); } @@ -866,7 +866,7 @@ void CmdPartMakeSolid::activated(int iMsg) (*it)->Label.getValue()); } else if (type == TopAbs_COMPOUND || type == TopAbs_COMPSOLID) { - str = QString::fromAscii( + str = QString::fromLatin1( "__s__=App.ActiveDocument.%1.Shape.Faces\n" "__s__=Part.Solid(Part.Shell(__s__))\n" "__o__=App.ActiveDocument.addObject(\"Part::Feature\",\"%1_solid\")\n" @@ -878,7 +878,7 @@ void CmdPartMakeSolid::activated(int iMsg) .arg(QLatin1String((*it)->Label.getValue())); } else if (type == TopAbs_SHELL) { - str = QString::fromAscii( + str = QString::fromLatin1( "__s__=App.ActiveDocument.%1.Shape\n" "__s__=Part.Solid(__s__)\n" "__o__=App.ActiveDocument.addObject(\"Part::Feature\",\"%1_solid\")\n" @@ -896,7 +896,7 @@ void CmdPartMakeSolid::activated(int iMsg) try { if (!str.isEmpty()) - doCommand(Doc, (const char*)str.toAscii()); + doCommand(Doc, (const char*)str.toLatin1()); } catch (const Base::Exception& e) { Base::Console().Error("Cannot convert %s because %s.\n", @@ -937,7 +937,7 @@ void CmdPartReverseShape::activated(int iMsg) for (std::vector::iterator it = objs.begin(); it != objs.end(); ++it) { const TopoDS_Shape& shape = static_cast(*it)->Shape.getValue(); if (!shape.IsNull()) { - QString str = QString::fromAscii( + QString str = QString::fromLatin1( "__s__=App.ActiveDocument.%1.Shape.copy()\n" "__s__.reverse()\n" "__o__=App.ActiveDocument.addObject(\"Part::Feature\",\"%1_rev\")\n" @@ -950,7 +950,7 @@ void CmdPartReverseShape::activated(int iMsg) try { if (!str.isEmpty()) - doCommand(Doc, (const char*)str.toAscii()); + doCommand(Doc, (const char*)str.toLatin1()); } catch (const Base::Exception& e) { Base::Console().Error("Cannot convert %s because %s.\n", diff --git a/src/Mod/Part/Gui/CommandParametric.cpp b/src/Mod/Part/Gui/CommandParametric.cpp index 5cbc38a9c5..f64076c5dd 100644 --- a/src/Mod/Part/Gui/CommandParametric.cpp +++ b/src/Mod/Part/Gui/CommandParametric.cpp @@ -58,7 +58,7 @@ void CmdPartCylinder::activated(int iMsg) openCommand((const char*)cmd.toUtf8()); doCommand(Doc,"App.ActiveDocument.addObject(\"Part::Cylinder\",\"Cylinder\")"); - cmd = QString::fromAscii("App.ActiveDocument.ActiveObject.Label = \"%1\"") + cmd = QString::fromLatin1("App.ActiveDocument.ActiveObject.Label = \"%1\"") .arg(qApp->translate("CmdPartCylinder","Cylinder")); doCommand(Doc,(const char*)cmd.toUtf8()); commitCommand(); @@ -98,7 +98,7 @@ void CmdPartBox::activated(int iMsg) openCommand((const char*)cmd.toUtf8()); doCommand(Doc,"App.ActiveDocument.addObject(\"Part::Box\",\"Box\")"); - cmd = QString::fromAscii("App.ActiveDocument.ActiveObject.Label = \"%1\"") + cmd = QString::fromLatin1("App.ActiveDocument.ActiveObject.Label = \"%1\"") .arg(qApp->translate("CmdPartBox","Cube")); doCommand(Doc,(const char*)cmd.toUtf8()); commitCommand(); @@ -138,7 +138,7 @@ void CmdPartSphere::activated(int iMsg) openCommand((const char*)cmd.toUtf8()); doCommand(Doc,"App.ActiveDocument.addObject(\"Part::Sphere\",\"Sphere\")"); - cmd = QString::fromAscii("App.ActiveDocument.ActiveObject.Label = \"%1\"") + cmd = QString::fromLatin1("App.ActiveDocument.ActiveObject.Label = \"%1\"") .arg(qApp->translate("CmdPartSphere","Sphere")); doCommand(Doc,(const char*)cmd.toUtf8()); commitCommand(); @@ -178,7 +178,7 @@ void CmdPartCone::activated(int iMsg) openCommand((const char*)cmd.toUtf8()); doCommand(Doc,"App.ActiveDocument.addObject(\"Part::Cone\",\"Cone\")"); - cmd = QString::fromAscii("App.ActiveDocument.ActiveObject.Label = \"%1\"") + cmd = QString::fromLatin1("App.ActiveDocument.ActiveObject.Label = \"%1\"") .arg(qApp->translate("CmdPartCone","Cone")); doCommand(Doc,(const char*)cmd.toUtf8()); commitCommand(); @@ -218,7 +218,7 @@ void CmdPartTorus::activated(int iMsg) openCommand((const char*)cmd.toUtf8()); doCommand(Doc,"App.ActiveDocument.addObject(\"Part::Torus\",\"Torus\")"); - cmd = QString::fromAscii("App.ActiveDocument.ActiveObject.Label = \"%1\"") + cmd = QString::fromLatin1("App.ActiveDocument.ActiveObject.Label = \"%1\"") .arg(qApp->translate("CmdPartTorus","Torus")); doCommand(Doc,(const char*)cmd.toUtf8()); commitCommand(); diff --git a/src/Mod/Part/Gui/CrossSections.cpp b/src/Mod/Part/Gui/CrossSections.cpp index 9fc77d2691..85bd2e7cc1 100644 --- a/src/Mod/Part/Gui/CrossSections.cpp +++ b/src/Mod/Part/Gui/CrossSections.cpp @@ -119,7 +119,7 @@ private: }; } -CrossSections::CrossSections(const Base::BoundBox3d& bb, QWidget* parent, Qt::WFlags fl) +CrossSections::CrossSections(const Base::BoundBox3d& bb, QWidget* parent, Qt::WindowFlags fl) : QDialog(parent, fl), bbox(bb) { ui = new Ui_CrossSections(); @@ -240,28 +240,28 @@ void CrossSections::apply() App::Document* doc = (*it)->getDocument(); std::string s = (*it)->getNameInDocument(); s += "_cs"; - app->runPythonCode(QString::fromAscii( + app->runPythonCode(QString::fromLatin1( "wires=list()\n" "shape=FreeCAD.getDocument(\"%1\").%2.Shape\n") .arg(QLatin1String(doc->getName())) - .arg(QLatin1String((*it)->getNameInDocument())).toAscii()); + .arg(QLatin1String((*it)->getNameInDocument())).toLatin1()); for (std::vector::iterator jt = d.begin(); jt != d.end(); ++jt) { - app->runPythonCode(QString::fromAscii( + app->runPythonCode(QString::fromLatin1( "for i in shape.slice(Base.Vector(%1,%2,%3),%4):\n" " wires.append(i)\n" - ).arg(a).arg(b).arg(c).arg(*jt).toAscii()); + ).arg(a).arg(b).arg(c).arg(*jt).toLatin1()); seq.next(); } - app->runPythonCode(QString::fromAscii( + app->runPythonCode(QString::fromLatin1( "comp=Part.Compound(wires)\n" "slice=FreeCAD.getDocument(\"%1\").addObject(\"Part::Feature\",\"%2\")\n" "slice.Shape=comp\n" "slice.purgeTouched()\n" "del slice,comp,wires,shape") .arg(QLatin1String(doc->getName())) - .arg(QLatin1String(s.c_str())).toAscii()); + .arg(QLatin1String(s.c_str())).toLatin1()); seq.next(); } diff --git a/src/Mod/Part/Gui/CrossSections.h b/src/Mod/Part/Gui/CrossSections.h index b0879b20fa..379d1981d5 100644 --- a/src/Mod/Part/Gui/CrossSections.h +++ b/src/Mod/Part/Gui/CrossSections.h @@ -44,7 +44,7 @@ class CrossSections : public QDialog enum Plane { XY, XZ, YZ }; public: - CrossSections(const Base::BoundBox3d& bb, QWidget* parent = 0, Qt::WFlags fl = 0); + CrossSections(const Base::BoundBox3d& bb, QWidget* parent = 0, Qt::WindowFlags fl = 0); ~CrossSections(); void accept(); void apply(); diff --git a/src/Mod/Part/Gui/DlgBooleanOperation.cpp b/src/Mod/Part/Gui/DlgBooleanOperation.cpp index 2d045a2bd5..d189966a58 100644 --- a/src/Mod/Part/Gui/DlgBooleanOperation.cpp +++ b/src/Mod/Part/Gui/DlgBooleanOperation.cpp @@ -134,7 +134,7 @@ void DlgBooleanOperation::slotChangedObject(const App::DocumentObject& obj, if (!shape.IsNull()) { Gui::Document* activeGui = Gui::Application::Instance->getDocument(obj.getDocument()); QString label = QString::fromUtf8(obj.Label.getValue()); - QString name = QString::fromAscii(obj.getNameInDocument()); + QString name = QString::fromLatin1(obj.getNameInDocument()); QTreeWidgetItem* child = new BooleanOperationItem(); child->setCheckState(0, Qt::Unchecked); @@ -217,7 +217,7 @@ void DlgBooleanOperation::findShapes() const TopoDS_Shape& shape = static_cast(*it)->Shape.getValue(); if (!shape.IsNull()) { QString label = QString::fromUtf8((*it)->Label.getValue()); - QString name = QString::fromAscii((*it)->getNameInDocument()); + QString name = QString::fromLatin1((*it)->getNameInDocument()); QTreeWidgetItem* child = new BooleanOperationItem(); child->setCheckState(0, Qt::Unchecked); diff --git a/src/Mod/Part/Gui/DlgExtrusion.cpp b/src/Mod/Part/Gui/DlgExtrusion.cpp index f67b17bb83..632b07bbcf 100644 --- a/src/Mod/Part/Gui/DlgExtrusion.cpp +++ b/src/Mod/Part/Gui/DlgExtrusion.cpp @@ -52,7 +52,7 @@ using namespace PartGui; -DlgExtrusion::DlgExtrusion(QWidget* parent, Qt::WFlags fl) +DlgExtrusion::DlgExtrusion(QWidget* parent, Qt::WindowFlags fl) : QDialog(parent, fl), ui(new Ui_DlgExtrusion) { ui->setupUi(this); @@ -103,7 +103,7 @@ void DlgExtrusion::findShapes() if (canExtrude(shape)) { QTreeWidgetItem* item = new QTreeWidgetItem(ui->treeWidget); item->setText(0, QString::fromUtf8((*it)->Label.getValue())); - item->setData(0, Qt::UserRole, QString::fromAscii((*it)->getNameInDocument())); + item->setData(0, Qt::UserRole, QString::fromLatin1((*it)->getNameInDocument())); Gui::ViewProvider* vp = activeGui->getViewProvider(*it); if (vp) item->setIcon(0, vp->getIcon()); @@ -168,14 +168,14 @@ void DlgExtrusion::apply() QList items = ui->treeWidget->selectedItems(); for (QList::iterator it = items.begin(); it != items.end(); ++it) { shape = (*it)->data(0, Qt::UserRole).toString(); - type = QString::fromAscii("Part::Extrusion"); + type = QString::fromLatin1("Part::Extrusion"); if (addBaseName) { QString baseName = QString::fromLatin1("Extrude_%1").arg(shape); label = QString::fromLatin1("%1_Extrude").arg((*it)->text(0)); - name = QString::fromAscii(activeDoc->getUniqueObjectName((const char*)baseName.toLatin1()).c_str()); + name = QString::fromLatin1(activeDoc->getUniqueObjectName((const char*)baseName.toLatin1()).c_str()); } else { - name = QString::fromAscii(activeDoc->getUniqueObjectName("Extrude").c_str()); + name = QString::fromLatin1(activeDoc->getUniqueObjectName("Extrude").c_str()); label = name; } @@ -187,7 +187,7 @@ void DlgExtrusion::apply() bool makeSolid = ui->makeSolid->isChecked(); // inspect geometry - App::DocumentObject* obj = activeDoc->getObject((const char*)shape.toAscii()); + App::DocumentObject* obj = activeDoc->getObject((const char*)shape.toLatin1()); if (!obj || !obj->isDerivedFrom(Part::Feature::getClassTypeId())) continue; Part::Feature* fea = static_cast(obj); const TopoDS_Shape& data = fea->Shape.getValue(); @@ -211,7 +211,7 @@ void DlgExtrusion::apply() } } - QString code = QString::fromAscii( + QString code = QString::fromLatin1( "FreeCAD.getDocument(\"%1\").addObject(\"%2\",\"%3\")\n" "FreeCAD.getDocument(\"%1\").%3.Base = FreeCAD.getDocument(\"%1\").%4\n" "FreeCAD.getDocument(\"%1\").%3.Dir = (%5,%6,%7)\n" @@ -219,7 +219,7 @@ void DlgExtrusion::apply() "FreeCAD.getDocument(\"%1\").%3.TaperAngle = (%9)\n" "FreeCADGui.getDocument(\"%1\").%4.Visibility = False\n" "FreeCAD.getDocument(\"%1\").%3.Label = '%10'\n") - .arg(QString::fromAscii(this->document.c_str())) + .arg(QString::fromLatin1(this->document.c_str())) .arg(type).arg(name).arg(shape) .arg(dirX*len) .arg(dirY*len) @@ -227,9 +227,9 @@ void DlgExtrusion::apply() .arg(makeSolid ? QLatin1String("True") : QLatin1String("False")) .arg(angle) .arg(label); - Gui::Application::Instance->runPythonCode((const char*)code.toAscii()); - QByteArray to = name.toAscii(); - QByteArray from = shape.toAscii(); + Gui::Application::Instance->runPythonCode((const char*)code.toLatin1()); + QByteArray to = name.toLatin1(); + QByteArray from = shape.toLatin1(); Gui::Command::copyVisual(to, "ShapeColor", from); Gui::Command::copyVisual(to, "LineColor", from); Gui::Command::copyVisual(to, "PointColor", from); @@ -239,21 +239,21 @@ void DlgExtrusion::apply() try { ui->statusLabel->clear(); activeDoc->recompute(); - ui->statusLabel->setText(QString::fromAscii + ui->statusLabel->setText(QString::fromLatin1 ("%1").arg(tr("Succeeded"))); } catch (const std::exception& e) { - ui->statusLabel->setText(QString::fromAscii + ui->statusLabel->setText(QString::fromLatin1 ("%1").arg(tr("Failed"))); Base::Console().Error("%s\n", e.what()); } catch (const Base::Exception& e) { - ui->statusLabel->setText(QString::fromAscii + ui->statusLabel->setText(QString::fromLatin1 ("%1").arg(tr("Failed"))); Base::Console().Error("%s\n", e.what()); } catch (...) { - ui->statusLabel->setText(QString::fromAscii + ui->statusLabel->setText(QString::fromLatin1 ("%1").arg(tr("Failed"))); Base::Console().Error("General error in extrusion\n"); } diff --git a/src/Mod/Part/Gui/DlgExtrusion.h b/src/Mod/Part/Gui/DlgExtrusion.h index 38423de6dd..33380d23e3 100644 --- a/src/Mod/Part/Gui/DlgExtrusion.h +++ b/src/Mod/Part/Gui/DlgExtrusion.h @@ -37,7 +37,7 @@ class DlgExtrusion : public QDialog Q_OBJECT public: - DlgExtrusion(QWidget* parent = 0, Qt::WFlags fl = 0); + DlgExtrusion(QWidget* parent = 0, Qt::WindowFlags fl = 0); ~DlgExtrusion(); void accept(); void apply(); diff --git a/src/Mod/Part/Gui/DlgFilletEdges.cpp b/src/Mod/Part/Gui/DlgFilletEdges.cpp index 993c1d34aa..11fe911189 100644 --- a/src/Mod/Part/Gui/DlgFilletEdges.cpp +++ b/src/Mod/Part/Gui/DlgFilletEdges.cpp @@ -108,7 +108,7 @@ void FilletRadiusDelegate::setModelData(QWidget *editor, QAbstractItemModel *mod QDoubleSpinBox *spinBox = static_cast(editor); spinBox->interpretText(); //double value = spinBox->value(); - //QString value = QString::fromAscii("%1").arg(spinBox->value(),0,'f',2); + //QString value = QString::fromLatin1("%1").arg(spinBox->value(),0,'f',2); QString value = QLocale::system().toString(spinBox->value(),'f',Base::UnitsApi::getDecimals()); model->setData(index, value, Qt::EditRole); @@ -201,7 +201,7 @@ namespace PartGui { /* TRANSLATOR PartGui::DlgFilletEdges */ -DlgFilletEdges::DlgFilletEdges(FilletType type, Part::FilletBase* fillet, QWidget* parent, Qt::WFlags fl) +DlgFilletEdges::DlgFilletEdges(FilletType type, Part::FilletBase* fillet, QWidget* parent, Qt::WindowFlags fl) : QWidget(parent, fl), ui(new Ui_DlgFilletEdges()), d(new Private()) { ui->setupUi(this); @@ -282,7 +282,7 @@ void DlgFilletEdges::onSelectionChanged(const Gui::SelectionChanges& msg) std::string docname = doc->getName(); std::string objname = d->object->getNameInDocument(); if (docname==msg.pDocName && objname==msg.pObjectName) { - QString subelement = QString::fromAscii(msg.pSubName); + QString subelement = QString::fromLatin1(msg.pSubName); if (subelement.startsWith(QLatin1String("Edge"))) { onSelectEdge(subelement, msg.Type); } @@ -376,7 +376,7 @@ void DlgFilletEdges::onSelectEdge(const QString& subelement, int type) QAbstractItemModel* model = ui->treeView->model(); for (int i=0; irowCount(); ++i) { int id = model->data(model->index(i,0), Qt::UserRole).toInt(); - QString name = QString::fromAscii("Edge%1").arg(id); + QString name = QString::fromLatin1("Edge%1").arg(id); if (name == subelement) { // ok, check the selected sub-element Qt::CheckState checkState = @@ -408,12 +408,12 @@ void DlgFilletEdges::onSelectEdgesOfFace(const QString& subelement, int type) for(int j = 1; j <= mapOfEdges.Extent(); ++j) { TopoDS_Edge edge = TopoDS::Edge(mapOfEdges.FindKey(j)); int id = d->all_edges.FindIndex(edge); - QString name = QString::fromAscii("Edge%1").arg(id); + QString name = QString::fromLatin1("Edge%1").arg(id); onSelectEdge(name, type); Gui::SelectionChanges::MsgType msgType = Gui::SelectionChanges::MsgType(type); if (msgType == Gui::SelectionChanges::AddSelection) { Gui::Selection().addSelection(d->object->getDocument()->getName(), - d->object->getNameInDocument(), (const char*)name.toAscii()); + d->object->getNameInDocument(), (const char*)name.toLatin1()); } } } @@ -440,7 +440,7 @@ void DlgFilletEdges::onDeleteObject(const App::DocumentObject& obj) on_shapeObject_activated(0); } else { - QString shape = QString::fromAscii(obj.getNameInDocument()); + QString shape = QString::fromLatin1(obj.getNameInDocument()); // start from the second item for (int i=1; ishapeObject->count(); i++) { if (ui->shapeObject->itemData(i).toString() == shape) { @@ -473,7 +473,7 @@ void DlgFilletEdges::toggleCheckState(const QModelIndex& index) return; QVariant check = index.data(Qt::CheckStateRole); int id = index.data(Qt::UserRole).toInt(); - QString name = QString::fromAscii("Edge%1").arg(id); + QString name = QString::fromLatin1("Edge%1").arg(id); Qt::CheckState checkState = static_cast(check.toInt()); bool block = this->blockConnection(false); @@ -483,13 +483,13 @@ void DlgFilletEdges::toggleCheckState(const QModelIndex& index) App::Document* doc = d->object->getDocument(); Gui::Selection().addSelection(doc->getName(), d->object->getNameInDocument(), - (const char*)name.toAscii()); + (const char*)name.toLatin1()); } else { App::Document* doc = d->object->getDocument(); Gui::Selection().rmvSelection(doc->getName(), d->object->getNameInDocument(), - (const char*)name.toAscii()); + (const char*)name.toLatin1()); } this->blockConnection(block); @@ -506,7 +506,7 @@ void DlgFilletEdges::findShapes() int current_index = 0; for (std::vector::iterator it = objs.begin(); it!=objs.end(); ++it, ++index) { ui->shapeObject->addItem(QString::fromUtf8((*it)->Label.getValue())); - ui->shapeObject->setItemData(index, QString::fromAscii((*it)->getNameInDocument())); + ui->shapeObject->setItemData(index, QString::fromLatin1((*it)->getNameInDocument())); if (current_index == 0) { if (Gui::Selection().isSelected(*it)) { current_index = index; @@ -822,22 +822,22 @@ bool DlgFilletEdges::accept() std::string fillet = getFilletType(); int index = ui->shapeObject->currentIndex(); shape = ui->shapeObject->itemData(index).toString(); - type = QString::fromAscii("Part::%1").arg(QString::fromAscii(fillet.c_str())); + type = QString::fromLatin1("Part::%1").arg(QString::fromLatin1(fillet.c_str())); if (d->fillet) - name = QString::fromAscii(d->fillet->getNameInDocument()); + name = QString::fromLatin1(d->fillet->getNameInDocument()); else - name = QString::fromAscii(activeDoc->getUniqueObjectName(fillet.c_str()).c_str()); + name = QString::fromLatin1(activeDoc->getUniqueObjectName(fillet.c_str()).c_str()); activeDoc->openTransaction(fillet.c_str()); QString code; if (!d->fillet) { - code = QString::fromAscii( + code = QString::fromLatin1( "FreeCAD.ActiveDocument.addObject(\"%1\",\"%2\")\n" "FreeCAD.ActiveDocument.%2.Base = FreeCAD.ActiveDocument.%3\n") .arg(type).arg(name).arg(shape); } - code += QString::fromAscii("__fillets__ = []\n"); + code += QString::fromLatin1("__fillets__ = []\n"); for (int i=0; irowCount(); ++i) { QVariant value = model->index(i,0).data(Qt::CheckStateRole); Qt::CheckState checkState = static_cast(value.toInt()); @@ -850,7 +850,7 @@ bool DlgFilletEdges::accept() double r2 = r1; if (end_radius) r2 = model->index(i,2).data().toDouble(); - code += QString::fromAscii( + code += QString::fromLatin1( "__fillets__.append((%1,%2,%3))\n") .arg(id).arg(r1,0,'f',Base::UnitsApi::getDecimals()).arg(r2,0,'f',Base::UnitsApi::getDecimals()); todo = true; @@ -865,12 +865,12 @@ bool DlgFilletEdges::accept() } Gui::WaitCursor wc; - code += QString::fromAscii( + code += QString::fromLatin1( "FreeCAD.ActiveDocument.%1.Edges = __fillets__\n" "del __fillets__\n" "FreeCADGui.ActiveDocument.%2.Visibility = False\n") .arg(name).arg(shape); - Gui::Application::Instance->runPythonCode((const char*)code.toAscii()); + Gui::Application::Instance->runPythonCode((const char*)code.toLatin1()); activeDoc->commitTransaction(); activeDoc->recompute(); if (d->fillet) { @@ -879,8 +879,8 @@ bool DlgFilletEdges::accept() if (vp) vp->show(); } - QByteArray to = name.toAscii(); - QByteArray from = shape.toAscii(); + QByteArray to = name.toLatin1(); + QByteArray from = shape.toLatin1(); Gui::Command::copyVisual(to, "LineColor", from); Gui::Command::copyVisual(to, "PointColor", from); return true; @@ -888,7 +888,7 @@ bool DlgFilletEdges::accept() // --------------------------------------- -FilletEdgesDialog::FilletEdgesDialog(DlgFilletEdges::FilletType type, Part::FilletBase* fillet, QWidget* parent, Qt::WFlags fl) +FilletEdgesDialog::FilletEdgesDialog(DlgFilletEdges::FilletType type, Part::FilletBase* fillet, QWidget* parent, Qt::WindowFlags fl) : QDialog(parent, fl) { widget = new DlgFilletEdges(type, fillet, this); @@ -958,7 +958,7 @@ bool TaskFilletEdges::reject() /* TRANSLATOR PartGui::DlgChamferEdges */ -DlgChamferEdges::DlgChamferEdges(Part::FilletBase* chamfer, QWidget* parent, Qt::WFlags fl) +DlgChamferEdges::DlgChamferEdges(Part::FilletBase* chamfer, QWidget* parent, Qt::WindowFlags fl) : DlgFilletEdges(DlgFilletEdges::CHAMFER, chamfer, parent, fl) { this->setWindowTitle(tr("Chamfer Edges")); diff --git a/src/Mod/Part/Gui/DlgFilletEdges.h b/src/Mod/Part/Gui/DlgFilletEdges.h index c18cedbcf0..a92c37231e 100644 --- a/src/Mod/Part/Gui/DlgFilletEdges.h +++ b/src/Mod/Part/Gui/DlgFilletEdges.h @@ -80,7 +80,7 @@ class DlgFilletEdges : public QWidget, public Gui::SelectionObserver public: enum FilletType { FILLET, CHAMFER }; - DlgFilletEdges(FilletType type, Part::FilletBase*, QWidget* parent = 0, Qt::WFlags fl = 0); + DlgFilletEdges(FilletType type, Part::FilletBase*, QWidget* parent = 0, Qt::WindowFlags fl = 0); ~DlgFilletEdges(); bool accept(); @@ -120,7 +120,7 @@ class FilletEdgesDialog : public QDialog Q_OBJECT public: - FilletEdgesDialog(DlgFilletEdges::FilletType type, Part::FilletBase* fillet, QWidget* parent = 0, Qt::WFlags fl = 0); + FilletEdgesDialog(DlgFilletEdges::FilletType type, Part::FilletBase* fillet, QWidget* parent = 0, Qt::WindowFlags fl = 0); ~FilletEdgesDialog(); void accept(); @@ -133,7 +133,7 @@ class DlgChamferEdges : public DlgFilletEdges Q_OBJECT public: - DlgChamferEdges(Part::FilletBase*, QWidget* parent = 0, Qt::WFlags fl = 0); + DlgChamferEdges(Part::FilletBase*, QWidget* parent = 0, Qt::WindowFlags fl = 0); ~DlgChamferEdges(); protected: diff --git a/src/Mod/Part/Gui/DlgPartBoxImp.cpp b/src/Mod/Part/Gui/DlgPartBoxImp.cpp index 528e574464..d1815b7bcd 100644 --- a/src/Mod/Part/Gui/DlgPartBoxImp.cpp +++ b/src/Mod/Part/Gui/DlgPartBoxImp.cpp @@ -34,9 +34,9 @@ using namespace PartGui; * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ -DlgPartBoxImp::DlgPartBoxImp(QWidget* parent, Qt::WFlags fl) +DlgPartBoxImp::DlgPartBoxImp(QWidget* parent, Qt::WindowFlags fl) : Gui::LocationInterface(parent, fl) { } diff --git a/src/Mod/Part/Gui/DlgPartBoxImp.h b/src/Mod/Part/Gui/DlgPartBoxImp.h index 0890d1669b..4f175b0d5d 100644 --- a/src/Mod/Part/Gui/DlgPartBoxImp.h +++ b/src/Mod/Part/Gui/DlgPartBoxImp.h @@ -33,7 +33,7 @@ class DlgPartBoxImp : public Gui::LocationInterface Q_OBJECT public: - DlgPartBoxImp(QWidget* parent = 0, Qt::WFlags fl = 0); + DlgPartBoxImp(QWidget* parent = 0, Qt::WindowFlags fl = 0); ~DlgPartBoxImp(); }; diff --git a/src/Mod/Part/Gui/DlgPartCylinderImp.cpp b/src/Mod/Part/Gui/DlgPartCylinderImp.cpp index c168a1ee5d..ae926ff70c 100644 --- a/src/Mod/Part/Gui/DlgPartCylinderImp.cpp +++ b/src/Mod/Part/Gui/DlgPartCylinderImp.cpp @@ -34,9 +34,9 @@ using namespace PartGui; * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ -DlgPartCylinderImp::DlgPartCylinderImp(QWidget* parent, Qt::WFlags fl) +DlgPartCylinderImp::DlgPartCylinderImp(QWidget* parent, Qt::WindowFlags fl) : Gui::LocationInterface(parent, fl) { QList list = this->findChildren(); diff --git a/src/Mod/Part/Gui/DlgPartCylinderImp.h b/src/Mod/Part/Gui/DlgPartCylinderImp.h index ba835763c5..8924b73e42 100644 --- a/src/Mod/Part/Gui/DlgPartCylinderImp.h +++ b/src/Mod/Part/Gui/DlgPartCylinderImp.h @@ -33,7 +33,7 @@ class DlgPartCylinderImp : public Gui::LocationInterface Q_OBJECT public: - DlgPartCylinderImp(QWidget* parent = 0, Qt::WFlags fl = 0); + DlgPartCylinderImp(QWidget* parent = 0, Qt::WindowFlags fl = 0); ~DlgPartCylinderImp(); }; diff --git a/src/Mod/Part/Gui/DlgPartImportIgesImp.cpp b/src/Mod/Part/Gui/DlgPartImportIgesImp.cpp index 4ddd84e9af..7fd8dd2f5b 100644 --- a/src/Mod/Part/Gui/DlgPartImportIgesImp.cpp +++ b/src/Mod/Part/Gui/DlgPartImportIgesImp.cpp @@ -40,9 +40,9 @@ using namespace PartGui; * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ -DlgPartImportIgesImp::DlgPartImportIgesImp(QWidget* parent, Qt::WFlags fl) +DlgPartImportIgesImp::DlgPartImportIgesImp(QWidget* parent, Qt::WindowFlags fl) : QDialog(parent, fl) { this->setupUi(this); diff --git a/src/Mod/Part/Gui/DlgPartImportIgesImp.h b/src/Mod/Part/Gui/DlgPartImportIgesImp.h index b81480ce55..91eadb68bf 100644 --- a/src/Mod/Part/Gui/DlgPartImportIgesImp.h +++ b/src/Mod/Part/Gui/DlgPartImportIgesImp.h @@ -33,7 +33,7 @@ class DlgPartImportIgesImp : public QDialog, public Ui_DlgPartImportIges Q_OBJECT public: - DlgPartImportIgesImp( QWidget* parent = 0, Qt::WFlags fl = 0 ); + DlgPartImportIgesImp( QWidget* parent = 0, Qt::WindowFlags fl = 0 ); ~DlgPartImportIgesImp(); public Q_SLOTS: diff --git a/src/Mod/Part/Gui/DlgPartImportStepImp.cpp b/src/Mod/Part/Gui/DlgPartImportStepImp.cpp index 3740a043d0..02d2a1956d 100644 --- a/src/Mod/Part/Gui/DlgPartImportStepImp.cpp +++ b/src/Mod/Part/Gui/DlgPartImportStepImp.cpp @@ -39,9 +39,9 @@ using namespace PartGui; * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ -DlgPartImportStepImp::DlgPartImportStepImp( QWidget* parent, Qt::WFlags fl ) +DlgPartImportStepImp::DlgPartImportStepImp( QWidget* parent, Qt::WindowFlags fl ) : QDialog( parent, fl ) { this->setupUi(this); diff --git a/src/Mod/Part/Gui/DlgPartImportStepImp.h b/src/Mod/Part/Gui/DlgPartImportStepImp.h index 3302aa5040..46afb81c63 100644 --- a/src/Mod/Part/Gui/DlgPartImportStepImp.h +++ b/src/Mod/Part/Gui/DlgPartImportStepImp.h @@ -33,7 +33,7 @@ class DlgPartImportStepImp : public QDialog, public Ui_DlgPartImportStep Q_OBJECT public: - DlgPartImportStepImp( QWidget* parent = 0, Qt::WFlags fl = 0 ); + DlgPartImportStepImp( QWidget* parent = 0, Qt::WindowFlags fl = 0 ); ~DlgPartImportStepImp(); public Q_SLOTS: diff --git a/src/Mod/Part/Gui/DlgPrimitives.cpp b/src/Mod/Part/Gui/DlgPrimitives.cpp index ceaaded93e..4d05bf6f71 100644 --- a/src/Mod/Part/Gui/DlgPrimitives.cpp +++ b/src/Mod/Part/Gui/DlgPrimitives.cpp @@ -102,7 +102,7 @@ void Picker::createPrimitive(QWidget* widget, const QString& descr, Gui::Documen // Execute the Python block doc->openCommand(descr.toUtf8()); - Gui::Command::doCommand(Gui::Command::Doc, (const char*)cmd.toAscii()); + Gui::Command::doCommand(Gui::Command::Doc, (const char*)cmd.toLatin1()); doc->commitCommand(); Gui::Command::doCommand(Gui::Command::Doc, "App.ActiveDocument.recompute()"); Gui::Command::doCommand(Gui::Command::Gui, "Gui.SendMsgToActiveView(\"ViewFit\")"); @@ -129,7 +129,7 @@ QString Picker::toPlacement(const gp_Ax2& axis) const Base::Rotation rot(Base::convertTo(theAxis), theAngle); gp_Pnt loc = axis.Location(); - return QString::fromAscii("Base.Placement(Base.Vector(%1,%2,%3),Base.Rotation(%4,%5,%6,%7))") + return QString::fromLatin1("Base.Placement(Base.Vector(%1,%2,%3),Base.Rotation(%4,%5,%6,%7))") .arg(loc.X(),0,'f',2) .arg(loc.Y(),0,'f',2) .arg(loc.Z(),0,'f',2) @@ -159,8 +159,8 @@ public: Handle_Geom_TrimmedCurve trim = arc.Value(); Handle_Geom_Circle circle = Handle_Geom_Circle::DownCast(trim->BasisCurve()); - QString name = QString::fromAscii(doc->getUniqueObjectName("Circle").c_str()); - return QString::fromAscii( + QString name = QString::fromLatin1(doc->getUniqueObjectName("Circle").c_str()); + return QString::fromLatin1( "App.ActiveDocument.addObject(\"Part::Circle\",\"%1\")\n" "App.ActiveDocument.%1.Radius=%2\n" "App.ActiveDocument.%1.Angle0=%3\n" @@ -349,8 +349,8 @@ void DlgPrimitives::createPrimitive(const QString& placement) return; } if (ui.comboBox1->currentIndex() == 0) { // plane - name = QString::fromAscii(doc->getUniqueObjectName("Plane").c_str()); - cmd = QString::fromAscii( + name = QString::fromLatin1(doc->getUniqueObjectName("Plane").c_str()); + cmd = QString::fromLatin1( "App.ActiveDocument.addObject(\"Part::Plane\",\"%1\")\n" "App.ActiveDocument.%1.Length=%2\n" "App.ActiveDocument.%1.Width=%3\n" @@ -363,8 +363,8 @@ void DlgPrimitives::createPrimitive(const QString& placement) .arg(tr("Plane")); } else if (ui.comboBox1->currentIndex() == 1) { // box - name = QString::fromAscii(doc->getUniqueObjectName("Box").c_str()); - cmd = QString::fromAscii( + name = QString::fromLatin1(doc->getUniqueObjectName("Box").c_str()); + cmd = QString::fromLatin1( "App.ActiveDocument.addObject(\"Part::Box\",\"%1\")\n" "App.ActiveDocument.%1.Length=%2\n" "App.ActiveDocument.%1.Width=%3\n" @@ -379,8 +379,8 @@ void DlgPrimitives::createPrimitive(const QString& placement) .arg(tr("Box")); } else if (ui.comboBox1->currentIndex() == 2) { // cylinder - name = QString::fromAscii(doc->getUniqueObjectName("Cylinder").c_str()); - cmd = QString::fromAscii( + name = QString::fromLatin1(doc->getUniqueObjectName("Cylinder").c_str()); + cmd = QString::fromLatin1( "App.ActiveDocument.addObject(\"Part::Cylinder\",\"%1\")\n" "App.ActiveDocument.%1.Radius=%2\n" "App.ActiveDocument.%1.Height=%3\n" @@ -395,8 +395,8 @@ void DlgPrimitives::createPrimitive(const QString& placement) .arg(tr("Cylinder")); } else if (ui.comboBox1->currentIndex() == 3) { // cone - name = QString::fromAscii(doc->getUniqueObjectName("Cone").c_str()); - cmd = QString::fromAscii( + name = QString::fromLatin1(doc->getUniqueObjectName("Cone").c_str()); + cmd = QString::fromLatin1( "App.ActiveDocument.addObject(\"Part::Cone\",\"%1\")\n" "App.ActiveDocument.%1.Radius1=%2\n" "App.ActiveDocument.%1.Radius2=%3\n" @@ -413,8 +413,8 @@ void DlgPrimitives::createPrimitive(const QString& placement) .arg(tr("Cone")); } else if (ui.comboBox1->currentIndex() == 4) { // sphere - name = QString::fromAscii(doc->getUniqueObjectName("Sphere").c_str()); - cmd = QString::fromAscii( + name = QString::fromLatin1(doc->getUniqueObjectName("Sphere").c_str()); + cmd = QString::fromLatin1( "App.ActiveDocument.addObject(\"Part::Sphere\",\"%1\")\n" "App.ActiveDocument.%1.Radius=%2\n" "App.ActiveDocument.%1.Angle1=%3\n" @@ -431,8 +431,8 @@ void DlgPrimitives::createPrimitive(const QString& placement) .arg(tr("Sphere")); } else if (ui.comboBox1->currentIndex() == 5) { // ellipsoid - name = QString::fromAscii(doc->getUniqueObjectName("Ellipsoid").c_str()); - cmd = QString::fromAscii( + name = QString::fromLatin1(doc->getUniqueObjectName("Ellipsoid").c_str()); + cmd = QString::fromLatin1( "App.ActiveDocument.addObject(\"Part::Ellipsoid\",\"%1\")\n" "App.ActiveDocument.%1.Radius1=%2\n" "App.ActiveDocument.%1.Radius2=%3\n" @@ -453,8 +453,8 @@ void DlgPrimitives::createPrimitive(const QString& placement) .arg(tr("Ellipsoid")); } else if (ui.comboBox1->currentIndex() == 6) { // torus - name = QString::fromAscii(doc->getUniqueObjectName("Torus").c_str()); - cmd = QString::fromAscii( + name = QString::fromLatin1(doc->getUniqueObjectName("Torus").c_str()); + cmd = QString::fromLatin1( "App.ActiveDocument.addObject(\"Part::Torus\",\"%1\")\n" "App.ActiveDocument.%1.Radius1=%2\n" "App.ActiveDocument.%1.Radius2=%3\n" @@ -473,8 +473,8 @@ void DlgPrimitives::createPrimitive(const QString& placement) .arg(tr("Torus")); } else if (ui.comboBox1->currentIndex() == 7) { // prism - name = QString::fromAscii(doc->getUniqueObjectName("Prism").c_str()); - cmd = QString::fromAscii( + name = QString::fromLatin1(doc->getUniqueObjectName("Prism").c_str()); + cmd = QString::fromLatin1( "App.ActiveDocument.addObject(\"Part::Prism\",\"%1\")\n" "App.ActiveDocument.%1.Polygon=%2\n" "App.ActiveDocument.%1.Circumradius=%3\n" @@ -489,8 +489,8 @@ void DlgPrimitives::createPrimitive(const QString& placement) .arg(tr("Prism")); } else if (ui.comboBox1->currentIndex() == 8) { // wedge - name = QString::fromAscii(doc->getUniqueObjectName("Wedge").c_str()); - cmd = QString::fromAscii( + name = QString::fromLatin1(doc->getUniqueObjectName("Wedge").c_str()); + cmd = QString::fromLatin1( "App.ActiveDocument.addObject(\"Part::Wedge\",\"%1\")\n" "App.ActiveDocument.%1.Xmin=%2\n" "App.ActiveDocument.%1.Ymin=%3\n" @@ -519,8 +519,8 @@ void DlgPrimitives::createPrimitive(const QString& placement) .arg(tr("Wedge")); } else if (ui.comboBox1->currentIndex() == 9) { // helix - name = QString::fromAscii(doc->getUniqueObjectName("Helix").c_str()); - cmd = QString::fromAscii( + name = QString::fromLatin1(doc->getUniqueObjectName("Helix").c_str()); + cmd = QString::fromLatin1( "App.ActiveDocument.addObject(\"Part::Helix\",\"%1\")\n" "App.ActiveDocument.%1.Pitch=%2\n" "App.ActiveDocument.%1.Height=%3\n" @@ -540,8 +540,8 @@ void DlgPrimitives::createPrimitive(const QString& placement) .arg(tr("Helix")); } else if (ui.comboBox1->currentIndex() == 10) { // spiral - name = QString::fromAscii(doc->getUniqueObjectName("Spiral").c_str()); - cmd = QString::fromAscii( + name = QString::fromLatin1(doc->getUniqueObjectName("Spiral").c_str()); + cmd = QString::fromLatin1( "App.ActiveDocument.addObject(\"Part::Spiral\",\"%1\")\n" "App.ActiveDocument.%1.Growth=%2\n" "App.ActiveDocument.%1.Rotations=%3\n" @@ -556,8 +556,8 @@ void DlgPrimitives::createPrimitive(const QString& placement) .arg(tr("Spiral")); } else if (ui.comboBox1->currentIndex() == 11) { // circle - name = QString::fromAscii(doc->getUniqueObjectName("Circle").c_str()); - cmd = QString::fromAscii( + name = QString::fromLatin1(doc->getUniqueObjectName("Circle").c_str()); + cmd = QString::fromLatin1( "App.ActiveDocument.addObject(\"Part::Circle\",\"%1\")\n" "App.ActiveDocument.%1.Radius=%2\n" "App.ActiveDocument.%1.Angle0=%3\n" @@ -572,8 +572,8 @@ void DlgPrimitives::createPrimitive(const QString& placement) .arg(tr("Circle")); } else if (ui.comboBox1->currentIndex() == 12) { // ellipse - name = QString::fromAscii(doc->getUniqueObjectName("Ellipse").c_str()); - cmd = QString::fromAscii( + name = QString::fromLatin1(doc->getUniqueObjectName("Ellipse").c_str()); + cmd = QString::fromLatin1( "App.ActiveDocument.addObject(\"Part::Ellipse\",\"%1\")\n" "App.ActiveDocument.%1.MajorRadius=%2\n" "App.ActiveDocument.%1.MinorRadius=%3\n" @@ -590,8 +590,8 @@ void DlgPrimitives::createPrimitive(const QString& placement) .arg(tr("Ellipse")); } else if (ui.comboBox1->currentIndex() == 13) { // vertex - name = QString::fromAscii(doc->getUniqueObjectName("Vertex").c_str()); - cmd = QString::fromAscii( + name = QString::fromLatin1(doc->getUniqueObjectName("Vertex").c_str()); + cmd = QString::fromLatin1( "App.ActiveDocument.addObject(\"Part::Vertex\",\"%1\")\n" "App.ActiveDocument.%1.X=%2\n" "App.ActiveDocument.%1.Y=%3\n" @@ -606,8 +606,8 @@ void DlgPrimitives::createPrimitive(const QString& placement) .arg(tr("Vertex")); } else if (ui.comboBox1->currentIndex() == 14) { // line - name = QString::fromAscii(doc->getUniqueObjectName("Line").c_str()); - cmd = QString::fromAscii( + name = QString::fromLatin1(doc->getUniqueObjectName("Line").c_str()); + cmd = QString::fromLatin1( "App.ActiveDocument.addObject(\"Part::Line\",\"%1\")\n" "App.ActiveDocument.%1.X1=%2\n" "App.ActiveDocument.%1.Y1=%3\n" @@ -628,8 +628,8 @@ void DlgPrimitives::createPrimitive(const QString& placement) .arg(tr("Line")); } else if (ui.comboBox1->currentIndex() == 15) { // RegularPolygon - name = QString::fromAscii(doc->getUniqueObjectName("RegularPolygon").c_str()); - cmd = QString::fromAscii( + name = QString::fromLatin1(doc->getUniqueObjectName("RegularPolygon").c_str()); + cmd = QString::fromLatin1( "App.ActiveDocument.addObject(\"Part::RegularPolygon\",\"%1\")\n" "App.ActiveDocument.%1.Polygon=%2\n" "App.ActiveDocument.%1.Circumradius=%3\n" @@ -789,7 +789,7 @@ QString Location::toPlacement() const Base::Rotation rot(Base::convertTo(theAxis), theAngle); Base::Vector3d loc = ui.loc->getPosition(); - return QString::fromAscii("Base.Placement(Base.Vector(%1,%2,%3),Base.Rotation(%4,%5,%6,%7))") + return QString::fromLatin1("Base.Placement(Base.Vector(%1,%2,%3),Base.Rotation(%4,%5,%6,%7))") .arg(loc.x,0,'f',2) .arg(loc.y,0,'f',2) .arg(loc.z,0,'f',2) diff --git a/src/Mod/Part/Gui/DlgRevolution.cpp b/src/Mod/Part/Gui/DlgRevolution.cpp index 99137d5892..0bd98f11a4 100644 --- a/src/Mod/Part/Gui/DlgRevolution.cpp +++ b/src/Mod/Part/Gui/DlgRevolution.cpp @@ -97,7 +97,7 @@ public: } }; -DlgRevolution::DlgRevolution(QWidget* parent, Qt::WFlags fl) +DlgRevolution::DlgRevolution(QWidget* parent, Qt::WindowFlags fl) : Gui::LocationDialog(parent, fl), filter(0) { ui = new Ui_RevolutionComp(this); @@ -164,7 +164,7 @@ void DlgRevolution::findShapes() // So allowed are: vertex, edge, wire, face, shell and compound QTreeWidgetItem* item = new QTreeWidgetItem(ui->treeWidget); item->setText(0, QString::fromUtf8((*it)->Label.getValue())); - item->setData(0, Qt::UserRole, QString::fromAscii((*it)->getNameInDocument())); + item->setData(0, Qt::UserRole, QString::fromLatin1((*it)->getNameInDocument())); Gui::ViewProvider* vp = activeGui->getViewProvider(*it); if (vp) item->setIcon(0, vp->getIcon()); } @@ -185,16 +185,16 @@ void DlgRevolution::accept() QString shape, type, name, solid; QList items = ui->treeWidget->selectedItems(); if (ui->checkSolid->isChecked()) { - solid = QString::fromAscii("True");} + solid = QString::fromLatin1("True");} else { - solid = QString::fromAscii("False");} + solid = QString::fromLatin1("False");} for (QList::iterator it = items.begin(); it != items.end(); ++it) { shape = (*it)->data(0, Qt::UserRole).toString(); - type = QString::fromAscii("Part::Revolution"); - name = QString::fromAscii(activeDoc->getUniqueObjectName("Revolve").c_str()); + type = QString::fromLatin1("Part::Revolution"); + name = QString::fromLatin1(activeDoc->getUniqueObjectName("Revolve").c_str()); Base::Vector3d axis = this->getDirection(); - QString code = QString::fromAscii( + QString code = QString::fromLatin1( "FreeCAD.ActiveDocument.addObject(\"%1\",\"%2\")\n" "FreeCAD.ActiveDocument.%2.Source = FreeCAD.ActiveDocument.%3\n" "FreeCAD.ActiveDocument.%2.Axis = (%4,%5,%6)\n" @@ -212,9 +212,9 @@ void DlgRevolution::accept() .arg(ui->angle->value(),0,'f',2) .arg(solid) ; - Gui::Application::Instance->runPythonCode((const char*)code.toAscii()); - QByteArray to = name.toAscii(); - QByteArray from = shape.toAscii(); + Gui::Application::Instance->runPythonCode((const char*)code.toLatin1()); + QByteArray to = name.toLatin1(); + QByteArray from = shape.toLatin1(); Gui::Command::copyVisual(to, "ShapeColor", from); Gui::Command::copyVisual(to, "LineColor", from); Gui::Command::copyVisual(to, "PointColor", from); diff --git a/src/Mod/Part/Gui/DlgRevolution.h b/src/Mod/Part/Gui/DlgRevolution.h index 7f3d648b83..f88b35210c 100644 --- a/src/Mod/Part/Gui/DlgRevolution.h +++ b/src/Mod/Part/Gui/DlgRevolution.h @@ -36,7 +36,7 @@ class DlgRevolution : public Gui::LocationDialog, public Gui::SelectionObserver Q_OBJECT public: - DlgRevolution(QWidget* parent = 0, Qt::WFlags fl = 0); + DlgRevolution(QWidget* parent = 0, Qt::WindowFlags fl = 0); ~DlgRevolution(); void accept(); diff --git a/src/Mod/Part/Gui/Mirroring.cpp b/src/Mod/Part/Gui/Mirroring.cpp index 9e8094e22e..13469b893e 100644 --- a/src/Mod/Part/Gui/Mirroring.cpp +++ b/src/Mod/Part/Gui/Mirroring.cpp @@ -94,7 +94,7 @@ void Mirroring::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 objs = activeDoc->getObjectsOfType (Part::Feature::getClassTypeId()); @@ -102,7 +102,7 @@ void Mirroring::findShapes() const TopoDS_Shape& shape = static_cast(*it)->Shape.getValue(); if (!shape.IsNull()) { 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); @@ -123,7 +123,7 @@ bool Mirroring::accept() return false; } - App::Document* activeDoc = App::GetApplication().getDocument((const char*)this->document.toAscii()); + App::Document* activeDoc = App::GetApplication().getDocument((const char*)this->document.toLatin1()); if (!activeDoc) { QMessageBox::critical(this, windowTitle(), tr("No such document '%1'.").arg(this->document)); @@ -135,7 +135,7 @@ bool Mirroring::accept() activeDoc->openTransaction("Mirroring"); QString shape, label; - QRegExp rx(QString::fromAscii(" \\(Mirror #\\d+\\)$")); + QRegExp rx(QString::fromLatin1(" \\(Mirror #\\d+\\)$")); QList items = ui->shapes->selectedItems(); float normx=0, normy=0, normz=0; int index = ui->comboBox->currentIndex(); @@ -156,9 +156,9 @@ bool Mirroring::accept() int pos = label.indexOf(rx); if (pos > -1) label = label.left(pos); - label.append(QString::fromAscii(" (Mirror #%1)").arg(++count)); + label.append(QString::fromLatin1(" (Mirror #%1)").arg(++count)); - QString code = QString::fromAscii( + QString code = QString::fromLatin1( "__doc__=FreeCAD.getDocument(\"%1\")\n" "__doc__.addObject(\"Part::Mirroring\")\n" "__doc__.ActiveObject.Source=__doc__.getObject(\"%2\")\n" @@ -169,8 +169,8 @@ bool Mirroring::accept() .arg(this->document).arg(shape).arg(label) .arg(normx).arg(normy).arg(normz) .arg(basex).arg(basey).arg(basez); - Gui::Application::Instance->runPythonCode((const char*)code.toAscii()); - QByteArray from = shape.toAscii(); + Gui::Application::Instance->runPythonCode((const char*)code.toLatin1()); + QByteArray from = shape.toLatin1(); Gui::Command::copyVisual("ActiveObject", "ShapeColor", from); Gui::Command::copyVisual("ActiveObject", "LineColor", from); Gui::Command::copyVisual("ActiveObject", "PointColor", from); diff --git a/src/Mod/Part/Gui/SoBrepEdgeSet.cpp b/src/Mod/Part/Gui/SoBrepEdgeSet.cpp index b47d1e5739..6ff150313b 100644 --- a/src/Mod/Part/Gui/SoBrepEdgeSet.cpp +++ b/src/Mod/Part/Gui/SoBrepEdgeSet.cpp @@ -131,9 +131,9 @@ void SoBrepEdgeSet::renderHighlight(SoGLRenderAction *action) //SoLineWidthElement::set(state, this, 4.0f); SoLazyElement::setEmissive(state, &this->highlightColor); - SoOverrideElement::setEmissiveColorOverride(state, this, TRUE); + SoOverrideElement::setEmissiveColorOverride(state, this, true); SoLazyElement::setDiffuse(state, this,1, &this->highlightColor,&this->colorpacker1); - SoOverrideElement::setDiffuseColorOverride(state, this, TRUE); + SoOverrideElement::setDiffuseColorOverride(state, this, true); SoLazyElement::setLightModel(state, SoLazyElement::BASE_COLOR); const SoCoordinateElement * coords; @@ -146,7 +146,7 @@ void SoBrepEdgeSet::renderHighlight(SoGLRenderAction *action) SbBool normalCacheUsed; this->getVertexData(state, coords, normals, cindices, nindices, - tindices, mindices, numcindices, FALSE, normalCacheUsed); + tindices, mindices, numcindices, false, normalCacheUsed); SoMaterialBundle mb(action); mb.sendFirst(); // make sure we have the correct material @@ -174,9 +174,9 @@ void SoBrepEdgeSet::renderSelection(SoGLRenderAction *action) //SoLineWidthElement::set(state, this, 4.0f); SoLazyElement::setEmissive(state, &this->selectionColor); - SoOverrideElement::setEmissiveColorOverride(state, this, TRUE); + SoOverrideElement::setEmissiveColorOverride(state, this, true); SoLazyElement::setDiffuse(state, this,1, &this->selectionColor,&this->colorpacker2); - SoOverrideElement::setDiffuseColorOverride(state, this, TRUE); + SoOverrideElement::setDiffuseColorOverride(state, this, true); SoLazyElement::setLightModel(state, SoLazyElement::BASE_COLOR); const SoCoordinateElement * coords; @@ -189,7 +189,7 @@ void SoBrepEdgeSet::renderSelection(SoGLRenderAction *action) SbBool normalCacheUsed; this->getVertexData(state, coords, normals, cindices, nindices, - tindices, mindices, numcindices, FALSE, normalCacheUsed); + tindices, mindices, numcindices, false, normalCacheUsed); SoMaterialBundle mb(action); mb.sendFirst(); // make sure we have the correct material diff --git a/src/Mod/Part/Gui/SoBrepFaceSet.cpp b/src/Mod/Part/Gui/SoBrepFaceSet.cpp index 57c792865d..63ce32a04c 100644 --- a/src/Mod/Part/Gui/SoBrepFaceSet.cpp +++ b/src/Mod/Part/Gui/SoBrepFaceSet.cpp @@ -194,7 +194,7 @@ void SoBrepFaceSet::GLRender(SoGLRenderAction *action) SoMaterialBundle mb(action); Binding mbind = this->findMaterialBinding(state); - SoTextureCoordinateBundle tb(action, TRUE, FALSE); + SoTextureCoordinateBundle tb(action, true, false); SbBool doTextures = tb.needCoordinates(); int32_t hl_idx = this->highlightIndex.getValue(); @@ -320,7 +320,7 @@ void SoBrepFaceSet::renderColoredArray(SoMaterialBundle *const materials) int tris = partIndex[part_id]; if (tris > 0) { - materials->send(part_id, TRUE); + materials->send(part_id, true); glDrawElements(GL_TRIANGLES, 3 * tris, GL_UNSIGNED_INT, ptr); ptr += 3 * tris; } @@ -363,7 +363,7 @@ void SoBrepFaceSet::GLRender(SoGLRenderAction *action) SoMaterialBundle mb(action); - SoTextureCoordinateBundle tb(action, TRUE, FALSE); + SoTextureCoordinateBundle tb(action, true, false); doTextures = tb.needCoordinates(); SbBool sendNormals = !mb.isColorOnly() || tb.isFunction(); @@ -461,13 +461,13 @@ void SoBrepFaceSet::generatePrimitives(SoAction * action) SbBool sendNormals; SbBool normalCacheUsed; - sendNormals = TRUE; // always generate normals + sendNormals = true; // always generate normals this->getVertexData(state, coords, normals, cindices, nindices, tindices, mindices, numindices, sendNormals, normalCacheUsed); - SoTextureCoordinateBundle tb(action, FALSE, FALSE); + SoTextureCoordinateBundle tb(action, false, false); doTextures = tb.needCoordinates(); if (!sendNormals) nbind = OVERALL; @@ -674,11 +674,11 @@ void SoBrepFaceSet::renderHighlight(SoGLRenderAction *action) state->push(); SoLazyElement::setEmissive(state, &this->highlightColor); - SoOverrideElement::setEmissiveColorOverride(state, this, TRUE); + SoOverrideElement::setEmissiveColorOverride(state, this, true); #if 0 // disables shading effect - // sendNormals will be FALSE + // sendNormals will be false SoLazyElement::setDiffuse(state, this,1, &this->highlightColor,&this->colorpacker); - SoOverrideElement::setDiffuseColorOverride(state, this, TRUE); + SoOverrideElement::setDiffuseColorOverride(state, this, true); SoLazyElement::setLightModel(state, SoLazyElement::BASE_COLOR); #endif @@ -697,7 +697,7 @@ void SoBrepFaceSet::renderHighlight(SoGLRenderAction *action) SbBool normalCacheUsed; SoMaterialBundle mb(action); - SoTextureCoordinateBundle tb(action, TRUE, FALSE); + SoTextureCoordinateBundle tb(action, true, false); doTextures = tb.needCoordinates(); SbBool sendNormals = !mb.isColorOnly() || tb.isFunction(); @@ -734,7 +734,7 @@ void SoBrepFaceSet::renderHighlight(SoGLRenderAction *action) // materials mbind = OVERALL; - doTextures = FALSE; + doTextures = false; renderShape(static_cast(coords), &(cindices[start]), length, &(pindices[id]), 1, normals, nindices, &mb, mindices, &tb, tindices, nbind, mbind, doTextures?1:0); @@ -752,10 +752,10 @@ void SoBrepFaceSet::renderSelection(SoGLRenderAction *action) state->push(); SoLazyElement::setEmissive(state, &this->selectionColor); - SoOverrideElement::setEmissiveColorOverride(state, this, TRUE); + SoOverrideElement::setEmissiveColorOverride(state, this, true); #if 0 // disables shading effect SoLazyElement::setDiffuse(state, this,1, &this->selectionColor,&this->colorpacker); - SoOverrideElement::setDiffuseColorOverride(state, this, TRUE); + SoOverrideElement::setDiffuseColorOverride(state, this, true); SoLazyElement::setLightModel(state, SoLazyElement::BASE_COLOR); #endif @@ -774,7 +774,7 @@ void SoBrepFaceSet::renderSelection(SoGLRenderAction *action) SbBool normalCacheUsed; SoMaterialBundle mb(action); - SoTextureCoordinateBundle tb(action, TRUE, FALSE); + SoTextureCoordinateBundle tb(action, true, false); doTextures = tb.needCoordinates(); SbBool sendNormals = !mb.isColorOnly() || tb.isFunction(); @@ -791,7 +791,7 @@ void SoBrepFaceSet::renderSelection(SoGLRenderAction *action) // materials mbind = OVERALL; - doTextures = FALSE; + doTextures = false; for (int i=0; isend(matnr++, TRUE); + materials->send(matnr++, true); } else if (mbind == PER_PART_INDEXED) { if (trinr == 0) - materials->send(*matindices++, TRUE); + materials->send(*matindices++, true); } else if (mbind == PER_VERTEX || mbind == PER_FACE) { - materials->send(matnr++, TRUE); + materials->send(matnr++, true); } else if (mbind == PER_VERTEX_INDEXED || mbind == PER_FACE_INDEXED) { - materials->send(*matindices++, TRUE); + materials->send(*matindices++, true); } if (normals) { @@ -917,9 +917,9 @@ void SoBrepFaceSet::renderShape(const SoGLCoordinateElement * const vertexlist, /* vertex 2 *********************************************************/ if (mbind == PER_VERTEX) - materials->send(matnr++, TRUE); + materials->send(matnr++, true); else if (mbind == PER_VERTEX_INDEXED) - materials->send(*matindices++, TRUE); + materials->send(*matindices++, true); if (normals) { if (nbind == PER_VERTEX) { @@ -942,9 +942,9 @@ void SoBrepFaceSet::renderShape(const SoGLCoordinateElement * const vertexlist, /* vertex 3 *********************************************************/ if (mbind == PER_VERTEX) - materials->send(matnr++, TRUE); + materials->send(matnr++, true); else if (mbind == PER_VERTEX_INDEXED) - materials->send(*matindices++, TRUE); + materials->send(*matindices++, true); if (normals) { if (nbind == PER_VERTEX) { diff --git a/src/Mod/Part/Gui/SoBrepPointSet.cpp b/src/Mod/Part/Gui/SoBrepPointSet.cpp index 2f0d0eda7c..921f6aa861 100644 --- a/src/Mod/Part/Gui/SoBrepPointSet.cpp +++ b/src/Mod/Part/Gui/SoBrepPointSet.cpp @@ -131,14 +131,14 @@ void SoBrepPointSet::renderHighlight(SoGLRenderAction *action) if (ps < 4.0f) SoPointSizeElement::set(state, this, 4.0f); SoLazyElement::setEmissive(state, &this->highlightColor); - SoOverrideElement::setEmissiveColorOverride(state, this, TRUE); + SoOverrideElement::setEmissiveColorOverride(state, this, true); SoLazyElement::setDiffuse(state, this,1, &this->highlightColor,&this->colorpacker); - SoOverrideElement::setDiffuseColorOverride(state, this, TRUE); + SoOverrideElement::setDiffuseColorOverride(state, this, true); const SoCoordinateElement * coords; const SbVec3f * normals; - this->getVertexData(state, coords, normals, FALSE); + this->getVertexData(state, coords, normals, false); SoMaterialBundle mb(action); mb.sendFirst(); // make sure we have the correct material @@ -161,16 +161,16 @@ void SoBrepPointSet::renderSelection(SoGLRenderAction *action) if (ps < 4.0f) SoPointSizeElement::set(state, this, 4.0f); SoLazyElement::setEmissive(state, &this->selectionColor); - SoOverrideElement::setEmissiveColorOverride(state, this, TRUE); + SoOverrideElement::setEmissiveColorOverride(state, this, true); SoLazyElement::setDiffuse(state, this,1, &this->selectionColor,&this->colorpacker); - SoOverrideElement::setDiffuseColorOverride(state, this, TRUE); + SoOverrideElement::setDiffuseColorOverride(state, this, true); const SoCoordinateElement * coords; const SbVec3f * normals; const int32_t * cindices; int numcindices; - this->getVertexData(state, coords, normals, FALSE); + this->getVertexData(state, coords, normals, false); SoMaterialBundle mb(action); mb.sendFirst(); // make sure we have the correct material diff --git a/src/Mod/Part/Gui/SoFCShapeObject.cpp b/src/Mod/Part/Gui/SoFCShapeObject.cpp index c157ebfd14..e4da17d5b1 100644 --- a/src/Mod/Part/Gui/SoFCShapeObject.cpp +++ b/src/Mod/Part/Gui/SoFCShapeObject.cpp @@ -86,7 +86,7 @@ void SoFCControlPoints::GLRender(SoGLRenderAction *action) if (!points) return; SoMaterialBundle mb(action); - SoTextureCoordinateBundle tb(action, TRUE, FALSE); + SoTextureCoordinateBundle tb(action, true, false); SoLazyElement::setLightModel(state, SoLazyElement::BASE_COLOR); mb.sendFirst(); // make sure we have the correct material diff --git a/src/Mod/Part/Gui/TaskCheckGeometry.cpp b/src/Mod/Part/Gui/TaskCheckGeometry.cpp index 9b449968b6..0fc20d7326 100644 --- a/src/Mod/Part/Gui/TaskCheckGeometry.cpp +++ b/src/Mod/Part/Gui/TaskCheckGeometry.cpp @@ -561,7 +561,7 @@ void TaskCheckGeometryResults::buildShapeContent(const QString &baseName, const std::ostringstream stream; if (!shapeContentString.empty()) stream << std::endl << std::endl; - stream << baseName.toAscii().data() << ":" << std::endl; + stream << baseName.toLatin1().data() << ":" << std::endl; BRepTools_ShapeSet set; set.Add(shape); @@ -709,7 +709,7 @@ void TaskCheckGeometryResults::currentRowChanged (const QModelIndex ¤t, co QString doc, object, sub; if (!this->split((*stringIt), doc, object, sub)) continue; - Gui::Selection().addSelection(doc.toAscii(), object.toAscii(), sub.toAscii()); + Gui::Selection().addSelection(doc.toLatin1(), object.toLatin1(), sub.toLatin1()); } } } @@ -717,7 +717,7 @@ void TaskCheckGeometryResults::currentRowChanged (const QModelIndex ¤t, co bool TaskCheckGeometryResults::split(QString &input, QString &doc, QString &object, QString &sub) { - QStringList strings = input.split(QString::fromAscii(".")); + QStringList strings = input.split(QString::fromLatin1(".")); if (strings.size() != 3) return false; doc = strings.at(0); diff --git a/src/Mod/Part/Gui/TaskDimension.cpp b/src/Mod/Part/Gui/TaskDimension.cpp index 67a7408185..b7f2d9886e 100644 --- a/src/Mod/Part/Gui/TaskDimension.cpp +++ b/src/Mod/Part/Gui/TaskDimension.cpp @@ -322,12 +322,12 @@ PartGui::DimensionLinear::DimensionLinear() { SO_KIT_CONSTRUCTOR(PartGui::DimensionLinear); - SO_KIT_ADD_CATALOG_ENTRY(transformation, SoTransform, TRUE, topSeparator,"" , TRUE); - SO_KIT_ADD_CATALOG_ENTRY(annotate, SoAnnotation, TRUE, topSeparator,"" , TRUE); - SO_KIT_ADD_CATALOG_ENTRY(leftArrow, SoShapeKit, TRUE, topSeparator,"" ,TRUE); - SO_KIT_ADD_CATALOG_ENTRY(rightArrow, SoShapeKit, TRUE, topSeparator,"" ,TRUE); - SO_KIT_ADD_CATALOG_ENTRY(line, SoShapeKit, TRUE, annotate,"" ,TRUE); - SO_KIT_ADD_CATALOG_ENTRY(textSep, SoSeparator, TRUE, annotate,"" ,TRUE); + SO_KIT_ADD_CATALOG_ENTRY(transformation, SoTransform, true, topSeparator,"" , true); + SO_KIT_ADD_CATALOG_ENTRY(annotate, SoAnnotation, true, topSeparator,"" , true); + SO_KIT_ADD_CATALOG_ENTRY(leftArrow, SoShapeKit, true, topSeparator,"" ,true); + SO_KIT_ADD_CATALOG_ENTRY(rightArrow, SoShapeKit, true, topSeparator,"" ,true); + SO_KIT_ADD_CATALOG_ENTRY(line, SoShapeKit, true, annotate,"" ,true); + SO_KIT_ADD_CATALOG_ENTRY(textSep, SoSeparator, true, annotate,"" ,true); SO_KIT_INIT_INSTANCE(); @@ -350,13 +350,13 @@ PartGui::DimensionLinear::~DimensionLinear() SbBool PartGui::DimensionLinear::affectsState() const { - return FALSE; + return false; } void PartGui::DimensionLinear::setupDimension() { //transformation - SoTransform *trans = static_cast(getPart("transformation", TRUE)); + SoTransform *trans = static_cast(getPart("transformation", true)); trans->translation.connectFrom(&point1); //build engine for vector subtraction and length. SoCalculator *hyp = new SoCalculator(); @@ -389,7 +389,7 @@ void PartGui::DimensionLinear::setupDimension() //have use local here to do the offset because the main is wired up to length of dimension. set("rightArrow.localTransform", "translation 0.0 -0.25 0.0"); //half cone height. - SoTransform *transform = static_cast(getPart("rightArrow.transform", FALSE)); + SoTransform *transform = static_cast(getPart("rightArrow.transform", false)); if (!transform) return;//what to do here? SoComposeVec3f *vec = new SoComposeVec3f; @@ -420,7 +420,7 @@ void PartGui::DimensionLinear::setupDimension() setPart("line.material", material); //text - SoSeparator *textSep = static_cast(getPart("textSep", TRUE)); + SoSeparator *textSep = static_cast(getPart("textSep", true)); if (!textSep) return; @@ -1014,12 +1014,12 @@ PartGui::DimensionAngular::DimensionAngular() { SO_KIT_CONSTRUCTOR(PartGui::DimensionAngular); - SO_KIT_ADD_CATALOG_ENTRY(transformation, SoMatrixTransform, TRUE, topSeparator,"" , TRUE); - SO_KIT_ADD_CATALOG_ENTRY(annotate, SoAnnotation, TRUE, topSeparator,"" , TRUE); - SO_KIT_ADD_CATALOG_ENTRY(arrow1, SoShapeKit, TRUE, topSeparator,"" ,TRUE); - SO_KIT_ADD_CATALOG_ENTRY(arrow2, SoShapeKit, TRUE, topSeparator,"" ,TRUE); - SO_KIT_ADD_CATALOG_ENTRY(arcSep, SoSeparator, TRUE, annotate,"" ,TRUE); - SO_KIT_ADD_CATALOG_ENTRY(textSep, SoSeparator, TRUE, annotate,"" ,TRUE); + SO_KIT_ADD_CATALOG_ENTRY(transformation, SoMatrixTransform, true, topSeparator,"" , true); + SO_KIT_ADD_CATALOG_ENTRY(annotate, SoAnnotation, true, topSeparator,"" , true); + SO_KIT_ADD_CATALOG_ENTRY(arrow1, SoShapeKit, true, topSeparator,"" ,true); + SO_KIT_ADD_CATALOG_ENTRY(arrow2, SoShapeKit, true, topSeparator,"" ,true); + SO_KIT_ADD_CATALOG_ENTRY(arcSep, SoSeparator, true, annotate,"" ,true); + SO_KIT_ADD_CATALOG_ENTRY(textSep, SoSeparator, true, annotate,"" ,true); SO_KIT_INIT_INSTANCE(); @@ -1042,14 +1042,14 @@ PartGui::DimensionAngular::~DimensionAngular() SbBool PartGui::DimensionAngular::affectsState() const { - return FALSE; + return false; } void PartGui::DimensionAngular::setupDimension() { //transformation - SoMatrixTransform *trans = static_cast(getPart("transformation", TRUE)); + SoMatrixTransform *trans = static_cast(getPart("transformation", true)); trans->matrix.connectFrom(&matrix); //color @@ -1110,14 +1110,14 @@ void PartGui::DimensionAngular::setupDimension() lineSet->numVertices.connectFrom(&arcEngine->pointCount); lineSet->startIndex.setValue(0); - SoSeparator *arcSep = static_cast(getPart("arcSep", TRUE)); + SoSeparator *arcSep = static_cast(getPart("arcSep", true)); if (!arcSep) return; arcSep->addChild(material); arcSep->addChild(lineSet); //text - SoSeparator *textSep = static_cast(getPart("textSep", TRUE)); + SoSeparator *textSep = static_cast(getPart("textSep", true)); if (!textSep) return; diff --git a/src/Mod/Part/Gui/TaskFaceColors.cpp b/src/Mod/Part/Gui/TaskFaceColors.cpp index 14e4e557d4..04b28824d3 100644 --- a/src/Mod/Part/Gui/TaskFaceColors.cpp +++ b/src/Mod/Part/Gui/TaskFaceColors.cpp @@ -221,7 +221,7 @@ public: Gui::View3DInventorViewer* view = reinterpret_cast(cb->getUserData()); view->removeEventCallback(SoMouseButtonEvent::getClassTypeId(), selectionCallback, ud); SoNode* root = view->getSceneGraph(); - static_cast(root)->selectionRole.setValue(TRUE); + static_cast(root)->selectionRole.setValue(true); std::vector picked = view->getGLPolygon(); SoCamera* cam = view->getSoRenderManager()->getCamera(); @@ -277,7 +277,7 @@ FaceColors::~FaceColors() d->view->removeEventCallback(SoMouseButtonEvent::getClassTypeId(), Private::selectionCallback, this); SoNode* root = d->view->getSceneGraph(); - static_cast(root)->selectionRole.setValue(TRUE); + static_cast(root)->selectionRole.setValue(true); } Gui::Selection().rmvSelectionGate(); d->connectDelDoc.disconnect(); @@ -308,7 +308,7 @@ void FaceColors::on_boxSelection_clicked() // avoid that the selection node handles the event otherwise the callback function won't be // called immediately SoNode* root = viewer->getSceneGraph(); - static_cast(root)->selectionRole.setValue(FALSE); + static_cast(root)->selectionRole.setValue(false); d->view = viewer; } } @@ -369,14 +369,14 @@ void FaceColors::onSelectionChanged(const Gui::SelectionChanges& msg) } if (selection_changed) { - QString faces = QString::fromAscii("["); + QString faces = QString::fromLatin1("["); int size = d->index.size(); for (QSet::iterator it = d->index.begin(); it != d->index.end(); ++it) { faces += QString::number(*it + 1); if (--size > 0) - faces += QString::fromAscii(","); + faces += QString::fromLatin1(","); } - faces += QString::fromAscii("]"); + faces += QString::fromLatin1("]"); d->ui->labelElement->setText(faces); d->ui->colorButton->setDisabled(d->index.isEmpty()); } diff --git a/src/Mod/Part/Gui/TaskLoft.cpp b/src/Mod/Part/Gui/TaskLoft.cpp index ed6c7c323f..6d2c4cd13d 100644 --- a/src/Mod/Part/Gui/TaskLoft.cpp +++ b/src/Mod/Part/Gui/TaskLoft.cpp @@ -118,7 +118,7 @@ void LoftWidget::findShapes() shape.ShapeType() == TopAbs_EDGE || shape.ShapeType() == TopAbs_VERTEX) { QString label = QString::fromUtf8((*it)->Label.getValue()); - QString name = QString::fromAscii((*it)->getNameInDocument()); + QString name = QString::fromLatin1((*it)->getNameInDocument()); QTreeWidgetItem* child = new QTreeWidgetItem(); child->setText(0, label); @@ -135,19 +135,19 @@ bool LoftWidget::accept() { QString list, solid, ruled, closed; if (d->ui.checkSolid->isChecked()) - solid = QString::fromAscii("True"); + solid = QString::fromLatin1("True"); else - solid = QString::fromAscii("False"); + solid = QString::fromLatin1("False"); if (d->ui.checkRuledSurface->isChecked()) - ruled = QString::fromAscii("True"); + ruled = QString::fromLatin1("True"); else - ruled = QString::fromAscii("False"); + ruled = QString::fromLatin1("False"); if (d->ui.checkClosed->isChecked()) - closed = QString::fromAscii("True"); + closed = QString::fromLatin1("True"); else - closed = QString::fromAscii("False"); + closed = QString::fromLatin1("False"); QTextStream str(&list); @@ -164,18 +164,18 @@ bool LoftWidget::accept() try { QString cmd; - cmd = QString::fromAscii( + cmd = QString::fromLatin1( "App.getDocument('%5').addObject('Part::Loft','Loft')\n" "App.getDocument('%5').ActiveObject.Sections=[%1]\n" "App.getDocument('%5').ActiveObject.Solid=%2\n" "App.getDocument('%5').ActiveObject.Ruled=%3\n" "App.getDocument('%5').ActiveObject.Closed=%4\n" - ).arg(list).arg(solid).arg(ruled).arg(closed).arg(QString::fromAscii(d->document.c_str())); + ).arg(list).arg(solid).arg(ruled).arg(closed).arg(QString::fromLatin1(d->document.c_str())); Gui::Document* doc = Gui::Application::Instance->getDocument(d->document.c_str()); if (!doc) throw Base::Exception("Document doesn't exist anymore"); doc->openCommand("Loft"); - Gui::Application::Instance->runPythonCode((const char*)cmd.toAscii(), false, false); + Gui::Application::Instance->runPythonCode((const char*)cmd.toLatin1(), false, false); doc->getDocument()->recompute(); App::DocumentObject* obj = doc->getDocument()->getActiveObject(); if (obj && !obj->isValid()) { @@ -186,7 +186,7 @@ bool LoftWidget::accept() doc->commitCommand(); } catch (const Base::Exception& e) { - QMessageBox::warning(this, tr("Input error"), QString::fromAscii(e.what())); + QMessageBox::warning(this, tr("Input error"), QString::fromLatin1(e.what())); return false; } diff --git a/src/Mod/Part/Gui/TaskOffset.cpp b/src/Mod/Part/Gui/TaskOffset.cpp index 77d0c0aebb..8fe827a00c 100644 --- a/src/Mod/Part/Gui/TaskOffset.cpp +++ b/src/Mod/Part/Gui/TaskOffset.cpp @@ -162,7 +162,7 @@ bool OffsetWidget::accept() Gui::Command::commitCommand(); } catch (const Base::Exception& e) { - QMessageBox::warning(this, tr("Input error"), QString::fromAscii(e.what())); + QMessageBox::warning(this, tr("Input error"), QString::fromLatin1(e.what())); return false; } diff --git a/src/Mod/Part/Gui/TaskShapeBuilder.cpp b/src/Mod/Part/Gui/TaskShapeBuilder.cpp index d8b406a6a8..720cf540ba 100644 --- a/src/Mod/Part/Gui/TaskShapeBuilder.cpp +++ b/src/Mod/Part/Gui/TaskShapeBuilder.cpp @@ -192,7 +192,7 @@ void ShapeBuilderWidget::createEdgeFromVertex() } QString cmd; - cmd = QString::fromAscii( + cmd = QString::fromLatin1( "_=Part.makeLine(%1, %2)\n" "if _.isNull(): raise RuntimeError('Failed to create edge')\n" "App.ActiveDocument.addObject('Part::Feature','Edge').Shape=_\n" @@ -201,7 +201,7 @@ void ShapeBuilderWidget::createEdgeFromVertex() try { Gui::Application::Instance->activeDocument()->openCommand("Edge"); - Gui::Application::Instance->runPythonCode((const char*)cmd.toAscii(), false, false); + Gui::Application::Instance->runPythonCode((const char*)cmd.toLatin1(), false, false); Gui::Application::Instance->activeDocument()->commitCommand(); } catch (const Base::Exception&) { @@ -235,7 +235,7 @@ void ShapeBuilderWidget::createFaceFromVertex() QString cmd; if (d->ui.checkPlanar->isChecked()) { - cmd = QString::fromAscii( + cmd = QString::fromLatin1( "_=Part.Face(Part.makePolygon(%1, True))\n" "if _.isNull(): raise RuntimeError('Failed to create face')\n" "App.ActiveDocument.addObject('Part::Feature','Face').Shape=_\n" @@ -243,7 +243,7 @@ void ShapeBuilderWidget::createFaceFromVertex() ).arg(list); } else { - cmd = QString::fromAscii( + cmd = QString::fromLatin1( "_=Part.makeFilledFace([Part.makePolygon(%1, True)])\n" "if _.isNull(): raise RuntimeError('Failed to create face')\n" "App.ActiveDocument.addObject('Part::Feature','Face').Shape=_\n" @@ -253,7 +253,7 @@ void ShapeBuilderWidget::createFaceFromVertex() try { Gui::Application::Instance->activeDocument()->openCommand("Face"); - Gui::Application::Instance->runPythonCode((const char*)cmd.toAscii(), false, false); + Gui::Application::Instance->runPythonCode((const char*)cmd.toLatin1(), false, false); Gui::Application::Instance->activeDocument()->commitCommand(); } catch (const Base::Exception&) { @@ -287,7 +287,7 @@ void ShapeBuilderWidget::createFaceFromEdge() QString cmd; if (d->ui.checkPlanar->isChecked()) { - cmd = QString::fromAscii( + cmd = QString::fromLatin1( "_=Part.Face(Part.Wire(Part.__sortEdges__(%1)))\n" "if _.isNull(): raise RuntimeError('Failed to create face')\n" "App.ActiveDocument.addObject('Part::Feature','Face').Shape=_\n" @@ -295,7 +295,7 @@ void ShapeBuilderWidget::createFaceFromEdge() ).arg(list); } else { - cmd = QString::fromAscii( + cmd = QString::fromLatin1( "_=Part.makeFilledFace(Part.__sortEdges__(%1))\n" "if _.isNull(): raise RuntimeError('Failed to create face')\n" "App.ActiveDocument.addObject('Part::Feature','Face').Shape=_\n" @@ -305,7 +305,7 @@ void ShapeBuilderWidget::createFaceFromEdge() try { Gui::Application::Instance->activeDocument()->openCommand("Face"); - Gui::Application::Instance->runPythonCode((const char*)cmd.toAscii(), false, false); + Gui::Application::Instance->runPythonCode((const char*)cmd.toLatin1(), false, false); Gui::Application::Instance->activeDocument()->commitCommand(); } catch (const Base::Exception&) { @@ -349,7 +349,7 @@ void ShapeBuilderWidget::createShellFromFace() } QString cmd; - cmd = QString::fromAscii( + cmd = QString::fromLatin1( "_=Part.Shell(%1)\n" "if _.isNull(): raise RuntimeError('Failed to create shell')\n" "App.ActiveDocument.addObject('Part::Feature','Shell').Shape=_.removeSplitter()\n" @@ -358,7 +358,7 @@ void ShapeBuilderWidget::createShellFromFace() try { Gui::Application::Instance->activeDocument()->openCommand("Shell"); - Gui::Application::Instance->runPythonCode((const char*)cmd.toAscii(), false, false); + Gui::Application::Instance->runPythonCode((const char*)cmd.toLatin1(), false, false); Gui::Application::Instance->activeDocument()->commitCommand(); } catch (const Base::Exception&) { @@ -387,7 +387,7 @@ void ShapeBuilderWidget::createSolidFromShell() } QString cmd; - cmd = QString::fromAscii( + cmd = QString::fromLatin1( "shell=%1\n" "if shell.ShapeType != 'Shell': raise RuntimeError('Part object is not a shell')\n" "_=Part.Solid(shell)\n" @@ -398,7 +398,7 @@ void ShapeBuilderWidget::createSolidFromShell() try { Gui::Application::Instance->activeDocument()->openCommand("Solid"); - Gui::Application::Instance->runPythonCode((const char*)cmd.toAscii(), false, false); + Gui::Application::Instance->runPythonCode((const char*)cmd.toLatin1(), false, false); Gui::Application::Instance->activeDocument()->commitCommand(); } catch (const Base::Exception&) { diff --git a/src/Mod/Part/Gui/TaskSweep.cpp b/src/Mod/Part/Gui/TaskSweep.cpp index 6cc8bea51f..2f622529a5 100644 --- a/src/Mod/Part/Gui/TaskSweep.cpp +++ b/src/Mod/Part/Gui/TaskSweep.cpp @@ -180,7 +180,7 @@ void SweepWidget::findShapes() shape.ShapeType() == TopAbs_EDGE || shape.ShapeType() == TopAbs_VERTEX) { QString label = QString::fromUtf8((*it)->Label.getValue()); - QString name = QString::fromAscii((*it)->getNameInDocument()); + QString name = QString::fromLatin1((*it)->getNameInDocument()); QTreeWidgetItem* child = new QTreeWidgetItem(); child->setText(0, label); @@ -275,14 +275,14 @@ bool SweepWidget::accept() QString list, solid, frenet; if (d->ui.checkSolid->isChecked()) - solid = QString::fromAscii("True"); + solid = QString::fromLatin1("True"); else - solid = QString::fromAscii("False"); + solid = QString::fromLatin1("False"); if (d->ui.checkFrenet->isChecked()) - frenet = QString::fromAscii("True"); + frenet = QString::fromLatin1("True"); else - frenet = QString::fromAscii("False"); + frenet = QString::fromLatin1("False"); QTextStream str(&list); @@ -305,7 +305,7 @@ bool SweepWidget::accept() try { Gui::WaitCursor wc; QString cmd; - cmd = QString::fromAscii( + cmd = QString::fromLatin1( "App.getDocument('%5').addObject('Part::Sweep','Sweep')\n" "App.getDocument('%5').ActiveObject.Sections=[%1]\n" "App.getDocument('%5').ActiveObject.Spine=%2\n" @@ -316,12 +316,12 @@ bool SweepWidget::accept() .arg(QLatin1String(selection.c_str())) .arg(solid) .arg(frenet) - .arg(QString::fromAscii(d->document.c_str())); + .arg(QString::fromLatin1(d->document.c_str())); Gui::Document* doc = Gui::Application::Instance->getDocument(d->document.c_str()); if (!doc) throw Base::Exception("Document doesn't exist anymore"); doc->openCommand("Sweep"); - Gui::Application::Instance->runPythonCode((const char*)cmd.toAscii(), false, false); + Gui::Application::Instance->runPythonCode((const char*)cmd.toLatin1(), false, false); doc->getDocument()->recompute(); App::DocumentObject* obj = doc->getDocument()->getActiveObject(); if (obj && !obj->isValid()) { @@ -332,7 +332,7 @@ bool SweepWidget::accept() doc->commitCommand(); } catch (const Base::Exception& e) { - QMessageBox::warning(this, tr("Input error"), QString::fromAscii(e.what())); + QMessageBox::warning(this, tr("Input error"), QString::fromLatin1(e.what())); return false; } diff --git a/src/Mod/Part/Gui/TaskThickness.cpp b/src/Mod/Part/Gui/TaskThickness.cpp index 5a2370f67a..380ea3a91c 100644 --- a/src/Mod/Part/Gui/TaskThickness.cpp +++ b/src/Mod/Part/Gui/TaskThickness.cpp @@ -228,7 +228,7 @@ bool ThicknessWidget::accept() Gui::Command::commitCommand(); } catch (const Base::Exception& e) { - QMessageBox::warning(this, tr("Input error"), QString::fromAscii(e.what())); + QMessageBox::warning(this, tr("Input error"), QString::fromLatin1(e.what())); return false; } diff --git a/src/Mod/Part/Gui/ViewProviderCurveNet.cpp b/src/Mod/Part/Gui/ViewProviderCurveNet.cpp index bae3040634..40e64aac1a 100644 --- a/src/Mod/Part/Gui/ViewProviderCurveNet.cpp +++ b/src/Mod/Part/Gui/ViewProviderCurveNet.cpp @@ -190,7 +190,7 @@ bool ViewProviderCurveNet::handleEvent(const SoEvent * const ev, Gui::View3DInve if (ev->getTypeId().isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) { const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev; const int button = event->getButton(); - const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE; + const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false; // which button pressed? switch (button) { diff --git a/src/Mod/Part/Gui/ViewProviderMirror.cpp b/src/Mod/Part/Gui/ViewProviderMirror.cpp index 944afc9fb6..6b47774cb2 100644 --- a/src/Mod/Part/Gui/ViewProviderMirror.cpp +++ b/src/Mod/Part/Gui/ViewProviderMirror.cpp @@ -119,7 +119,7 @@ bool ViewProviderMirror::setEdit(int ModNum) // translation and center fields are overridden. SoSearchAction sa; sa.setInterest(SoSearchAction::FIRST); - sa.setSearchingAll(FALSE); + sa.setSearchingAll(false); sa.setNode(trans); sa.apply(pcEditNode); SoPath * path = sa.getPath(); diff --git a/src/Mod/PartDesign/Gui/AppPartDesignGui.cpp b/src/Mod/PartDesign/Gui/AppPartDesignGui.cpp index 963957d654..6fe67cbcc6 100644 --- a/src/Mod/PartDesign/Gui/AppPartDesignGui.cpp +++ b/src/Mod/PartDesign/Gui/AppPartDesignGui.cpp @@ -45,8 +45,6 @@ #include "ViewProviderScaled.h" #include "ViewProviderMultiTransform.h" -//#include "resources/qrc_PartDesign.cpp" - // use a different name to CreateCommand() void CreatePartDesignCommands(void); diff --git a/src/Mod/PartDesign/Gui/FeaturePickDialog.cpp b/src/Mod/PartDesign/Gui/FeaturePickDialog.cpp index 0af2a00152..029e4e76b2 100644 --- a/src/Mod/PartDesign/Gui/FeaturePickDialog.cpp +++ b/src/Mod/PartDesign/Gui/FeaturePickDialog.cpp @@ -44,7 +44,7 @@ FeaturePickDialog::FeaturePickDialog(std::vector& objects) { ui->setupUi(this); for (std::vector::const_iterator o = objects.begin(); o != objects.end(); ++o) - ui->listWidget->addItem(QString::fromAscii((*o)->getNameInDocument())); + ui->listWidget->addItem(QString::fromLatin1((*o)->getNameInDocument())); } FeaturePickDialog::~FeaturePickDialog() @@ -56,7 +56,7 @@ std::vector FeaturePickDialog::getFeatures() { std::vector result; for (std::vector::const_iterator s = features.begin(); s != features.end(); ++s) - result.push_back(App::GetApplication().getActiveDocument()->getObject(s->toAscii().data())); + result.push_back(App::GetApplication().getActiveDocument()->getObject(s->toLatin1().data())); return result; } diff --git a/src/Mod/PartDesign/Gui/TaskDraftParameters.cpp b/src/Mod/PartDesign/Gui/TaskDraftParameters.cpp index cdd503133e..0151811cfe 100644 --- a/src/Mod/PartDesign/Gui/TaskDraftParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskDraftParameters.cpp @@ -398,7 +398,7 @@ bool TaskDlgDraftParameters::accept() Gui::Command::doCommand(Gui::Command::Doc,str.str().c_str()); } 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; } std::string neutralPlane = parameter->getPlane(); diff --git a/src/Mod/PartDesign/Gui/TaskGrooveParameters.cpp b/src/Mod/PartDesign/Gui/TaskGrooveParameters.cpp index 2ce7fbcbc4..30f30b1218 100644 --- a/src/Mod/PartDesign/Gui/TaskGrooveParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskGrooveParameters.cpp @@ -89,7 +89,7 @@ TaskGrooveParameters::TaskGrooveParameters(ViewProviderGroove *GrooveView,QWidge for (int i=ui->axis->count()-1; i >= count+2; i--) ui->axis->removeItem(i); for (int i=ui->axis->count(); i < count+2; i++) - ui->axis->addItem(QString::fromAscii("Sketch axis %1").arg(i-2)); + ui->axis->addItem(QString::fromLatin1("Sketch axis %1").arg(i-2)); int pos=-1; @@ -106,7 +106,7 @@ TaskGrooveParameters::TaskGrooveParameters(ViewProviderGroove *GrooveView,QWidge } if (pos < 0 || pos >= ui->axis->count()) { - ui->axis->addItem(QString::fromAscii("Undefined")); + ui->axis->addItem(QString::fromLatin1("Undefined")); pos = ui->axis->count()-1; } diff --git a/src/Mod/PartDesign/Gui/TaskLinearPatternParameters.cpp b/src/Mod/PartDesign/Gui/TaskLinearPatternParameters.cpp index 41e5e73238..621a10cf4b 100644 --- a/src/Mod/PartDesign/Gui/TaskLinearPatternParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskLinearPatternParameters.cpp @@ -121,7 +121,7 @@ void TaskLinearPatternParameters::setupUI() for (std::vector::const_iterator i = originals.begin(); i != originals.end(); ++i) { if ((*i) != NULL) { // find the first valid original - ui->lineOriginal->setText(QString::fromAscii((*i)->getNameInDocument())); + ui->lineOriginal->setText(QString::fromLatin1((*i)->getNameInDocument())); break; } } @@ -163,7 +163,7 @@ void TaskLinearPatternParameters::updateUI() for (int i=ui->comboDirection->count()-1; i >= 2; i--) ui->comboDirection->removeItem(i); for (int i=ui->comboDirection->count(); i < maxcount; i++) - ui->comboDirection->addItem(QString::fromAscii("Sketch axis %1").arg(i-2)); + ui->comboDirection->addItem(QString::fromLatin1("Sketch axis %1").arg(i-2)); bool undefined = false; if (directionFeature != NULL && !directions.empty()) { @@ -178,7 +178,7 @@ void TaskLinearPatternParameters::updateUI() else undefined = true; } else if (directionFeature != NULL && !directions.empty()) { - ui->comboDirection->addItem(QString::fromAscii(directions.front().c_str())); + ui->comboDirection->addItem(QString::fromLatin1(directions.front().c_str())); ui->comboDirection->setCurrentIndex(maxcount); } } else { @@ -222,7 +222,7 @@ void TaskLinearPatternParameters::onSelectionChanged(const Gui::SelectionChanges std::string subName(msg.pSubName); if (originalSelected(msg)) { - ui->lineOriginal->setText(QString::fromAscii(msg.pObjectName)); + ui->lineOriginal->setText(QString::fromLatin1(msg.pObjectName)); } else if (referenceSelectionMode && ((subName.size() > 4 && subName.substr(0,4) == "Edge") || (subName.size() > 4 && subName.substr(0,4) == "Face"))) { @@ -247,7 +247,7 @@ void TaskLinearPatternParameters::onSelectionChanged(const Gui::SelectionChanges for (int i=ui->comboDirection->count()-1; i >= maxcount; i--) ui->comboDirection->removeItem(i); - ui->comboDirection->addItem(QString::fromAscii(subName.c_str())); + ui->comboDirection->addItem(QString::fromLatin1(subName.c_str())); ui->comboDirection->setCurrentIndex(maxcount); ui->comboDirection->addItem(tr("Select reference...")); } @@ -459,7 +459,7 @@ bool TaskDlgLinearPatternParameters::accept() parameter->apply(); } 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; } diff --git a/src/Mod/PartDesign/Gui/TaskMirroredParameters.cpp b/src/Mod/PartDesign/Gui/TaskMirroredParameters.cpp index b0b7a0c76b..eae21f844d 100644 --- a/src/Mod/PartDesign/Gui/TaskMirroredParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskMirroredParameters.cpp @@ -107,7 +107,7 @@ void TaskMirroredParameters::setupUI() for (std::vector::const_iterator i = originals.begin(); i != originals.end(); ++i) { if ((*i) != NULL) { // find the first valid original - ui->lineOriginal->setText(QString::fromAscii((*i)->getNameInDocument())); + ui->lineOriginal->setText(QString::fromLatin1((*i)->getNameInDocument())); break; } } @@ -136,7 +136,7 @@ void TaskMirroredParameters::updateUI() for (int i=ui->comboPlane->count()-1; i >= 2; i--) ui->comboPlane->removeItem(i); for (int i=ui->comboPlane->count(); i < maxcount; i++) - ui->comboPlane->addItem(QString::fromAscii("Sketch axis %1").arg(i-2)); + ui->comboPlane->addItem(QString::fromLatin1("Sketch axis %1").arg(i-2)); bool undefined = false; if (mirrorPlaneFeature != NULL && !mirrorPlanes.empty()) { @@ -151,7 +151,7 @@ void TaskMirroredParameters::updateUI() else undefined = true; } else if (mirrorPlaneFeature != NULL && !mirrorPlanes.empty()) { - ui->comboPlane->addItem(QString::fromAscii(mirrorPlanes.front().c_str())); + ui->comboPlane->addItem(QString::fromLatin1(mirrorPlanes.front().c_str())); ui->comboPlane->setCurrentIndex(maxcount); } } else { @@ -179,7 +179,7 @@ void TaskMirroredParameters::onSelectionChanged(const Gui::SelectionChanges& msg std::string subName(msg.pSubName); if (originalSelected(msg)) { - ui->lineOriginal->setText(QString::fromAscii(msg.pObjectName)); + ui->lineOriginal->setText(QString::fromLatin1(msg.pObjectName)); } else if (referenceSelectionMode && (subName.size() > 4 && subName.substr(0,4) == "Face")) { @@ -203,7 +203,7 @@ void TaskMirroredParameters::onSelectionChanged(const Gui::SelectionChanges& msg for (int i=ui->comboPlane->count()-1; i >= maxcount; i--) ui->comboPlane->removeItem(i); - ui->comboPlane->addItem(QString::fromAscii(subName.c_str())); + ui->comboPlane->addItem(QString::fromLatin1(subName.c_str())); ui->comboPlane->setCurrentIndex(maxcount); ui->comboPlane->addItem(tr("Select reference...")); } @@ -359,7 +359,7 @@ bool TaskDlgMirroredParameters::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; } diff --git a/src/Mod/PartDesign/Gui/TaskMultiTransformParameters.cpp b/src/Mod/PartDesign/Gui/TaskMultiTransformParameters.cpp index 53eaafebb7..97424bda6f 100644 --- a/src/Mod/PartDesign/Gui/TaskMultiTransformParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskMultiTransformParameters.cpp @@ -117,7 +117,7 @@ TaskMultiTransformParameters::TaskMultiTransformParameters(ViewProviderTransform for (std::vector::const_iterator i = transformFeatures.begin(); i != transformFeatures.end(); i++) { if ((*i) != NULL) - ui->listTransformFeatures->addItem(QString::fromAscii((*i)->Label.getValue())); + ui->listTransformFeatures->addItem(QString::fromLatin1((*i)->Label.getValue())); } if (transformFeatures.size() > 0) { ui->listTransformFeatures->setCurrentRow(0, QItemSelectionModel::ClearAndSelect); @@ -135,7 +135,7 @@ TaskMultiTransformParameters::TaskMultiTransformParameters(ViewProviderTransform for (std::vector::const_iterator i = originals.begin(); i != originals.end(); i++) { if ((*i) != NULL) { // find the first valid original - ui->lineOriginal->setText(QString::fromAscii((*i)->getNameInDocument())); + ui->lineOriginal->setText(QString::fromLatin1((*i)->getNameInDocument())); break; } } @@ -146,7 +146,7 @@ void TaskMultiTransformParameters::onSelectionChanged(const Gui::SelectionChange { if (originalSelected(msg)) { App::DocumentObject* selectedObject = TransformedView->getObject()->getDocument()->getActiveObject(); - ui->lineOriginal->setText(QString::fromAscii(selectedObject->getNameInDocument())); + ui->lineOriginal->setText(QString::fromLatin1(selectedObject->getNameInDocument())); } } @@ -302,12 +302,12 @@ void TaskMultiTransformParameters::finishAdd(std::string &newFeatName) // Note: Inserts always happen before the specified iterator so in order to append at the // end we need to use push_back() and append() transformFeatures.push_back(newFeature); - ui->listTransformFeatures->addItem(QString::fromAscii(newFeature->Label.getValue())); + ui->listTransformFeatures->addItem(QString::fromLatin1(newFeature->Label.getValue())); ui->listTransformFeatures->setCurrentRow(row+1, QItemSelectionModel::ClearAndSelect); } else { // Note: The feature tree always seems to append to the end, no matter what we say here transformFeatures.insert(transformFeatures.begin() + row + 1, newFeature); - ui->listTransformFeatures->insertItem(row + 1, QString::fromAscii(newFeature->Label.getValue())); + ui->listTransformFeatures->insertItem(row + 1, QString::fromLatin1(newFeature->Label.getValue())); ui->listTransformFeatures->setCurrentRow(row + 1, QItemSelectionModel::ClearAndSelect); } pcMultiTransform->Transformations.setValues(transformFeatures); @@ -444,7 +444,7 @@ bool TaskDlgMultiTransformParameters::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; } diff --git a/src/Mod/PartDesign/Gui/TaskPadParameters.cpp b/src/Mod/PartDesign/Gui/TaskPadParameters.cpp index 620ff420ca..cf93b10dad 100644 --- a/src/Mod/PartDesign/Gui/TaskPadParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskPadParameters.cpp @@ -537,7 +537,7 @@ bool TaskDlgPadParameters::accept() parameter->apply(); } 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; } diff --git a/src/Mod/PartDesign/Gui/TaskPocketParameters.cpp b/src/Mod/PartDesign/Gui/TaskPocketParameters.cpp index 2108ac7fac..2a273edd46 100644 --- a/src/Mod/PartDesign/Gui/TaskPocketParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskPocketParameters.cpp @@ -481,7 +481,7 @@ bool TaskDlgPocketParameters::accept() parameter->apply(); } 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; } diff --git a/src/Mod/PartDesign/Gui/TaskPolarPatternParameters.cpp b/src/Mod/PartDesign/Gui/TaskPolarPatternParameters.cpp index 1a7aef46cc..8e556d8145 100644 --- a/src/Mod/PartDesign/Gui/TaskPolarPatternParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskPolarPatternParameters.cpp @@ -121,7 +121,7 @@ void TaskPolarPatternParameters::setupUI() for (std::vector::const_iterator i = originals.begin(); i != originals.end(); ++i) { if ((*i) != NULL) { // find the first valid original - ui->lineOriginal->setText(QString::fromAscii((*i)->getNameInDocument())); + ui->lineOriginal->setText(QString::fromLatin1((*i)->getNameInDocument())); break; } } @@ -159,7 +159,7 @@ void TaskPolarPatternParameters::updateUI() if (axes.front() == "N_Axis") ui->comboAxis->setCurrentIndex(0); else if (axisFeature != NULL && !axes.empty()) { - ui->comboAxis->addItem(QString::fromAscii(axes.front().c_str())); + ui->comboAxis->addItem(QString::fromLatin1(axes.front().c_str())); ui->comboAxis->setCurrentIndex(1); } } else { @@ -200,7 +200,7 @@ void TaskPolarPatternParameters::onSelectionChanged(const Gui::SelectionChanges& std::string subName(msg.pSubName); if (originalSelected(msg)) { - ui->lineOriginal->setText(QString::fromAscii(msg.pObjectName)); + ui->lineOriginal->setText(QString::fromLatin1(msg.pObjectName)); } else if (referenceSelectionMode && (subName.size() > 4 && subName.substr(0,4) == "Edge")) { @@ -220,7 +220,7 @@ void TaskPolarPatternParameters::onSelectionChanged(const Gui::SelectionChanges& for (int i=ui->comboAxis->count()-1; i >= 1; i--) ui->comboAxis->removeItem(i); - ui->comboAxis->addItem(QString::fromAscii(subName.c_str())); + ui->comboAxis->addItem(QString::fromLatin1(subName.c_str())); ui->comboAxis->setCurrentIndex(1); ui->comboAxis->addItem(tr("Select reference...")); } @@ -401,7 +401,7 @@ bool TaskDlgPolarPatternParameters::accept() parameter->apply(); } 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; } diff --git a/src/Mod/PartDesign/Gui/TaskRevolutionParameters.cpp b/src/Mod/PartDesign/Gui/TaskRevolutionParameters.cpp index bfdeae0b09..911a071f9e 100644 --- a/src/Mod/PartDesign/Gui/TaskRevolutionParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskRevolutionParameters.cpp @@ -88,7 +88,7 @@ TaskRevolutionParameters::TaskRevolutionParameters(ViewProviderRevolution *Revol for (int i=ui->axis->count()-1; i >= count+2; i--) ui->axis->removeItem(i); for (int i=ui->axis->count(); i < count+2; i++) - ui->axis->addItem(QString::fromAscii("Sketch axis %1").arg(i-2)); + ui->axis->addItem(QString::fromLatin1("Sketch axis %1").arg(i-2)); int pos=-1; diff --git a/src/Mod/PartDesign/Gui/TaskScaledParameters.cpp b/src/Mod/PartDesign/Gui/TaskScaledParameters.cpp index 80566fef6c..ec2a586580 100644 --- a/src/Mod/PartDesign/Gui/TaskScaledParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskScaledParameters.cpp @@ -106,7 +106,7 @@ void TaskScaledParameters::setupUI() for (std::vector::const_iterator i = originals.begin(); i != originals.end(); ++i) { if ((*i) != NULL) { // find the first valid original - ui->lineOriginal->setText(QString::fromAscii((*i)->getNameInDocument())); + ui->lineOriginal->setText(QString::fromLatin1((*i)->getNameInDocument())); break; } } @@ -143,7 +143,7 @@ void TaskScaledParameters::onSelectionChanged(const Gui::SelectionChanges& msg) { if (originalSelected(msg)) { App::DocumentObject* selectedObject = TransformedView->getObject()->getDocument()->getActiveObject(); - ui->lineOriginal->setText(QString::fromAscii(selectedObject->getNameInDocument())); + ui->lineOriginal->setText(QString::fromLatin1(selectedObject->getNameInDocument())); } } @@ -240,7 +240,7 @@ bool TaskDlgScaledParameters::accept() parameter->apply(); } 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; } diff --git a/src/Mod/PartDesign/Gui/TaskTransformedParameters.cpp b/src/Mod/PartDesign/Gui/TaskTransformedParameters.cpp index aeb8ef47ef..9031165f07 100644 --- a/src/Mod/PartDesign/Gui/TaskTransformedParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskTransformedParameters.cpp @@ -54,7 +54,7 @@ using namespace Gui; TaskTransformedParameters::TaskTransformedParameters(ViewProviderTransformed *TransformedView, QWidget *parent) : TaskBox(Gui::BitmapFactory().pixmap((std::string("PartDesign_") + TransformedView->featureName).c_str()), - QString::fromAscii((TransformedView->featureName + " parameters").c_str()), + QString::fromLatin1((TransformedView->featureName + " parameters").c_str()), true, parent), TransformedView(TransformedView), @@ -261,7 +261,7 @@ bool TaskDlgTransformedParameters::accept() Gui::Command::runCommand(Gui::Command::Doc,str.str().c_str()); } 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; } diff --git a/src/Mod/PartDesign/Gui/ViewProviderTransformed.cpp b/src/Mod/PartDesign/Gui/ViewProviderTransformed.cpp index bd636721c9..f1b6f4b067 100644 --- a/src/Mod/PartDesign/Gui/ViewProviderTransformed.cpp +++ b/src/Mod/PartDesign/Gui/ViewProviderTransformed.cpp @@ -200,7 +200,7 @@ void ViewProviderTransformed::recomputeFeature(void) pcTransformed->getDocument()->recomputeFeature(pcTransformed); const std::vector log = pcTransformed->getDocument()->getRecomputeLog(); unsigned rejected = pcTransformed->getRejectedTransformations().size(); - QString msg = QString::fromAscii("%1"); + QString msg = QString::fromLatin1("%1"); if (rejected > 0) { msg = QString::fromLatin1("%1
\r\n%2"); if (rejected == 1) diff --git a/src/Mod/Path/Gui/AppPathGuiPy.cpp b/src/Mod/Path/Gui/AppPathGuiPy.cpp index 6205525115..154d9de233 100644 --- a/src/Mod/Path/Gui/AppPathGuiPy.cpp +++ b/src/Mod/Path/Gui/AppPathGuiPy.cpp @@ -61,10 +61,10 @@ static PyObject * open(PyObject *self, PyObject *args) PY_TRY { std::string path = App::GetApplication().getHomePath(); path += "Mod/Path/PathScripts/"; - QDir dir1(QString::fromUtf8(path.c_str()), QString::fromAscii("*_pre.py")); + QDir dir1(QString::fromUtf8(path.c_str()), QString::fromLatin1("*_pre.py")); std::string cMacroPath = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Macro") ->GetASCII("MacroPath",App::Application::getUserAppDataDir().c_str()); - QDir dir2(QString::fromUtf8(cMacroPath.c_str()), QString::fromAscii("*_pre.py")); + QDir dir2(QString::fromUtf8(cMacroPath.c_str()), QString::fromLatin1("*_pre.py")); QFileInfoList list = dir1.entryInfoList(); list << dir2.entryInfoList(); std::vector scripts; @@ -90,7 +90,7 @@ static PyObject * open(PyObject *self, PyObject *args) for (int i = 0; i < list.size(); ++i) { QFileInfo fileInfo = list.at(i); if (fileInfo.baseName().toStdString() == selected) { - if (fileInfo.absoluteFilePath().contains(QString::fromAscii("PathScripts"))) { + if (fileInfo.absoluteFilePath().contains(QString::fromLatin1("PathScripts"))) { pre << "from PathScripts import " << selected; } else { pre << "import " << selected; @@ -122,10 +122,10 @@ static PyObject * importer(PyObject *self, PyObject *args) PY_TRY { std::string path = App::GetApplication().getHomePath(); path += "Mod/Path/PathScripts/"; - QDir dir1(QString::fromUtf8(path.c_str()), QString::fromAscii("*_pre.py")); + QDir dir1(QString::fromUtf8(path.c_str()), QString::fromLatin1("*_pre.py")); std::string cMacroPath = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Macro") ->GetASCII("MacroPath",App::Application::getUserAppDataDir().c_str()); - QDir dir2(QString::fromUtf8(cMacroPath.c_str()), QString::fromAscii("*_pre.py")); + QDir dir2(QString::fromUtf8(cMacroPath.c_str()), QString::fromLatin1("*_pre.py")); QFileInfoList list = dir1.entryInfoList(); list << dir2.entryInfoList(); std::vector scripts; @@ -160,7 +160,7 @@ static PyObject * importer(PyObject *self, PyObject *args) for (int i = 0; i < list.size(); ++i) { QFileInfo fileInfo = list.at(i); if (fileInfo.baseName().toStdString() == selected) { - if (fileInfo.absoluteFilePath().contains(QString::fromAscii("PathScripts"))) { + if (fileInfo.absoluteFilePath().contains(QString::fromLatin1("PathScripts"))) { pre << "from PathScripts import " << selected; } else { pre << "import " << selected; @@ -192,10 +192,10 @@ static PyObject * exporter(PyObject *self, PyObject *args) Py_Error(Base::BaseExceptionFreeCADError, "No object to export"); std::string path = App::GetApplication().getHomePath(); path += "Mod/Path/PathScripts/"; - QDir dir1(QString::fromUtf8(path.c_str()), QString::fromAscii("*_post.py")); + QDir dir1(QString::fromUtf8(path.c_str()), QString::fromLatin1("*_post.py")); std::string cMacroPath = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Macro") ->GetASCII("MacroPath",App::Application::getUserAppDataDir().c_str()); - QDir dir2(QString::fromUtf8(cMacroPath.c_str()), QString::fromAscii("*_post.py")); + QDir dir2(QString::fromUtf8(cMacroPath.c_str()), QString::fromLatin1("*_post.py")); QFileInfoList list = dir1.entryInfoList(); list << dir2.entryInfoList(); std::vector scripts; @@ -230,7 +230,7 @@ static PyObject * exporter(PyObject *self, PyObject *args) for (int i = 0; i < list.size(); ++i) { QFileInfo fileInfo = list.at(i); if (fileInfo.baseName().toStdString() == selected) { - if (fileInfo.absoluteFilePath().contains(QString::fromAscii("PathScripts"))) { + if (fileInfo.absoluteFilePath().contains(QString::fromLatin1("PathScripts"))) { pre << "from PathScripts import " << selected; } else { pre << "import " << selected; diff --git a/src/Mod/Path/Gui/TaskDlgPathCompound.cpp b/src/Mod/Path/Gui/TaskDlgPathCompound.cpp index 46f755b5a3..7ecfe650d8 100644 --- a/src/Mod/Path/Gui/TaskDlgPathCompound.cpp +++ b/src/Mod/Path/Gui/TaskDlgPathCompound.cpp @@ -66,10 +66,10 @@ TaskWidgetPathCompound::TaskWidgetPathCompound(ViewProviderPathCompound *Compoun Path::FeatureCompound* pcCompound = static_cast(CompoundView->getObject()); const std::vector &Paths = pcCompound->Group.getValues(); for (std::vector::const_iterator it= Paths.begin();it!=Paths.end();++it) { - QString name = QString::fromAscii((*it)->getNameInDocument()); - name += QString::fromAscii(" ("); + QString name = QString::fromLatin1((*it)->getNameInDocument()); + name += QString::fromLatin1(" ("); name += QString::fromUtf8((*it)->Label.getValue()); - name += QString::fromAscii(")"); + name += QString::fromLatin1(")"); ui->PathsList->addItem(name); } } @@ -86,7 +86,7 @@ std::vector TaskWidgetPathCompound::getList(void) const { QListWidgetItem* item = ui->PathsList->item(i); QString name = item->text(); QStringList result; - result = name.split(QRegExp(QString::fromAscii("\\s+"))); + result = name.split(QRegExp(QString::fromLatin1("\\s+"))); std::cout << result[0].toStdString() << std::endl; names.push_back(result[0].toStdString()); } diff --git a/src/Mod/Path/libarea/kurve/Finite.cpp b/src/Mod/Path/libarea/kurve/Finite.cpp index 0dee646e2e..ad2755a52e 100644 --- a/src/Mod/Path/libarea/kurve/Finite.cpp +++ b/src/Mod/Path/libarea/kurve/Finite.cpp @@ -273,7 +273,7 @@ namespace geoff_geometry { two lines P1P2 and P3P4. Calculate also the values of mua and mub where Pa = P1 + t1 (P2 - P1) Pb = P3 + t2 (P4 - P3) - Return FALSE if no solution exists. P Bourke method. + Return false if no solution exists. P Bourke method. Input this 1st line Input l2 2nd line Output lshort shortest line between lines (if lshort.ok == false, the line intersect at a point lshort.p0) diff --git a/src/Mod/Points/Gui/DlgPointsReadImp.cpp b/src/Mod/Points/Gui/DlgPointsReadImp.cpp index 64d1af703d..7a06dc627f 100644 --- a/src/Mod/Points/Gui/DlgPointsReadImp.cpp +++ b/src/Mod/Points/Gui/DlgPointsReadImp.cpp @@ -31,7 +31,7 @@ using namespace PointsGui; -DlgPointsReadImp::DlgPointsReadImp(const char *FileName, QWidget* parent, Qt::WFlags fl ) +DlgPointsReadImp::DlgPointsReadImp(const char *FileName, QWidget* parent, Qt::WindowFlags fl ) : QDialog( parent, fl ) { _FileName = FileName; diff --git a/src/Mod/Points/Gui/DlgPointsReadImp.h b/src/Mod/Points/Gui/DlgPointsReadImp.h index 4d9020778b..0e8d0ebc41 100644 --- a/src/Mod/Points/Gui/DlgPointsReadImp.h +++ b/src/Mod/Points/Gui/DlgPointsReadImp.h @@ -36,7 +36,7 @@ class DlgPointsReadImp : public QDialog, public Ui_DlgPointsRead Q_OBJECT public: - DlgPointsReadImp(const char *FileName, QWidget* parent = 0, Qt::WFlags fl = 0 ); + DlgPointsReadImp(const char *FileName, QWidget* parent = 0, Qt::WindowFlags fl = 0 ); ~DlgPointsReadImp(); private: diff --git a/src/Mod/Raytracing/Gui/Command.cpp b/src/Mod/Raytracing/Gui/Command.cpp index 743eed8289..ef5e8e6851 100644 --- a/src/Mod/Raytracing/Gui/Command.cpp +++ b/src/Mod/Raytracing/Gui/Command.cpp @@ -374,7 +374,7 @@ Gui::Action * CmdRaytracingNewPovrayProject::createAction(void) std::string path = App::Application::getResourceDir(); path += "Mod/Raytracing/Templates/"; - QDir dir(QString::fromUtf8(path.c_str()), QString::fromAscii("*.pov")); + QDir dir(QString::fromUtf8(path.c_str()), QString::fromLatin1("*.pov")); for (unsigned int i=0; iaddAction(fi.baseName()); @@ -771,7 +771,7 @@ Gui::Action * CmdRaytracingNewLuxProject::createAction(void) std::string path = App::Application::getResourceDir(); path += "Mod/Raytracing/Templates/"; - QDir dir(QString::fromUtf8(path.c_str()), QString::fromAscii("*.lxs")); + QDir dir(QString::fromUtf8(path.c_str()), QString::fromLatin1("*.lxs")); for (unsigned int i=0; iaddAction(fi.baseName()); diff --git a/src/Mod/Raytracing/Gui/ViewProvider.cpp b/src/Mod/Raytracing/Gui/ViewProvider.cpp index dfeb7e3750..960e01d631 100644 --- a/src/Mod/Raytracing/Gui/ViewProvider.cpp +++ b/src/Mod/Raytracing/Gui/ViewProvider.cpp @@ -76,7 +76,7 @@ bool ViewProviderLux::setEdit(int ModNum) std::string path = App::Application::getResourceDir(); path += "Mod/Raytracing/Templates/"; QString dataDir = QString::fromUtf8(path.c_str()); - QDir dir(dataDir, QString::fromAscii("*.lxs")); + QDir dir(dataDir, QString::fromLatin1("*.lxs")); QStringList items; int current = 0; QFileInfo cfi(QString::fromUtf8(static_cast(getObject())->Template.getValue())); @@ -93,7 +93,7 @@ bool ViewProviderLux::setEdit(int ModNum) if (ok) { App::Document* doc = getObject()->getDocument(); doc->openTransaction("Edit LuxRender project"); - QString fn = QString::fromAscii("%1%2.lxs").arg(dataDir).arg(file); + QString fn = QString::fromLatin1("%1%2.lxs").arg(dataDir).arg(file); static_cast(getObject())->Template.setValue((const char*)fn.toUtf8()); doc->commitTransaction(); doc->recompute(); @@ -148,7 +148,7 @@ bool ViewProviderPovray::setEdit(int ModNum) std::string path = App::Application::getResourceDir(); path += "Mod/Raytracing/Templates/"; QString dataDir = QString::fromUtf8(path.c_str()); - QDir dir(dataDir, QString::fromAscii("*.pov")); + QDir dir(dataDir, QString::fromLatin1("*.pov")); QStringList items; int current = 0; QFileInfo cfi(QString::fromUtf8(static_cast(getObject())->Template.getValue())); @@ -165,7 +165,7 @@ bool ViewProviderPovray::setEdit(int ModNum) if (ok) { App::Document* doc = getObject()->getDocument(); doc->openTransaction("Edit Povray project"); - QString fn = QString::fromAscii("%1%2.pov").arg(dataDir).arg(file); + QString fn = QString::fromLatin1("%1%2.pov").arg(dataDir).arg(file); static_cast(getObject())->Template.setValue((const char*)fn.toUtf8()); doc->commitTransaction(); doc->recompute(); diff --git a/src/Mod/ReverseEngineering/Gui/AppReverseEngineeringGui.cpp b/src/Mod/ReverseEngineering/Gui/AppReverseEngineeringGui.cpp index 4401158b0c..4192223028 100644 --- a/src/Mod/ReverseEngineering/Gui/AppReverseEngineeringGui.cpp +++ b/src/Mod/ReverseEngineering/Gui/AppReverseEngineeringGui.cpp @@ -34,8 +34,6 @@ #include #include -//#include "resources/qrc_ReverseEngineering.cpp" - // use a different name to CreateCommand() void CreateReverseEngineeringCommands(void); diff --git a/src/Mod/ReverseEngineering/Gui/FitBSplineSurface.cpp b/src/Mod/ReverseEngineering/Gui/FitBSplineSurface.cpp index 91ece27282..7db53bd6ec 100644 --- a/src/Mod/ReverseEngineering/Gui/FitBSplineSurface.cpp +++ b/src/Mod/ReverseEngineering/Gui/FitBSplineSurface.cpp @@ -171,7 +171,7 @@ bool FitBSplineSurfaceWidget::accept() } catch (const Base::Exception& e) { Gui::Command::abortCommand(); - QMessageBox::warning(this, tr("Input error"), QString::fromAscii(e.what())); + QMessageBox::warning(this, tr("Input error"), QString::fromLatin1(e.what())); return false; } diff --git a/src/Mod/ReverseEngineering/Gui/Poisson.cpp b/src/Mod/ReverseEngineering/Gui/Poisson.cpp index ba5c2c5681..22cc77331b 100644 --- a/src/Mod/ReverseEngineering/Gui/Poisson.cpp +++ b/src/Mod/ReverseEngineering/Gui/Poisson.cpp @@ -105,7 +105,7 @@ bool PoissonWidget::accept() } catch (const Base::Exception& e) { Gui::Command::abortCommand(); - QMessageBox::warning(this, tr("Input error"), QString::fromAscii(e.what())); + QMessageBox::warning(this, tr("Input error"), QString::fromLatin1(e.what())); return false; } diff --git a/src/Mod/Robot/Gui/AppRobotGui.cpp b/src/Mod/Robot/Gui/AppRobotGui.cpp index f2d06c8c26..0b9c20c408 100644 --- a/src/Mod/Robot/Gui/AppRobotGui.cpp +++ b/src/Mod/Robot/Gui/AppRobotGui.cpp @@ -36,7 +36,6 @@ #include "ViewProviderTrajectoryDressUp.h" #include "ViewProviderTrajectoryCompound.h" #include "Workbench.h" -//#include "resources/qrc_Robot.cpp" // use a different name to CreateCommand() void CreateRobotCommands(void); diff --git a/src/Mod/Robot/Gui/CommandTrajectory.cpp b/src/Mod/Robot/Gui/CommandTrajectory.cpp index d110dd2427..f95aa99bc4 100644 --- a/src/Mod/Robot/Gui/CommandTrajectory.cpp +++ b/src/Mod/Robot/Gui/CommandTrajectory.cpp @@ -268,26 +268,26 @@ void CmdRobotSetDefaultValues::activated(int iMsg) bool ok; QString text = QInputDialog::getText(0, QObject::tr("set default speed"), QObject::tr("speed: (e.g. 1 m/s or 3 cm/s)"), QLineEdit::Normal, - QString::fromAscii("1 m/s"), &ok); + QString::fromLatin1("1 m/s"), &ok); if ( ok && !text.isEmpty() ) { - doCommand(Doc,"_DefSpeed = '%s'",text.toAscii().constData()); + doCommand(Doc,"_DefSpeed = '%s'",text.toLatin1().constData()); } QStringList items; - items << QString::fromAscii("False") << QString::fromAscii("True"); + items << QString::fromLatin1("False") << QString::fromLatin1("True"); QString item = QInputDialog::getItem(0, QObject::tr("set default continuity"), QObject::tr("continuous ?"), items, 0, false, &ok); if (ok && !item.isEmpty()) - doCommand(Doc,"_DefCont = %s",item.toAscii().constData()); + doCommand(Doc,"_DefCont = %s",item.toLatin1().constData()); text.clear(); text = QInputDialog::getText(0, QObject::tr("set default acceleration"), QObject::tr("acceleration: (e.g. 1 m/s^2 or 3 cm/s^2)"), QLineEdit::Normal, - QString::fromAscii("1 m/s^2"), &ok); + QString::fromLatin1("1 m/s^2"), &ok); if ( ok && !text.isEmpty() ) { - doCommand(Doc,"_DefAccelaration = '%s'",text.toAscii().constData()); + doCommand(Doc,"_DefAccelaration = '%s'",text.toLatin1().constData()); } diff --git a/src/Mod/Robot/Gui/TaskEdge2TracParameter.cpp b/src/Mod/Robot/Gui/TaskEdge2TracParameter.cpp index f9e82456dd..133e4fbef4 100644 --- a/src/Mod/Robot/Gui/TaskEdge2TracParameter.cpp +++ b/src/Mod/Robot/Gui/TaskEdge2TracParameter.cpp @@ -114,7 +114,7 @@ void TaskEdge2TracParameter::setEdgeAndClusterNbr(int NbrEdges,int NbrClusters) palette.setBrush(QPalette::WindowText,QColor(a,p,p)); } - text = QString::fromAscii("Edges: %1").arg(NbrEdges); + text = QString::fromLatin1("Edges: %1").arg(NbrEdges); ui->label_Edges->setPalette(palette); ui->label_Edges->setText(text); @@ -125,7 +125,7 @@ void TaskEdge2TracParameter::setEdgeAndClusterNbr(int NbrEdges,int NbrClusters) palette.setBrush(QPalette::WindowText,QColor(a,p,p)); } - text = QString::fromAscii("Cluster: %1").arg(NbrClusters); + text = QString::fromLatin1("Cluster: %1").arg(NbrClusters); ui->label_Cluster->setPalette(palette); ui->label_Cluster->setText(text); diff --git a/src/Mod/Robot/Gui/TaskRobot6Axis.cpp b/src/Mod/Robot/Gui/TaskRobot6Axis.cpp index 8658b9a241..080653bbe3 100644 --- a/src/Mod/Robot/Gui/TaskRobot6Axis.cpp +++ b/src/Mod/Robot/Gui/TaskRobot6Axis.cpp @@ -130,7 +130,7 @@ void TaskRobot6Axis::viewTcp(const Base::Placement pos) double A,B,C; pos.getRotation().getYawPitchRoll(A,B,C); - QString result = QString::fromAscii("TCP:( %1, %2, %3, %4, %5, %6 )") + QString result = QString::fromLatin1("TCP:( %1, %2, %3, %4, %5, %6 )") .arg(pos.getPosition().x,0,'f',1) .arg(pos.getPosition().y,0,'f',1) .arg(pos.getPosition().z,0,'f',1) @@ -146,7 +146,7 @@ void TaskRobot6Axis::viewTool(const Base::Placement pos) double A,B,C; pos.getRotation().getYawPitchRoll(A,B,C); - QString result = QString::fromAscii("Tool:( %1, %2, %3, %4, %5, %6 )") + QString result = QString::fromLatin1("Tool:( %1, %2, %3, %4, %5, %6 )") .arg(pos.getPosition().x,0,'f',1) .arg(pos.getPosition().y,0,'f',1) .arg(pos.getPosition().z,0,'f',1) diff --git a/src/Mod/Robot/Gui/TaskTrajectory.cpp b/src/Mod/Robot/Gui/TaskTrajectory.cpp index 92f5addf3a..d6fa3d87a9 100644 --- a/src/Mod/Robot/Gui/TaskTrajectory.cpp +++ b/src/Mod/Robot/Gui/TaskTrajectory.cpp @@ -69,17 +69,17 @@ TaskTrajectory::TaskTrajectory(Robot::RobotObject *pcRobotObject,Robot::Trajecto for(unsigned int i=0;itrajectoryTable->setItem(i, 0, new QTableWidgetItem(QString::fromAscii("UNDEF")));break; - case Robot::Waypoint::CIRC: ui->trajectoryTable->setItem(i, 0, new QTableWidgetItem(QString::fromAscii("CIRC")));break; - case Robot::Waypoint::PTP: ui->trajectoryTable->setItem(i, 0, new QTableWidgetItem(QString::fromAscii("PTP")));break; - case Robot::Waypoint::LINE: ui->trajectoryTable->setItem(i, 0, new QTableWidgetItem(QString::fromAscii("LIN")));break; - default: ui->trajectoryTable->setItem(i, 0, new QTableWidgetItem(QString::fromAscii("UNDEF")));break; + case Robot::Waypoint::UNDEF: ui->trajectoryTable->setItem(i, 0, new QTableWidgetItem(QString::fromLatin1("UNDEF")));break; + case Robot::Waypoint::CIRC: ui->trajectoryTable->setItem(i, 0, new QTableWidgetItem(QString::fromLatin1("CIRC")));break; + case Robot::Waypoint::PTP: ui->trajectoryTable->setItem(i, 0, new QTableWidgetItem(QString::fromLatin1("PTP")));break; + case Robot::Waypoint::LINE: ui->trajectoryTable->setItem(i, 0, new QTableWidgetItem(QString::fromLatin1("LIN")));break; + default: ui->trajectoryTable->setItem(i, 0, new QTableWidgetItem(QString::fromLatin1("UNDEF")));break; } ui->trajectoryTable->setItem(i, 1, new QTableWidgetItem(QString::fromUtf8(pt.Name.c_str()))); if(pt.Cont) - ui->trajectoryTable->setItem(i, 2, new QTableWidgetItem(QString::fromAscii("|"))); + ui->trajectoryTable->setItem(i, 2, new QTableWidgetItem(QString::fromLatin1("|"))); else - ui->trajectoryTable->setItem(i, 2, new QTableWidgetItem(QString::fromAscii("-"))); + ui->trajectoryTable->setItem(i, 2, new QTableWidgetItem(QString::fromLatin1("-"))); ui->trajectoryTable->setItem(i, 3, new QTableWidgetItem(QString::number(pt.Velocity))); ui->trajectoryTable->setItem(i, 4, new QTableWidgetItem(QString::number(pt.Accelaration))); @@ -118,7 +118,7 @@ void TaskTrajectory::viewTool(const Base::Placement pos) double A,B,C; pos.getRotation().getYawPitchRoll(A,B,C); - QString result = QString::fromAscii("Pos:(%1, %2, %3, %4, %5, %6)") + QString result = QString::fromLatin1("Pos:(%1, %2, %3, %4, %5, %6)") .arg(pos.getPosition().x,0,'f',1) .arg(pos.getPosition().y,0,'f',1) .arg(pos.getPosition().z,0,'f',1) diff --git a/src/Mod/Robot/Gui/TaskTrajectoryDressUpParameter.cpp b/src/Mod/Robot/Gui/TaskTrajectoryDressUpParameter.cpp index f11181a5cf..c519ee4957 100644 --- a/src/Mod/Robot/Gui/TaskTrajectoryDressUpParameter.cpp +++ b/src/Mod/Robot/Gui/TaskTrajectoryDressUpParameter.cpp @@ -108,7 +108,7 @@ void TaskTrajectoryDressUpParameter::viewPlacement(void) double A,B,C; Base::Vector3d pos = PosAdd.getPosition(); PosAdd.getRotation().getYawPitchRoll(A,B,C); - QString val = QString::fromAscii("(%1,%2,%3),(%4,%5,%6)\n") + QString val = QString::fromLatin1("(%1,%2,%3),(%4,%5,%6)\n") .arg(pos.x,0,'g',6) .arg(pos.y,0,'g',6) .arg(pos.z,0,'g',6) diff --git a/src/Mod/Robot/Gui/TrajectorySimulate.cpp b/src/Mod/Robot/Gui/TrajectorySimulate.cpp index e565eee3ad..fae228ed8d 100644 --- a/src/Mod/Robot/Gui/TrajectorySimulate.cpp +++ b/src/Mod/Robot/Gui/TrajectorySimulate.cpp @@ -65,17 +65,17 @@ TrajectorySimulate::TrajectorySimulate(Robot::RobotObject *pcRobotObject,Robot:: for(unsigned int i=0;isetItem(i, 0, new QTableWidgetItem(QString::fromAscii("UNDEF")));break; - case Robot::Waypoint::CIRC: trajectoryTable->setItem(i, 0, new QTableWidgetItem(QString::fromAscii("CIRC")));break; - case Robot::Waypoint::PTP: trajectoryTable->setItem(i, 0, new QTableWidgetItem(QString::fromAscii("PTP")));break; - case Robot::Waypoint::LINE: trajectoryTable->setItem(i, 0, new QTableWidgetItem(QString::fromAscii("LIN")));break; - default: trajectoryTable->setItem(i, 0, new QTableWidgetItem(QString::fromAscii("UNDEF")));break; + case Robot::Waypoint::UNDEF: trajectoryTable->setItem(i, 0, new QTableWidgetItem(QString::fromLatin1("UNDEF")));break; + case Robot::Waypoint::CIRC: trajectoryTable->setItem(i, 0, new QTableWidgetItem(QString::fromLatin1("CIRC")));break; + case Robot::Waypoint::PTP: trajectoryTable->setItem(i, 0, new QTableWidgetItem(QString::fromLatin1("PTP")));break; + case Robot::Waypoint::LINE: trajectoryTable->setItem(i, 0, new QTableWidgetItem(QString::fromLatin1("LIN")));break; + default: trajectoryTable->setItem(i, 0, new QTableWidgetItem(QString::fromLatin1("UNDEF")));break; } trajectoryTable->setItem(i, 1, new QTableWidgetItem(QString::fromUtf8(pt.Name.c_str()))); if(pt.Cont) - trajectoryTable->setItem(i, 2, new QTableWidgetItem(QString::fromAscii("|"))); + trajectoryTable->setItem(i, 2, new QTableWidgetItem(QString::fromLatin1("|"))); else - trajectoryTable->setItem(i, 2, new QTableWidgetItem(QString::fromAscii("-"))); + trajectoryTable->setItem(i, 2, new QTableWidgetItem(QString::fromLatin1("-"))); trajectoryTable->setItem(i, 3, new QTableWidgetItem(QString::number(pt.Velocity))); trajectoryTable->setItem(i, 4, new QTableWidgetItem(QString::number(pt.Accelaration))); diff --git a/src/Mod/Robot/Gui/ViewProviderRobotObject.cpp b/src/Mod/Robot/Gui/ViewProviderRobotObject.cpp index 78d4653d40..573680e5f7 100644 --- a/src/Mod/Robot/Gui/ViewProviderRobotObject.cpp +++ b/src/Mod/Robot/Gui/ViewProviderRobotObject.cpp @@ -201,7 +201,7 @@ void ViewProviderRobotObject::updateData(const App::Property* prop) // Axis 1 searchAction.setName("FREECAD_AXIS1"); searchAction.setInterest(SoSearchAction::FIRST); - searchAction.setSearchingAll(FALSE); + searchAction.setSearchingAll(false); searchAction.apply(pcRobotRoot); path = searchAction.getPath(); if(path){ @@ -214,7 +214,7 @@ void ViewProviderRobotObject::updateData(const App::Property* prop) // Axis 2 searchAction.setName("FREECAD_AXIS2"); searchAction.setInterest(SoSearchAction::FIRST); - searchAction.setSearchingAll(FALSE); + searchAction.setSearchingAll(false); searchAction.apply(pcRobotRoot); path = searchAction.getPath(); if(path){ @@ -227,7 +227,7 @@ void ViewProviderRobotObject::updateData(const App::Property* prop) // Axis 3 searchAction.setName("FREECAD_AXIS3"); searchAction.setInterest(SoSearchAction::FIRST); - searchAction.setSearchingAll(FALSE); + searchAction.setSearchingAll(false); searchAction.apply(pcRobotRoot); path = searchAction.getPath(); if(path){ @@ -240,7 +240,7 @@ void ViewProviderRobotObject::updateData(const App::Property* prop) // Axis 4 searchAction.setName("FREECAD_AXIS4"); searchAction.setInterest(SoSearchAction::FIRST); - searchAction.setSearchingAll(FALSE); + searchAction.setSearchingAll(false); searchAction.apply(pcRobotRoot); path = searchAction.getPath(); if(path){ @@ -253,7 +253,7 @@ void ViewProviderRobotObject::updateData(const App::Property* prop) // Axis 5 searchAction.setName("FREECAD_AXIS5"); searchAction.setInterest(SoSearchAction::FIRST); - searchAction.setSearchingAll(FALSE); + searchAction.setSearchingAll(false); searchAction.apply(pcRobotRoot); path = searchAction.getPath(); if(path){ @@ -266,7 +266,7 @@ void ViewProviderRobotObject::updateData(const App::Property* prop) // Axis 6 searchAction.setName("FREECAD_AXIS6"); searchAction.setInterest(SoSearchAction::FIRST); - searchAction.setSearchingAll(FALSE); + searchAction.setSearchingAll(false); searchAction.apply(pcRobotRoot); path = searchAction.getPath(); if(path){ diff --git a/src/Mod/Robot/Gui/Workbench.cpp b/src/Mod/Robot/Gui/Workbench.cpp index 6cd93359d0..0e339799c7 100644 --- a/src/Mod/Robot/Gui/Workbench.cpp +++ b/src/Mod/Robot/Gui/Workbench.cpp @@ -69,9 +69,9 @@ Workbench::~Workbench() void Workbench::activated() { std::string res = App::Application::getResourceDir(); - QString dir = QString::fromAscii("%1/Mod/Robot/Lib/Kuka") + QString dir = QString::fromLatin1("%1/Mod/Robot/Lib/Kuka") .arg(QString::fromUtf8(res.c_str())); - QFileInfo fi(dir, QString::fromAscii("kr_16.csv")); + QFileInfo fi(dir, QString::fromLatin1("kr_16.csv")); if (!fi.exists()) { Gui::WaitCursor wc; @@ -80,7 +80,7 @@ void Workbench::activated() Gui::getMainWindow(), QObject::tr("No robot files installed"), QObject::tr("Please visit %1 and copy the files to %2") - .arg(QString::fromAscii( + .arg(QString::fromLatin1( "https://free-cad.svn.sourceforge.net" "/svnroot/free-cad/trunk/src/Mod/Robot/Lib/Kuka")).arg(dir) ); diff --git a/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp b/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp index 64203ee8c5..298cf2af56 100644 --- a/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp +++ b/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp @@ -4545,7 +4545,7 @@ public: viewer = static_cast(mdi)->getViewer(); SoNode* root = viewer->getSceneGraph(); - static_cast(root)->selectionRole.setValue(TRUE); + static_cast(root)->selectionRole.setValue(true); Gui::Selection().clearSelection(); Gui::Selection().rmvSelectionGate(); diff --git a/src/Mod/Sketcher/Gui/CommandSketcherTools.cpp b/src/Mod/Sketcher/Gui/CommandSketcherTools.cpp index ef223931a0..7e5ca46a54 100644 --- a/src/Mod/Sketcher/Gui/CommandSketcherTools.cpp +++ b/src/Mod/Sketcher/Gui/CommandSketcherTools.cpp @@ -1568,7 +1568,7 @@ void CmdSketcherCompCopy::activated(int iMsg) assert(iMsg < a.size()); pcAction->setIcon(a[iMsg]->icon()); - pcAction->setShortcut(QString::fromAscii("CTRL+C")); + pcAction->setShortcut(QString::fromLatin1("CTRL+C")); } Gui::Action * CmdSketcherCompCopy::createAction(void) @@ -1589,7 +1589,7 @@ Gui::Action * CmdSketcherCompCopy::createAction(void) int defaultId = 0; pcAction->setProperty("defaultAction", QVariant(defaultId)); - pcAction->setShortcut(QString::fromAscii(sAccel)); + pcAction->setShortcut(QString::fromLatin1(sAccel)); return pcAction; } diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp b/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp index fc4e78987f..302a64d6f8 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp +++ b/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp @@ -549,26 +549,26 @@ void DrawSketchHandler::renderSuggestConstraintsCursor(std::vectorType) { case Horizontal: - iconType = QString::fromAscii("Constraint_Horizontal"); + iconType = QString::fromLatin1("Constraint_Horizontal"); break; case Vertical: - iconType = QString::fromAscii("Constraint_Vertical"); + iconType = QString::fromLatin1("Constraint_Vertical"); break; case Coincident: - iconType = QString::fromAscii("Constraint_PointOnPoint"); + iconType = QString::fromLatin1("Constraint_PointOnPoint"); break; case PointOnObject: - iconType = QString::fromAscii("Constraint_PointOnObject"); + iconType = QString::fromLatin1("Constraint_PointOnObject"); break; case Tangent: - iconType = QString::fromAscii("Constraint_Tangent"); + iconType = QString::fromLatin1("Constraint_Tangent"); break; default: break; } if (!iconType.isEmpty()) { - QPixmap icon = Gui::BitmapFactory().pixmap(iconType.toAscii()).scaledToWidth(iconSize); + QPixmap icon = Gui::BitmapFactory().pixmap(iconType.toLatin1()).scaledToWidth(iconSize); qp.drawPixmap(QPoint(baseIcon.width() + i * iconSize, baseIcon.height() - iconSize), icon); } } diff --git a/src/Mod/Sketcher/Gui/SoDatumLabel.cpp b/src/Mod/Sketcher/Gui/SoDatumLabel.cpp index b168ace77f..5aed51b4dc 100644 --- a/src/Mod/Sketcher/Gui/SoDatumLabel.cpp +++ b/src/Mod/Sketcher/Gui/SoDatumLabel.cpp @@ -110,7 +110,7 @@ void SoDatumLabel::drawImage() return; } - QFont font(QString::fromAscii(name.getValue()), size.getValue()); + QFont font(QString::fromLatin1(name.getValue()), size.getValue()); QFontMetrics fm(font); QString str = QString::fromUtf8(s[0].getString()); diff --git a/src/Mod/Sketcher/Gui/TaskSketcherConstrains.cpp b/src/Mod/Sketcher/Gui/TaskSketcherConstrains.cpp index 596c8b3ed4..2b60c2801d 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherConstrains.cpp +++ b/src/Mod/Sketcher/Gui/TaskSketcherConstrains.cpp @@ -307,8 +307,8 @@ public: protected: QPixmap 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; @@ -559,8 +559,8 @@ void TaskSketcherConstrains::onSelectionChanged(const Gui::SelectionChanges& msg if (strcmp(msg.pDocName,sketchView->getSketchObject()->getDocument()->getName())==0 && strcmp(msg.pObjectName,sketchView->getSketchObject()->getNameInDocument())== 0) { if (msg.pSubName) { - QRegExp rx(QString::fromAscii("^Constraint(\\d+)$")); - QString expr = QString::fromAscii(msg.pSubName); + QRegExp rx(QString::fromLatin1("^Constraint(\\d+)$")); + QString expr = QString::fromLatin1(msg.pSubName); int pos = expr.indexOf(rx); if (pos > -1) { bool ok; @@ -669,8 +669,8 @@ void TaskSketcherConstrains::on_listWidgetConstraints_itemChanged(QListWidgetIte catch (const Base::Exception & e) { Gui::Command::abortCommand(); - QMessageBox::critical(Gui::MainWindow::getInstance(), QString::fromAscii("Error"), - QString::fromAscii(e.what()), QMessageBox::Ok, QMessageBox::Ok); + QMessageBox::critical(Gui::MainWindow::getInstance(), QString::fromLatin1("Error"), + QString::fromLatin1(e.what()), QMessageBox::Ok, QMessageBox::Ok); } } diff --git a/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp b/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp index cb116b4ff6..07b692b3e5 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp +++ b/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp @@ -314,11 +314,11 @@ void TaskSketcherElements::onSelectionChanged(const Gui::SelectionChanges& msg) if (strcmp(msg.pDocName,sketchView->getSketchObject()->getDocument()->getName())==0 && strcmp(msg.pObjectName,sketchView->getSketchObject()->getNameInDocument())== 0) { if (msg.pSubName) { - QString expr = QString::fromAscii(msg.pSubName); + QString expr = QString::fromLatin1(msg.pSubName); std::string shapetype(msg.pSubName); // if-else edge vertex if (shapetype.size() > 4 && shapetype.substr(0,4) == "Edge") { - QRegExp rx(QString::fromAscii("^Edge(\\d+)$")); + QRegExp rx(QString::fromLatin1("^Edge(\\d+)$")); int pos = expr.indexOf(rx); if (pos > -1) { bool ok; @@ -337,7 +337,7 @@ void TaskSketcherElements::onSelectionChanged(const Gui::SelectionChanges& msg) } } else if (shapetype.size() > 6 && shapetype.substr(0,6) == "Vertex"){ - QRegExp rx(QString::fromAscii("^Vertex(\\d+)$")); + QRegExp rx(QString::fromLatin1("^Vertex(\\d+)$")); int pos = expr.indexOf(rx); if (pos > -1) { bool ok; diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index 2aaea090a6..184983b0b8 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -351,7 +351,7 @@ void ViewProviderSketch::purgeHandler(void) viewer = static_cast(mdi)->getViewer(); SoNode* root = viewer->getSceneGraph(); - static_cast(root)->selectionRole.setValue(FALSE); + static_cast(root)->selectionRole.setValue(false); } void ViewProviderSketch::setAxisPickStyle(bool on) @@ -1510,7 +1510,7 @@ void ViewProviderSketch::onSelectionChanged(const Gui::SelectionChanges& msg) // temp += "."; // temp += it->SubName; // } - // new QListWidgetItem(QString::fromAscii(temp.c_str()), selectionView); + // new QListWidgetItem(QString::fromLatin1(temp.c_str()), selectionView); //} } else if (msg.Type == Gui::SelectionChanges::SetPreselect) { @@ -1580,7 +1580,7 @@ std::set ViewProviderSketch::detectPreselectionConstr(const SoPickedPoint * } } if(constrIds) { - QString constrIdsStr = QString::fromAscii(constrIds->string.getValue().getString()); + QString constrIdsStr = QString::fromLatin1(constrIds->string.getValue().getString()); if(edit->combinedConstrBoxes.count(constrIdsStr) && dynamic_cast(tail)) { // If it's a combined constraint icon @@ -1602,7 +1602,7 @@ std::set ViewProviderSketch::detectPreselectionConstr(const SoPickedPoint * } } else { // It's a constraint icon, not a combined one - QStringList constrIdStrings = constrIdsStr.split(QString::fromAscii(",")); + QStringList constrIdStrings = constrIdsStr.split(QString::fromLatin1(",")); while(!constrIdStrings.empty()) constrIndices.insert(constrIdStrings.takeAt(0).toInt()); } @@ -2398,23 +2398,23 @@ QString ViewProviderSketch::iconTypeFromConstraint(Constraint *constraint) /*! TODO: Consider pushing this functionality up into Constraint */ switch(constraint->Type) { case Horizontal: - return QString::fromAscii("small/Constraint_Horizontal_sm"); + return QString::fromLatin1("small/Constraint_Horizontal_sm"); case Vertical: - return QString::fromAscii("small/Constraint_Vertical_sm"); + return QString::fromLatin1("small/Constraint_Vertical_sm"); case PointOnObject: - return QString::fromAscii("small/Constraint_PointOnObject_sm"); + return QString::fromLatin1("small/Constraint_PointOnObject_sm"); case Tangent: - return QString::fromAscii("small/Constraint_Tangent_sm"); + return QString::fromLatin1("small/Constraint_Tangent_sm"); case Parallel: - return QString::fromAscii("small/Constraint_Parallel_sm"); + return QString::fromLatin1("small/Constraint_Parallel_sm"); case Perpendicular: - return QString::fromAscii("small/Constraint_Perpendicular_sm"); + return QString::fromLatin1("small/Constraint_Perpendicular_sm"); case Equal: - return QString::fromAscii("small/Constraint_EqualLength_sm"); + return QString::fromLatin1("small/Constraint_EqualLength_sm"); case Symmetric: - return QString::fromAscii("small/Constraint_Symmetric_sm"); + return QString::fromLatin1("small/Constraint_Symmetric_sm"); case SnellsLaw: - return QString::fromAscii("small/Constraint_SnellsLaw_sm"); + return QString::fromLatin1("small/Constraint_SnellsLaw_sm"); default: return QString(); } @@ -2582,7 +2582,7 @@ void ViewProviderSketch::drawConstraintIcons() if((*it)->Name.empty()) thisIcon.label = QString::number(constrId + 1); else - thisIcon.label = QString::fromAscii((*it)->Name.c_str()); + thisIcon.label = QString::fromLatin1((*it)->Name.c_str()); iconQueue.push_back(thisIcon); // Note that the second translation is meant to be applied after the first. @@ -2602,7 +2602,7 @@ void ViewProviderSketch::drawConstraintIcons() if ((*it)->Name.empty()) thisIcon.label = QString(); else - thisIcon.label = QString::fromAscii((*it)->Name.c_str()); + thisIcon.label = QString::fromLatin1((*it)->Name.c_str()); iconQueue.push_back(thisIcon); } @@ -2711,7 +2711,7 @@ void ViewProviderSketch::drawMergedConstraintIcons(IconQueue iconQueue) maxColorPriority = constrColorPriority(i->constraintId); if(idString.length()) - idString.append(QString::fromAscii(",")); + idString.append(QString::fromLatin1(",")); idString.append(QString::number(i->constraintId)); if((avPos - i->position).length() < closest) { @@ -2742,7 +2742,7 @@ void ViewProviderSketch::drawMergedConstraintIcons(IconQueue iconQueue) iconColor= constrColor(i->constraintId); } - idString.append(QString::fromAscii(",") + + idString.append(QString::fromLatin1(",") + QString::number(i->constraintId)); i = iconQueue.erase(i); @@ -2817,7 +2817,7 @@ void ViewProviderSketch::drawMergedConstraintIcons(IconQueue iconQueue) } edit->combinedConstrBoxes[idString] = boundingBoxes; - thisInfo->string.setValue(idString.toAscii().data()); + thisInfo->string.setValue(idString.toLatin1().data()); sendConstraintIconToCoin(compositeIcon, thisDest); } @@ -2833,9 +2833,9 @@ QImage ViewProviderSketch::renderConstrIcon(const QString &type, int *vPad) { // Constants to help create constraint icons - QString joinStr = QString::fromAscii(", "); + QString joinStr = QString::fromLatin1(", "); - QImage icon = Gui::BitmapFactory().pixmap(type.toAscii()).toImage(); + QImage icon = Gui::BitmapFactory().pixmap(type.toLatin1()).toImage(); QFont font = QApplication::font(); font.setPixelSize(11); @@ -2918,7 +2918,7 @@ void ViewProviderSketch::drawTypicalConstraintIcon(const constrIconQueueItem &i) QList() << color, i.iconRotation); - i.infoPtr->string.setValue(QString::number(i.constraintId).toAscii().data()); + i.infoPtr->string.setValue(QString::number(i.constraintId).toLatin1().data()); sendConstraintIconToCoin(image, i.destination); } @@ -4612,9 +4612,9 @@ void ViewProviderSketch::setEditViewer(Gui::View3DInventorViewer* viewer, int Mo viewer->setCameraOrientation(rot); - viewer->setEditing(TRUE); + viewer->setEditing(true); SoNode* root = viewer->getSceneGraph(); - static_cast(root)->selectionRole.setValue(FALSE); + static_cast(root)->selectionRole.setValue(false); viewer->addGraphicsItem(rubberband); rubberband->setViewer(viewer); @@ -4623,9 +4623,9 @@ void ViewProviderSketch::setEditViewer(Gui::View3DInventorViewer* viewer, int Mo void ViewProviderSketch::unsetEditViewer(Gui::View3DInventorViewer* viewer) { viewer->removeGraphicsItem(rubberband); - viewer->setEditing(FALSE); + viewer->setEditing(false); SoNode* root = viewer->getSceneGraph(); - static_cast(root)->selectionRole.setValue(TRUE); + static_cast(root)->selectionRole.setValue(true); } void ViewProviderSketch::setPositionText(const Base::Vector2D &Pos, const SbString &text) diff --git a/src/Mod/Spreadsheet/Gui/AppSpreadsheetGui.cpp b/src/Mod/Spreadsheet/Gui/AppSpreadsheetGui.cpp index 14f5461f25..a270b4efa7 100644 --- a/src/Mod/Spreadsheet/Gui/AppSpreadsheetGui.cpp +++ b/src/Mod/Spreadsheet/Gui/AppSpreadsheetGui.cpp @@ -22,7 +22,6 @@ #include "Workbench.h" #include "ViewProviderSpreadsheet.h" #include "SpreadsheetView.h" -#include "qrc_Spreadsheet.cxx" // use a different name to CreateCommand() void CreateSpreadsheetCommands(void); diff --git a/src/Mod/Spreadsheet/Gui/CMakeLists.txt b/src/Mod/Spreadsheet/Gui/CMakeLists.txt index 9130457905..8f27a0392f 100644 --- a/src/Mod/Spreadsheet/Gui/CMakeLists.txt +++ b/src/Mod/Spreadsheet/Gui/CMakeLists.txt @@ -40,7 +40,6 @@ SET(SpreadsheetGui_RES_SRCS Resources/Spreadsheet.qrc ) -#fc_add_resources(SpreadsheetGui_QRC_SRCS ${SpreadsheetGui_RES_SRCS}) qt4_add_resources(SpreadsheetGui_QRC_SRCS ${SpreadsheetGui_RES_SRCS}) set(SpreadsheetGui_UIC_SRCS @@ -52,7 +51,7 @@ qt4_wrap_ui(SpreadsheetGui_UIC_HDRS ${SpreadsheetGui_UIC_SRCS}) SET(SpreadsheetGui_SRCS # ${SpreadsheetGui_MOC_SRCS} -# ${SpreadsheetGui_QRC_SRCS} + ${SpreadsheetGui_QRC_SRCS} AppSpreadsheetGui.cpp AppSpreadsheetGuiPy.cpp Command.cpp diff --git a/src/Mod/Spreadsheet/Gui/SpreadsheetView.cpp b/src/Mod/Spreadsheet/Gui/SpreadsheetView.cpp index 55c5311150..39bc03012a 100644 --- a/src/Mod/Spreadsheet/Gui/SpreadsheetView.cpp +++ b/src/Mod/Spreadsheet/Gui/SpreadsheetView.cpp @@ -104,11 +104,11 @@ SheetView::SheetView(Gui::Document *pcDocument, App::DocumentObject *docObj, QWi palette.setColor(QPalette::Text, QColor(0, 0, 0)); ui->cells->setPalette(palette); - QList bgList = Gui::getMainWindow()->findChildren(QString::fromAscii("Spreadsheet_BackgroundColor")); + QList bgList = Gui::getMainWindow()->findChildren(QString::fromLatin1("Spreadsheet_BackgroundColor")); if (bgList.size() > 0) bgList[0]->setCurrentColor(palette.color(QPalette::Base)); - QList fgList = Gui::getMainWindow()->findChildren(QString::fromAscii("Spreadsheet_ForegroundColor")); + QList fgList = Gui::getMainWindow()->findChildren(QString::fromLatin1("Spreadsheet_ForegroundColor")); if (fgList.size() > 0) fgList[0]->setCurrentColor(palette.color(QPalette::Text)); diff --git a/src/Mod/Spreadsheet/Gui/ViewProviderSpreadsheet.cpp b/src/Mod/Spreadsheet/Gui/ViewProviderSpreadsheet.cpp index b6b45531e4..11912ced91 100644 --- a/src/Mod/Spreadsheet/Gui/ViewProviderSpreadsheet.cpp +++ b/src/Mod/Spreadsheet/Gui/ViewProviderSpreadsheet.cpp @@ -181,7 +181,7 @@ SheetView *ViewProviderSheet::showSpreadsheetView() (this->pcObject->getDocument()); view = new SheetView(doc, this->pcObject, Gui::getMainWindow()); view->setWindowIcon(Gui::BitmapFactory().pixmap(":icons/Spreadsheet.svg")); - view->setWindowTitle(QString::fromUtf8(pcObject->Label.getValue()) + QString::fromAscii("[*]")); + view->setWindowTitle(QString::fromUtf8(pcObject->Label.getValue()) + QString::fromLatin1("[*]")); Gui::getMainWindow()->addWindow(view); startEditing(); } diff --git a/src/Mod/Spreadsheet/Gui/Workbench.cpp b/src/Mod/Spreadsheet/Gui/Workbench.cpp index 474db089dc..00e0b569bc 100644 --- a/src/Mod/Spreadsheet/Gui/Workbench.cpp +++ b/src/Mod/Spreadsheet/Gui/Workbench.cpp @@ -65,7 +65,7 @@ Workbench::~Workbench() void Workbench::activated() { if (!initialized) { - QList bars = Gui::getMainWindow()->findChildren(QString::fromAscii("Spreadsheet")); + QList bars = Gui::getMainWindow()->findChildren(QString::fromLatin1("Spreadsheet")); if (bars.size() == 1) { QToolBar * bar = bars[0]; @@ -73,24 +73,24 @@ void Workbench::activated() QtColorPicker * backgroundColor; QPalette palette = Gui::getMainWindow()->palette(); - QList fgList = Gui::getMainWindow()->findChildren(QString::fromAscii("Spreadsheet_ForegroundColor")); + QList fgList = Gui::getMainWindow()->findChildren(QString::fromLatin1("Spreadsheet_ForegroundColor")); if (fgList.size() > 0) foregroundColor = fgList[0]; else { foregroundColor = new QtColorPicker(); - foregroundColor->setObjectName(QString::fromAscii("Spreadsheet_ForegroundColor")); + foregroundColor->setObjectName(QString::fromLatin1("Spreadsheet_ForegroundColor")); foregroundColor->setStandardColors(); foregroundColor->setCurrentColor(palette.color(QPalette::Foreground)); QObject::connect(foregroundColor, SIGNAL(colorSet(QColor)), workbenchHelper.get(), SLOT(setForegroundColor(QColor))); } bar->addWidget(foregroundColor); - QList bgList = Gui::getMainWindow()->findChildren(QString::fromAscii("Spreadsheet_BackgroundColor")); + QList bgList = Gui::getMainWindow()->findChildren(QString::fromLatin1("Spreadsheet_BackgroundColor")); if (bgList.size() > 0) backgroundColor = bgList[0]; else { backgroundColor = new QtColorPicker(); - backgroundColor->setObjectName(QString::fromAscii("Spreadsheet_BackgroundColor")); + backgroundColor->setObjectName(QString::fromLatin1("Spreadsheet_BackgroundColor")); backgroundColor->setStandardColors(); backgroundColor->setCurrentColor(palette.color(QPalette::Base)); QObject::connect(backgroundColor, SIGNAL(colorSet(QColor)), workbenchHelper.get(), SLOT(setBackgroundColor(QColor))); diff --git a/src/Mod/Spreadsheet/Gui/qtcolorpicker.cpp b/src/Mod/Spreadsheet/Gui/qtcolorpicker.cpp index 5bb793cec3..ea222095c5 100644 --- a/src/Mod/Spreadsheet/Gui/qtcolorpicker.cpp +++ b/src/Mod/Spreadsheet/Gui/qtcolorpicker.cpp @@ -44,20 +44,20 @@ ** ****************************************************************************/ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include -#include +#include #include #include #include @@ -480,7 +480,7 @@ void QtColorPicker::insertColor(const QColor &color, const QString &text, int in /*! \property QtColorPicker::colorDialog \brief Whether the ellipsis "..." (more) button is available. - If this property is set to TRUE, the color grid popup will include + If this property is set to true, the color grid popup will include a "More" button (signified by an ellipsis, "...") which pops up a QColorDialog when clicked. The user will then be able to select any custom color they like. diff --git a/src/Mod/Spreadsheet/Gui/qtcolorpicker.h b/src/Mod/Spreadsheet/Gui/qtcolorpicker.h index 7b10da3321..4f1a405ed9 100644 --- a/src/Mod/Spreadsheet/Gui/qtcolorpicker.h +++ b/src/Mod/Spreadsheet/Gui/qtcolorpicker.h @@ -46,11 +46,11 @@ #ifndef QTCOLORPICKER_H #define QTCOLORPICKER_H -#include +#include #include #include -#include +#include #include #include diff --git a/src/Mod/Test/Gui/UnitTestImp.cpp b/src/Mod/Test/Gui/UnitTestImp.cpp index 5ecf4d52c0..6b45c35d3e 100644 --- a/src/Mod/Test/Gui/UnitTestImp.cpp +++ b/src/Mod/Test/Gui/UnitTestImp.cpp @@ -77,15 +77,15 @@ bool UnitTestDialog::hasInstance() * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ -UnitTestDialog::UnitTestDialog(QWidget* parent, Qt::WFlags f) +UnitTestDialog::UnitTestDialog(QWidget* parent, Qt::WindowFlags f) : QDialog(parent, f) { this->setupUi(this); // As it doesn't seem to be able to change the "Highlight" color for the active colorgroup // we force e.g. the "Motif" style only for the progressbar to change the color to green or red. - this->progressBar->setStyle(QStyleFactory::create(QString::fromAscii("Motif"))); + this->progressBar->setStyle(QStyleFactory::create(QString::fromLatin1("Motif"))); setProgressColor(QColor(40,210,43)); // a darker green // red items diff --git a/src/Mod/Test/Gui/UnitTestImp.h b/src/Mod/Test/Gui/UnitTestImp.h index ad7e6daef5..284c6986b2 100644 --- a/src/Mod/Test/Gui/UnitTestImp.h +++ b/src/Mod/Test/Gui/UnitTestImp.h @@ -56,7 +56,7 @@ public: static bool hasInstance(); protected: - UnitTestDialog(QWidget* parent = 0, Qt::WFlags f = 0); + UnitTestDialog(QWidget* parent = 0, Qt::WindowFlags f = 0); ~UnitTestDialog(); void setProgressColor(const QColor& col); diff --git a/src/Mod/Test/Gui/UnitTestPy.cpp b/src/Mod/Test/Gui/UnitTestPy.cpp index 2a9bda1b02..b434ae91a1 100644 --- a/src/Mod/Test/Gui/UnitTestPy.cpp +++ b/src/Mod/Test/Gui/UnitTestPy.cpp @@ -116,7 +116,7 @@ Py::Object UnitTestDialogPy::getUnitTest(const Py::Tuple& args) { if (!PyArg_ParseTuple(args.ptr(), "")) throw Py::Exception(); - return Py::String((const char*)UnitTestDialog::instance()->getUnitTest().toAscii()); + return Py::String((const char*)UnitTestDialog::instance()->getUnitTest().toLatin1()); } Py::Object UnitTestDialogPy::setStatusText(const Py::Tuple& args) diff --git a/src/Mod/Web/Gui/AppWebGuiPy.cpp b/src/Mod/Web/Gui/AppWebGuiPy.cpp index 6c477e1dcc..cf2a28c2f1 100644 --- a/src/Mod/Web/Gui/AppWebGuiPy.cpp +++ b/src/Mod/Web/Gui/AppWebGuiPy.cpp @@ -80,7 +80,7 @@ openBrowserHTML(PyObject *self, PyObject *args) WebGui::BrowserView* pcBrowserView = 0; pcBrowserView = new WebGui::BrowserView(Gui::getMainWindow()); pcBrowserView->resize(400, 300); - pcBrowserView->setHtml(QString::fromUtf8(HtmlCode),QUrl(QString::fromAscii(BaseUrl)),QString::fromUtf8(TabName)); + pcBrowserView->setHtml(QString::fromUtf8(HtmlCode),QUrl(QString::fromLatin1(BaseUrl)),QString::fromUtf8(TabName)); Gui::getMainWindow()->addWindow(pcBrowserView); } else { diff --git a/src/Mod/Web/Gui/BrowserView.h b/src/Mod/Web/Gui/BrowserView.h index 546742851b..e0b9d3d675 100644 --- a/src/Mod/Web/Gui/BrowserView.h +++ b/src/Mod/Web/Gui/BrowserView.h @@ -73,7 +73,7 @@ public: void load(const char* URL); void load(const QUrl & url); - void setHtml(const QString& HtmlCode,const QUrl & BaseUrl,const QString& TabName=QString::fromAscii("Browser")); + void setHtml(const QString& HtmlCode,const QUrl & BaseUrl,const QString& TabName=QString::fromLatin1("Browser")); void stop(void); void OnChange(Base::Subject &rCaller,const char* rcReason);