From 2bd82fa340d9a5a856a04d03f6a7204b46511f1a Mon Sep 17 00:00:00 2001 From: dismine Date: Fri, 24 Oct 2014 17:27:41 +0300 Subject: [PATCH] Refactoring. Do not use QStringLiteral for empty strings. --HG-- branch : develop --- src/app/container/vformula.cpp | 4 ++-- src/app/dialogs/tools/dialogeditwrongformula.cpp | 2 +- src/libs/vpropertyexplorer/plugins/vstringproperty.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/container/vformula.cpp b/src/app/container/vformula.cpp index cb8fe443b..a9662cd25 100644 --- a/src/app/container/vformula.cpp +++ b/src/app/container/vformula.cpp @@ -36,13 +36,13 @@ //--------------------------------------------------------------------------------------------------------------------- VFormula::VFormula() :formula(QString()), value(QString(tr("Error"))), checkZero(true), data(nullptr), toolId(NULL_ID), - postfix(QStringLiteral("")), _error(true), dValue(0) + postfix(QString()), _error(true), dValue(0) {} //--------------------------------------------------------------------------------------------------------------------- VFormula::VFormula(const QString &formula, const VContainer *container) :formula(qApp->FormulaToUser(formula)), value(QString(tr("Error"))), checkZero(true), data(container), - toolId(NULL_ID), postfix(QStringLiteral("")), _error(true), dValue(0) + toolId(NULL_ID), postfix(QString()), _error(true), dValue(0) { this->formula.replace("\n", " ");// Replace line return with spaces for calc if exist Eval(); diff --git a/src/app/dialogs/tools/dialogeditwrongformula.cpp b/src/app/dialogs/tools/dialogeditwrongformula.cpp index 3f9ed69a7..85ec8beee 100644 --- a/src/app/dialogs/tools/dialogeditwrongformula.cpp +++ b/src/app/dialogs/tools/dialogeditwrongformula.cpp @@ -32,7 +32,7 @@ //--------------------------------------------------------------------------------------------------------------------- DialogEditWrongFormula::DialogEditWrongFormula(const VContainer *data, const quint32 &toolId, QWidget *parent) :DialogTool(data, toolId, parent), ui(new Ui::DialogEditWrongFormula), formula(QString()), formulaBaseHeight(0), - checkZero(false), postfix(QStringLiteral("")), restoreCursor(false) + checkZero(false), postfix(QString()), restoreCursor(false) { ui->setupUi(this); InitVariables(ui); diff --git a/src/libs/vpropertyexplorer/plugins/vstringproperty.cpp b/src/libs/vpropertyexplorer/plugins/vstringproperty.cpp index 0446e6a3a..d4bac678c 100644 --- a/src/libs/vpropertyexplorer/plugins/vstringproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vstringproperty.cpp @@ -32,14 +32,14 @@ VPE::VStringProperty::VStringProperty(const QString &name, const QMapVariantValue.setValue(QStringLiteral("")); + d_ptr->VariantValue.setValue(QString()); d_ptr->VariantValue.convert(QVariant::String); } VPE::VStringProperty::VStringProperty(const QString &name) : VProperty(name), readOnly(false), typeForParent(0) { - d_ptr->VariantValue.setValue(QStringLiteral("")); + d_ptr->VariantValue.setValue(QString()); d_ptr->VariantValue.convert(QVariant::String); } @@ -66,7 +66,7 @@ QVariant VPE::VStringProperty::getEditorData(const QWidget *editor) const return tmpEditor->text(); } - return QVariant(QStringLiteral("")); + return QVariant(QString()); } void VPE::VStringProperty::setReadOnly(bool readOnly)