diff --git a/Core/Aggregate/ParticleLayout.h b/Core/Aggregate/ParticleLayout.h index 70cd1ecb502b8d7f9b58d31ebc2754a35db4829e..b654197b73168f6426e16121be38d7ae6c8884d3 100644 --- a/Core/Aggregate/ParticleLayout.h +++ b/Core/Aggregate/ParticleLayout.h @@ -39,8 +39,7 @@ public: void accept(INodeVisitor* visitor) const final override { visitor->visit(this); } void addParticle(const IAbstractParticle& particle, double abundance = -1.0, - const kvector_t position = kvector_t(), - const IRotation& rotation = IdentityRotation()); + const kvector_t position = {}, const IRotation& rotation = IdentityRotation()); SafePointerVector<IParticle> particles() const final override; diff --git a/Core/Instrument/OutputData.h b/Core/Instrument/OutputData.h index 258b907d25ad5c9e86b8926fc7eae4ce6f729cd0..bad3a97cede5059a6cea0a2fdf7bf8da7a076ad5 100644 --- a/Core/Instrument/OutputData.h +++ b/Core/Instrument/OutputData.h @@ -551,7 +551,7 @@ template <class T> void OutputData<T>::allocate() dims[i] = (int)getAxis(i).size(); } mp_ll_data = new LLData<T>(rank, dims); - T default_value = T(); + T default_value = {}; mp_ll_data->setAll(default_value); delete[] dims; } diff --git a/Core/Lattice/Lattice.cpp b/Core/Lattice/Lattice.cpp index d75ec628561c1ac72b05cd740baea2144ded3806..9e37c51281b99f5ca7ebf4c241dd4c3d3b19aa77 100644 --- a/Core/Lattice/Lattice.cpp +++ b/Core/Lattice/Lattice.cpp @@ -57,7 +57,7 @@ Lattice Lattice::createTransformedLattice(const Transform3D& transform) const kvector_t a1 = transform.transformed(m_a); kvector_t a2 = transform.transformed(m_b); kvector_t a3 = transform.transformed(m_c); - Lattice result = Lattice(a1, a2, a3); + Lattice result = {a1, a2, a3}; if (mp_selection_rule) result.setSelectionRule(*mp_selection_rule); return result; diff --git a/Core/Material/MaterialFactoryFuncs.h b/Core/Material/MaterialFactoryFuncs.h index 7abb7c3c6d654a51b867904e4135095821f13e13..313b037524528db9d750f3a41204ab5b06c823cb 100644 --- a/Core/Material/MaterialFactoryFuncs.h +++ b/Core/Material/MaterialFactoryFuncs.h @@ -26,7 +26,7 @@ BA_CORE_API_ Material HomogeneousMaterial(); //! @ingroup materials BA_CORE_API_ Material HomogeneousMaterial(const std::string& name, double delta, double beta, - kvector_t magnetization = kvector_t()); + kvector_t magnetization = {}); //! @ingroup materials @@ -37,7 +37,7 @@ BA_CORE_API_ Material HomogeneousMaterial(const std::string& name, double delta, //! With no parameters given, constructs default (vacuum) material with \f$n = 1\f$ and zero //! magnetization. BA_CORE_API_ Material HomogeneousMaterial(const std::string& name, complex_t refractive_index, - kvector_t magnetization = kvector_t()); + kvector_t magnetization = {}); //! @ingroup materials @@ -60,7 +60,7 @@ BA_CORE_API_ Material MaterialBySLD(); //! @param sld_imag: imaginary part of the scattering length density, inverse square angstroms //! @param magnetization: magnetization (in A/m) BA_CORE_API_ Material MaterialBySLD(const std::string& name, double sld_real, double sld_imag, - kvector_t magnetization = kvector_t()); + kvector_t magnetization = {}); #ifndef SWIG diff --git a/Core/StandardSamples/LayersWithAbsorptionBuilder.cpp b/Core/StandardSamples/LayersWithAbsorptionBuilder.cpp index 28aaa503c49015c680a3353aebdc2f4cb16849d2..e38647553462d5e822a64fea8cc60ff87ebd9a43 100644 --- a/Core/StandardSamples/LayersWithAbsorptionBuilder.cpp +++ b/Core/StandardSamples/LayersWithAbsorptionBuilder.cpp @@ -85,6 +85,6 @@ size_t LayersWithAbsorptionBuilder::size() FormFactorComponents& LayersWithAbsorptionBuilder::ff_components() { - static FormFactorComponents result = FormFactorComponents(); + static FormFactorComponents result = {}; return result; } diff --git a/Core/StandardSamples/ParaCrystalBuilder.cpp b/Core/StandardSamples/ParaCrystalBuilder.cpp index e3e7eac5a3e0924a73b667e8fbc9b7d15a4d7167..858834c71fee66f5afdafa8a9a0d0157b8096f50 100644 --- a/Core/StandardSamples/ParaCrystalBuilder.cpp +++ b/Core/StandardSamples/ParaCrystalBuilder.cpp @@ -127,7 +127,7 @@ size_t Basic2DParaCrystalBuilder::size() FTDistribution2DComponents& Basic2DParaCrystalBuilder::pdf_components() { - static FTDistribution2DComponents result = FTDistribution2DComponents(); + static FTDistribution2DComponents result = {}; return result; } diff --git a/Core/StandardSamples/ParticleInTheAirBuilder.cpp b/Core/StandardSamples/ParticleInTheAirBuilder.cpp index b7a9f8470a3df85aa218fe6de9a9c072430e373f..cb93e18b7dfd112f651fcac47db45004714e8aae 100644 --- a/Core/StandardSamples/ParticleInTheAirBuilder.cpp +++ b/Core/StandardSamples/ParticleInTheAirBuilder.cpp @@ -70,6 +70,6 @@ size_t ParticleInTheAirBuilder::size() FormFactorComponents& ParticleInTheAirBuilder::ff_components() { - static FormFactorComponents result = FormFactorComponents(); + static FormFactorComponents result = {}; return result; } diff --git a/Fit/Minimizer/MinimizerFactory.cpp b/Fit/Minimizer/MinimizerFactory.cpp index dad7213af420c0f6d1145c1dbd835d0373446d1d..4bfe08d5124dc72ead8e14cf78f7c460e79fe860 100644 --- a/Fit/Minimizer/MinimizerFactory.cpp +++ b/Fit/Minimizer/MinimizerFactory.cpp @@ -130,6 +130,6 @@ std::string MinimizerFactory::catalogDetailsToString() const MinimizerCatalog& MinimizerFactory::catalog() { - static MinimizerCatalog s_catalog = MinimizerCatalog(); + static MinimizerCatalog s_catalog; return s_catalog; } diff --git a/GUI/ba3d/view/camera.cpp b/GUI/ba3d/view/camera.cpp index db3373aa70c5821d74392774b7537c2f4929d37c..ed623529a069834e1ff3c810b8cc8a4b9c855eeb 100644 --- a/GUI/ba3d/view/camera.cpp +++ b/GUI/ba3d/view/camera.cpp @@ -105,7 +105,7 @@ void Camera::endTransform(bool keep) pos3DAxes.rot = (pos3DAxes.rot * addRot).normalized(); // no zooming for 3D axes } - addRot = QQuaternion(); + addRot = {}; zoom = 1; set(); } diff --git a/GUI/ba3d/view/camera.h b/GUI/ba3d/view/camera.h index 54dfe3d42086843a025dea907865ba916ecfe440..885a21ff39e2edcf0440f0ef6c5f0fc9726ed67f 100644 --- a/GUI/ba3d/view/camera.h +++ b/GUI/ba3d/view/camera.h @@ -39,7 +39,7 @@ public: Position(); Position(const Vector3D& eye, const Vector3D& ctr, const Vector3D& up, - const QQuaternion& = QQuaternion()); + const QQuaternion& = {}); Vector3D eye, ctr, up; QQuaternion rot; diff --git a/GUI/coregui/Models/ComboProperty.cpp b/GUI/coregui/Models/ComboProperty.cpp index b3c561ca2e62a54b02f03e716c3d41ef5a0c496b..d36a2013876421aa109caf0f3fd268293ee25600 100644 --- a/GUI/coregui/Models/ComboProperty.cpp +++ b/GUI/coregui/Models/ComboProperty.cpp @@ -220,10 +220,10 @@ void ComboProperty::setStringOfSelections(const QString& values) QString ComboProperty::label() const { if (m_selected_indices.size() > 1) { - return QStringLiteral("Multiple"); + return "Multiple"; } else if (m_selected_indices.size() == 1) { return getValue(); } else { - return QStringLiteral("None"); + return "None"; } } diff --git a/GUI/coregui/Models/ComponentProxyModel.h b/GUI/coregui/Models/ComponentProxyModel.h index 156763d10fd0e495da71239b0a6bbf25deb50e64..17cee81aa1a437570dd21e33c51707aa6c03c9e3 100644 --- a/GUI/coregui/Models/ComponentProxyModel.h +++ b/GUI/coregui/Models/ComponentProxyModel.h @@ -49,16 +49,16 @@ public: QModelIndex mapToSource(const QModelIndex& proxyIndex) const; QModelIndex mapFromSource(const QModelIndex& sourceIndex) const; - QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const; + QModelIndex index(int row, int column, const QModelIndex& parent = {}) const; QModelIndex parent(const QModelIndex& child) const; - int rowCount(const QModelIndex& parent = QModelIndex()) const; - int columnCount(const QModelIndex& parent = QModelIndex()) const; + int rowCount(const QModelIndex& parent = {}) const; + int columnCount(const QModelIndex& parent = {}) const; bool hasChildren(const QModelIndex& parent) const; private slots: void sourceDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight, - const QVector<int>& roles = QVector<int>()); + const QVector<int>& roles = {}); void sourceRowsInserted(const QModelIndex& parent, int start, int end); void sourceRowsRemoved(const QModelIndex& parent, int start, int end); diff --git a/GUI/coregui/Models/ComponentProxyStrategy.cpp b/GUI/coregui/Models/ComponentProxyStrategy.cpp index 302a03356b5860269cb0fcd1ca1cb10c8e4f17cc..3b5fc91a095167f05a2750411ad5747e8dbb074f 100644 --- a/GUI/coregui/Models/ComponentProxyStrategy.cpp +++ b/GUI/coregui/Models/ComponentProxyStrategy.cpp @@ -29,7 +29,7 @@ void ComponentProxyStrategy::onDataChanged(SessionModel* source, ComponentProxyM bool ComponentProxyStrategy::processSourceIndex(const QModelIndex& index) { - QPersistentModelIndex sourceIndex = QPersistentModelIndex(index); + QPersistentModelIndex sourceIndex = {index}; SessionItem* item = m_source->itemForIndex(index); diff --git a/GUI/coregui/Models/DataItem.cpp b/GUI/coregui/Models/DataItem.cpp index 7090a231c713c142b7b8fbccc5eb19c7ab39b42e..e24f550fe9db8ec4ba154c8dce75c1d2da09ed2c 100644 --- a/GUI/coregui/Models/DataItem.cpp +++ b/GUI/coregui/Models/DataItem.cpp @@ -88,7 +88,7 @@ QString DataItem::selectedAxesUnits() const DataItem::DataItem(const QString& modelType) : SessionItem(modelType) { // name of the file used to serialize given IntensityDataItem - addProperty(P_FILE_NAME, QStringLiteral("undefined"))->setVisible(false); + addProperty(P_FILE_NAME, "undefined")->setVisible(false); ComboProperty units = ComboProperty() << "nbins"; addProperty(P_AXES_UNITS, units.variant()); diff --git a/GUI/coregui/Models/FTDecayFunctionItems.cpp b/GUI/coregui/Models/FTDecayFunctionItems.cpp index 7383827685c6c44329939f4aaa3875835eda4970..70958141f6db9e5f437391533cf5230ea0af5685 100644 --- a/GUI/coregui/Models/FTDecayFunctionItems.cpp +++ b/GUI/coregui/Models/FTDecayFunctionItems.cpp @@ -24,7 +24,7 @@ FTDecayFunction1DItem::FTDecayFunction1DItem(const QString& name) : SessionItem( void FTDecayFunction1DItem::add_decay_property() { addProperty(P_DECAY_LENGTH, 1000.0) - ->setToolTip(QStringLiteral("Decay length (half-width of the distribution in nanometers)")); + ->setToolTip("Decay length (half-width of the distribution in nanometers)"); } // --------------------------------------------------------------------------------------------- // @@ -32,7 +32,7 @@ void FTDecayFunction1DItem::add_decay_property() FTDecayFunction1DCauchyItem::FTDecayFunction1DCauchyItem() : FTDecayFunction1DItem("FTDecayFunction1DCauchy") { - setToolTip(QStringLiteral("One-dimensional Cauchy decay function")); + setToolTip("One-dimensional Cauchy decay function"); add_decay_property(); } @@ -46,7 +46,7 @@ std::unique_ptr<IFTDecayFunction1D> FTDecayFunction1DCauchyItem::createFTDecayFu FTDecayFunction1DGaussItem::FTDecayFunction1DGaussItem() : FTDecayFunction1DItem("FTDecayFunction1DGauss") { - setToolTip(QStringLiteral("One-dimensional Gauss decay function")); + setToolTip("One-dimensional Gauss decay function"); add_decay_property(); } @@ -60,7 +60,7 @@ std::unique_ptr<IFTDecayFunction1D> FTDecayFunction1DGaussItem::createFTDecayFun FTDecayFunction1DTriangleItem::FTDecayFunction1DTriangleItem() : FTDecayFunction1DItem("FTDecayFunction1DTriangle") { - setToolTip(QStringLiteral("One-dimensional triangle decay function")); + setToolTip("One-dimensional triangle decay function"); add_decay_property(); } @@ -76,12 +76,11 @@ const QString FTDecayFunction1DVoigtItem::P_ETA = QString::fromStdString("Eta"); FTDecayFunction1DVoigtItem::FTDecayFunction1DVoigtItem() : FTDecayFunction1DItem("FTDecayFunction1DVoigt") { - setToolTip(QStringLiteral("One-dimensional pseudo-Voigt decay function")); + setToolTip("One-dimensional pseudo-Voigt decay function"); add_decay_property(); addProperty(P_ETA, 0.5) ->setLimits(RealLimits::limited(0.0, 1.0)) - .setToolTip(QStringLiteral( - "Parameter [0,1] to balance between Cauchy (eta=0.0) and Gauss (eta=1.0)")); + .setToolTip("Parameter [0,1] to balance between Cauchy (eta=0.0) and Gauss (eta=1.0)"); } std::unique_ptr<IFTDecayFunction1D> FTDecayFunction1DVoigtItem::createFTDecayFunction() const @@ -102,18 +101,18 @@ FTDecayFunction2DItem::FTDecayFunction2DItem(const QString& name) : SessionItem( void FTDecayFunction2DItem::add_decay_property() { addProperty(P_DECAY_LENGTH_X, 1000.0) - ->setToolTip(QStringLiteral("Decay length (half-width of the distribution in nanometers) " - "\nalong x-axis of the distribution")); + ->setToolTip("Decay length (half-width of the distribution in nanometers) " + "\nalong x-axis of the distribution"); addProperty(P_DECAY_LENGTH_Y, 1000.0) - ->setToolTip(QStringLiteral("Decay length (half-width of the distribution in nanometers) " - "\nalong y-axis of the distribution")); + ->setToolTip("Decay length (half-width of the distribution in nanometers) " + "\nalong y-axis of the distribution"); } void FTDecayFunction2DItem::add_gammadelta_property() { addProperty(P_GAMMA, 0.0) - ->setToolTip(QStringLiteral( - "Distribution orientation with respect to the first lattice vector in degrees")); + ->setToolTip( + "Distribution orientation with respect to the first lattice vector in degrees"); addProperty(P_DELTA, 90.0)->setVisible(false); } @@ -122,7 +121,7 @@ void FTDecayFunction2DItem::add_gammadelta_property() FTDecayFunction2DCauchyItem::FTDecayFunction2DCauchyItem() : FTDecayFunction2DItem("FTDecayFunction2DCauchy") { - setToolTip(QStringLiteral("Two-dimensional Cauchy decay function")); + setToolTip("Two-dimensional Cauchy decay function"); add_decay_property(); add_gammadelta_property(); } @@ -139,7 +138,7 @@ std::unique_ptr<IFTDecayFunction2D> FTDecayFunction2DCauchyItem::createFTDecayFu FTDecayFunction2DGaussItem::FTDecayFunction2DGaussItem() : FTDecayFunction2DItem("FTDecayFunction2DGauss") { - setToolTip(QStringLiteral("Two-dimensional Gauss decay function")); + setToolTip("Two-dimensional Gauss decay function"); add_decay_property(); add_gammadelta_property(); } @@ -158,12 +157,11 @@ const QString FTDecayFunction2DVoigtItem::P_ETA = QString::fromStdString("Eta"); FTDecayFunction2DVoigtItem::FTDecayFunction2DVoigtItem() : FTDecayFunction2DItem("FTDecayFunction2DVoigt") { - setToolTip(QStringLiteral("Two-dimensional pseudo-Voigt decay function")); + setToolTip("Two-dimensional pseudo-Voigt decay function"); add_decay_property(); addProperty(P_ETA, 0.5) ->setLimits(RealLimits::limited(0.0, 1.0)) - .setToolTip(QStringLiteral( - "Parameter [0,1] to balance between Cauchy (eta=0.0) and Gauss (eta=1.0)")); + .setToolTip("Parameter [0,1] to balance between Cauchy (eta=0.0) and Gauss (eta=1.0)"); add_gammadelta_property(); } diff --git a/GUI/coregui/Models/FTDistributionItems.cpp b/GUI/coregui/Models/FTDistributionItems.cpp index 3a1eeb1aca486578a3a34628fbcfadc33ff5c2a3..08d2492f5c5a187c994d8b758f1fd4fb53846c14 100644 --- a/GUI/coregui/Models/FTDistributionItems.cpp +++ b/GUI/coregui/Models/FTDistributionItems.cpp @@ -21,8 +21,7 @@ FTDistribution1DItem::FTDistribution1DItem(const QString& name) : SessionItem(na void FTDistribution1DItem::add_omega_property() { - addProperty(P_OMEGA, 1.0) - ->setToolTip(QStringLiteral("Half-width of the distribution in nanometers")); + addProperty(P_OMEGA, 1.0)->setToolTip("Half-width of the distribution in nanometers"); } // --------------------------------------------------------------------------------------------- // @@ -30,7 +29,7 @@ void FTDistribution1DItem::add_omega_property() FTDistribution1DCauchyItem::FTDistribution1DCauchyItem() : FTDistribution1DItem("FTDistribution1DCauchy") { - setToolTip(QStringLiteral("One-dimensional Cauchy probability distribution")); + setToolTip("One-dimensional Cauchy probability distribution"); add_omega_property(); } @@ -44,7 +43,7 @@ std::unique_ptr<IFTDistribution1D> FTDistribution1DCauchyItem::createFTDistribut FTDistribution1DGaussItem::FTDistribution1DGaussItem() : FTDistribution1DItem("FTDistribution1DGauss") { - setToolTip(QStringLiteral("One-dimensional Gauss probability distribution")); + setToolTip("One-dimensional Gauss probability distribution"); add_omega_property(); } @@ -57,7 +56,7 @@ std::unique_ptr<IFTDistribution1D> FTDistribution1DGaussItem::createFTDistributi FTDistribution1DGateItem::FTDistribution1DGateItem() : FTDistribution1DItem("FTDistribution1DGate") { - setToolTip(QStringLiteral("One-dimensional Gate probability distribution")); + setToolTip("One-dimensional Gate probability distribution"); add_omega_property(); } @@ -71,7 +70,7 @@ std::unique_ptr<IFTDistribution1D> FTDistribution1DGateItem::createFTDistributio FTDistribution1DTriangleItem::FTDistribution1DTriangleItem() : FTDistribution1DItem("FTDistribution1DTriangle") { - setToolTip(QStringLiteral("One-dimensional triangle probability distribution")); + setToolTip("One-dimensional triangle probability distribution"); add_omega_property(); } @@ -85,7 +84,7 @@ std::unique_ptr<IFTDistribution1D> FTDistribution1DTriangleItem::createFTDistrib FTDistribution1DCosineItem::FTDistribution1DCosineItem() : FTDistribution1DItem("FTDistribution1DCosine") { - setToolTip(QStringLiteral("One-dimensional Cosine probability distribution")); + setToolTip("One-dimensional Cosine probability distribution"); add_omega_property(); } @@ -101,12 +100,11 @@ const QString FTDistribution1DVoigtItem::P_ETA = QString::fromStdString("Eta"); FTDistribution1DVoigtItem::FTDistribution1DVoigtItem() : FTDistribution1DItem("FTDistribution1DVoigt") { - setToolTip(QStringLiteral("One-dimensional pseudo-Voigt probability distribution")); + setToolTip("One-dimensional pseudo-Voigt probability distribution"); add_omega_property(); addProperty(P_ETA, 0.5) ->setLimits(RealLimits::limited(0.0, 1.0)) - .setToolTip(QStringLiteral( - "Parameter [0,1] to balance between Cauchy (eta=0.0) and Gauss (eta=1.0)")); + .setToolTip("Parameter [0,1] to balance between Cauchy (eta=0.0) and Gauss (eta=1.0)"); } std::unique_ptr<IFTDistribution1D> FTDistribution1DVoigtItem::createFTDistribution() const @@ -126,19 +124,16 @@ FTDistribution2DItem::FTDistribution2DItem(const QString& name) : SessionItem(na void FTDistribution2DItem::add_omega_properties() { addProperty(P_OMEGA_X, 1.0) - ->setToolTip( - QStringLiteral("Half-width of the distribution along its x-axis in nanometers")); + ->setToolTip("Half-width of the distribution along its x-axis in nanometers"); addProperty(P_OMEGA_Y, 1.0) - ->setToolTip( - QStringLiteral("Half-width of the distribution along its y-axis in nanometers")); + ->setToolTip("Half-width of the distribution along its y-axis in nanometers"); } void FTDistribution2DItem::add_gamma_property() { addProperty(P_GAMMA, 0.0) - ->setToolTip( - QStringLiteral("Angle in direct space between " - "first lattice vector \nand x-axis of the distribution in degrees")); + ->setToolTip("Angle in direct space between " + "first lattice vector \nand x-axis of the distribution in degrees"); } void FTDistribution2DItem::add_properties() @@ -152,7 +147,7 @@ void FTDistribution2DItem::add_properties() FTDistribution2DCauchyItem::FTDistribution2DCauchyItem() : FTDistribution2DItem("FTDistribution2DCauchy") { - setToolTip(QStringLiteral("Two-dimensional Cauchy probability distribution")); + setToolTip("Two-dimensional Cauchy probability distribution"); add_properties(); } @@ -168,7 +163,7 @@ std::unique_ptr<IFTDistribution2D> FTDistribution2DCauchyItem::createFTDistribut FTDistribution2DGaussItem::FTDistribution2DGaussItem() : FTDistribution2DItem("FTDistribution2DGauss") { - setToolTip(QStringLiteral("Two-dimensional Gauss probability distribution")); + setToolTip("Two-dimensional Gauss probability distribution"); add_properties(); } @@ -183,7 +178,7 @@ std::unique_ptr<IFTDistribution2D> FTDistribution2DGaussItem::createFTDistributi FTDistribution2DGateItem::FTDistribution2DGateItem() : FTDistribution2DItem("FTDistribution2DGate") { - setToolTip(QStringLiteral("Two-dimensional Gate probability distribution")); + setToolTip("Two-dimensional Gate probability distribution"); add_properties(); } @@ -198,7 +193,7 @@ std::unique_ptr<IFTDistribution2D> FTDistribution2DGateItem::createFTDistributio FTDistribution2DConeItem::FTDistribution2DConeItem() : FTDistribution2DItem("FTDistribution2DCone") { - setToolTip(QStringLiteral("Two-dimensional Cone probability distribution")); + setToolTip("Two-dimensional Cone probability distribution"); add_properties(); } @@ -216,13 +211,12 @@ const QString FTDistribution2DVoigtItem::P_ETA = QString::fromStdString("Eta"); FTDistribution2DVoigtItem::FTDistribution2DVoigtItem() : FTDistribution2DItem("FTDistribution2DVoigt") { - setToolTip(QStringLiteral("Two-dimensional pseudo-Voigt probability distribution")); + setToolTip("Two-dimensional pseudo-Voigt probability distribution"); add_omega_properties(); addProperty(P_ETA, 0.5) ->setLimits(RealLimits::limited(0.0, 1.0)) - .setToolTip(QStringLiteral( - "Parameter [0,1] to balance between Cauchy (eta=0.0) and Gauss (eta=1.0)")); + .setToolTip("Parameter [0,1] to balance between Cauchy (eta=0.0) and Gauss (eta=1.0)"); add_gamma_property(); } diff --git a/GUI/coregui/Models/FitParameterHelper.cpp b/GUI/coregui/Models/FitParameterHelper.cpp index f10be8c4afbe86491562df5fdae503d94c62d59e..0041793242a90b4dc68e9f68d48f97e4605b05ac 100644 --- a/GUI/coregui/Models/FitParameterHelper.cpp +++ b/GUI/coregui/Models/FitParameterHelper.cpp @@ -33,7 +33,7 @@ void FitParameterHelper::createFitParameter(FitParameterContainerItem* container FitParameterItem* fitPar = dynamic_cast<FitParameterItem*>( container->model()->insertNewItem("FitParameter", container->index())); Q_ASSERT(fitPar); - fitPar->setDisplayName(QStringLiteral("par")); + fitPar->setDisplayName("par"); SessionItem* link = fitPar->model()->insertNewItem("FitParameterLink", fitPar->index()); fitPar->setItemValue(FitParameterItem::P_START_VALUE, parameterItem->value()); link->setItemValue(FitParameterLinkItem::P_LINK, getParameterItemPath(parameterItem)); diff --git a/GUI/coregui/Models/FitParameterItems.cpp b/GUI/coregui/Models/FitParameterItems.cpp index 1761d0fdadbad3b393ce3a2d084fbec3414e5dfa..4d7cc4c96a57c479a04c6253c3753529584c1cf0 100644 --- a/GUI/coregui/Models/FitParameterItems.cpp +++ b/GUI/coregui/Models/FitParameterItems.cpp @@ -27,11 +27,11 @@ namespace ComboProperty fitParameterTypeCombo() { - QStringList tooltips = QStringList() << QStringLiteral("Fixed at given value") - << QStringLiteral("Limited in the range [min, max]") - << QStringLiteral("Limited at lower bound [min, inf]") - << QStringLiteral("Limited at upper bound [-inf, max]") - << QStringLiteral("No limits imposed to parameter value"); + QStringList tooltips = QStringList() << "Fixed at given value" + << "Limited in the range [min, max]" + << "Limited at lower bound [min, inf]" + << "Limited at upper bound [-inf, max]" + << "No limits imposed to parameter value"; ComboProperty result; result << "fixed" diff --git a/GUI/coregui/Models/FitParameterProxyModel.cpp b/GUI/coregui/Models/FitParameterProxyModel.cpp index 44d2847482feb0aad9292933fee1dfbe620437b2..5a17cc2fb0d242f446e58b925181214f10fba715 100644 --- a/GUI/coregui/Models/FitParameterProxyModel.cpp +++ b/GUI/coregui/Models/FitParameterProxyModel.cpp @@ -27,14 +27,11 @@ FitParameterProxyModel::FitParameterProxyModel(FitParameterContainerItem* fitPar QObject* parent) : QAbstractItemModel(parent), m_root_item(fitParContainer) { - addColumn(PAR_NAME, QStringLiteral("Name"), QStringLiteral("Name of fit parameter")); - addColumn(PAR_TYPE, FitParameterItem::P_TYPE, QStringLiteral("Fit parameter limits type")); - addColumn(PAR_VALUE, FitParameterItem::P_START_VALUE, - QStringLiteral("Starting value of fit parameter")); - addColumn(PAR_MIN, FitParameterItem::P_MIN, - QStringLiteral("Lower bound on fit parameter value")); - addColumn(PAR_MAX, FitParameterItem::P_MAX, - QStringLiteral("Upper bound on fit parameter value")); + addColumn(PAR_NAME, "Name", "Name of fit parameter"); + addColumn(PAR_TYPE, FitParameterItem::P_TYPE, "Fit parameter limits type"); + addColumn(PAR_VALUE, FitParameterItem::P_START_VALUE, "Starting value of fit parameter"); + addColumn(PAR_MIN, FitParameterItem::P_MIN, "Lower bound on fit parameter value"); + addColumn(PAR_MAX, FitParameterItem::P_MAX, "Upper bound on fit parameter value"); connectModel(fitParContainer->model()); diff --git a/GUI/coregui/Models/FormFactorItems.cpp b/GUI/coregui/Models/FormFactorItems.cpp index 88fc7bf80e0c18550e6f112c3e09a90b5d13012a..94baca6b534420e6b6b70306ee8f183fe41a6881 100644 --- a/GUI/coregui/Models/FormFactorItems.cpp +++ b/GUI/coregui/Models/FormFactorItems.cpp @@ -18,21 +18,18 @@ /* ------------------------------------------------ */ -const QString AnisoPyramidItem::P_LENGTH = QString::fromStdString("Length"); -const QString AnisoPyramidItem::P_WIDTH = QString::fromStdString("Width"); -const QString AnisoPyramidItem::P_HEIGHT = QString::fromStdString("Height"); -const QString AnisoPyramidItem::P_ALPHA = QString::fromStdString("Alpha"); +const QString AnisoPyramidItem::P_LENGTH("Length"); +const QString AnisoPyramidItem::P_WIDTH("Width"); +const QString AnisoPyramidItem::P_HEIGHT("Height"); +const QString AnisoPyramidItem::P_ALPHA("Alpha"); AnisoPyramidItem::AnisoPyramidItem() : FormFactorItem("AnisoPyramid") { - setToolTip(QStringLiteral("A truncated pyramid with a rectangular base")); - addProperty(P_LENGTH, 20.0) - ->setToolTip(QStringLiteral("Length of the rectangular base in nanometers")); - addProperty(P_WIDTH, 16.0) - ->setToolTip(QStringLiteral("Width of the rectangular base in nanometers")); - addProperty(P_HEIGHT, 13.0)->setToolTip(QStringLiteral("Height of pyramid in nanometers")); - addProperty(P_ALPHA, 60.0) - ->setToolTip(QStringLiteral("Dihedral angle in degrees between base and facet")); + setToolTip("A truncated pyramid with a rectangular base"); + addProperty(P_LENGTH, 20.0)->setToolTip("Length of the rectangular base in nanometers"); + addProperty(P_WIDTH, 16.0)->setToolTip("Width of the rectangular base in nanometers"); + addProperty(P_HEIGHT, 13.0)->setToolTip("Height of pyramid in nanometers"); + addProperty(P_ALPHA, 60.0)->setToolTip("Dihedral angle in degrees between base and facet"); } std::unique_ptr<IFormFactor> AnisoPyramidItem::createFormFactor() const @@ -44,16 +41,16 @@ std::unique_ptr<IFormFactor> AnisoPyramidItem::createFormFactor() const /* ------------------------------------------------ */ -const QString BarGaussItem::P_LENGTH = QString::fromStdString("Length"); -const QString BarGaussItem::P_WIDTH = QString::fromStdString("Width"); -const QString BarGaussItem::P_HEIGHT = QString::fromStdString("Height"); +const QString BarGaussItem::P_LENGTH("Length"); +const QString BarGaussItem::P_WIDTH("Width"); +const QString BarGaussItem::P_HEIGHT("Height"); BarGaussItem::BarGaussItem() : FormFactorItem("BarGauss") { - setToolTip(QStringLiteral("Rectangular cuboid")); - addProperty(P_LENGTH, 20.0)->setToolTip(QStringLiteral("Length of the base in nanometers")); - addProperty(P_WIDTH, 16.0)->setToolTip(QStringLiteral("Width of the base in nanometers")); - addProperty(P_HEIGHT, 13.0)->setToolTip(QStringLiteral("Height of the box in nanometers")); + setToolTip("Rectangular cuboid"); + addProperty(P_LENGTH, 20.0)->setToolTip("Length of the base in nanometers"); + addProperty(P_WIDTH, 16.0)->setToolTip("Width of the base in nanometers"); + addProperty(P_HEIGHT, 13.0)->setToolTip("Height of the box in nanometers"); } std::unique_ptr<IFormFactor> BarGaussItem::createFormFactor() const @@ -65,16 +62,16 @@ std::unique_ptr<IFormFactor> BarGaussItem::createFormFactor() const /* ------------------------------------------------ */ -const QString BarLorentzItem::P_LENGTH = QString::fromStdString("Length"); -const QString BarLorentzItem::P_WIDTH = QString::fromStdString("Width"); -const QString BarLorentzItem::P_HEIGHT = QString::fromStdString("Height"); +const QString BarLorentzItem::P_LENGTH("Length"); +const QString BarLorentzItem::P_WIDTH("Width"); +const QString BarLorentzItem::P_HEIGHT("Height"); BarLorentzItem::BarLorentzItem() : FormFactorItem("BarLorentz") { - setToolTip(QStringLiteral("Rectangular cuboid")); - addProperty(P_LENGTH, 20.0)->setToolTip(QStringLiteral("Length of the base in nanometers")); - addProperty(P_WIDTH, 16.0)->setToolTip(QStringLiteral("Width of the base in nanometers")); - addProperty(P_HEIGHT, 13.0)->setToolTip(QStringLiteral("Height of the box in nanometers")); + setToolTip("Rectangular cuboid"); + addProperty(P_LENGTH, 20.0)->setToolTip("Length of the base in nanometers"); + addProperty(P_WIDTH, 16.0)->setToolTip("Width of the base in nanometers"); + addProperty(P_HEIGHT, 13.0)->setToolTip("Height of the box in nanometers"); } std::unique_ptr<IFormFactor> BarLorentzItem::createFormFactor() const @@ -86,16 +83,16 @@ std::unique_ptr<IFormFactor> BarLorentzItem::createFormFactor() const /* ------------------------------------------------ */ -const QString BoxItem::P_LENGTH = QString::fromStdString("Length"); -const QString BoxItem::P_WIDTH = QString::fromStdString("Width"); -const QString BoxItem::P_HEIGHT = QString::fromStdString("Height"); +const QString BoxItem::P_LENGTH("Length"); +const QString BoxItem::P_WIDTH("Width"); +const QString BoxItem::P_HEIGHT("Height"); BoxItem::BoxItem() : FormFactorItem("Box") { - setToolTip(QStringLiteral("Rectangular cuboid")); - addProperty(P_LENGTH, 20.0)->setToolTip(QStringLiteral("Length of the base in nanometers")); - addProperty(P_WIDTH, 16.0)->setToolTip(QStringLiteral("Width of the base in nanometers")); - addProperty(P_HEIGHT, 13.0)->setToolTip(QStringLiteral("Height of the box in nanometers")); + setToolTip("Rectangular cuboid"); + addProperty(P_LENGTH, 20.0)->setToolTip("Length of the base in nanometers"); + addProperty(P_WIDTH, 16.0)->setToolTip("Width of the base in nanometers"); + addProperty(P_HEIGHT, 13.0)->setToolTip("Height of the box in nanometers"); } std::unique_ptr<IFormFactor> BoxItem::createFormFactor() const @@ -107,17 +104,17 @@ std::unique_ptr<IFormFactor> BoxItem::createFormFactor() const /* ------------------------------------------------ */ -const QString ConeItem::P_RADIUS = QString::fromStdString("Radius"); -const QString ConeItem::P_HEIGHT = QString::fromStdString("Height"); -const QString ConeItem::P_ALPHA = QString::fromStdString("Alpha"); +const QString ConeItem::P_RADIUS("Radius"); +const QString ConeItem::P_HEIGHT("Height"); +const QString ConeItem::P_ALPHA("Alpha"); ConeItem::ConeItem() : FormFactorItem("Cone") { - setToolTip(QStringLiteral("Truncated cone with circular base")); - addProperty(P_RADIUS, 10.0)->setToolTip(QStringLiteral("Radius of the base in nanometers")); - addProperty(P_HEIGHT, 13.0)->setToolTip(QStringLiteral("Height of the cone in nanometers")); + setToolTip("Truncated cone with circular base"); + addProperty(P_RADIUS, 10.0)->setToolTip("Radius of the base in nanometers"); + addProperty(P_HEIGHT, 13.0)->setToolTip("Height of the cone in nanometers"); addProperty(P_ALPHA, 60.0) - ->setToolTip(QStringLiteral("Angle between the base and the side surface in degrees")); + ->setToolTip("Angle between the base and the side surface in degrees"); } std::unique_ptr<IFormFactor> ConeItem::createFormFactor() const @@ -129,19 +126,16 @@ std::unique_ptr<IFormFactor> ConeItem::createFormFactor() const /* ------------------------------------------------ */ -const QString Cone6Item::P_BASEEDGE = QString::fromStdString("BaseEdge"); -const QString Cone6Item::P_HEIGHT = QString::fromStdString("Height"); -const QString Cone6Item::P_ALPHA = QString::fromStdString("Alpha"); +const QString Cone6Item::P_BASEEDGE("BaseEdge"); +const QString Cone6Item::P_HEIGHT("Height"); +const QString Cone6Item::P_ALPHA("Alpha"); Cone6Item::Cone6Item() : FormFactorItem("Cone6") { - setToolTip(QStringLiteral("A truncated pyramid, based on a regular hexagon")); - addProperty(P_BASEEDGE, 10.0) - ->setToolTip(QStringLiteral("Edge of the regular hexagonal base in nanometers")); - addProperty(P_HEIGHT, 13.0) - ->setToolTip(QStringLiteral("Height of a truncated pyramid in nanometers")); - addProperty(P_ALPHA, 60.0) - ->setToolTip(QStringLiteral("Dihedral angle in degrees between base and facet")); + setToolTip("A truncated pyramid, based on a regular hexagon"); + addProperty(P_BASEEDGE, 10.0)->setToolTip("Edge of the regular hexagonal base in nanometers"); + addProperty(P_HEIGHT, 13.0)->setToolTip("Height of a truncated pyramid in nanometers"); + addProperty(P_ALPHA, 60.0)->setToolTip("Dihedral angle in degrees between base and facet"); } std::unique_ptr<IFormFactor> Cone6Item::createFormFactor() const @@ -153,24 +147,21 @@ std::unique_ptr<IFormFactor> Cone6Item::createFormFactor() const /* ------------------------------------------------ */ -const QString CuboctahedronItem::P_LENGTH = QString::fromStdString("Length"); -const QString CuboctahedronItem::P_HEIGHT = QString::fromStdString("Height"); -const QString CuboctahedronItem::P_HEIGHT_RATIO = QString::fromStdString("HeightRatio"); -const QString CuboctahedronItem::P_ALPHA = QString::fromStdString("Alpha"); +const QString CuboctahedronItem::P_LENGTH("Length"); +const QString CuboctahedronItem::P_HEIGHT("Height"); +const QString CuboctahedronItem::P_HEIGHT_RATIO("HeightRatio"); +const QString CuboctahedronItem::P_ALPHA("Alpha"); CuboctahedronItem::CuboctahedronItem() : FormFactorItem("Cuboctahedron") { - setToolTip(QStringLiteral("Compound of two truncated pyramids with a common square base \n" - "and opposite orientations")); - addProperty(P_LENGTH, 20.0) - ->setToolTip(QStringLiteral("Side length of the common square base in nanometers")); - addProperty(P_HEIGHT, 13.0) - ->setToolTip(QStringLiteral("Height of the lower pyramid in nanometers")); + setToolTip("Compound of two truncated pyramids with a common square base \n" + "and opposite orientations"); + addProperty(P_LENGTH, 20.0)->setToolTip("Side length of the common square base in nanometers"); + addProperty(P_HEIGHT, 13.0)->setToolTip("Height of the lower pyramid in nanometers"); addProperty(P_HEIGHT_RATIO, 0.7) ->setLimits(RealLimits::lowerLimited(0.0)) - .setToolTip(QStringLiteral("Ratio of heights of top to bottom pyramids")); - addProperty(P_ALPHA, 60.0) - ->setToolTip(QStringLiteral("Dihedral angle in degrees between base and facets")); + .setToolTip("Ratio of heights of top to bottom pyramids"); + addProperty(P_ALPHA, 60.0)->setToolTip("Dihedral angle in degrees between base and facets"); } std::unique_ptr<IFormFactor> CuboctahedronItem::createFormFactor() const @@ -182,15 +173,14 @@ std::unique_ptr<IFormFactor> CuboctahedronItem::createFormFactor() const /* ------------------------------------------------ */ -const QString CylinderItem::P_RADIUS = QString::fromStdString("Radius"); -const QString CylinderItem::P_HEIGHT = QString::fromStdString("Height"); +const QString CylinderItem::P_RADIUS("Radius"); +const QString CylinderItem::P_HEIGHT("Height"); CylinderItem::CylinderItem() : FormFactorItem("Cylinder") { - setToolTip(QStringLiteral("Cylinder with a circular base")); - addProperty(P_RADIUS, 8.0) - ->setToolTip(QStringLiteral("Radius of the circular base in nanometers")); - addProperty(P_HEIGHT, 16.0)->setToolTip(QStringLiteral("Height of the cylinder in nanometers")); + setToolTip("Cylinder with a circular base"); + addProperty(P_RADIUS, 8.0)->setToolTip("Radius of the circular base in nanometers"); + addProperty(P_HEIGHT, 16.0)->setToolTip("Height of the cylinder in nanometers"); } std::unique_ptr<IFormFactor> CylinderItem::createFormFactor() const @@ -201,12 +191,12 @@ std::unique_ptr<IFormFactor> CylinderItem::createFormFactor() const /* ------------------------------------------------ */ -const QString DodecahedronItem::P_EDGE = QString::fromStdString("Edge"); +const QString DodecahedronItem::P_EDGE("Edge"); DodecahedronItem::DodecahedronItem() : FormFactorItem("Dodecahedron") { - setToolTip(QStringLiteral("Dodecahedron")); - addProperty(P_EDGE, 10.0)->setToolTip(QStringLiteral("Length of the edge in nanometers")); + setToolTip("Dodecahedron"); + addProperty(P_EDGE, 10.0)->setToolTip("Length of the edge in nanometers"); } std::unique_ptr<IFormFactor> DodecahedronItem::createFormFactor() const @@ -216,13 +206,12 @@ std::unique_ptr<IFormFactor> DodecahedronItem::createFormFactor() const /* ------------------------------------------------ */ -const QString DotItem::P_RADIUS = QString::fromStdString("Radius"); +const QString DotItem::P_RADIUS("Radius"); DotItem::DotItem() : FormFactorItem("Dot") { - setToolTip(QStringLiteral("A dot, with constant formfactor F(q)=4pi/3 R^3")); - addProperty(P_RADIUS, 8.0) - ->setToolTip(QStringLiteral("Radius of reference sphere in nanometers")); + setToolTip("A dot, with constant formfactor F(q)=4pi/3 R^3"); + addProperty(P_RADIUS, 8.0)->setToolTip("Radius of reference sphere in nanometers"); } std::unique_ptr<IFormFactor> DotItem::createFormFactor() const @@ -232,21 +221,18 @@ std::unique_ptr<IFormFactor> DotItem::createFormFactor() const /* ------------------------------------------------ */ -const QString EllipsoidalCylinderItem::P_RADIUS_X = QString::fromStdString("RadiusX"); -const QString EllipsoidalCylinderItem::P_RADIUS_Y = QString::fromStdString("RadiusY"); -const QString EllipsoidalCylinderItem::P_HEIGHT = QString::fromStdString("Height"); +const QString EllipsoidalCylinderItem::P_RADIUS_X("RadiusX"); +const QString EllipsoidalCylinderItem::P_RADIUS_Y("RadiusY"); +const QString EllipsoidalCylinderItem::P_HEIGHT("Height"); EllipsoidalCylinderItem::EllipsoidalCylinderItem() : FormFactorItem("EllipsoidalCylinder") { - setToolTip(QStringLiteral("Cylinder with an ellipse cross section")); + setToolTip("Cylinder with an ellipse cross section"); addProperty(P_RADIUS_X, 8.0) - ->setToolTip( - QStringLiteral("Radius of the ellipse base in the x-direction, in nanometers")); + ->setToolTip("Radius of the ellipse base in the x-direction, in nanometers"); addProperty(P_RADIUS_Y, 13.0) - ->setToolTip( - QStringLiteral("Radius of the ellipse base in the y-direction, in nanometers")); - addProperty(P_HEIGHT, 16.0) - ->setToolTip(QStringLiteral("Height of the ellipsoidal cylinder in nanometers")); + ->setToolTip("Radius of the ellipse base in the y-direction, in nanometers"); + addProperty(P_HEIGHT, 16.0)->setToolTip("Height of the ellipsoidal cylinder in nanometers"); } std::unique_ptr<IFormFactor> EllipsoidalCylinderItem::createFormFactor() const @@ -258,12 +244,12 @@ std::unique_ptr<IFormFactor> EllipsoidalCylinderItem::createFormFactor() const /* ------------------------------------------------ */ -const QString FullSphereItem::P_RADIUS = QString::fromStdString("Radius"); +const QString FullSphereItem::P_RADIUS("Radius"); FullSphereItem::FullSphereItem() : FormFactorItem("FullSphere") { - setToolTip(QStringLiteral("Full sphere")); - addProperty(P_RADIUS, 8.0)->setToolTip(QStringLiteral("Radius of the sphere in nanometers")); + setToolTip("Full sphere"); + addProperty(P_RADIUS, 8.0)->setToolTip("Radius of the sphere in nanometers"); } std::unique_ptr<IFormFactor> FullSphereItem::createFormFactor() const @@ -273,17 +259,14 @@ std::unique_ptr<IFormFactor> FullSphereItem::createFormFactor() const /* ------------------------------------------------ */ -const QString FullSpheroidItem::P_RADIUS = QString::fromStdString("Radius"); -const QString FullSpheroidItem::P_HEIGHT = QString::fromStdString("Height"); +const QString FullSpheroidItem::P_RADIUS("Radius"); +const QString FullSpheroidItem::P_HEIGHT("Height"); FullSpheroidItem::FullSpheroidItem() : FormFactorItem("FullSpheroid") { - setToolTip( - QStringLiteral("Full spheroid, generated by rotating an ellipse around the vertical axis")); - addProperty(P_RADIUS, 10.0) - ->setToolTip(QStringLiteral("Radius of the circular cross section in nanometers")); - addProperty(P_HEIGHT, 13.0) - ->setToolTip(QStringLiteral("Height of the full spheroid in nanometers")); + setToolTip("Full spheroid, generated by rotating an ellipse around the vertical axis"); + addProperty(P_RADIUS, 10.0)->setToolTip("Radius of the circular cross section in nanometers"); + addProperty(P_HEIGHT, 13.0)->setToolTip("Height of the full spheroid in nanometers"); } std::unique_ptr<IFormFactor> FullSpheroidItem::createFormFactor() const @@ -294,22 +277,18 @@ std::unique_ptr<IFormFactor> FullSpheroidItem::createFormFactor() const /* ------------------------------------------------ */ -const QString HemiEllipsoidItem::P_RADIUS_X = QString::fromStdString("RadiusX"); -const QString HemiEllipsoidItem::P_RADIUS_Y = QString::fromStdString("RadiusY"); -const QString HemiEllipsoidItem::P_HEIGHT = QString::fromStdString("Height"); +const QString HemiEllipsoidItem::P_RADIUS_X("RadiusX"); +const QString HemiEllipsoidItem::P_RADIUS_Y("RadiusY"); +const QString HemiEllipsoidItem::P_HEIGHT("Height"); HemiEllipsoidItem::HemiEllipsoidItem() : FormFactorItem("HemiEllipsoid") { - setToolTip( - QStringLiteral("An horizontally oriented ellipsoid, truncated at the central plane")); + setToolTip("An horizontally oriented ellipsoid, truncated at the central plane"); addProperty(P_RADIUS_X, 10.0) - ->setToolTip( - QStringLiteral("Radius of the ellipse base in the x-direction, in nanometers")); + ->setToolTip("Radius of the ellipse base in the x-direction, in nanometers"); addProperty(P_RADIUS_Y, 6.0) - ->setToolTip( - QStringLiteral("Radius of the ellipse base in the y-direction, in nanometers")); - addProperty(P_HEIGHT, 8.0) - ->setToolTip(QStringLiteral("Height of the hemi ellipsoid in nanometers")); + ->setToolTip("Radius of the ellipse base in the y-direction, in nanometers"); + addProperty(P_HEIGHT, 8.0)->setToolTip("Height of the hemi ellipsoid in nanometers"); } std::unique_ptr<IFormFactor> HemiEllipsoidItem::createFormFactor() const @@ -321,12 +300,12 @@ std::unique_ptr<IFormFactor> HemiEllipsoidItem::createFormFactor() const /* ------------------------------------------------ */ -const QString IcosahedronItem::P_EDGE = QString::fromStdString("Edge"); +const QString IcosahedronItem::P_EDGE("Edge"); IcosahedronItem::IcosahedronItem() : FormFactorItem("Icosahedron") { - setToolTip(QStringLiteral("Icosahedron")); - addProperty(P_EDGE, 10.0)->setToolTip(QStringLiteral("Length of the edge in nanometers")); + setToolTip("Icosahedron"); + addProperty(P_EDGE, 10.0)->setToolTip("Length of the edge in nanometers"); } std::unique_ptr<IFormFactor> IcosahedronItem::createFormFactor() const @@ -336,15 +315,14 @@ std::unique_ptr<IFormFactor> IcosahedronItem::createFormFactor() const /* ------------------------------------------------ */ -const QString Prism3Item::P_BASEEDGE = QString::fromStdString("BaseEdge"); -const QString Prism3Item::P_HEIGHT = QString::fromStdString("Height"); +const QString Prism3Item::P_BASEEDGE("BaseEdge"); +const QString Prism3Item::P_HEIGHT("Height"); Prism3Item::Prism3Item() : FormFactorItem("Prism3") { - setToolTip(QStringLiteral("Prism with an equilaterial triangle base")); - addProperty(P_BASEEDGE, 10.0) - ->setToolTip(QStringLiteral("Length of the base edge in nanometers")); - addProperty(P_HEIGHT, 13.0)->setToolTip(QStringLiteral("Height in nanometers")); + setToolTip("Prism with an equilaterial triangle base"); + addProperty(P_BASEEDGE, 10.0)->setToolTip("Length of the base edge in nanometers"); + addProperty(P_HEIGHT, 13.0)->setToolTip("Height in nanometers"); } std::unique_ptr<IFormFactor> Prism3Item::createFormFactor() const @@ -355,15 +333,14 @@ std::unique_ptr<IFormFactor> Prism3Item::createFormFactor() const /* ------------------------------------------------ */ -const QString Prism6Item::P_BASEEDGE = QString::fromStdString("BaseEdge"); -const QString Prism6Item::P_HEIGHT = QString::fromStdString("Height"); +const QString Prism6Item::P_BASEEDGE("BaseEdge"); +const QString Prism6Item::P_HEIGHT("Height"); Prism6Item::Prism6Item() : FormFactorItem("Prism6") { - setToolTip(QStringLiteral("Prism with a regular hexagonal base")); - addProperty(P_BASEEDGE, 5.0) - ->setToolTip(QStringLiteral("Length of the hexagonal base in nanometers")); - addProperty(P_HEIGHT, 11.0)->setToolTip(QStringLiteral("Height in nanometers")); + setToolTip("Prism with a regular hexagonal base"); + addProperty(P_BASEEDGE, 5.0)->setToolTip("Length of the hexagonal base in nanometers"); + addProperty(P_HEIGHT, 11.0)->setToolTip("Height in nanometers"); } std::unique_ptr<IFormFactor> Prism6Item::createFormFactor() const @@ -374,18 +351,17 @@ std::unique_ptr<IFormFactor> Prism6Item::createFormFactor() const /* ------------------------------------------------ */ -const QString PyramidItem::P_BASEEDGE = QString::fromStdString("BaseEdge"); -const QString PyramidItem::P_HEIGHT = QString::fromStdString("Height"); -const QString PyramidItem::P_ALPHA = QString::fromStdString("Alpha"); +const QString PyramidItem::P_BASEEDGE("BaseEdge"); +const QString PyramidItem::P_HEIGHT("Height"); +const QString PyramidItem::P_ALPHA("Alpha"); PyramidItem::PyramidItem() : FormFactorItem("Pyramid") { - setToolTip(QStringLiteral("Truncated pyramid with a square base")); - addProperty(P_BASEEDGE, 18.0) - ->setToolTip(QStringLiteral("Length of the square base in nanometers")); - addProperty(P_HEIGHT, 13.0)->setToolTip(QStringLiteral("Height of the pyramid in nanometers")); + setToolTip("Truncated pyramid with a square base"); + addProperty(P_BASEEDGE, 18.0)->setToolTip("Length of the square base in nanometers"); + addProperty(P_HEIGHT, 13.0)->setToolTip("Height of the pyramid in nanometers"); addProperty(P_ALPHA, 60.0) - ->setToolTip(QStringLiteral("Dihedral angle between the base and a side face in degrees")); + ->setToolTip("Dihedral angle between the base and a side face in degrees"); } std::unique_ptr<IFormFactor> PyramidItem::createFormFactor() const @@ -397,18 +373,16 @@ std::unique_ptr<IFormFactor> PyramidItem::createFormFactor() const /* ------------------------------------------------ */ -const QString Ripple1BoxItem::P_LENGTH = QString::fromStdString("Length"); -const QString Ripple1BoxItem::P_WIDTH = QString::fromStdString("Width"); -const QString Ripple1BoxItem::P_HEIGHT = QString::fromStdString("Height"); +const QString Ripple1BoxItem::P_LENGTH("Length"); +const QString Ripple1BoxItem::P_WIDTH("Width"); +const QString Ripple1BoxItem::P_HEIGHT("Height"); Ripple1BoxItem::Ripple1BoxItem() : FormFactorItem("Ripple1Box") { - setToolTip(QStringLiteral("Particle with a cosine profile and a rectangular base")); - addProperty(P_LENGTH, 27.0) - ->setToolTip(QStringLiteral("Length of the rectangular base in nanometers")); - addProperty(P_WIDTH, 20.0) - ->setToolTip(QStringLiteral("Width of the rectangular base in nanometers")); - addProperty(P_HEIGHT, 14.0)->setToolTip(QStringLiteral("Height of the ripple in nanometers")); + setToolTip("Particle with a cosine profile and a rectangular base"); + addProperty(P_LENGTH, 27.0)->setToolTip("Length of the rectangular base in nanometers"); + addProperty(P_WIDTH, 20.0)->setToolTip("Width of the rectangular base in nanometers"); + addProperty(P_HEIGHT, 14.0)->setToolTip("Height of the ripple in nanometers"); } std::unique_ptr<IFormFactor> Ripple1BoxItem::createFormFactor() const @@ -420,18 +394,16 @@ std::unique_ptr<IFormFactor> Ripple1BoxItem::createFormFactor() const /* ------------------------------------------------ */ -const QString Ripple1GaussItem::P_LENGTH = QString::fromStdString("Length"); -const QString Ripple1GaussItem::P_WIDTH = QString::fromStdString("Width"); -const QString Ripple1GaussItem::P_HEIGHT = QString::fromStdString("Height"); +const QString Ripple1GaussItem::P_LENGTH("Length"); +const QString Ripple1GaussItem::P_WIDTH("Width"); +const QString Ripple1GaussItem::P_HEIGHT("Height"); Ripple1GaussItem::Ripple1GaussItem() : FormFactorItem("Ripple1Gauss") { - setToolTip(QStringLiteral("Particle with a cosine profile and a rectangular base")); - addProperty(P_LENGTH, 27.0) - ->setToolTip(QStringLiteral("Length of the rectangular base in nanometers")); - addProperty(P_WIDTH, 20.0) - ->setToolTip(QStringLiteral("Width of the rectangular base in nanometers")); - addProperty(P_HEIGHT, 14.0)->setToolTip(QStringLiteral("Height of the ripple in nanometers")); + setToolTip("Particle with a cosine profile and a rectangular base"); + addProperty(P_LENGTH, 27.0)->setToolTip("Length of the rectangular base in nanometers"); + addProperty(P_WIDTH, 20.0)->setToolTip("Width of the rectangular base in nanometers"); + addProperty(P_HEIGHT, 14.0)->setToolTip("Height of the ripple in nanometers"); } std::unique_ptr<IFormFactor> Ripple1GaussItem::createFormFactor() const @@ -443,18 +415,16 @@ std::unique_ptr<IFormFactor> Ripple1GaussItem::createFormFactor() const /* ------------------------------------------------ */ -const QString Ripple1LorentzItem::P_LENGTH = QString::fromStdString("Length"); -const QString Ripple1LorentzItem::P_WIDTH = QString::fromStdString("Width"); -const QString Ripple1LorentzItem::P_HEIGHT = QString::fromStdString("Height"); +const QString Ripple1LorentzItem::P_LENGTH("Length"); +const QString Ripple1LorentzItem::P_WIDTH("Width"); +const QString Ripple1LorentzItem::P_HEIGHT("Height"); Ripple1LorentzItem::Ripple1LorentzItem() : FormFactorItem("Ripple1Lorentz") { - setToolTip(QStringLiteral("Particle with a cosine profile and a rectangular base")); - addProperty(P_LENGTH, 27.0) - ->setToolTip(QStringLiteral("Length of the rectangular base in nanometers")); - addProperty(P_WIDTH, 20.0) - ->setToolTip(QStringLiteral("Width of the rectangular base in nanometers")); - addProperty(P_HEIGHT, 14.0)->setToolTip(QStringLiteral("Height of the ripple in nanometers")); + setToolTip("Particle with a cosine profile and a rectangular base"); + addProperty(P_LENGTH, 27.0)->setToolTip("Length of the rectangular base in nanometers"); + addProperty(P_WIDTH, 20.0)->setToolTip("Width of the rectangular base in nanometers"); + addProperty(P_HEIGHT, 14.0)->setToolTip("Height of the ripple in nanometers"); } std::unique_ptr<IFormFactor> Ripple1LorentzItem::createFormFactor() const @@ -466,22 +436,19 @@ std::unique_ptr<IFormFactor> Ripple1LorentzItem::createFormFactor() const /* ------------------------------------------------ */ -const QString Ripple2BoxItem::P_LENGTH = QString::fromStdString("Length"); -const QString Ripple2BoxItem::P_WIDTH = QString::fromStdString("Width"); -const QString Ripple2BoxItem::P_HEIGHT = QString::fromStdString("Height"); -const QString Ripple2BoxItem::P_ASYMMETRY = QString::fromStdString("AsymmetryLength"); +const QString Ripple2BoxItem::P_LENGTH("Length"); +const QString Ripple2BoxItem::P_WIDTH("Width"); +const QString Ripple2BoxItem::P_HEIGHT("Height"); +const QString Ripple2BoxItem::P_ASYMMETRY("AsymmetryLength"); Ripple2BoxItem::Ripple2BoxItem() : FormFactorItem("Ripple2Box") { - setToolTip( - QStringLiteral("Particle with an asymmetric triangle profile and a rectangular base")); - addProperty(P_LENGTH, 36.0) - ->setToolTip(QStringLiteral("Length of the rectangular base in nanometers")); - addProperty(P_WIDTH, 25.0) - ->setToolTip(QStringLiteral("Width of the rectangular base in nanometers")); - addProperty(P_HEIGHT, 14.0)->setToolTip(QStringLiteral("Height of the ripple in nanometers")); + setToolTip("Particle with an asymmetric triangle profile and a rectangular base"); + addProperty(P_LENGTH, 36.0)->setToolTip("Length of the rectangular base in nanometers"); + addProperty(P_WIDTH, 25.0)->setToolTip("Width of the rectangular base in nanometers"); + addProperty(P_HEIGHT, 14.0)->setToolTip("Height of the ripple in nanometers"); addProperty(P_ASYMMETRY, 3.0) - ->setToolTip(QStringLiteral("Asymmetry length of the triangular profile in nanometers")); + ->setToolTip("Asymmetry length of the triangular profile in nanometers"); } std::unique_ptr<IFormFactor> Ripple2BoxItem::createFormFactor() const @@ -493,22 +460,19 @@ std::unique_ptr<IFormFactor> Ripple2BoxItem::createFormFactor() const /* ------------------------------------------------ */ -const QString Ripple2GaussItem::P_LENGTH = QString::fromStdString("Length"); -const QString Ripple2GaussItem::P_WIDTH = QString::fromStdString("Width"); -const QString Ripple2GaussItem::P_HEIGHT = QString::fromStdString("Height"); -const QString Ripple2GaussItem::P_ASYMMETRY = QString::fromStdString("AsymmetryLength"); +const QString Ripple2GaussItem::P_LENGTH("Length"); +const QString Ripple2GaussItem::P_WIDTH("Width"); +const QString Ripple2GaussItem::P_HEIGHT("Height"); +const QString Ripple2GaussItem::P_ASYMMETRY("AsymmetryLength"); Ripple2GaussItem::Ripple2GaussItem() : FormFactorItem("Ripple2Gauss") { - setToolTip( - QStringLiteral("Particle with an asymmetric triangle profile and a rectangular base")); - addProperty(P_LENGTH, 36.0) - ->setToolTip(QStringLiteral("Length of the rectangular base in nanometers")); - addProperty(P_WIDTH, 25.0) - ->setToolTip(QStringLiteral("Width of the rectangular base in nanometers")); - addProperty(P_HEIGHT, 14.0)->setToolTip(QStringLiteral("Height of the ripple in nanometers")); + setToolTip("Particle with an asymmetric triangle profile and a rectangular base"); + addProperty(P_LENGTH, 36.0)->setToolTip("Length of the rectangular base in nanometers"); + addProperty(P_WIDTH, 25.0)->setToolTip("Width of the rectangular base in nanometers"); + addProperty(P_HEIGHT, 14.0)->setToolTip("Height of the ripple in nanometers"); addProperty(P_ASYMMETRY, 3.0) - ->setToolTip(QStringLiteral("Asymmetry length of the triangular profile in nanometers")); + ->setToolTip("Asymmetry length of the triangular profile in nanometers"); } std::unique_ptr<IFormFactor> Ripple2GaussItem::createFormFactor() const @@ -520,22 +484,19 @@ std::unique_ptr<IFormFactor> Ripple2GaussItem::createFormFactor() const /* ------------------------------------------------ */ -const QString Ripple2LorentzItem::P_LENGTH = QString::fromStdString("Length"); -const QString Ripple2LorentzItem::P_WIDTH = QString::fromStdString("Width"); -const QString Ripple2LorentzItem::P_HEIGHT = QString::fromStdString("Height"); -const QString Ripple2LorentzItem::P_ASYMMETRY = QString::fromStdString("AsymmetryLength"); +const QString Ripple2LorentzItem::P_LENGTH("Length"); +const QString Ripple2LorentzItem::P_WIDTH("Width"); +const QString Ripple2LorentzItem::P_HEIGHT("Height"); +const QString Ripple2LorentzItem::P_ASYMMETRY("AsymmetryLength"); Ripple2LorentzItem::Ripple2LorentzItem() : FormFactorItem("Ripple2Lorentz") { - setToolTip( - QStringLiteral("Particle with an asymmetric triangle profile and a rectangular base")); - addProperty(P_LENGTH, 36.0) - ->setToolTip(QStringLiteral("Length of the rectangular base in nanometers")); - addProperty(P_WIDTH, 25.0) - ->setToolTip(QStringLiteral("Width of the rectangular base in nanometers")); - addProperty(P_HEIGHT, 14.0)->setToolTip(QStringLiteral("Height of the ripple in nanometers")); + setToolTip("Particle with an asymmetric triangle profile and a rectangular base"); + addProperty(P_LENGTH, 36.0)->setToolTip("Length of the rectangular base in nanometers"); + addProperty(P_WIDTH, 25.0)->setToolTip("Width of the rectangular base in nanometers"); + addProperty(P_HEIGHT, 14.0)->setToolTip("Height of the ripple in nanometers"); addProperty(P_ASYMMETRY, 3.0) - ->setToolTip(QStringLiteral("Asymmetry length of the triangular profile in nanometers")); + ->setToolTip("Asymmetry length of the triangular profile in nanometers"); } std::unique_ptr<IFormFactor> Ripple2LorentzItem::createFormFactor() const @@ -547,20 +508,17 @@ std::unique_ptr<IFormFactor> Ripple2LorentzItem::createFormFactor() const /* ------------------------------------------------ */ -const QString TetrahedronItem::P_BASEEDGE = QString::fromStdString("BaseEdge"); -const QString TetrahedronItem::P_HEIGHT = QString::fromStdString("Height"); -const QString TetrahedronItem::P_ALPHA = QString::fromStdString("Alpha"); +const QString TetrahedronItem::P_BASEEDGE("BaseEdge"); +const QString TetrahedronItem::P_HEIGHT("Height"); +const QString TetrahedronItem::P_ALPHA("Alpha"); TetrahedronItem::TetrahedronItem() : FormFactorItem("Tetrahedron") { - setToolTip(QStringLiteral("A truncated tethrahedron")); + setToolTip("A truncated tethrahedron"); addProperty(P_BASEEDGE, 15.0) - ->setToolTip( - QStringLiteral("Length of one edge of the equilateral triangular base in nanometers")); - addProperty(P_HEIGHT, 6.0) - ->setToolTip(QStringLiteral("Height of the tetrahedron in nanometers")); - addProperty(P_ALPHA, 60.0) - ->setToolTip(QStringLiteral("Dihedral angle in degrees between base and facet")); + ->setToolTip("Length of one edge of the equilateral triangular base in nanometers"); + addProperty(P_HEIGHT, 6.0)->setToolTip("Height of the tetrahedron in nanometers"); + addProperty(P_ALPHA, 60.0)->setToolTip("Dihedral angle in degrees between base and facet"); } std::unique_ptr<IFormFactor> TetrahedronItem::createFormFactor() const @@ -572,16 +530,15 @@ std::unique_ptr<IFormFactor> TetrahedronItem::createFormFactor() const /* ------------------------------------------------ */ -const QString TruncatedCubeItem::P_LENGTH = QString::fromStdString("Length"); -const QString TruncatedCubeItem::P_REMOVED_LENGTH = QString::fromStdString("RemovedLength"); +const QString TruncatedCubeItem::P_LENGTH("Length"); +const QString TruncatedCubeItem::P_REMOVED_LENGTH("RemovedLength"); TruncatedCubeItem::TruncatedCubeItem() : FormFactorItem("TruncatedCube") { - setToolTip(QStringLiteral("A cube whose eight vertices have been removed")); - addProperty(P_LENGTH, 15.0) - ->setToolTip(QStringLiteral("Length of the full cube's edge in nanometers")); + setToolTip("A cube whose eight vertices have been removed"); + addProperty(P_LENGTH, 15.0)->setToolTip("Length of the full cube's edge in nanometers"); addProperty(P_REMOVED_LENGTH, 6.0) - ->setToolTip(QStringLiteral("Removed length from each edge of the cube in nanometers")); + ->setToolTip("Removed length from each edge of the cube in nanometers"); } std::unique_ptr<IFormFactor> TruncatedCubeItem::createFormFactor() const @@ -592,19 +549,16 @@ std::unique_ptr<IFormFactor> TruncatedCubeItem::createFormFactor() const /* ------------------------------------------------ */ -const QString TruncatedSphereItem::P_RADIUS = QString::fromStdString("Radius"); -const QString TruncatedSphereItem::P_HEIGHT = QString::fromStdString("Height"); -const QString TruncatedSphereItem::P_REMOVED_TOP = QString::fromStdString("DeltaHeight"); +const QString TruncatedSphereItem::P_RADIUS("Radius"); +const QString TruncatedSphereItem::P_HEIGHT("Height"); +const QString TruncatedSphereItem::P_REMOVED_TOP("DeltaHeight"); TruncatedSphereItem::TruncatedSphereItem() : FormFactorItem("TruncatedSphere") { - setToolTip(QStringLiteral("Spherical dome")); - addProperty(P_RADIUS, 5.0) - ->setToolTip(QStringLiteral("Radius of the truncated sphere in nanometers")); - addProperty(P_HEIGHT, 7.0) - ->setToolTip(QStringLiteral("Height of the truncated sphere in nanometers")); - addProperty(P_REMOVED_TOP, 0.0) - ->setToolTip(QStringLiteral("Height of the removed top cap in nanometers")); + setToolTip("Spherical dome"); + addProperty(P_RADIUS, 5.0)->setToolTip("Radius of the truncated sphere in nanometers"); + addProperty(P_HEIGHT, 7.0)->setToolTip("Height of the truncated sphere in nanometers"); + addProperty(P_REMOVED_TOP, 0.0)->setToolTip("Height of the removed top cap in nanometers"); } std::unique_ptr<IFormFactor> TruncatedSphereItem::createFormFactor() const @@ -616,23 +570,19 @@ std::unique_ptr<IFormFactor> TruncatedSphereItem::createFormFactor() const /* ------------------------------------------------ */ -const QString TruncatedSpheroidItem::P_RADIUS = QString::fromStdString("Radius"); -const QString TruncatedSpheroidItem::P_HEIGHT = QString::fromStdString("Height"); -const QString TruncatedSpheroidItem::P_HFC = QString::fromStdString("HeightFlattening"); -const QString TruncatedSpheroidItem::P_REMOVED_TOP = QString::fromStdString("DeltaHeight"); +const QString TruncatedSpheroidItem::P_RADIUS("Radius"); +const QString TruncatedSpheroidItem::P_HEIGHT("Height"); +const QString TruncatedSpheroidItem::P_HFC("HeightFlattening"); +const QString TruncatedSpheroidItem::P_REMOVED_TOP("DeltaHeight"); TruncatedSpheroidItem::TruncatedSpheroidItem() : FormFactorItem("TruncatedSpheroid") { - setToolTip(QStringLiteral("Spheroidal dome")); - addProperty(P_RADIUS, 7.5) - ->setToolTip(QStringLiteral("Radius of the truncated spheroid in nanometers")); - addProperty(P_HEIGHT, 9.0) - ->setToolTip(QStringLiteral("Height of the truncated spheroid in nanometers")); + setToolTip("Spheroidal dome"); + addProperty(P_RADIUS, 7.5)->setToolTip("Radius of the truncated spheroid in nanometers"); + addProperty(P_HEIGHT, 9.0)->setToolTip("Height of the truncated spheroid in nanometers"); addProperty(P_HFC, 1.2) - ->setToolTip(QStringLiteral( - "Ratio of the height of the corresponding full spheroid to its diameter")); - addProperty(P_REMOVED_TOP, 0.0) - ->setToolTip(QStringLiteral("Height of the removed top cap in nanometers")); + ->setToolTip("Ratio of the height of the corresponding full spheroid to its diameter"); + addProperty(P_REMOVED_TOP, 0.0)->setToolTip("Height of the removed top cap in nanometers"); } std::unique_ptr<IFormFactor> TruncatedSpheroidItem::createFormFactor() const diff --git a/GUI/coregui/Models/InstrumentItems.cpp b/GUI/coregui/Models/InstrumentItems.cpp index e3d2c139765c8f7e7c27bee580a59267d159acae..4c7981a09e37a065b107254fb6e726c04277d640 100644 --- a/GUI/coregui/Models/InstrumentItems.cpp +++ b/GUI/coregui/Models/InstrumentItems.cpp @@ -50,7 +50,7 @@ QStringList InstrumentItem::translateList(const QStringList& list) const result = SessionItem::translateList(list); if (instrument_names.contains(result.back())) { result.removeLast(); - result << QStringLiteral("Instrument"); + result << "Instrument"; } } return result; diff --git a/GUI/coregui/Models/InterferenceFunctionItems.cpp b/GUI/coregui/Models/InterferenceFunctionItems.cpp index c600d00b01929b3f06dbd9d307c2e662e43f7b52..064cac21b45f5cdd7639d38993b30e24b5c5afde 100644 --- a/GUI/coregui/Models/InterferenceFunctionItems.cpp +++ b/GUI/coregui/Models/InterferenceFunctionItems.cpp @@ -39,7 +39,7 @@ InterferenceFunctionItem::InterferenceFunctionItem(const QString& modelType) : SessionGraphicsItem(modelType) { addProperty(P_POSITION_VARIANCE, 0.0) - ->setToolTip(QStringLiteral("Variance of the position in each dimension (nm^2)")); + ->setToolTip("Variance of the position in each dimension (nm^2)"); } InterferenceFunctionItem::~InterferenceFunctionItem() {} @@ -58,14 +58,13 @@ const QString InterferenceFunction1DLatticeItem::P_DECAY_FUNCTION = decay_functi InterferenceFunction1DLatticeItem::InterferenceFunction1DLatticeItem() : InterferenceFunctionItem("Interference1DLattice") { - setToolTip(QStringLiteral("Interference function of a 1D lattice")); - addProperty(P_LENGTH, 20.0 * Units::nanometer) - ->setToolTip(QStringLiteral("Lattice length in nanometers")); + setToolTip("Interference function of a 1D lattice"); + addProperty(P_LENGTH, 20.0 * Units::nanometer)->setToolTip("Lattice length in nanometers"); addProperty(P_ROTATION_ANGLE, 0.0) - ->setToolTip(QStringLiteral("Rotation of lattice with respect to x-axis of reference \n" - "frame (beam direction) in degrees ")); + ->setToolTip("Rotation of lattice with respect to x-axis of reference \n" + "frame (beam direction) in degrees "); addGroupProperty(P_DECAY_FUNCTION, "Decay function 1D") - ->setToolTip(QStringLiteral("One-dimensional decay function (finite size effects)")); + ->setToolTip("One-dimensional decay function (finite size effects)"); } std::unique_ptr<IInterferenceFunction> @@ -90,12 +89,12 @@ const QString InterferenceFunction2DLatticeItem::P_XI_INTEGRATION = "Integration InterferenceFunction2DLatticeItem::InterferenceFunction2DLatticeItem() : InterferenceFunctionItem("Interference2DLattice") { - setToolTip(QStringLiteral("Interference function of a 2D lattice")); + setToolTip("Interference function of a 2D lattice"); addGroupProperty(P_LATTICE_TYPE, "Lattice group")->setToolTip("Type of lattice"); addGroupProperty(P_DECAY_FUNCTION, "Decay function 2D") ->setToolTip("Two-dimensional decay function (finite size effects)"); addProperty(P_XI_INTEGRATION, false) - ->setToolTip(QStringLiteral("Enables/disables averaging over the lattice rotation angle.")); + ->setToolTip("Enables/disables averaging over the lattice rotation angle."); mapper()->setOnPropertyChange([this](const QString& name) { if (name == P_XI_INTEGRATION && isTag(InterferenceFunction2DLatticeItem::P_LATTICE_TYPE)) { @@ -149,30 +148,27 @@ const QString InterferenceFunction2DParaCrystalItem::P_PDF2 = "PDF #2"; InterferenceFunction2DParaCrystalItem::InterferenceFunction2DParaCrystalItem() : InterferenceFunctionItem("Interference2DParaCrystal") { - setToolTip(QStringLiteral("Interference function of a two-dimensional paracrystal")); + setToolTip("Interference function of a two-dimensional paracrystal"); addGroupProperty(InterferenceFunction2DLatticeItem::P_LATTICE_TYPE, "Lattice group") - ->setToolTip(QStringLiteral("Type of lattice")); + ->setToolTip("Type of lattice"); getGroupItem(InterferenceFunction2DLatticeItem::P_LATTICE_TYPE) ->getItem(Lattice2DItem::P_LATTICE_ROTATION_ANGLE) ->setEnabled(false); addProperty(P_XI_INTEGRATION, true) - ->setToolTip(QStringLiteral("Enables/disables averaging over the lattice rotation angle.")); + ->setToolTip("Enables/disables averaging over the lattice rotation angle."); addProperty(P_DAMPING_LENGTH, 0.0) - ->setToolTip( - QStringLiteral("The damping (coherence) length of the paracrystal in nanometers")); + ->setToolTip("The damping (coherence) length of the paracrystal in nanometers"); addProperty(P_DOMAIN_SIZE1, 20.0 * Units::micrometer) - ->setToolTip(QStringLiteral( - "Size of the coherent domain along the first basis vector in nanometers")); + ->setToolTip("Size of the coherent domain along the first basis vector in nanometers"); addProperty(P_DOMAIN_SIZE2, 20.0 * Units::micrometer) - ->setToolTip(QStringLiteral( - "Size of the coherent domain along the second basis vector in nanometers")); + ->setToolTip("Size of the coherent domain along the second basis vector in nanometers"); addGroupProperty(P_PDF1, "PDF 2D") - ->setToolTip(QStringLiteral("Probability distribution in first lattice direction")); + ->setToolTip("Probability distribution in first lattice direction"); addGroupProperty(P_PDF2, "PDF 2D") - ->setToolTip(QStringLiteral("Probability distribution in second lattice direction")); + ->setToolTip("Probability distribution in second lattice direction"); mapper()->setOnPropertyChange([this](const QString& name) { if (name == P_XI_INTEGRATION && isTag(InterferenceFunction2DLatticeItem::P_LATTICE_TYPE)) { @@ -257,15 +253,13 @@ const QString InterferenceFunctionFinite2DLatticeItem::P_DOMAIN_SIZE_2 = "Domain InterferenceFunctionFinite2DLatticeItem::InterferenceFunctionFinite2DLatticeItem() : InterferenceFunctionItem("InterferenceFinite2DLattice") { - setToolTip(QStringLiteral("Interference function of a finite 2D lattice")); + setToolTip("Interference function of a finite 2D lattice"); addGroupProperty(InterferenceFunction2DLatticeItem::P_LATTICE_TYPE, "Lattice group") ->setToolTip("Type of lattice"); addProperty(P_XI_INTEGRATION, false) - ->setToolTip(QStringLiteral("Enables/disables averaging over the lattice rotation angle.")); - addProperty(P_DOMAIN_SIZE_1, 100u) - ->setToolTip(QStringLiteral("Domain size 1 in number of unit cells")); - addProperty(P_DOMAIN_SIZE_2, 100u) - ->setToolTip(QStringLiteral("Domain size 2 in number of unit cells")); + ->setToolTip("Enables/disables averaging over the lattice rotation angle."); + addProperty(P_DOMAIN_SIZE_1, 100u)->setToolTip("Domain size 1 in number of unit cells"); + addProperty(P_DOMAIN_SIZE_2, 100u)->setToolTip("Domain size 2 in number of unit cells"); mapper()->setOnPropertyChange([this](const QString& name) { if (name == P_XI_INTEGRATION && isTag(InterferenceFunction2DLatticeItem::P_LATTICE_TYPE)) { @@ -313,11 +307,9 @@ const QString InterferenceFunctionHardDiskItem::P_DENSITY = InterferenceFunctionHardDiskItem::InterferenceFunctionHardDiskItem() : InterferenceFunctionItem("InterferenceHardDisk") { - setToolTip(QStringLiteral("Interference function for hard disk Percus-Yevick")); - addProperty(P_RADIUS, 5.0 * Units::nanometer) - ->setToolTip(QStringLiteral("Hard disk radius in nanometers")); - addProperty(P_DENSITY, 0.002) - ->setToolTip(QStringLiteral("Particle density in particles per square nanometer")); + setToolTip("Interference function for hard disk Percus-Yevick"); + addProperty(P_RADIUS, 5.0 * Units::nanometer)->setToolTip("Hard disk radius in nanometers"); + addProperty(P_DENSITY, 0.002)->setToolTip("Particle density in particles per square nanometer"); } std::unique_ptr<IInterferenceFunction> @@ -344,20 +336,19 @@ const QString InterferenceFunctionRadialParaCrystalItem::P_PDF = "PDF"; InterferenceFunctionRadialParaCrystalItem::InterferenceFunctionRadialParaCrystalItem() : InterferenceFunctionItem("InterferenceRadialParaCrystal") { - setToolTip(QStringLiteral("Interference function of a radial paracrystal")); + setToolTip("Interference function of a radial paracrystal"); addProperty(P_PEAK_DISTANCE, 20.0 * Units::nanometer) - ->setToolTip(QStringLiteral("Average distance to the next neighbor in nanometers")); + ->setToolTip("Average distance to the next neighbor in nanometers"); addProperty(P_DAMPING_LENGTH, 1000.0 * Units::nanometer) - ->setToolTip(QStringLiteral("The damping (coherence) length of the paracrystal " - "in nanometers")); + ->setToolTip("The damping (coherence) length of the paracrystal " + "in nanometers"); addProperty(P_DOMAIN_SIZE, 0.0) - ->setToolTip(QStringLiteral("Size of coherence domain along the lattice main axis " - "in nanometers")); + ->setToolTip("Size of coherence domain along the lattice main axis " + "in nanometers"); addProperty(P_KAPPA, 0.0) - ->setToolTip(QStringLiteral("Size spacing coupling parameter of the Size Spacing " - "Correlation Approximation")); - addGroupProperty(P_PDF, "PDF 1D") - ->setToolTip(QStringLiteral("One-dimensional probability distribution")); + ->setToolTip("Size spacing coupling parameter of the Size Spacing " + "Correlation Approximation"); + addGroupProperty(P_PDF, "PDF 1D")->setToolTip("One-dimensional probability distribution"); } std::unique_ptr<IInterferenceFunction> diff --git a/GUI/coregui/Models/JobItem.cpp b/GUI/coregui/Models/JobItem.cpp index d6433146514e41b26512954f2e068f7fbd3c28b6..6d624d30df641a4255005db101586aff2a856c36 100644 --- a/GUI/coregui/Models/JobItem.cpp +++ b/GUI/coregui/Models/JobItem.cpp @@ -65,7 +65,7 @@ JobItem::JobItem() : SessionItem("JobItem") auto durationItem = addProperty(P_DURATION, QString()); durationItem->setEditable(false); - durationItem->setToolTip(QStringLiteral("Duration of DWBA simulation in sec.msec format")); + durationItem->setToolTip("Duration of DWBA simulation in sec.msec format"); addProperty(P_COMMENTS, QString())->setVisible(false); addProperty(P_PROGRESS, 0)->setVisible(false); diff --git a/GUI/coregui/Models/Lattice2DItems.cpp b/GUI/coregui/Models/Lattice2DItems.cpp index 76f7e5df6889ab86e348d038eaee574e139d147e..be935b34ea39c2ffe5fb198e10a7c24aa5c8d1c1 100644 --- a/GUI/coregui/Models/Lattice2DItems.cpp +++ b/GUI/coregui/Models/Lattice2DItems.cpp @@ -38,13 +38,12 @@ const QString BasicLatticeItem::P_LATTICE_ANGLE = QString::fromStdString("Alpha" BasicLatticeItem::BasicLatticeItem() : Lattice2DItem("BasicLattice") { - setToolTip(QStringLiteral("Two dimensional lattice")); + setToolTip("Two dimensional lattice"); addProperty(P_LATTICE_LENGTH1, 20.0) - ->setToolTip(QStringLiteral("Length of first lattice vector in nanometers")); + ->setToolTip("Length of first lattice vector in nanometers"); addProperty(P_LATTICE_LENGTH2, 20.0) - ->setToolTip(QStringLiteral("Length of second lattice vector in nanometers")); - addProperty(P_LATTICE_ANGLE, 90.0) - ->setToolTip(QStringLiteral("Angle between lattice vectors in degrees")); + ->setToolTip("Length of second lattice vector in nanometers"); + addProperty(P_LATTICE_ANGLE, 90.0)->setToolTip("Angle between lattice vectors in degrees"); addProperty(Lattice2DItem::P_LATTICE_ROTATION_ANGLE, 0.0)->setToolTip(axis_rotation_tooltip); } @@ -63,7 +62,7 @@ const QString SquareLatticeItem::P_LATTICE_LENGTH = QString::fromStdString("Latt SquareLatticeItem::SquareLatticeItem() : Lattice2DItem("SquareLattice") { addProperty(P_LATTICE_LENGTH, 20.0) - ->setToolTip(QStringLiteral("Length of first and second lattice vectors in nanometers")); + ->setToolTip("Length of first and second lattice vectors in nanometers"); addProperty(Lattice2DItem::P_LATTICE_ROTATION_ANGLE, 0.0)->setToolTip(axis_rotation_tooltip); } @@ -81,7 +80,7 @@ const QString HexagonalLatticeItem::P_LATTICE_LENGTH = QString::fromStdString("L HexagonalLatticeItem::HexagonalLatticeItem() : Lattice2DItem("HexagonalLattice") { addProperty(P_LATTICE_LENGTH, 20.0) - ->setToolTip(QStringLiteral("Length of first and second lattice vectors in nanometers")); + ->setToolTip("Length of first and second lattice vectors in nanometers"); addProperty(Lattice2DItem::P_LATTICE_ROTATION_ANGLE, 0.0)->setToolTip(axis_rotation_tooltip); } diff --git a/GUI/coregui/Models/LayerItem.cpp b/GUI/coregui/Models/LayerItem.cpp index 22b2a3f39154b0aa722bb2091960e797d6b72a43..a2fbae90d089c3fa36b24331c26ec6c20b573e45 100644 --- a/GUI/coregui/Models/LayerItem.cpp +++ b/GUI/coregui/Models/LayerItem.cpp @@ -30,21 +30,20 @@ const QString LayerItem::T_LAYOUTS = "Layout tag"; LayerItem::LayerItem() : SessionGraphicsItem("Layer") { - setToolTip(QStringLiteral("A layer with thickness and material")); + setToolTip("A layer with thickness and material"); addProperty(P_THICKNESS, 0.0) ->setLimits(RealLimits::lowerLimited(0.0)) - .setToolTip(QStringLiteral("Thickness of a layer in nanometers")); + .setToolTip("Thickness of a layer in nanometers"); addProperty(P_MATERIAL, MaterialItemUtils::defaultMaterialProperty().variant()) - ->setToolTip(QStringLiteral("Material the layer is made of")) + ->setToolTip("Material the layer is made of") .setEditorType("ExtMaterialEditor"); addProperty(P_NSLICES, 1) ->setLimits(RealLimits::lowerLimited(0.0)) .setToolTip(layer_nslices_tooltip); - addGroupProperty(P_ROUGHNESS, "Roughness") - ->setToolTip(QStringLiteral("Roughness of top interface")); + addGroupProperty(P_ROUGHNESS, "Roughness")->setToolTip("Roughness of top interface"); registerTag(T_LAYOUTS, 0, -1, QStringList() << "ParticleLayout"); setDefaultTag(T_LAYOUTS); diff --git a/GUI/coregui/Models/LayerRoughnessItems.cpp b/GUI/coregui/Models/LayerRoughnessItems.cpp index 14f3b5c2e3aceaf98ec59d59a4bcf16b39ec703b..6fe78ca2a22df1ae7fba7b41cb1f4cbc671d8ec9 100644 --- a/GUI/coregui/Models/LayerRoughnessItems.cpp +++ b/GUI/coregui/Models/LayerRoughnessItems.cpp @@ -30,10 +30,10 @@ const QString LayerBasicRoughnessItem::P_LATERAL_CORR_LENGTH = LayerBasicRoughnessItem::LayerBasicRoughnessItem() : SessionItem("LayerBasicRoughness") { - setToolTip(QStringLiteral("A roughness of interface between two layers.")); - addProperty(P_SIGMA, 1.0)->setToolTip(QStringLiteral("rms of the roughness in nanometers")); + setToolTip("A roughness of interface between two layers."); + addProperty(P_SIGMA, 1.0)->setToolTip("rms of the roughness in nanometers"); addProperty(P_HURST, 0.3)->setLimits(RealLimits::limited(0.0, 1.0)).setToolTip(hurst_tooltip); getItem(P_HURST)->setDecimals(3); addProperty(P_LATERAL_CORR_LENGTH, 5.0) - ->setToolTip(QStringLiteral("Lateral correlation length of the roughness in nanometers")); + ->setToolTip("Lateral correlation length of the roughness in nanometers"); } diff --git a/GUI/coregui/Models/MesoCrystalItem.cpp b/GUI/coregui/Models/MesoCrystalItem.cpp index e211046c7abc519186a286cabfc129d40fc9f953..ac57f76980b42dc06b64ba10a22421257fddf92d 100644 --- a/GUI/coregui/Models/MesoCrystalItem.cpp +++ b/GUI/coregui/Models/MesoCrystalItem.cpp @@ -62,7 +62,7 @@ const QString MesoCrystalItem::P_VECTOR_C = "Third lattice vector"; MesoCrystalItem::MesoCrystalItem() : SessionGraphicsItem("MesoCrystal") { - setToolTip(QStringLiteral("A 3D crystal structure of nanoparticles")); + setToolTip("A 3D crystal structure of nanoparticles"); addGroupProperty(P_OUTER_SHAPE, "Form Factor"); diff --git a/GUI/coregui/Models/MinimizerItem.cpp b/GUI/coregui/Models/MinimizerItem.cpp index bbfa72649c9651bf03fa20e06d652aec29be82f2..fd544658e896e6fcce9f268a0ad9493426b027ff 100644 --- a/GUI/coregui/Models/MinimizerItem.cpp +++ b/GUI/coregui/Models/MinimizerItem.cpp @@ -33,8 +33,7 @@ const QString MinimizerContainerItem::P_NORM = "Norm function"; MinimizerContainerItem::MinimizerContainerItem() : MinimizerItem("MinimizerContainer") { - addGroupProperty(P_MINIMIZERS, "Minimizer library group") - ->setToolTip(QStringLiteral("Minimizer library")); + addGroupProperty(P_MINIMIZERS, "Minimizer library group")->setToolTip("Minimizer library"); ComboProperty metric_combo; for (auto& item : ObjectiveMetricUtils::metricNames()) diff --git a/GUI/coregui/Models/ModelMapper.h b/GUI/coregui/Models/ModelMapper.h index d1db2bfba10e657a4e57cf823b9b14bffa00d87c..30fe3de54301b1dfdefb239de1d27901bf2536e6 100644 --- a/GUI/coregui/Models/ModelMapper.h +++ b/GUI/coregui/Models/ModelMapper.h @@ -59,7 +59,7 @@ public: public slots: void onDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight, - const QVector<int>& roles = QVector<int>()); + const QVector<int>& roles = {}); void onRowsInserted(const QModelIndex& parent, int first, int last); diff --git a/GUI/coregui/Models/MultiLayerItem.cpp b/GUI/coregui/Models/MultiLayerItem.cpp index 3955a3ae82c0a5003873491dcd983de05de8fb19..1ef82cde915d5271e075ef1a4e11ee91a16e9e9e 100644 --- a/GUI/coregui/Models/MultiLayerItem.cpp +++ b/GUI/coregui/Models/MultiLayerItem.cpp @@ -28,13 +28,13 @@ const QString MultiLayerItem::T_LAYERS = "Layer tag"; MultiLayerItem::MultiLayerItem() : SessionGraphicsItem("MultiLayer") { - setToolTip(QStringLiteral("A multilayer to hold stack of layers")); + setToolTip("A multilayer to hold stack of layers"); setItemName("MultiLayer"); addProperty(P_CROSS_CORR_LENGTH, 0.0) ->setDecimals(5) - .setToolTip(QStringLiteral("Cross correlation length of roughnesses \n" - "between interfaces in nanometers")); + .setToolTip("Cross correlation length of roughnesses \n" + "between interfaces in nanometers"); addGroupProperty(P_EXTERNAL_FIELD, "Vector")->setToolTip(external_field_tooltip); registerTag(T_LAYERS, 0, -1, QStringList() << "Layer"); diff --git a/GUI/coregui/Models/ParameterTranslators.h b/GUI/coregui/Models/ParameterTranslators.h index d189135146c1075a5acea636515b6c4f80e7b2f4..52cfbc305dd14455f956f68620a08065dc33f5cf 100644 --- a/GUI/coregui/Models/ParameterTranslators.h +++ b/GUI/coregui/Models/ParameterTranslators.h @@ -33,11 +33,11 @@ class ModelTypeTranslator : public IPathTranslator { public: ModelTypeTranslator(QString gui_model_type, QString domain_name); - ~ModelTypeTranslator() override {} + ~ModelTypeTranslator() final {} - ModelTypeTranslator* clone() const override; + ModelTypeTranslator* clone() const final; - QStringList translate(const QStringList& list) const override; + QStringList translate(const QStringList& list) const final; private: QString m_gui_model_type; @@ -48,11 +48,11 @@ class AddElementTranslator : public IPathTranslator { public: AddElementTranslator(QString gui_name, QString additional_name); - ~AddElementTranslator() override {} + ~AddElementTranslator() final {} - AddElementTranslator* clone() const override; + AddElementTranslator* clone() const final; - QStringList translate(const QStringList& list) const override; + QStringList translate(const QStringList& list) const final; private: QString m_gui_name; @@ -62,32 +62,32 @@ private: class RotationTranslator : public IPathTranslator { public: - ~RotationTranslator() override {} + ~RotationTranslator() final {} - RotationTranslator* clone() const override { return new RotationTranslator; } + RotationTranslator* clone() const final { return new RotationTranslator; } - QStringList translate(const QStringList& list) const override; + QStringList translate(const QStringList& list) const final; }; class DistributionNoneTranslator : public IPathTranslator { public: - ~DistributionNoneTranslator() override {} + ~DistributionNoneTranslator() final {} - DistributionNoneTranslator* clone() const override { return new DistributionNoneTranslator; } + DistributionNoneTranslator* clone() const final { return new DistributionNoneTranslator; } - QStringList translate(const QStringList& list) const override; + QStringList translate(const QStringList& list) const final; }; class RoughnessTranslator : public IPathTranslator { public: RoughnessTranslator(const SessionItem* p_parent); - ~RoughnessTranslator() override {} + ~RoughnessTranslator() final {} - RoughnessTranslator* clone() const override; + RoughnessTranslator* clone() const final; - QStringList translate(const QStringList& list) const override; + QStringList translate(const QStringList& list) const final; private: int getLayerIndex(QString layerName) const; @@ -99,12 +99,12 @@ class VectorParameterTranslator : public IPathTranslator { public: VectorParameterTranslator(QString gui_name, std::string base_name, - QStringList additional_names = QStringList()); - ~VectorParameterTranslator() override {} + QStringList additional_names = {}); + ~VectorParameterTranslator() final {} - VectorParameterTranslator* clone() const override; + VectorParameterTranslator* clone() const final; - QStringList translate(const QStringList& list) const override; + QStringList translate(const QStringList& list) const final; private: QString m_gui_name; diff --git a/GUI/coregui/Models/ParticleCompositionItem.cpp b/GUI/coregui/Models/ParticleCompositionItem.cpp index f0ea0169de4f7e2998e5c51ed3c0350fba556be7..c57e3980b92828d8fb3faec5e3d97e9927121acd 100644 --- a/GUI/coregui/Models/ParticleCompositionItem.cpp +++ b/GUI/coregui/Models/ParticleCompositionItem.cpp @@ -38,7 +38,7 @@ const QString ParticleCompositionItem::T_PARTICLES = "Particle Tag"; ParticleCompositionItem::ParticleCompositionItem() : SessionGraphicsItem("ParticleComposition") { - setToolTip(QStringLiteral("Composition of particles with fixed positions")); + setToolTip("Composition of particles with fixed positions"); addProperty(ParticleItem::P_ABUNDANCE, 1.0) ->setLimits(RealLimits::limited(0.0, 1.0)) diff --git a/GUI/coregui/Models/ParticleCoreShellItem.cpp b/GUI/coregui/Models/ParticleCoreShellItem.cpp index b9f7bf596ebcf3015cf1da034600221a918a0c38..b0f28e45f544f28b2c1104a15c79015f4c4fa4a2 100644 --- a/GUI/coregui/Models/ParticleCoreShellItem.cpp +++ b/GUI/coregui/Models/ParticleCoreShellItem.cpp @@ -38,7 +38,7 @@ const QString ParticleCoreShellItem::T_SHELL = "Shell tag"; ParticleCoreShellItem::ParticleCoreShellItem() : SessionGraphicsItem("ParticleCoreShell") { - setToolTip(QStringLiteral("A particle with a core/shell geometry")); + setToolTip("A particle with a core/shell geometry"); addProperty(ParticleItem::P_ABUNDANCE, 1.0) ->setLimits(RealLimits::limited(0.0, 1.0)) diff --git a/GUI/coregui/Models/ParticleDistributionItem.cpp b/GUI/coregui/Models/ParticleDistributionItem.cpp index e62fbe7bc881c8b26f55a547b104322eedb9d5fd..44245a71e5c66857c013084ae79553d8d3691f8f 100644 --- a/GUI/coregui/Models/ParticleDistributionItem.cpp +++ b/GUI/coregui/Models/ParticleDistributionItem.cpp @@ -39,8 +39,8 @@ const QString ParticleDistributionItem::T_PARTICLES = "Particle Tag"; ParticleDistributionItem::ParticleDistributionItem() : SessionGraphicsItem("ParticleDistribution") { - setToolTip(QStringLiteral("Collection of particles obtained via parametric distribution " - "of particle prototype")); + setToolTip("Collection of particles obtained via parametric distribution " + "of particle prototype"); addProperty(ParticleItem::P_ABUNDANCE, 1.0) ->setLimits(RealLimits::limited(0.0, 1.0)) @@ -48,7 +48,7 @@ ParticleDistributionItem::ParticleDistributionItem() : SessionGraphicsItem("Part .setToolTip(abundance_tooltip); addGroupProperty(P_DISTRIBUTION, "Distribution group") - ->setToolTip(QStringLiteral("Distribution to apply to the specified parameter")); + ->setToolTip("Distribution to apply to the specified parameter"); registerTag(T_PARTICLES, 0, 1, QStringList() << "Particle" @@ -58,11 +58,10 @@ ParticleDistributionItem::ParticleDistributionItem() : SessionGraphicsItem("Part setDefaultTag(T_PARTICLES); ComboProperty par_prop; - addProperty(P_DISTRIBUTED_PARAMETER, par_prop.variant()) - ->setToolTip(QStringLiteral("Parameter to distribute")); + addProperty(P_DISTRIBUTED_PARAMETER, par_prop.variant())->setToolTip("Parameter to distribute"); addProperty(P_LINKED_PARAMETER, par_prop.variant()) - ->setToolTip(QStringLiteral("Linked parameter")) + ->setToolTip("Linked parameter") .setEditorType("MultiSelectionComboEditor"); updateMainParameterList(); diff --git a/GUI/coregui/Models/ParticleItem.cpp b/GUI/coregui/Models/ParticleItem.cpp index 293fbbff2cfcd998ea527b64b95780bc27dd35a3..f9f02dbf4547e0be04e4d43ddddd59a42e0ae1ce 100644 --- a/GUI/coregui/Models/ParticleItem.cpp +++ b/GUI/coregui/Models/ParticleItem.cpp @@ -45,7 +45,7 @@ ParticleItem::ParticleItem() : SessionGraphicsItem("Particle") { addGroupProperty(P_FORM_FACTOR, "Form Factor"); addProperty(P_MATERIAL, MaterialItemUtils::defaultMaterialProperty().variant()) - ->setToolTip(QStringLiteral("Material of particle")) + ->setToolTip("Material of particle") .setEditorType("ExtMaterialEditor"); addProperty(P_ABUNDANCE, 1.0) diff --git a/GUI/coregui/Models/ParticleLayoutItem.cpp b/GUI/coregui/Models/ParticleLayoutItem.cpp index 2e5ac0e8797d6e3651d711deba3501cf22910bcb..6a895b7c5d95af547fddd3aa14ce4024c342adb1 100644 --- a/GUI/coregui/Models/ParticleLayoutItem.cpp +++ b/GUI/coregui/Models/ParticleLayoutItem.cpp @@ -51,7 +51,7 @@ const QString ParticleLayoutItem::T_INTERFERENCE = "Interference Tag"; ParticleLayoutItem::ParticleLayoutItem() : SessionGraphicsItem("ParticleLayout") { - setToolTip(QStringLiteral("A layout of particles")); + setToolTip("A layout of particles"); addProperty(P_TOTAL_DENSITY, 0.01)->setToolTip(density_tooltip); getItem(P_TOTAL_DENSITY)->setDecimals(10); diff --git a/GUI/coregui/Models/PointwiseAxisItem.cpp b/GUI/coregui/Models/PointwiseAxisItem.cpp index b26841f5db8200674ebbe65176537425c27f6a76..e5096a0a0020db4c7bf99462c298070d4412c69f 100644 --- a/GUI/coregui/Models/PointwiseAxisItem.cpp +++ b/GUI/coregui/Models/PointwiseAxisItem.cpp @@ -32,7 +32,7 @@ PointwiseAxisItem::PointwiseAxisItem() : BasicAxisItem("PointwiseAxis"), m_instr getItem(P_MIN_DEG)->setEnabled(false); getItem(P_NBINS)->setEnabled(false); getItem(P_MAX_DEG)->setEnabled(false); - addProperty(P_FILE_NAME, QStringLiteral("undefined"))->setVisible(false); + addProperty(P_FILE_NAME, "undefined")->setVisible(false); addProperty(P_NATIVE_AXIS_UNITS, "nbins")->setVisible(false); setLastModified(QDateTime::currentDateTime()); diff --git a/GUI/coregui/Models/RealDataItem.cpp b/GUI/coregui/Models/RealDataItem.cpp index df6ea558a1fdaa5c3e5a203da7274ab9f7e393b3..3d200eec223c10dd98d363e14f36e4a9af7124ec 100644 --- a/GUI/coregui/Models/RealDataItem.cpp +++ b/GUI/coregui/Models/RealDataItem.cpp @@ -30,7 +30,7 @@ const QString RealDataItem::P_NATIVE_DATA_UNITS = "Native user data units"; RealDataItem::RealDataItem() : SessionItem("RealData"), m_linkedInstrument(nullptr) { - setItemName(QStringLiteral("undefined")); + setItemName("undefined"); // Registering this tag even without actual data item to avoid troubles in copying RealDataItem registerTag(T_INTENSITY_DATA, 1, 1, diff --git a/GUI/coregui/Models/RectangularDetectorItem.cpp b/GUI/coregui/Models/RectangularDetectorItem.cpp index 69012e80799782fee089c3727ff5a8783a549d9b..e1922e89f975ccf9d38c3b44fd5264ae3217b9b2 100644 --- a/GUI/coregui/Models/RectangularDetectorItem.cpp +++ b/GUI/coregui/Models/RectangularDetectorItem.cpp @@ -81,17 +81,15 @@ RectangularDetectorItem::RectangularDetectorItem() item->getItem(BasicAxisItem::P_TITLE)->setVisible(false); item->getItem(BasicAxisItem::P_MIN_DEG)->setVisible(false); item->setItemValue(BasicAxisItem::P_MAX_DEG, default_detector_width); - item->getItem(BasicAxisItem::P_MAX_DEG)->setDisplayName(QStringLiteral("Width [mm]")); - item->getItem(BasicAxisItem::P_MAX_DEG) - ->setToolTip(QStringLiteral("Width of the detector in mm")); + item->getItem(BasicAxisItem::P_MAX_DEG)->setDisplayName("Width [mm]"); + item->getItem(BasicAxisItem::P_MAX_DEG)->setToolTip("Width of the detector in mm"); item = addGroupProperty(P_Y_AXIS, "BasicAxis"); item->getItem(BasicAxisItem::P_TITLE)->setVisible(false); item->getItem(BasicAxisItem::P_MIN_DEG)->setVisible(false); item->setItemValue(BasicAxisItem::P_MAX_DEG, default_detector_height); - item->getItem(BasicAxisItem::P_MAX_DEG)->setDisplayName(QStringLiteral("Height [mm]")); - item->getItem(BasicAxisItem::P_MAX_DEG) - ->setToolTip(QStringLiteral("Height of the detector in mm")); + item->getItem(BasicAxisItem::P_MAX_DEG)->setDisplayName("Height [mm]"); + item->getItem(BasicAxisItem::P_MAX_DEG)->setToolTip("Height of the detector in mm"); // alignment selector addProperty(P_ALIGNMENT, alignmentCombo().variant()); @@ -114,8 +112,7 @@ RectangularDetectorItem::RectangularDetectorItem() addProperty(P_DBEAM_V0, 0.0)->setToolTip(tooltip_dbeam_v0).setLimits(RealLimits::limitless()); addProperty(P_DISTANCE, default_detector_distance) - ->setToolTip( - QStringLiteral("Distance in [mm] from the sample origin to the detector plane")); + ->setToolTip("Distance in [mm] from the sample origin to the detector plane"); register_resolution_function(); diff --git a/GUI/coregui/Models/RotationItems.cpp b/GUI/coregui/Models/RotationItems.cpp index a18b247c5043ffaccabd41dabd699e124452cdc5..423e1150f5399ed50d20e8398fc03287eb23147f 100644 --- a/GUI/coregui/Models/RotationItems.cpp +++ b/GUI/coregui/Models/RotationItems.cpp @@ -22,9 +22,8 @@ const QString XRotationItem::P_ANGLE = "Angle"; XRotationItem::XRotationItem() : RotationItem("XRotation") { - setToolTip(QStringLiteral("Particle rotation around x-axis")); - addProperty(P_ANGLE, 0.0) - ->setToolTip(QStringLiteral("Rotation angle around x-axis in degrees")); + setToolTip("Particle rotation around x-axis"); + addProperty(P_ANGLE, 0.0)->setToolTip("Rotation angle around x-axis in degrees"); } std::unique_ptr<IRotation> XRotationItem::createRotation() const @@ -39,9 +38,8 @@ const QString YRotationItem::P_ANGLE = "Angle"; YRotationItem::YRotationItem() : RotationItem("YRotation") { - setToolTip(QStringLiteral("Particle rotation around y-axis")); - addProperty(P_ANGLE, 0.0) - ->setToolTip(QStringLiteral("Rotation angle around y-axis in degrees")); + setToolTip("Particle rotation around y-axis"); + addProperty(P_ANGLE, 0.0)->setToolTip("Rotation angle around y-axis in degrees"); } std::unique_ptr<IRotation> YRotationItem::createRotation() const @@ -56,9 +54,8 @@ const QString ZRotationItem::P_ANGLE = "Angle"; ZRotationItem::ZRotationItem() : RotationItem("ZRotation") { - setToolTip(QStringLiteral("Particle rotation around z-axis")); - addProperty(P_ANGLE, 0.0) - ->setToolTip(QStringLiteral("Rotation angle around z-axis in degrees")); + setToolTip("Particle rotation around z-axis"); + addProperty(P_ANGLE, 0.0)->setToolTip("Rotation angle around z-axis in degrees"); } std::unique_ptr<IRotation> ZRotationItem::createRotation() const @@ -75,14 +72,11 @@ const QString EulerRotationItem::P_GAMMA = "Gamma"; EulerRotationItem::EulerRotationItem() : RotationItem("EulerRotation") { - setToolTip(QStringLiteral("Sequence of three rotations following Euler angles \n" - "notation z-x'-z'")); - addProperty(P_ALPHA, 0.0) - ->setToolTip(QStringLiteral("First Euler anle in z-x'-z' sequence in degrees")); - addProperty(P_BETA, 0.0) - ->setToolTip(QStringLiteral("Second Euler anle in z-x'-z' sequence in degrees")); - addProperty(P_GAMMA, 0.0) - ->setToolTip(QStringLiteral("Third Euler anle in z-x'-z' sequence in degrees")); + setToolTip("Sequence of three rotations following Euler angles \n" + "notation z-x'-z'"); + addProperty(P_ALPHA, 0.0)->setToolTip("First Euler anle in z-x'-z' sequence in degrees"); + addProperty(P_BETA, 0.0)->setToolTip("Second Euler anle in z-x'-z' sequence in degrees"); + addProperty(P_GAMMA, 0.0)->setToolTip("Third Euler anle in z-x'-z' sequence in degrees"); } std::unique_ptr<IRotation> EulerRotationItem::createRotation() const diff --git a/GUI/coregui/Models/SampleValidator.cpp b/GUI/coregui/Models/SampleValidator.cpp index 0438d5f277210e35335986fd59f5b2315f09c1a7..0379fac5807b6cf8344a901eab8b943d7d326e12 100644 --- a/GUI/coregui/Models/SampleValidator.cpp +++ b/GUI/coregui/Models/SampleValidator.cpp @@ -67,11 +67,10 @@ QString SampleValidator::validateMultiLayerItem(const SessionItem* item) QVector<SessionItem*> layers = item->getItems(MultiLayerItem::T_LAYERS); if (layers.isEmpty()) { - result = QStringLiteral("MultiLayer should contain at least one layer."); + result = "MultiLayer should contain at least one layer."; } else if (layers.size() == 1) { if (layers.front()->getItems(LayerItem::T_LAYOUTS).isEmpty()) { - result = QStringLiteral( - "The single layer in your MultiLayer should contain ParticleLayout."); + result = "The single layer in your MultiLayer should contain ParticleLayout."; } } return result; @@ -83,7 +82,7 @@ QString SampleValidator::validateParticleLayoutItem(const SessionItem* item) QVector<SessionItem*> particles = item->getItems(ParticleLayoutItem::T_PARTICLES); if (particles.isEmpty()) - result = QStringLiteral("ParticleLayout doesn't contain any particles."); + result = "ParticleLayout doesn't contain any particles."; return result; } @@ -96,7 +95,7 @@ QString SampleValidator::validateParticleCoreShellItem(const SessionItem* item) const SessionItem* shell = item->getItem(ParticleCoreShellItem::T_SHELL); if (core == nullptr || shell == nullptr) - result = QStringLiteral("ParticleCoreShell doesn't have either core or shell defined."); + result = "ParticleCoreShell doesn't have either core or shell defined."; return result; } @@ -105,7 +104,7 @@ QString SampleValidator::validateParticleCompositionItem(const SessionItem* item { QString result; if (item->getItems(ParticleCompositionItem::T_PARTICLES).isEmpty()) - result = QStringLiteral("ParticleComposition doesn't have any particles."); + result = "ParticleComposition doesn't have any particles."; return result; } @@ -114,7 +113,7 @@ QString SampleValidator::validateParticleDistributionItem(const SessionItem* ite { QString result; if (item->getItems(ParticleDistributionItem::T_PARTICLES).isEmpty()) - result = QStringLiteral("ParticleDistribution doesn't have any particle."); + result = "ParticleDistribution doesn't have any particle."; return result; } @@ -127,8 +126,8 @@ bool SampleValidator::isValidMultiLayer(const MultiLayerItem* multilayer) iterateItems(multilayer); if (!m_valid_sample) { - m_validation_message = QStringLiteral("Can't setup DWBA simulation for given MultiLayer.\n") - + m_validation_message; + m_validation_message = + "Can't setup DWBA simulation for given MultiLayer.\n" + m_validation_message; } return m_valid_sample; } diff --git a/GUI/coregui/Models/SessionItem.cpp b/GUI/coregui/Models/SessionItem.cpp index d45d80284c87d22264a5bbf904a99b0edda4c290..24d8fcf37961f2203a2e6ad8be6b7af3095120d3 100644 --- a/GUI/coregui/Models/SessionItem.cpp +++ b/GUI/coregui/Models/SessionItem.cpp @@ -25,13 +25,13 @@ const QString SessionItem::P_NAME = "Name"; //! Constructs new item with given model type. The type must be defined. SessionItem::SessionItem(const QString& modelType) - : m_parent(nullptr), m_model(nullptr), m_values(new SessionItemData), + : m_parent(nullptr), m_model(nullptr), m_properties(new SessionItemData), m_tags(new SessionItemTags) { if (modelType.isEmpty()) throw GUIHelpers::Error("SessionItem::SessionItem() -> Empty modelType."); - setData(SessionFlags::ModelTypeRole, modelType); + setRoleProperty(SessionFlags::ModelTypeRole, modelType); setDisplayName(modelType); setDecimals(3); setLimits(RealLimits::nonnegative()); @@ -363,16 +363,16 @@ SessionItem* SessionItem::getGroupItem(const QString& groupName) const //! Returns corresponding variant under given role, invalid variant when role is not present. -QVariant SessionItem::data(int role) const +QVariant SessionItem::roleProperty(int role) const { - return m_values->data(role); + return m_properties->data(role); } //! Set variant to role, create role if not present yet. -bool SessionItem::setData(int role, const QVariant& value) +bool SessionItem::setRoleProperty(int role, const QVariant& value) { - bool result = m_values->setData(role, value); + bool result = m_properties->setData(role, value); if (result) emitDataChanged(role); return result; @@ -382,7 +382,7 @@ bool SessionItem::setData(int role, const QVariant& value) QVector<int> SessionItem::getRoles() const { - return m_values->roles(); + return m_properties->roles(); } //! Notify model about data changes. @@ -399,14 +399,14 @@ void SessionItem::emitDataChanged(int role) QString SessionItem::modelType() const { - return data(SessionFlags::ModelTypeRole).toString(); + return roleProperty(SessionFlags::ModelTypeRole).toString(); } //! Get value. QVariant SessionItem::value() const { - return data(Qt::DisplayRole); + return roleProperty(Qt::DisplayRole); } //! Set value, ensure that variant types match. @@ -417,28 +417,28 @@ bool SessionItem::setValue(QVariant value) throw GUIHelpers::Error("SessionItem::setRegisteredProperty() -> Error. Type of " "previous and new variant does not coincide."); - return setData(Qt::DisplayRole, value); + return setRoleProperty(Qt::DisplayRole, value); } //! Get default tag QString SessionItem::defaultTag() const { - return data(SessionFlags::DefaultTagRole).toString(); + return roleProperty(SessionFlags::DefaultTagRole).toString(); } //! Set default tag void SessionItem::setDefaultTag(const QString& tag) { - setData(SessionFlags::DefaultTagRole, tag); + setRoleProperty(SessionFlags::DefaultTagRole, tag); } //! Get display name of item, append index if ambigue. QString SessionItem::displayName() const { - QString result = data(SessionFlags::DisplayNameRole).toString(); + QString result = roleProperty(SessionFlags::DisplayNameRole).toString(); if (modelType() == "Property" || modelType() == "GroupProperty" || modelType() == "Parameter" || modelType() == "Parameter Label") @@ -461,7 +461,7 @@ QString SessionItem::displayName() const void SessionItem::setDisplayName(const QString& display_name) { - setData(SessionFlags::DisplayNameRole, display_name); + setRoleProperty(SessionFlags::DisplayNameRole, display_name); } //! Get item name, return display name if no name is set. @@ -513,46 +513,46 @@ bool SessionItem::isEditable() const RealLimits SessionItem::limits() const { - return data(SessionFlags::LimitsRole).value<RealLimits>(); + return roleProperty(SessionFlags::LimitsRole).value<RealLimits>(); } SessionItem& SessionItem::setLimits(const RealLimits& value) { - this->setData(SessionFlags::LimitsRole, QVariant::fromValue<RealLimits>(value)); + setRoleProperty(SessionFlags::LimitsRole, QVariant::fromValue<RealLimits>(value)); return *this; } int SessionItem::decimals() const { - return data(SessionFlags::DecimalRole).toInt(); + return roleProperty(SessionFlags::DecimalRole).toInt(); } SessionItem& SessionItem::setDecimals(int n) { - setData(SessionFlags::DecimalRole, n); + setRoleProperty(SessionFlags::DecimalRole, n); return *this; } QString SessionItem::toolTip() const { - return data(Qt::ToolTipRole).toString(); + return roleProperty(Qt::ToolTipRole).toString(); } SessionItem& SessionItem::setToolTip(const QString& tooltip) { - setData(Qt::ToolTipRole, tooltip); + setRoleProperty(Qt::ToolTipRole, tooltip); return *this; } QString SessionItem::editorType() const { - auto variant = data(SessionFlags::CustomEditorRole); + auto variant = roleProperty(SessionFlags::CustomEditorRole); return variant.isValid() ? variant.toString() : "Default"; } SessionItem& SessionItem::setEditorType(const QString& editorType) { - setData(SessionFlags::CustomEditorRole, editorType); + setRoleProperty(SessionFlags::CustomEditorRole, editorType); return *this; } @@ -608,7 +608,7 @@ void SessionItem::setModel(SessionModel* model) int SessionItem::flags() const { - QVariant flags = data(SessionFlags::FlagRole); + QVariant flags = roleProperty(SessionFlags::FlagRole); if (!flags.isValid()) return SessionFlags::VISIBLE | SessionFlags::EDITABLE | SessionFlags::ENABLED; @@ -625,7 +625,7 @@ void SessionItem::changeFlags(bool enabled, int flag) else flags &= ~flag; - setData(SessionFlags::FlagRole, flags); + setRoleProperty(SessionFlags::FlagRole, flags); } //! internal diff --git a/GUI/coregui/Models/SessionItem.h b/GUI/coregui/Models/SessionItem.h index 5356a38eaf476324c41a0907b4efcb607dd5b5f1..6f5c6fdff3d61afd2a88bcab548ddf537e5a85d5 100644 --- a/GUI/coregui/Models/SessionItem.h +++ b/GUI/coregui/Models/SessionItem.h @@ -50,8 +50,7 @@ public: SessionItem* takeRow(int row); // manage and check tags - bool registerTag(const QString& name, int min = 0, int max = -1, - QStringList modelTypes = QStringList()); + bool registerTag(const QString& name, int min = 0, int max = -1, QStringList modelTypes = {}); bool isTag(const QString& name) const; SessionItemTags* sessionItemTags(); QString tagFromItem(const SessionItem* item) const; @@ -77,8 +76,8 @@ public: template <typename T> T& groupItem(const QString& groupName) const; // access data stored in roles - virtual QVariant data(int role) const; - virtual bool setData(int role, const QVariant& value); + QVariant roleProperty(int role) const; + bool setRoleProperty(int role, const QVariant& value); QVector<int> getRoles() const; void emitDataChanged(int role = Qt::DisplayRole); @@ -132,7 +131,7 @@ private: SessionItem* m_parent; SessionModel* m_model; QVector<SessionItem*> m_children; - std::unique_ptr<SessionItemData> m_values; + std::unique_ptr<SessionItemData> m_properties; std::unique_ptr<SessionItemTags> m_tags; std::unique_ptr<ModelMapper> m_mapper; QVector<IPathTranslator*> m_translators; diff --git a/GUI/coregui/Models/SessionItemData.h b/GUI/coregui/Models/SessionItemData.h index 977880754d3f31e20a9f1b67934d0af79192705d..3070b319e3762c83337af678f6e590992b575084 100644 --- a/GUI/coregui/Models/SessionItemData.h +++ b/GUI/coregui/Models/SessionItemData.h @@ -34,7 +34,7 @@ private: class ItemData { public: - ItemData(int r = -1, const QVariant& v = QVariant()); + ItemData(int r = -1, const QVariant& v = {}); int role; QVariant data; bool operator==(const ItemData& other) const; diff --git a/GUI/coregui/Models/SessionItemTags.cpp b/GUI/coregui/Models/SessionItemTags.cpp index 196ceaff52f193711b0c30223f310914c5e07897..cdd22d7e727a5d2106184248178b2fdabd571ce7 100644 --- a/GUI/coregui/Models/SessionItemTags.cpp +++ b/GUI/coregui/Models/SessionItemTags.cpp @@ -15,8 +15,6 @@ #include "GUI/coregui/Models/SessionItemTags.h" #include "GUI/coregui/utils/GUIHelpers.h" -SessionItemTags::TagInfo::TagInfo() : min(0), max(-1), childCount(0) {} - //! Register tag with given parameters. Returns true in case of success. Returns //! false if parameters are invalid or such tag was already registered. @@ -25,18 +23,9 @@ bool SessionItemTags::registerTag(const QString& name, int min, int max, { if (min < 0 || (min > max && max >= 0)) return false; - if (name.isEmpty() || isValid(name)) return false; - - TagInfo info; - info.name = name; - info.min = min; - info.max = max; - info.modelTypes = modelTypes; - - m_tags.push_back(info); - + m_tags.push_back({name, min, max, 0, modelTypes}); return true; } @@ -50,11 +39,9 @@ bool SessionItemTags::isValid(const QString& tagName, const QString& modelType) if (tag.name == tagName) { if (modelType.isEmpty()) return true; - else - return tag.modelTypes.isEmpty() ? true : tag.modelTypes.contains(modelType); + return tag.modelTypes.isEmpty() ? true : tag.modelTypes.contains(modelType); } } - return false; } @@ -73,10 +60,8 @@ int SessionItemTags::tagStartIndex(const QString& tagName) const for (const auto& tag : m_tags) { if (tag.name == tagName) return index; - else - index += tag.childCount; + index += tag.childCount; } - throw GUIHelpers::Error("SessionItemTags::tagStartIndex() -> Error. Can';t find start index"); } @@ -84,11 +69,8 @@ int SessionItemTags::tagStartIndex(const QString& tagName) const int SessionItemTags::indexFromTagRow(const QString& tagName, int row) const { - auto& tag = tagInfo(tagName); - - if (row < 0 || row >= tag.childCount) + if (row < 0 || row >= tagInfo(tagName).childCount) throw GUIHelpers::Error("SessionItemTags::tagIndexFromRow() -> Error. Wrong row"); - return tagStartIndex(tagName) + row; } @@ -99,15 +81,11 @@ int SessionItemTags::insertIndexFromTagRow(const QString& tagName, int row) { if (maximumReached(tagName)) return -1; - auto& tag = tagInfo(tagName); - if (row > tag.childCount) return -1; - if (row < 0) row = tag.childCount; - return tagStartIndex(tagName) + row; } @@ -115,14 +93,11 @@ QString SessionItemTags::tagFromIndex(int index) const { if (index < 0) return ""; - for (const auto& tag : m_tags) { if (index < tag.childCount) return tag.name; - else - index -= tag.childCount; + index -= tag.childCount; } - return ""; } @@ -141,18 +116,15 @@ void SessionItemTags::addChild(const QString& tagName) if (maximumReached(tagName)) throw GUIHelpers::Error("SessionItemTags::addChild() -> Error. Can't exceed maximum" "allowed number of children."); - tagInfo(tagName).childCount++; } void SessionItemTags::removeChild(const QString& tagName) { auto& tag = tagInfo(tagName); - if (tag.childCount == 0) throw GUIHelpers::Error("SessionItemTags::removeChild() -> Error. Attempt to remove " "unexisting child."); - tag.childCount--; } @@ -160,8 +132,7 @@ bool SessionItemTags::isSingleItemTag(const QString& tagName) { if (!isValid(tagName)) return false; - - auto& tag = tagInfo(tagName); + const auto& tag = tagInfo(tagName); return tag.min == 1 && tag.max == 1 && tag.childCount == 1; } @@ -175,16 +146,13 @@ const SessionItemTags::TagInfo& SessionItemTags::tagInfo(const QString& tagName) for (const auto& tag : m_tags) if (tag.name == tagName) return tag; - throw GUIHelpers::Error("SessionItemTags::tagInfo() -> Error. No such tag '" + tagName + "'."); } bool SessionItemTags::maximumReached(const QString& tagName) const { - auto& tag = tagInfo(tagName); - + const auto& tag = tagInfo(tagName); if (tag.max != -1 && tag.max == tag.childCount) return true; - return false; } diff --git a/GUI/coregui/Models/SessionItemTags.h b/GUI/coregui/Models/SessionItemTags.h index 0b4c7133ad3137a46dc29b61184cda3c9973c191..9884404ad59dfa65b8ec3b79f19a582e5795de6f 100644 --- a/GUI/coregui/Models/SessionItemTags.h +++ b/GUI/coregui/Models/SessionItemTags.h @@ -49,14 +49,11 @@ public: bool maximumReached(const QString& tagName) const; private: - class TagInfo - { - public: - TagInfo(); + struct TagInfo { QString name; - int min; - int max; - int childCount; + int min{0}; + int max{-1}; + int childCount{0}; QStringList modelTypes; }; diff --git a/GUI/coregui/Models/SessionItemUtils.cpp b/GUI/coregui/Models/SessionItemUtils.cpp index 2e639e1a2ae61af21cf62fbe21c150a33688b090..bde42abeb84e4e05eaea35358ce2ec03954b8706 100644 --- a/GUI/coregui/Models/SessionItemUtils.cpp +++ b/GUI/coregui/Models/SessionItemUtils.cpp @@ -28,7 +28,7 @@ namespace { const GroupInfoCatalog& groupInfoCatalog() { - static GroupInfoCatalog s_catalog = GroupInfoCatalog(); + static GroupInfoCatalog s_catalog = {}; return s_catalog; } diff --git a/GUI/coregui/Models/SessionModel.cpp b/GUI/coregui/Models/SessionModel.cpp index 96f9d89e176273db445338b7fce9c02016d0d70d..6e7b611cede50010150691ea40c58e43c1722cdd 100644 --- a/GUI/coregui/Models/SessionModel.cpp +++ b/GUI/coregui/Models/SessionModel.cpp @@ -77,7 +77,7 @@ QVariant SessionModel::data(const QModelIndex& index, int role) const if (SessionItem* item = itemForIndex(index)) { if (role == Qt::DisplayRole || role == Qt::EditRole) { if (index.column() == SessionFlags::ITEM_VALUE) - return item->data(Qt::DisplayRole); + return item->value(); if (index.column() == SessionFlags::ITEM_NAME) return item->itemName(); } else if (role == Qt::ToolTipRole) { @@ -90,7 +90,7 @@ QVariant SessionModel::data(const QModelIndex& index, int role) const } else if (role == Qt::CheckStateRole && index.column() == SessionFlags::ITEM_VALUE) { return SessionItemUtils::CheckStateRole(*item); } else { - return item->data(role); + return item->roleProperty(role); } } return QVariant(); @@ -160,7 +160,7 @@ bool SessionModel::setData(const QModelIndex& index, const QVariant& value, int QModelIndex dataIndex = index; if (SessionItem* item = itemForIndex(dataIndex)) - if (item->setData(role, value)) + if (item->setRoleProperty(role, value)) return true; return false; diff --git a/GUI/coregui/Models/SessionModel.h b/GUI/coregui/Models/SessionModel.h index 943d0d3cb15b49425750886b5e4e5498c38edd8a..d85ce74f09f47c93b995a00775232af2c8d160ce 100644 --- a/GUI/coregui/Models/SessionModel.h +++ b/GUI/coregui/Models/SessionModel.h @@ -54,8 +54,8 @@ public: // End overridden methods from QAbstractItemModel QModelIndex indexOfItem(SessionItem* item) const; - SessionItem* insertNewItem(QString model_type, const QModelIndex& parent = QModelIndex(), - int row = -1, QString tag = ""); + SessionItem* insertNewItem(QString model_type, const QModelIndex& parent = {}, int row = -1, + QString tag = ""); QString getModelTag() const; QString getModelName() const; diff --git a/GUI/coregui/Models/SessionXML.cpp b/GUI/coregui/Models/SessionXML.cpp index 8c15fc7781584fbbf6e6b2b94c4a73d513fddb3c..e68b595e0952bcbbb7b5cf406365e8d89d291d8f 100644 --- a/GUI/coregui/Models/SessionXML.cpp +++ b/GUI/coregui/Models/SessionXML.cpp @@ -54,7 +54,7 @@ void SessionXML::writeItemAndChildItems(QXmlStreamWriter* writer, const SessionI QString tag = item->parent()->tagFromItem(item); writer->writeAttribute(SessionXML::TagAttribute, tag); writer->writeAttribute(SessionXML::DisplayNameAttribute, - item->data(SessionFlags::DisplayNameRole).toString()); + item->roleProperty(SessionFlags::DisplayNameRole).toString()); for (int role : item->getRoles()) { if (role == Qt::DisplayRole || role == Qt::EditRole) SessionXML::writeVariant(writer, item->value(), role); @@ -222,7 +222,7 @@ QString SessionXML::readProperty(QXmlStreamReader* reader, SessionItem* item, } if (variant.isValid()) { - item->setData(role, variant); + item->setRoleProperty(role, variant); } return parameter_name; diff --git a/GUI/coregui/Models/SimulationOptionsItem.cpp b/GUI/coregui/Models/SimulationOptionsItem.cpp index 00392d15deb5e735c6ad558605ec266c7cd6240a..34ef0c635e66eafb739aaad500e13cfe37d90fca 100644 --- a/GUI/coregui/Models/SimulationOptionsItem.cpp +++ b/GUI/coregui/Models/SimulationOptionsItem.cpp @@ -22,10 +22,8 @@ namespace QStringList getRunPolicyTooltips() { QStringList result; - result.append(QStringLiteral( - "Start simulation immediately, switch to Jobs view automatically when completed")); - result.append( - QStringLiteral("Start simulation immediately, do not switch to Jobs view when completed")); + result.append("Start simulation immediately, switch to Jobs view automatically when completed"); + result.append("Start simulation immediately, do not switch to Jobs view when completed"); return result; } diff --git a/GUI/coregui/Models/TransformationItem.cpp b/GUI/coregui/Models/TransformationItem.cpp index d81b9ed655f5e1b14c4444d6099e3f8ca66c6fc4..0494a6ef959a5bdac2b8168a7a0728a8032ea5ea 100644 --- a/GUI/coregui/Models/TransformationItem.cpp +++ b/GUI/coregui/Models/TransformationItem.cpp @@ -18,6 +18,6 @@ const QString TransformationItem::P_ROT = "Rotation type"; TransformationItem::TransformationItem() : SessionGraphicsItem("Rotation") { - setToolTip(QStringLiteral("Rotation applied to particles")); + setToolTip("Rotation applied to particles"); addGroupProperty(P_ROT, "Rotation group"); } diff --git a/GUI/coregui/Models/VectorItem.cpp b/GUI/coregui/Models/VectorItem.cpp index 3e910d59d568ee68f6b05ce0791eacce5e323768..ee94a8c46901abd9539518e3e7be03c2f660af5f 100644 --- a/GUI/coregui/Models/VectorItem.cpp +++ b/GUI/coregui/Models/VectorItem.cpp @@ -20,15 +20,9 @@ const QString VectorItem::P_Z = "Z"; VectorItem::VectorItem() : SessionItem("Vector") { - addProperty(P_X, 0.0) - ->setLimits(RealLimits::limitless()) - .setToolTip(QStringLiteral("x-coordinate")); - addProperty(P_Y, 0.0) - ->setLimits(RealLimits::limitless()) - .setToolTip(QStringLiteral("y-coordinate")); - addProperty(P_Z, 0.0) - ->setLimits(RealLimits::limitless()) - .setToolTip(QStringLiteral("z-coordinate")); + addProperty(P_X, 0.0)->setLimits(RealLimits::limitless()).setToolTip("x-coordinate"); + addProperty(P_Y, 0.0)->setLimits(RealLimits::limitless()).setToolTip("y-coordinate"); + addProperty(P_Z, 0.0)->setLimits(RealLimits::limitless()).setToolTip("z-coordinate"); mapper()->setOnPropertyChange([this](const QString&) { updateLabel(); }); diff --git a/GUI/coregui/Views/CommonWidgets/ItemComboToolBar.h b/GUI/coregui/Views/CommonWidgets/ItemComboToolBar.h index 8e484db51c99f03c74fbae77aa73113dfb289098..0c4ae95dc48f710d61e7c97900185df3d740b3aa 100644 --- a/GUI/coregui/Views/CommonWidgets/ItemComboToolBar.h +++ b/GUI/coregui/Views/CommonWidgets/ItemComboToolBar.h @@ -35,7 +35,7 @@ public: void setPresentation(const QString& name); void setPresentationList(const QStringList& presentationList, - const QStringList& activeList = QStringList()); + const QStringList& activeList = {}); QString currentPresentation() const; diff --git a/GUI/coregui/Views/FitWidgets/FitParameterWidget.cpp b/GUI/coregui/Views/FitWidgets/FitParameterWidget.cpp index 56b204fb4da92d8f2a202f4d5e375907fcd350f1..597c44578f825e901bba60ab9240ad47c5057d93 100644 --- a/GUI/coregui/Views/FitWidgets/FitParameterWidget.cpp +++ b/GUI/coregui/Views/FitWidgets/FitParameterWidget.cpp @@ -58,7 +58,7 @@ FitParameterWidget::FitParameterWidget(QWidget* parent) SLOT(onFitParameterTreeContextMenu(const QPoint&))); m_infoLabel->setArea(m_treeView); - m_infoLabel->setText(QStringLiteral("Drop parameter(s) to fit here")); + m_infoLabel->setText("Drop parameter(s) to fit here"); } //! Sets ParameterTuningWidget to be able to provide it with context menu and steer @@ -217,13 +217,13 @@ void FitParameterWidget::subscribeToItem() void FitParameterWidget::init_actions() { - m_createFitParAction = new QAction(QStringLiteral("Create fit parameter"), this); + m_createFitParAction = new QAction("Create fit parameter", this); connect(m_createFitParAction, SIGNAL(triggered()), this, SLOT(onCreateFitParAction())); - m_removeFromFitParAction = new QAction(QStringLiteral("Remove from fit parameters"), this); + m_removeFromFitParAction = new QAction("Remove from fit parameters", this); connect(m_removeFromFitParAction, SIGNAL(triggered()), this, SLOT(onRemoveFromFitParAction())); - m_removeFitParAction = new QAction(QStringLiteral("Remove fit parameter"), this); + m_removeFitParAction = new QAction("Remove fit parameter", this); connect(m_removeFitParAction, SIGNAL(triggered()), this, SLOT(onRemoveFitParAction())); connect(m_keyboardFilter, SIGNAL(removeItem()), this, SLOT(onRemoveFitParAction())); diff --git a/GUI/coregui/Views/ImportDataWidgets/RealDataSelectorActions.cpp b/GUI/coregui/Views/ImportDataWidgets/RealDataSelectorActions.cpp index d5906fe6549b06b3309be2cca5f6c9ca9057dd0b..24c3ddbbb15b54fa9711171ac5a8f6e040dca5fd 100644 --- a/GUI/coregui/Views/ImportDataWidgets/RealDataSelectorActions.cpp +++ b/GUI/coregui/Views/ImportDataWidgets/RealDataSelectorActions.cpp @@ -86,21 +86,21 @@ RealDataSelectorActions::RealDataSelectorActions(QObject* parent) m_removeDataAction(nullptr), m_rotateDataAction(new QAction(this)), m_realDataModel(nullptr), m_selectionModel(nullptr) { - m_import2dDataAction = new QAction(QStringLiteral("Import 2D data"), parent); + m_import2dDataAction = new QAction("Import 2D data", parent); m_import2dDataAction->setIcon(QIcon(":/images/import.svg")); - m_import2dDataAction->setToolTip(QStringLiteral("Import 2D data")); + m_import2dDataAction->setToolTip("Import 2D data"); connect(m_import2dDataAction, &QAction::triggered, this, &RealDataSelectorActions::onImport2dDataAction); - m_import1dDataAction = new QAction(QStringLiteral("Import 1D data"), parent); + m_import1dDataAction = new QAction("Import 1D data", parent); m_import1dDataAction->setIcon(QIcon(":/images/import.svg")); - m_import1dDataAction->setToolTip(QStringLiteral("Import 1D data")); + m_import1dDataAction->setToolTip("Import 1D data"); connect(m_import1dDataAction, &QAction::triggered, this, &RealDataSelectorActions::onImport1dDataAction); - m_removeDataAction = new QAction(QStringLiteral("Remove this data"), parent); + m_removeDataAction = new QAction("Remove this data", parent); m_removeDataAction->setIcon(QIcon(":/images/delete.svg")); - m_removeDataAction->setToolTip(QStringLiteral("Remove selected data")); + m_removeDataAction->setToolTip("Remove selected data"); connect(m_removeDataAction, &QAction::triggered, this, &RealDataSelectorActions::onRemoveDataAction); @@ -133,8 +133,8 @@ void RealDataSelectorActions::importDataLoop(int ndim) filter_string_ba = ""; } QString dirname = AppSvc::projectManager()->userImportDir(); - QStringList fileNames = QFileDialog::getOpenFileNames( - Q_NULLPTR, QStringLiteral("Open Intensity Files"), dirname, filter_string_ba); + QStringList fileNames = + QFileDialog::getOpenFileNames(Q_NULLPTR, "Open Intensity Files", dirname, filter_string_ba); if (fileNames.isEmpty()) return; diff --git a/GUI/coregui/Views/ImportDataWidgets/RealDataSelectorToolBar.cpp b/GUI/coregui/Views/ImportDataWidgets/RealDataSelectorToolBar.cpp index 439425b9e210b5f10fd5bebcd990d3560406c9a9..fd43a836e5d1495237152f22eabbe933f37e4f88 100644 --- a/GUI/coregui/Views/ImportDataWidgets/RealDataSelectorToolBar.cpp +++ b/GUI/coregui/Views/ImportDataWidgets/RealDataSelectorToolBar.cpp @@ -22,13 +22,13 @@ RealDataSelectorToolBar::RealDataSelectorToolBar(RealDataSelectorActions* action { setMinimumSize(minimumHeight(), minimumHeight()); - m_import2dDataButton->setText(QStringLiteral("Import 2D")); + m_import2dDataButton->setText("Import 2D"); m_import2dDataButton->setIcon(QIcon(":/images/import.svg")); m_import2dDataButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); m_import2dDataButton->setToolTip("Automatic import of 2D data formats."); addWidget(m_import2dDataButton); - m_import1dDataButton->setText(QStringLiteral("Import 1D")); + m_import1dDataButton->setText("Import 1D"); m_import1dDataButton->setIcon(QIcon(":/images/import.svg")); m_import1dDataButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); m_import1dDataButton->setToolTip("Import columnwise ascii files."); diff --git a/GUI/coregui/Views/InfoWidgets/GroupInfoBox.cpp b/GUI/coregui/Views/InfoWidgets/GroupInfoBox.cpp index 3f71a81077f73116c61393c17137e14fa968c632..8f83b80525a7c7ecdd297865fe146d65f5b2a0f3 100644 --- a/GUI/coregui/Views/InfoWidgets/GroupInfoBox.cpp +++ b/GUI/coregui/Views/InfoWidgets/GroupInfoBox.cpp @@ -73,7 +73,7 @@ void GroupInfoBox::mouseMoveEvent(QMouseEvent* event) void GroupInfoBox::init_box() { setMouseTracking(true); - m_toolTipText = QStringLiteral("Gives access to the extended distribution viewer."); + m_toolTipText = "Gives access to the extended distribution viewer."; } void GroupInfoBox::paintEvent(QPaintEvent*) diff --git a/GUI/coregui/Views/InfoWidgets/WarningSign.cpp b/GUI/coregui/Views/InfoWidgets/WarningSign.cpp index 6e366050a89126978d88509edfb13690d873ce1e..4108629209e7d00cedab7d266e08b0d997bf25ce 100644 --- a/GUI/coregui/Views/InfoWidgets/WarningSign.cpp +++ b/GUI/coregui/Views/InfoWidgets/WarningSign.cpp @@ -26,8 +26,8 @@ const int ypos_offset = 40; } // namespace WarningSign::WarningSign(QWidget* parent) - : QObject(parent), m_warning_header(QStringLiteral("Houston, we have a problem.")), - m_warningWidget(0), m_area(nullptr), m_clear_just_had_happened(false) + : QObject(parent), m_warning_header("Houston, we have a problem."), m_warningWidget(0), + m_area(nullptr), m_clear_just_had_happened(false) { setArea(parent); } diff --git a/GUI/coregui/Views/InfoWidgets/WarningSignWidget.cpp b/GUI/coregui/Views/InfoWidgets/WarningSignWidget.cpp index e411ba4173adca0d28342f25e36454a4b0c7fd20..302b9d179e26d560a74af5bd944e6c7ca6f8bd80 100644 --- a/GUI/coregui/Views/InfoWidgets/WarningSignWidget.cpp +++ b/GUI/coregui/Views/InfoWidgets/WarningSignWidget.cpp @@ -18,8 +18,8 @@ #include <QRect> WarningSignWidget::WarningSignWidget(QWidget* parent) - : QWidget(parent), m_pixmap(QStringLiteral(":/images/warning@2x.png")), - m_warning_header(QStringLiteral("Houston, we have a problem.")) + : QWidget(parent), m_pixmap(":/images/warning@2x.png"), + m_warning_header("Houston, we have a problem.") { setAttribute(Qt::WA_NoSystemBackground); setToolTip(m_warning_header + "\nClick to see details."); diff --git a/GUI/coregui/Views/IntensityDataWidgets/IntensityDataCanvas.cpp b/GUI/coregui/Views/IntensityDataWidgets/IntensityDataCanvas.cpp index 07d90f439d17ecaf84761d2493dc0e5fd0340dbe..c7a4d455c3006b665c882f7708be6c63c42050c0 100644 --- a/GUI/coregui/Views/IntensityDataWidgets/IntensityDataCanvas.cpp +++ b/GUI/coregui/Views/IntensityDataWidgets/IntensityDataCanvas.cpp @@ -31,7 +31,7 @@ namespace QString group_name() { - return QStringLiteral("IntensityDataCanvas/"); + return "IntensityDataCanvas/"; } QString gradient_setting_name() { diff --git a/GUI/coregui/Views/IntensityDataWidgets/ProjectionsPlot.cpp b/GUI/coregui/Views/IntensityDataWidgets/ProjectionsPlot.cpp index 37f274090e17778909b192a29712628148edcb3a..bea0334d086bdb079b7474d830b5d352f1e15fae 100644 --- a/GUI/coregui/Views/IntensityDataWidgets/ProjectionsPlot.cpp +++ b/GUI/coregui/Views/IntensityDataWidgets/ProjectionsPlot.cpp @@ -18,7 +18,6 @@ #include "GUI/coregui/Models/AxesItems.h" #include "GUI/coregui/Models/IntensityDataItem.h" #include "GUI/coregui/Models/MaskItems.h" -#include "GUI/coregui/Models/ModelMapper.h" #include "GUI/coregui/Models/ProjectionItems.h" #include "GUI/coregui/Models/SessionItem.h" #include "GUI/coregui/Views/FitWidgets/plot_constants.h" diff --git a/GUI/coregui/Views/JobWidgets/JobSelectorActions.cpp b/GUI/coregui/Views/JobWidgets/JobSelectorActions.cpp index 7271d7601790198d8c95af42b7eaf78a43221bf1..4f61a08e3da35ce72688d28242bc1d7e6fd03f9e 100644 --- a/GUI/coregui/Views/JobWidgets/JobSelectorActions.cpp +++ b/GUI/coregui/Views/JobWidgets/JobSelectorActions.cpp @@ -27,12 +27,12 @@ JobSelectorActions::JobSelectorActions(JobModel* jobModel, QObject* parent) : QObject(parent), m_runJobAction(nullptr), m_removeJobAction(nullptr), m_selectionModel(nullptr), m_jobModel(jobModel) { - m_runJobAction = new QAction(QStringLiteral("Run"), this); + m_runJobAction = new QAction("Run", this); m_runJobAction->setIcon(QIcon(":/images/play.svg")); m_runJobAction->setToolTip("Run currently selected job"); connect(m_runJobAction, &QAction::triggered, this, &JobSelectorActions::onRunJob); - m_removeJobAction = new QAction(QStringLiteral("Remove"), this); + m_removeJobAction = new QAction("Remove", this); m_removeJobAction->setIcon(QIcon(":/images/delete.svg")); m_removeJobAction->setToolTip("Remove currently selected job."); connect(m_removeJobAction, &QAction::triggered, this, &JobSelectorActions::onRemoveJob); diff --git a/GUI/coregui/Views/JobWidgets/JobSelectorActions.h b/GUI/coregui/Views/JobWidgets/JobSelectorActions.h index f5bdbbb3f75ad13b317d2918313621a71984daf7..118114c693fe007881e1bbf3c088308bb17be80d 100644 --- a/GUI/coregui/Views/JobWidgets/JobSelectorActions.h +++ b/GUI/coregui/Views/JobWidgets/JobSelectorActions.h @@ -39,7 +39,7 @@ public: public slots: void onRunJob(); void onRemoveJob(); - void onContextMenuRequest(const QPoint& point, const QModelIndex& indexAtPoint = QModelIndex()); + void onContextMenuRequest(const QPoint& point, const QModelIndex& indexAtPoint = {}); void equalizeSelectedToJob(int selected_id); private: diff --git a/GUI/coregui/Views/JobWidgets/JobSelectorToolBar.cpp b/GUI/coregui/Views/JobWidgets/JobSelectorToolBar.cpp index 60c28992ae3cad4dd1f30e84c1cabfffde506929..7dd835fa61274aa6ca423c8938c73f68fca30137 100644 --- a/GUI/coregui/Views/JobWidgets/JobSelectorToolBar.cpp +++ b/GUI/coregui/Views/JobWidgets/JobSelectorToolBar.cpp @@ -21,7 +21,7 @@ JobSelectorToolBar::JobSelectorToolBar(JobSelectorActions* actions, QWidget* par { setMinimumSize(minimumHeight(), minimumHeight()); - m_runJobButton->setText(QStringLiteral("Run")); + m_runJobButton->setText("Run"); m_runJobButton->setIcon(QIcon(":/images/play.svg")); m_runJobButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); m_runJobButton->setToolTip("Run currently selected job"); diff --git a/GUI/coregui/Views/JobWidgets/ProjectionsEditorCanvas.cpp b/GUI/coregui/Views/JobWidgets/ProjectionsEditorCanvas.cpp index 3de091c356bb8be8571552a2c90f2db12f64652d..56ccca6b248633d6d3336aaba674958306869a99 100644 --- a/GUI/coregui/Views/JobWidgets/ProjectionsEditorCanvas.cpp +++ b/GUI/coregui/Views/JobWidgets/ProjectionsEditorCanvas.cpp @@ -30,7 +30,7 @@ ProjectionsEditorCanvas::ProjectionsEditorCanvas(QWidget* parent) m_liveProjection(nullptr), m_model(nullptr), m_intensityDataItem(nullptr), m_currentActivity(MaskEditorFlags::HORIZONTAL_LINE_MODE), m_block_update(false) { - setObjectName(QStringLiteral("MaskEditorCanvas")); + setObjectName("MaskEditorCanvas"); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); QVBoxLayout* mainLayout = new QVBoxLayout; @@ -64,7 +64,7 @@ void ProjectionsEditorCanvas::setContext(SessionModel* model, void ProjectionsEditorCanvas::resetContext() { m_intensityDataItem = nullptr; - m_containerIndex = QModelIndex(); + m_containerIndex = {}; setConnected(false); m_colorMap = nullptr; m_scene->resetContext(); diff --git a/GUI/coregui/Views/JobWidgets/ProjectionsWidget.cpp b/GUI/coregui/Views/JobWidgets/ProjectionsWidget.cpp index 63f92b61e065d51430315aab9f56f9d7753498f2..b06ee0f5632235b84d25987f9655bf141f0ad74d 100644 --- a/GUI/coregui/Views/JobWidgets/ProjectionsWidget.cpp +++ b/GUI/coregui/Views/JobWidgets/ProjectionsWidget.cpp @@ -32,8 +32,8 @@ ProjectionsWidget::ProjectionsWidget(QWidget* parent) layout->setSpacing(0); m_tabWidget->setTabPosition(QTabWidget::North); - m_tabWidget->insertTab(HORIZONTAL, m_xProjection, QStringLiteral("Horizontal")); - m_tabWidget->insertTab(VERTICAL, m_yProjection, QStringLiteral("Vertical")); + m_tabWidget->insertTab(HORIZONTAL, m_xProjection, "Horizontal"); + m_tabWidget->insertTab(VERTICAL, m_yProjection, "Vertical"); layout->addWidget(m_tabWidget); setLayout(layout); diff --git a/GUI/coregui/Views/MaskWidgets/MaskEditor.cpp b/GUI/coregui/Views/MaskWidgets/MaskEditor.cpp index 0da7c22262e59fc7eb0f7b884bb0ac909853fe11..7151f03c4fb839f6821156f72fce74bb043c4c7b 100644 --- a/GUI/coregui/Views/MaskWidgets/MaskEditor.cpp +++ b/GUI/coregui/Views/MaskWidgets/MaskEditor.cpp @@ -29,7 +29,7 @@ MaskEditor::MaskEditor(QWidget* parent) m_editorPropertyPanel(new MaskEditorPropertyPanel), m_editorCanvas(new MaskEditorCanvas), m_splitter(new Manhattan::MiniSplitter) { - setObjectName(QStringLiteral("MaskEditor")); + setObjectName("MaskEditor"); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); m_splitter->addWidget(m_editorCanvas); diff --git a/GUI/coregui/Views/MaskWidgets/MaskEditorCanvas.cpp b/GUI/coregui/Views/MaskWidgets/MaskEditorCanvas.cpp index 787d72d18fedc2943b68414a24e1f204e85514b0..51b09b50cc772cb7ce0568d84726b3322ca427a3 100644 --- a/GUI/coregui/Views/MaskWidgets/MaskEditorCanvas.cpp +++ b/GUI/coregui/Views/MaskWidgets/MaskEditorCanvas.cpp @@ -30,7 +30,7 @@ MaskEditorCanvas::MaskEditorCanvas(QWidget* parent) m_intensityDataItem(0), m_statusLabel(new PlotStatusLabel(0, this)), m_resultsPresenter(new MaskResultsPresenter(this)) { - setObjectName(QStringLiteral("MaskEditorCanvas")); + setObjectName("MaskEditorCanvas"); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); QVBoxLayout* mainLayout = new QVBoxLayout; diff --git a/GUI/coregui/Views/MaskWidgets/MaskEditorPropertyPanel.cpp b/GUI/coregui/Views/MaskWidgets/MaskEditorPropertyPanel.cpp index 54f7e83d6ae04e88ab73520210dcb4987099e4cd..d603beb8c9b99d919be9ff14c536eee3c83b1ebd 100644 --- a/GUI/coregui/Views/MaskWidgets/MaskEditorPropertyPanel.cpp +++ b/GUI/coregui/Views/MaskWidgets/MaskEditorPropertyPanel.cpp @@ -97,7 +97,7 @@ void MaskEditorPropertyPanel::setMaskContext(SessionModel* model, void MaskEditorPropertyPanel::resetContext() { m_maskModel = nullptr; - m_rootIndex = QModelIndex(); + m_rootIndex = {}; m_intensityDataItem = nullptr; m_listView->setModel(nullptr); m_maskPropertyEditor->setItem(nullptr); diff --git a/GUI/coregui/Views/MaskWidgets/MaskGraphicsScene.cpp b/GUI/coregui/Views/MaskWidgets/MaskGraphicsScene.cpp index 0ff530f48ab6721f987874d7991400b81099b42f..9f61a7334668dfa37015b12dcc4eb5b6b99aa54a 100644 --- a/GUI/coregui/Views/MaskWidgets/MaskGraphicsScene.cpp +++ b/GUI/coregui/Views/MaskWidgets/MaskGraphicsScene.cpp @@ -109,7 +109,7 @@ void MaskGraphicsScene::resetContext() disconnect(m_maskModel, SIGNAL(modelReset()), this, SLOT(updateScene())); } m_maskModel = nullptr; - m_maskContainerIndex = QModelIndex(); + m_maskContainerIndex = {}; resetScene(); } @@ -646,7 +646,7 @@ void MaskGraphicsScene::processPolygonItem(QGraphicsSceneMouseEvent* event) if (PolygonView* polygon = currentPolygon()) { if (polygon->closePolygonIfNecessary()) { setDrawingInProgress(false); - m_currentMousePosition = QPointF(); + m_currentMousePosition = {}; return; } } diff --git a/GUI/coregui/Views/MaskWidgets/MaskGraphicsScene.h b/GUI/coregui/Views/MaskWidgets/MaskGraphicsScene.h index 69253346a2a84804e76b6780492297ab07702769..c8754a764764833bcaf1d5e306bff058fb96b54f 100644 --- a/GUI/coregui/Views/MaskWidgets/MaskGraphicsScene.h +++ b/GUI/coregui/Views/MaskWidgets/MaskGraphicsScene.h @@ -80,7 +80,7 @@ protected: private: void updateProxyWidget(); - void updateViews(const QModelIndex& parentIndex = QModelIndex(), IShape2DView* parentView = 0); + void updateViews(const QModelIndex& parentIndex = {}, IShape2DView* parentView = 0); IShape2DView* addViewForItem(SessionItem* item); void deleteViews(const QModelIndex& itemIndex); void removeItemViewFromScene(SessionItem* item); diff --git a/GUI/coregui/Views/MaskWidgets/MaskGraphicsView.cpp b/GUI/coregui/Views/MaskWidgets/MaskGraphicsView.cpp index fd51059261e74fa0410717758438df111f343133..1f1eefcc323279b5cd2959fc757bded06e994141 100644 --- a/GUI/coregui/Views/MaskWidgets/MaskGraphicsView.cpp +++ b/GUI/coregui/Views/MaskWidgets/MaskGraphicsView.cpp @@ -30,7 +30,7 @@ const double zoom_step = 0.05; MaskGraphicsView::MaskGraphicsView(QGraphicsScene* scene, QWidget* parent) : QGraphicsView(scene, parent), m_current_zoom_value(1.0) { - setObjectName(QStringLiteral("MaskGraphicsView")); + setObjectName("MaskGraphicsView"); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); setRenderHints(QPainter::HighQualityAntialiasing | QPainter::TextAntialiasing); setStyleSheet("QGraphicsView { border-style: none; }"); diff --git a/GUI/coregui/Views/MaterialEditor/MaterialEditorToolBar.cpp b/GUI/coregui/Views/MaterialEditor/MaterialEditorToolBar.cpp index 14d47db1402a0af1068cd277c683c4248ac53802..66a694a97d9d3f096cd924ba02d28319fce40fad 100644 --- a/GUI/coregui/Views/MaterialEditor/MaterialEditorToolBar.cpp +++ b/GUI/coregui/Views/MaterialEditor/MaterialEditorToolBar.cpp @@ -33,23 +33,23 @@ MaterialEditorToolBar::MaterialEditorToolBar(MaterialModel* materialModel, QWidg setIconSize(QSize(toolbar_icon_size, toolbar_icon_size)); setToolButtonStyle(Qt::ToolButtonTextBesideIcon); - m_newMaterialAction = new QAction(QStringLiteral("Add"), parent); + m_newMaterialAction = new QAction("Add", parent); m_newMaterialAction->setIcon(QIcon(":/images/shape-square-plus.svg")); - m_newMaterialAction->setToolTip(QStringLiteral("Add new material")); + m_newMaterialAction->setToolTip("Add new material"); connect(m_newMaterialAction, &QAction::triggered, this, &MaterialEditorToolBar::onNewMaterialAction); addAction(m_newMaterialAction); - m_cloneMaterialAction = new QAction(QStringLiteral("Clone"), parent); + m_cloneMaterialAction = new QAction("Clone", parent); m_cloneMaterialAction->setIcon(QIcon(":/images/content-copy.svg")); - m_cloneMaterialAction->setToolTip(QStringLiteral("Clone selected material")); + m_cloneMaterialAction->setToolTip("Clone selected material"); connect(m_cloneMaterialAction, &QAction::triggered, this, &MaterialEditorToolBar::onCloneMaterialAction); addAction(m_cloneMaterialAction); - m_removeMaterialAction = new QAction(QStringLiteral("Remove"), parent); + m_removeMaterialAction = new QAction("Remove", parent); m_removeMaterialAction->setIcon(QIcon(":/images/delete.svg")); - m_removeMaterialAction->setToolTip(QStringLiteral("Remove selected material")); + m_removeMaterialAction->setToolTip("Remove selected material"); connect(m_removeMaterialAction, &QAction::triggered, this, &MaterialEditorToolBar::onRemoveMaterialAction); addAction(m_removeMaterialAction); diff --git a/GUI/coregui/Views/PropertyEditor/PropertyEditorFactory.cpp b/GUI/coregui/Views/PropertyEditor/PropertyEditorFactory.cpp index 87c42c9ebdda2e34ae235c1944cd4397372307df..e322109d57327dded782cd79efdfc92c2fd57cd6 100644 --- a/GUI/coregui/Views/PropertyEditor/PropertyEditorFactory.cpp +++ b/GUI/coregui/Views/PropertyEditor/PropertyEditorFactory.cpp @@ -116,7 +116,7 @@ QWidget* PropertyEditorFactory::CreateEditor(const SessionItem& item, QWidget* p auto limits = item.limits(); editor->setLimits(limits); editor->setDecimals(item.decimals()); - editor->setSingleStep(getStep(item.data(Qt::EditRole).toDouble())); + editor->setSingleStep(getStep(item.roleProperty(Qt::EditRole).toDouble())); result = editor; } else { auto editor = new DoubleEditor; diff --git a/GUI/coregui/Views/RealSpaceWidgets/RealSpaceBuilder.h b/GUI/coregui/Views/RealSpaceWidgets/RealSpaceBuilder.h index 2a0cc5b70abee68b682b913ba661a1f10623c879..cc90cbd7daf9f4c640a891ebac4f251f5e264ec8 100644 --- a/GUI/coregui/Views/RealSpaceWidgets/RealSpaceBuilder.h +++ b/GUI/coregui/Views/RealSpaceWidgets/RealSpaceBuilder.h @@ -43,23 +43,21 @@ public: RealSpace::Vector3D::_z)); // up void populateMultiLayer(RealSpaceModel* model, const SessionItem& item, - const SceneGeometry& sceneGeometry, - const QVector3D& origin = QVector3D()); + const SceneGeometry& sceneGeometry, const QVector3D& origin = {}); void populateLayer(RealSpaceModel* model, const SessionItem& layerItem, - const SceneGeometry& sceneGeometry, const QVector3D& origin = QVector3D(), + const SceneGeometry& sceneGeometry, const QVector3D& origin = {}, const bool isTopLayer = false); void populateLayout(RealSpaceModel* model, const SessionItem& layoutItem, - const SceneGeometry& sceneGeometry, const QVector3D& origin = QVector3D()); + const SceneGeometry& sceneGeometry, const QVector3D& origin = {}); void populateParticleFromParticleItem(RealSpaceModel* model, const SessionItem& particleItem) const; - void - populateParticleFromParticle3DContainer(RealSpaceModel* model, - const Particle3DContainer& particle3DContainer, - const QVector3D& lattice_position = QVector3D()) const; + void populateParticleFromParticle3DContainer(RealSpaceModel* model, + const Particle3DContainer& particle3DContainer, + const QVector3D& lattice_position = {}) const; }; #endif // BORNAGAIN_GUI_COREGUI_VIEWS_REALSPACEWIDGETS_REALSPACEBUILDER_H diff --git a/GUI/coregui/Views/RealSpaceWidgets/RealSpaceCanvas.cpp b/GUI/coregui/Views/RealSpaceWidgets/RealSpaceCanvas.cpp index 94fbcd7ee89d3dfe43b62c10501ca9127654b09c..6d92ab07f3ca3768cf4b792ff18d92130919d542 100644 --- a/GUI/coregui/Views/RealSpaceWidgets/RealSpaceCanvas.cpp +++ b/GUI/coregui/Views/RealSpaceWidgets/RealSpaceCanvas.cpp @@ -84,7 +84,7 @@ void RealSpaceCanvas::updateToSelection() if (indices.size()) m_currentSelection = FilterPropertyProxy::toSourceIndex(indices.back()); else - m_currentSelection = QModelIndex(); + m_currentSelection = {}; // if no object is selected then display nothing on canvas updateScene(); @@ -208,7 +208,7 @@ void RealSpaceCanvas::resetScene() { m_realSpaceModel.reset(); m_view->setModel(nullptr); - m_currentSelection = QModelIndex(); + m_currentSelection = {}; } void RealSpaceCanvas::defaultView() @@ -243,8 +243,8 @@ void RealSpaceCanvas::setConnected(SampleModel* model, bool makeConnected) connect(model, &SampleModel::modelReset, this, &RealSpaceCanvas::resetScene, Qt::UniqueConnection); connect( - model, &SampleModel::modelAboutToBeReset, this, - [&]() { m_currentSelection = QModelIndex(); }, Qt::UniqueConnection); + model, &SampleModel::modelAboutToBeReset, this, [&]() { m_currentSelection = {}; }, + Qt::UniqueConnection); } else { disconnect(model, &SampleModel::rowsInserted, this, &RealSpaceCanvas::updateScene); diff --git a/GUI/coregui/Views/RealSpaceWidgets/RealSpaceMesoCrystalUtils.cpp b/GUI/coregui/Views/RealSpaceWidgets/RealSpaceMesoCrystalUtils.cpp index cdafa3be7d07c395977b7062f64458792bb80551..4dfcb7fa0446e6bf46240423a57d9132e9de638a 100644 --- a/GUI/coregui/Views/RealSpaceWidgets/RealSpaceMesoCrystalUtils.cpp +++ b/GUI/coregui/Views/RealSpaceWidgets/RealSpaceMesoCrystalUtils.cpp @@ -438,7 +438,7 @@ Particle3DContainer RealSpaceMesoCrystal::populateMesoCrystal() static_cast<float>(mesoCrystal_translation.z()))); // assign grey (default) color to the outer shape - QColor color = QColor(); + QColor color = {}; color.setAlphaF(0.3); outerShape3D->color = color; mesoCrystal3DContainer.addParticle(outerShape3D.release(), true); diff --git a/GUI/coregui/Views/RealSpaceWidgets/TransformTo3D.h b/GUI/coregui/Views/RealSpaceWidgets/TransformTo3D.h index eb57a1c7f017622efd27696d62b0cae4b8153971..2c93448353103ed12ffbcc1fe763c9cae7662345 100644 --- a/GUI/coregui/Views/RealSpaceWidgets/TransformTo3D.h +++ b/GUI/coregui/Views/RealSpaceWidgets/TransformTo3D.h @@ -36,7 +36,7 @@ BA_CORE_API_ double visualLayerThickness(const SessionItem& layerItem, BA_CORE_API_ std::unique_ptr<RealSpace::Layer> createLayer(const SessionItem& layerItem, const SceneGeometry& sceneGeometry, - const QVector3D& origin = QVector3D()); + const QVector3D& origin = {}); BA_CORE_API_ std::unique_ptr<RealSpace::Particles::Particle> createParticle3D(const SessionItem& particleItem); diff --git a/GUI/coregui/Views/SampleDesigner/ConnectableView.h b/GUI/coregui/Views/SampleDesigner/ConnectableView.h index 99622159375e3bf2e6dfd8ea6dda8ae21b8edc08..e0aad0833862124e038ce67de3eafc4ec4fd3c24 100644 --- a/GUI/coregui/Views/SampleDesigner/ConnectableView.h +++ b/GUI/coregui/Views/SampleDesigner/ConnectableView.h @@ -29,7 +29,7 @@ class BA_CORE_API_ ConnectableView : public IView { Q_OBJECT public: - ConnectableView(QGraphicsItem* parent = 0, QRectF rect = QRectF(0, 0, 50, 50)); + ConnectableView(QGraphicsItem* parent = 0, QRectF rect = {0, 0, 50, 50}); virtual ~ConnectableView() {} int type() const { return ViewTypes::ISAMPLE_RECT; } diff --git a/GUI/coregui/Views/SampleDesigner/DesignerMimeData.cpp b/GUI/coregui/Views/SampleDesigner/DesignerMimeData.cpp index d5357b1ba66156a159eb8980290ef20b0dd6bedb..279302d0deaa72c8f765a48e0f7d2fb796782de3 100644 --- a/GUI/coregui/Views/SampleDesigner/DesignerMimeData.cpp +++ b/GUI/coregui/Views/SampleDesigner/DesignerMimeData.cpp @@ -78,11 +78,11 @@ void DesignerMimeData::read_widget(QXmlStreamReader& reader) { for (const QXmlStreamAttribute& attribute : reader.attributes()) { QStringRef name = attribute.name(); - if (name == QStringLiteral("class")) { + if (name == "class") { m_classname = attribute.value().toString(); continue; } - reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + reader.raiseError("Unexpected attribute " + name.toString()); } reader.skipCurrentElement(); } diff --git a/GUI/coregui/Views/SampleDesigner/DesignerScene.cpp b/GUI/coregui/Views/SampleDesigner/DesignerScene.cpp index 0c343d0862eaf1ebd2a3b2587cbd363afa310259..e68779605f2bf71c98a526f4812cbf2402e2b6f4 100644 --- a/GUI/coregui/Views/SampleDesigner/DesignerScene.cpp +++ b/GUI/coregui/Views/SampleDesigner/DesignerScene.cpp @@ -134,7 +134,7 @@ void DesignerScene::resetScene() { clear(); m_ItemToView.clear(); - m_layer_interface_line = QLineF(); + m_layer_interface_line = {}; } void DesignerScene::updateScene() diff --git a/GUI/coregui/Views/SampleDesigner/DesignerScene.h b/GUI/coregui/Views/SampleDesigner/DesignerScene.h index 5ed459df67c6d896346d0f5c9b2f2a2eef8e308b..6fed463b21332dbe2cf93a7cb1e9c42bb17c6c04 100644 --- a/GUI/coregui/Views/SampleDesigner/DesignerScene.h +++ b/GUI/coregui/Views/SampleDesigner/DesignerScene.h @@ -67,7 +67,7 @@ public slots: void onRowsAboutToBeRemoved(const QModelIndex& parent, int first, int last); void onRowsRemoved(const QModelIndex& parent, int first, int last); - void setLayerInterfaceLine(const QLineF& line = QLineF()) + void setLayerInterfaceLine(const QLineF& line = {}) { m_layer_interface_line = line; invalidate(); @@ -90,7 +90,7 @@ protected: private: IView* addViewForItem(SessionItem* item); - void updateViews(const QModelIndex& parentIndex = QModelIndex(), IView* parentView = 0); + void updateViews(const QModelIndex& parentIndex = {}, IView* parentView = 0); void deleteViews(const QModelIndex& parentIndex); void alignViews(); void removeItemViewFromScene(SessionItem* item); diff --git a/GUI/coregui/Views/SampleDesigner/IView.cpp b/GUI/coregui/Views/SampleDesigner/IView.cpp index 318cb34dab582c7374a2d74fa8a8004ea4e3a100..c0e520cb97b24571398360c72544b120397344b0 100644 --- a/GUI/coregui/Views/SampleDesigner/IView.cpp +++ b/GUI/coregui/Views/SampleDesigner/IView.cpp @@ -13,7 +13,6 @@ // ************************************************************************** // #include "GUI/coregui/Views/SampleDesigner/IView.h" -#include "GUI/coregui/Models/ModelMapper.h" #include "GUI/coregui/Models/SessionGraphicsItem.h" #include <QString> diff --git a/GUI/coregui/Views/SampleDesigner/MesoCrystalView.cpp b/GUI/coregui/Views/SampleDesigner/MesoCrystalView.cpp index 4cd2054e9fc2b0618a360a0bb26e3d0c433f8352..5f071a6f6600fd22e90f81f81064bd831c2e00c2 100644 --- a/GUI/coregui/Views/SampleDesigner/MesoCrystalView.cpp +++ b/GUI/coregui/Views/SampleDesigner/MesoCrystalView.cpp @@ -25,11 +25,11 @@ MesoCrystalView::MesoCrystalView(QGraphicsItem* parent) : ConnectableView(parent setColor(DesignerHelper::getDefaultParticleColor()); setRectangle(DesignerHelper::getDefaultBoundingRect("ParticleCoreShell")); addPort("out", NodeEditorPort::OUTPUT, NodeEditorPort::FORM_FACTOR) - ->setToolTip(QStringLiteral("Connect to the ParticleLayout")); + ->setToolTip("Connect to the ParticleLayout"); addPort("basis", NodeEditorPort::INPUT, NodeEditorPort::FORM_FACTOR) - ->setToolTip(QStringLiteral("Connect basis particles")); + ->setToolTip("Connect basis particles"); addPort("transformation", NodeEditorPort::INPUT, NodeEditorPort::TRANSFORMATION) - ->setToolTip(QStringLiteral("Connect rotation to this port, if necessary")); + ->setToolTip("Connect rotation to this port, if necessary"); m_label_vspace = StyleUtils::SizeOfLetterM().height() * 2.5; } diff --git a/GUI/coregui/Views/SampleDesigner/ParticleCompositionView.cpp b/GUI/coregui/Views/SampleDesigner/ParticleCompositionView.cpp index 952bf6acf9194f86f4a89940a9082fa2e4bd8983..49f7fc92b4a2582f66cdf48ab04a8b345937f5ab 100644 --- a/GUI/coregui/Views/SampleDesigner/ParticleCompositionView.cpp +++ b/GUI/coregui/Views/SampleDesigner/ParticleCompositionView.cpp @@ -24,11 +24,11 @@ ParticleCompositionView::ParticleCompositionView(QGraphicsItem* parent) : Connec setColor(DesignerHelper::getDefaultParticleColor()); setRectangle(DesignerHelper::getDefaultBoundingRect("ParticleCoreShell")); addPort("out", NodeEditorPort::OUTPUT, NodeEditorPort::FORM_FACTOR) - ->setToolTip(QStringLiteral("Connect to the ParticleLayout")); + ->setToolTip("Connect to the ParticleLayout"); addPort("particles", NodeEditorPort::INPUT, NodeEditorPort::FORM_FACTOR) - ->setToolTip(QStringLiteral("Connect particles")); + ->setToolTip("Connect particles"); addPort("transformation", NodeEditorPort::INPUT, NodeEditorPort::TRANSFORMATION) - ->setToolTip(QStringLiteral("Connect rotation to this port, if necessary")); + ->setToolTip("Connect rotation to this port, if necessary"); m_label_vspace = StyleUtils::SizeOfLetterM().height() * 3.0; } diff --git a/GUI/coregui/Views/SampleDesigner/ParticleCoreShellView.cpp b/GUI/coregui/Views/SampleDesigner/ParticleCoreShellView.cpp index b7b996273b25fb1422ab75a8da195a0add3fe61e..ca2537410a0314c7aed4bdee9946f4bc3b8b6e59 100644 --- a/GUI/coregui/Views/SampleDesigner/ParticleCoreShellView.cpp +++ b/GUI/coregui/Views/SampleDesigner/ParticleCoreShellView.cpp @@ -24,13 +24,13 @@ ParticleCoreShellView::ParticleCoreShellView(QGraphicsItem* parent) : Connectabl setColor(DesignerHelper::getDefaultParticleColor()); setRectangle(DesignerHelper::getDefaultBoundingRect("ParticleCoreShell")); addPort("out", NodeEditorPort::OUTPUT, NodeEditorPort::FORM_FACTOR) - ->setToolTip(QStringLiteral("Connect to the ParticleLayout")); + ->setToolTip("Connect to the ParticleLayout"); addPort("core", NodeEditorPort::INPUT, NodeEditorPort::FORM_FACTOR) - ->setToolTip(QStringLiteral("Connect particle which will play the role of core.")); + ->setToolTip("Connect particle which will play the role of core."); addPort("shell", NodeEditorPort::INPUT, NodeEditorPort::FORM_FACTOR) - ->setToolTip(QStringLiteral("Connect particle which will play the role of shell.")); + ->setToolTip("Connect particle which will play the role of shell."); addPort("transformation", NodeEditorPort::INPUT, NodeEditorPort::TRANSFORMATION) - ->setToolTip(QStringLiteral("Connect particle rotation to this port, if necessary")); + ->setToolTip("Connect particle rotation to this port, if necessary"); m_label_vspace = StyleUtils::SizeOfLetterM().height() * 3.0; } diff --git a/GUI/coregui/Views/SampleDesigner/ParticleDistributionView.cpp b/GUI/coregui/Views/SampleDesigner/ParticleDistributionView.cpp index cc3af4b669679dbc83e589333bcb94b2b8854289..008f27aaf0ccfcd8695c9b8a9ecfe39fc0136860 100644 --- a/GUI/coregui/Views/SampleDesigner/ParticleDistributionView.cpp +++ b/GUI/coregui/Views/SampleDesigner/ParticleDistributionView.cpp @@ -23,10 +23,10 @@ ParticleDistributionView::ParticleDistributionView(QGraphicsItem* parent) : Conn setColor(DesignerHelper::getDefaultParticleColor()); setRectangle(DesignerHelper::getDefaultBoundingRect("ParticleDistribution")); addPort("out", NodeEditorPort::OUTPUT, NodeEditorPort::FORM_FACTOR) - ->setToolTip(QStringLiteral("Connect to the ParticleLayout")); + ->setToolTip("Connect to the ParticleLayout"); addPort("particle", NodeEditorPort::INPUT, NodeEditorPort::FORM_FACTOR) - ->setToolTip(QStringLiteral("Connect particle to this port. It will be a prototype \n" - "for parametric distribution.")); + ->setToolTip("Connect particle to this port. It will be a prototype \n" + "for parametric distribution."); m_label_vspace = StyleUtils::SizeOfLetterM().height() * 3.0; } diff --git a/GUI/coregui/Views/SampleDesigner/ParticleLayoutView.cpp b/GUI/coregui/Views/SampleDesigner/ParticleLayoutView.cpp index 2232878faf4ac366e1783637163ef460376f1d4c..36a129cedd9c4c1594c09628aacb8913a5cb68ca 100644 --- a/GUI/coregui/Views/SampleDesigner/ParticleLayoutView.cpp +++ b/GUI/coregui/Views/SampleDesigner/ParticleLayoutView.cpp @@ -24,13 +24,13 @@ ParticleLayoutView::ParticleLayoutView(QGraphicsItem* parent) : ConnectableView( setColor(QColor(135, 206, 50)); setRectangle(DesignerHelper::getParticleLayoutBoundingRect()); addPort("out", NodeEditorPort::OUTPUT, NodeEditorPort::PARTICLE_LAYOUT) - ->setToolTip(QStringLiteral("Connect this port with the layer " - "to populate it with particles")); + ->setToolTip("Connect this port with the layer " + "to populate it with particles"); addPort("particle", NodeEditorPort::INPUT, NodeEditorPort::FORM_FACTOR) - ->setToolTip(QStringLiteral("Connect one or several particles to this port")); + ->setToolTip("Connect one or several particles to this port"); addPort("interference", NodeEditorPort::INPUT, NodeEditorPort::INTERFERENCE) - ->setToolTip(QStringLiteral("Connect interference to this port " - "to have coherent scattering")); + ->setToolTip("Connect interference to this port " + "to have coherent scattering"); } void ParticleLayoutView::addView(IView* childView, int /* row */) diff --git a/GUI/coregui/Views/SampleDesigner/ParticleView.cpp b/GUI/coregui/Views/SampleDesigner/ParticleView.cpp index e77b2fdc4be78e1c4bf44e71ce1b32f10becf79f..a08cf34fa4869e3570351b827485e4fecfa03b50 100644 --- a/GUI/coregui/Views/SampleDesigner/ParticleView.cpp +++ b/GUI/coregui/Views/SampleDesigner/ParticleView.cpp @@ -29,9 +29,9 @@ ParticleView::ParticleView(QGraphicsItem* parent) : ConnectableView(parent) setColor(DesignerHelper::getDefaultParticleColor()); setRectangle(DesignerHelper::getParticleBoundingRect()); addPort("out", NodeEditorPort::OUTPUT, NodeEditorPort::FORM_FACTOR) - ->setToolTip(QStringLiteral("Connect to the ParticleLayout")); + ->setToolTip("Connect to the ParticleLayout"); addPort("transformation", NodeEditorPort::INPUT, NodeEditorPort::TRANSFORMATION) - ->setToolTip(QStringLiteral("Connect particle rotation to this port, if necessary")); + ->setToolTip("Connect particle rotation to this port, if necessary"); m_label_vspace = StyleUtils::SizeOfLetterM().height() * 3.0; } diff --git a/GUI/coregui/Views/SampleDesigner/SampleViewAligner.h b/GUI/coregui/Views/SampleDesigner/SampleViewAligner.h index 11b538d552feaebb787e210132d167216b2fb988..c8e87d3f91c55dc1fe60581569dc0b58b19abc36 100644 --- a/GUI/coregui/Views/SampleDesigner/SampleViewAligner.h +++ b/GUI/coregui/Views/SampleDesigner/SampleViewAligner.h @@ -30,13 +30,12 @@ class BA_CORE_API_ SampleViewAligner public: SampleViewAligner(DesignerScene* scene); - void alignSample(SessionItem* item, QPointF reference = QPointF(), - bool force_alignment = false); - void alignSample(const QModelIndex& parentIndex, QPointF reference = QPointF(), + void alignSample(SessionItem* item, QPointF reference = {}, bool force_alignment = false); + void alignSample(const QModelIndex& parentIndex, QPointF reference = {}, bool force_alignment = false); void smartAlign(); - void updateViews(const QModelIndex& parentIndex = QModelIndex()); + void updateViews(const QModelIndex& parentIndex = {}); void updateForces(); void calculateForces(IView* view); void advance(); diff --git a/GUI/coregui/Views/SampleDesigner/SampleWidgetBox.cpp b/GUI/coregui/Views/SampleDesigner/SampleWidgetBox.cpp index 4965e3cf1d6dc43b4b960b90c45f9d29a3cc0569..8929bf3cd77f5302467a1f6763fbc92d79d8abce 100644 --- a/GUI/coregui/Views/SampleDesigner/SampleWidgetBox.cpp +++ b/GUI/coregui/Views/SampleDesigner/SampleWidgetBox.cpp @@ -31,7 +31,7 @@ SampleWidgetBox::SampleWidgetBox(SampleDesignerInterface* core, QWidget* parent) setWindowTitle("Items Toolbox"); m_widgetBox = new qdesigner_internal::WidgetBox(m_core, this); - m_widgetBox->setFileName(QStringLiteral(":/widgetbox/widgetbox.xml")); + m_widgetBox->setFileName(":/widgetbox/widgetbox.xml"); m_widgetBox->load(); QVBoxLayout* layout = new QVBoxLayout; diff --git a/GUI/coregui/Views/SimulationWidgets/SimulationDataSelectorWidget.cpp b/GUI/coregui/Views/SimulationWidgets/SimulationDataSelectorWidget.cpp index 52f081e65ae16e7afaaa8670d4a8ff1041b63b0a..bb95fbc19b71b95c8f3008be6e8dfa14c4005a38 100644 --- a/GUI/coregui/Views/SimulationWidgets/SimulationDataSelectorWidget.cpp +++ b/GUI/coregui/Views/SimulationWidgets/SimulationDataSelectorWidget.cpp @@ -47,16 +47,16 @@ SimulationDataSelectorWidget::SimulationDataSelectorWidget(QWidget* parent) // selection of input parameters QGroupBox* groupBox = new QGroupBox("Data selection"); - QLabel* instrumentSelectionLabel = new QLabel(QStringLiteral("Select Instrument:")); + QLabel* instrumentSelectionLabel = new QLabel("Select Instrument:"); instrumentSelectionLabel->setToolTip(select_instrument_tooltip); m_instrumentCombo->setToolTip(select_instrument_tooltip); m_instrumentCombo->setAttribute(Qt::WA_MacShowFocusRect, false); - QLabel* sampleSelectionLabel = new QLabel(QStringLiteral("Select Sample:")); + QLabel* sampleSelectionLabel = new QLabel("Select Sample:"); sampleSelectionLabel->setToolTip(select_sample_tooltip); m_sampleCombo->setToolTip(select_sample_tooltip); - QLabel* readDataSelectionLabel = new QLabel(QStringLiteral("Select Real Data:")); + QLabel* readDataSelectionLabel = new QLabel("Select Real Data:"); readDataSelectionLabel->setToolTip(select_realdata_tooltip); m_realDataCombo->setToolTip(select_realdata_tooltip); @@ -154,12 +154,12 @@ void SimulationDataSelectorWidget::updateSelection(QComboBox* comboBox, QStringL comboBox->clear(); if (itemList.isEmpty()) { comboBox->setEnabled(false); - comboBox->addItem(QStringLiteral("Not yet defined")); + comboBox->addItem("Not yet defined"); } else { comboBox->setEnabled(true); // qSort(itemList.begin(), itemList.end()); // uncomment, if we want alphabetical order if (allow_none) - itemList.insert(-1, QStringLiteral("None")); + itemList.insert(-1, "None"); comboBox->addItems(itemList); if (itemList.contains(previousItem)) comboBox->setCurrentIndex(itemList.indexOf(previousItem)); diff --git a/GUI/coregui/Views/SimulationWidgets/SimulationSetupAssistant.cpp b/GUI/coregui/Views/SimulationWidgets/SimulationSetupAssistant.cpp index f933fc13126a7279dcf989e5dddbe0ebb655e6d7..4822ee2439feb9e1106cae9e93b2ced637d33570 100644 --- a/GUI/coregui/Views/SimulationWidgets/SimulationSetupAssistant.cpp +++ b/GUI/coregui/Views/SimulationWidgets/SimulationSetupAssistant.cpp @@ -34,7 +34,7 @@ bool SimulationSetupAssistant::isValidSimulationSetup(const MultiLayerItem* mult checkFittingSetup(instrumentItem, realData); if (!m_isValid) - QMessageBox::warning(nullptr, QStringLiteral("Can't run the job"), composeMessage()); + QMessageBox::warning(nullptr, "Can't run the job", composeMessage()); return m_isValid; } @@ -48,7 +48,7 @@ void SimulationSetupAssistant::clear() void SimulationSetupAssistant::checkMultiLayerItem(const MultiLayerItem* multiLayerItem) { if (!multiLayerItem) { - m_messages.append(QStringLiteral("No sample selected")); + m_messages.append("No sample selected"); m_isValid = false; } else { SampleValidator sampleValidator; @@ -62,7 +62,7 @@ void SimulationSetupAssistant::checkMultiLayerItem(const MultiLayerItem* multiLa void SimulationSetupAssistant::checkInstrumentItem(const InstrumentItem* instrumentItem) { if (!instrumentItem) { - m_messages.append(QStringLiteral("No instrument selected")); + m_messages.append("No instrument selected"); m_isValid = false; } } diff --git a/GUI/coregui/Views/widgetbox/qdesigner_utils_p.h b/GUI/coregui/Views/widgetbox/qdesigner_utils_p.h index b4ac301e69295c451c3cdaa323a2d3f15bce31ea..21675911bfdf670aba0a3b35de8a78d2a050484c 100644 --- a/GUI/coregui/Views/widgetbox/qdesigner_utils_p.h +++ b/GUI/coregui/Views/widgetbox/qdesigner_utils_p.h @@ -371,7 +371,7 @@ private: class QDESIGNER_SHARED_EXPORT PropertySheetStringListValue : public PropertySheetTranslatableData { public: - PropertySheetStringListValue(const QStringList& value = QStringList(), bool translatable = true, + PropertySheetStringListValue(const QStringList& value = {}, bool translatable = true, const QString& disambiguation = "", const QString& comment = ""); bool operator==(const PropertySheetStringListValue& other) const { return equals(other); } @@ -390,9 +390,8 @@ private: class QDESIGNER_SHARED_EXPORT PropertySheetKeySequenceValue : public PropertySheetTranslatableData { public: - PropertySheetKeySequenceValue(const QKeySequence& value = QKeySequence(), - bool translatable = true, const QString& disambiguation = "", - const QString& comment = ""); + PropertySheetKeySequenceValue(const QKeySequence& value = {}, bool translatable = true, + const QString& disambiguation = "", const QString& comment = ""); PropertySheetKeySequenceValue(const QKeySequence::StandardKey& standardKey, bool translatable = true, const QString& disambiguation = "", const QString& comment = ""); diff --git a/GUI/coregui/Views/widgetbox/widgetboxcategorylistview.cpp b/GUI/coregui/Views/widgetbox/widgetboxcategorylistview.cpp index 9ab93c951dfc53d180f4521530f116461e464722..6dac21597c43ca05c90d3dc19ad357d375581385 100644 --- a/GUI/coregui/Views/widgetbox/widgetboxcategorylistview.cpp +++ b/GUI/coregui/Views/widgetbox/widgetboxcategorylistview.cpp @@ -166,7 +166,7 @@ private: WidgetBoxCategoryModel::WidgetBoxCategoryModel(SampleDesignerInterface* core, QObject* parent) : QAbstractListModel(parent), #if QT_VERSION >= 0x050000 - m_classNameRegExp(QStringLiteral("<widget +class *= *\"([^\"]+)\"")), + m_classNameRegExp("<widget +class *= *\"([^\"]+)\""), #else m_classNameRegExp(QString("<widget +class *= *\"([^\"]+)\"")), #endif @@ -237,8 +237,7 @@ void WidgetBoxCategoryModel::addWidget(const QDesignerWidgetBoxInterface::Widget { // build item. Filter on name + class name if it is different and not a layout. QString filter = widget.name(); - if (!filter.contains(QStringLiteral("Layout")) - && m_classNameRegExp.indexIn(widget.domXml()) != -1) { + if (!filter.contains("Layout") && m_classNameRegExp.indexIn(widget.domXml()) != -1) { const QString className = m_classNameRegExp.cap(1); if (!filter.contains(className)) filter += className; @@ -399,7 +398,7 @@ QWidget* WidgetBoxCategoryEntryDelegate::createEditor(QWidget* parent, { QWidget* result = QItemDelegate::createEditor(parent, option, index); if (QLineEdit* line_edit = qobject_cast<QLineEdit*>(result)) { - QRegExp re = QRegExp(QStringLiteral("[_a-zA-Z][_a-zA-Z0-9]*")); + QRegExp re = QRegExp("[_a-zA-Z][_a-zA-Z0-9]*"); Q_ASSERT(re.isValid()); line_edit->setValidator(new QRegExpValidator(re, line_edit)); } @@ -529,9 +528,9 @@ QString WidgetBoxCategoryListView::widgetDomXml(const QDesignerWidgetBoxInterfac if (domXml.isEmpty()) { domXml = QLatin1String(uiOpeningTagC); - domXml += QStringLiteral("<widget class=\""); + domXml += "<widget class=\""; domXml += widget.name(); - domXml += QStringLiteral("\"/>"); + domXml += "\"/>"; domXml += QLatin1String(uiClosingTagC); } return domXml; diff --git a/GUI/coregui/mainwindow/ProjectUtils.cpp b/GUI/coregui/mainwindow/ProjectUtils.cpp index 8afc193bf309d59098115b2d128ad8d1787fa4a8..bc9f9f2e9eedadaab554f01d9e3ce003d6608487 100644 --- a/GUI/coregui/mainwindow/ProjectUtils.cpp +++ b/GUI/coregui/mainwindow/ProjectUtils.cpp @@ -37,7 +37,7 @@ QString ProjectUtils::projectDir(const QString& projectFileName) QString ProjectUtils::autosaveSubdir() { - return QStringLiteral("autosave"); + return "autosave"; } //! From '/projects/Untitled2/Untitled2.pro' returns '/projects/Untitled2/autosave'. @@ -98,7 +98,7 @@ bool ProjectUtils::removeRecursively(const QString& dirname) bool ProjectUtils::removeFile(const QString& dirname, const QString& filename) { - QString name = dirname + QStringLiteral("/") + filename; + QString name = dirname + "/" + filename; QFile fin(name); if (!fin.exists()) diff --git a/GUI/coregui/mainwindow/PyImportAssistant.cpp b/GUI/coregui/mainwindow/PyImportAssistant.cpp index c951ea4118b34089b5f70368fd3973833a605c14..19eb4ef800c6953aa24e1f1af3c820148d7b1ad7 100644 --- a/GUI/coregui/mainwindow/PyImportAssistant.cpp +++ b/GUI/coregui/mainwindow/PyImportAssistant.cpp @@ -54,7 +54,7 @@ QString getCandidate(const QStringList& funcNames) for (auto str : funcNames) { QString name = str.toLower(); - if (name.contains(QStringLiteral("sample")) || name.contains(QStringLiteral("multilayer"))) + if (name.contains("sample") || name.contains("multilayer")) return str; } diff --git a/GUI/coregui/mainwindow/SaveLoadInterface.cpp b/GUI/coregui/mainwindow/SaveLoadInterface.cpp index 3ad3c2324befbb483a2726088021a588dd258828..8634e0f990e44ec9a3b359d498fac4343d33ede3 100644 --- a/GUI/coregui/mainwindow/SaveLoadInterface.cpp +++ b/GUI/coregui/mainwindow/SaveLoadInterface.cpp @@ -19,5 +19,5 @@ SaveLoadInterface::~SaveLoadInterface() = default; QString SaveLoadInterface::fileName(const QString& projectDir) const { const auto filename = fileName(); - return projectDir.isEmpty() ? filename : projectDir + QStringLiteral("/") + filename; + return projectDir.isEmpty() ? filename : projectDir + "/" + filename; } diff --git a/GUI/coregui/mainwindow/mainwindow.cpp b/GUI/coregui/mainwindow/mainwindow.cpp index 4deb64690dac4f2de5625dddf1e2c892dcb364eb..2567b2a5df2595128e63608c89a900c4754d1afe 100644 --- a/GUI/coregui/mainwindow/mainwindow.cpp +++ b/GUI/coregui/mainwindow/mainwindow.cpp @@ -205,25 +205,25 @@ void MainWindow::initViews() m_tabWidget->insertTab(WELCOME, m_welcomeView, QIcon(":/images/main_welcomeview.svg"), "Welcome"); - m_tabWidget->setTabToolTip(WELCOME, QStringLiteral("Switch to Welcome View")); + m_tabWidget->setTabToolTip(WELCOME, "Switch to Welcome View"); m_tabWidget->insertTab(INSTRUMENT, m_instrumentView, QIcon(":/images/main_instrumentview.svg"), "Instrument"); - m_tabWidget->setTabToolTip(INSTRUMENT, QStringLiteral("Define the beam and the detector")); + m_tabWidget->setTabToolTip(INSTRUMENT, "Define the beam and the detector"); m_tabWidget->insertTab(SAMPLE, m_sampleView, QIcon(":/images/main_sampleview.svg"), "Sample"); - m_tabWidget->setTabToolTip(SAMPLE, QStringLiteral("Build the sample")); + m_tabWidget->setTabToolTip(SAMPLE, "Build the sample"); m_tabWidget->insertTab(IMPORT, m_importDataView, QIcon(":/images/main_importview.svg"), "Data"); - m_tabWidget->setTabToolTip(IMPORT, QStringLiteral("Import intensity data to fit")); + m_tabWidget->setTabToolTip(IMPORT, "Import intensity data to fit"); m_tabWidget->insertTab(SIMULATION, m_simulationView, QIcon(":/images/main_simulationview.svg"), "Simulation"); - m_tabWidget->setTabToolTip(SIMULATION, QStringLiteral("Run simulation")); + m_tabWidget->setTabToolTip(SIMULATION, "Run simulation"); m_tabWidget->insertTab(JOB, m_jobView, QIcon(":/images/main_jobview.svg"), "Jobs"); m_tabWidget->setTabToolTip( - JOB, QStringLiteral("Switch to see job results, tune parameters real time,\nfit the data")); + JOB, "Switch to see job results, tune parameters real time,\nfit the data"); m_tabWidget->setCurrentIndex(WELCOME); diff --git a/GUI/coregui/utils/GUIHelpers.cpp b/GUI/coregui/utils/GUIHelpers.cpp index 29f2149dbdd52f0fc5630743992921b2e4f42501..1a8bfc92d5a0dd644ba66a14873265785a0d6f1b 100644 --- a/GUI/coregui/utils/GUIHelpers.cpp +++ b/GUI/coregui/utils/GUIHelpers.cpp @@ -146,7 +146,7 @@ bool parseVersion(const QString& version, int& major_num, int& minor_num, int& p { major_num = minor_num = patch_num = 0; bool success(true); - QStringList nums = version.split(QStringLiteral(".")); + QStringList nums = version.split("."); if (nums.size() != 3) return false; diff --git a/Tests/Functional/Core/Std/Check.cpp b/Tests/Functional/Core/Std/Check.cpp index e7a1a06ad7fa2f210b5222ba0f856747de3ccaa0..3ad665b8337046042a98f5bbfceb2f762cf09394 100644 --- a/Tests/Functional/Core/Std/Check.cpp +++ b/Tests/Functional/Core/Std/Check.cpp @@ -36,18 +36,16 @@ bool checkSimulation(const std::string& name, const Simulation& direct_simulatio assert(name != ""); try { reference.reset(IntensityDataIOFactory::readOutputData( - FileSystemUtils::jointPath(BATesting::StdReferenceDir(), name + ".int.gz"))); + FileSystemUtils::jointPath(BATesting::StdReferenceDir(), name + ".int.gz"))); } catch (const std::exception&) { - std::cout - << "No reference found, but we proceed with the simulation to create a new one\n"; + std::cout << "No reference found, but we proceed with the simulation to create a new one\n"; } // Compare with reference if available. bool success = false; if (reference) { std::cout << "- check diff" << std::endl; - success = - IntensityDataFunctions::checkRelativeDifference(*reference, *result_data, limit); + success = IntensityDataFunctions::checkRelativeDifference(*reference, *result_data, limit); } // Save simulation if different from reference. diff --git a/Tests/Functional/GUI/Std/macros.cpp b/Tests/Functional/GUI/Std/macros.cpp index 43e3e119d34a821ebae4abd0275f168e5a2fc194..588d89cd01df3b0fe6d2d834d287659e9a50485f 100644 --- a/Tests/Functional/GUI/Std/macros.cpp +++ b/Tests/Functional/GUI/Std/macros.cpp @@ -14,5 +14,5 @@ #include "Tests/Functional/Std/Run.h" -#define GUI_STD_TEST +#define GUI_STD_TEST #include "Tests/Functional/Std/StandardTests.h" // contains macros that are executed by gtest diff --git a/Tests/Functional/Python/Std/macros.cpp b/Tests/Functional/Python/Std/macros.cpp index 2612de48a605ddd9419b614214cd86b375191693..5961e64030f232c36d8da701721b43917dd8d31a 100644 --- a/Tests/Functional/Python/Std/macros.cpp +++ b/Tests/Functional/Python/Std/macros.cpp @@ -14,5 +14,5 @@ #include "Tests/Functional/Std/Run.h" -#define PYTHON_STD_TEST +#define PYTHON_STD_TEST #include "Tests/Functional/Std/StandardTests.h" // contains macros that are executed by gtest diff --git a/Tests/Functional/Std/StandardTests.h b/Tests/Functional/Std/StandardTests.h index 03ab19b8731aa61ca74170ab944be86e1a9e84b3..ad28074a85985b68e6a9c172c4fb9b89a199b622 100644 --- a/Tests/Functional/Std/StandardTests.h +++ b/Tests/Functional/Std/StandardTests.h @@ -410,7 +410,6 @@ TEST_F(Std, SpecularDivergentBeam) "HomogeneousMultilayerBuilder", 1e-10)); } - // ************************************************************************** // // TODO: broken under GUI // ************************************************************************** // @@ -425,7 +424,6 @@ TEST_F(Std, RelativeResolutionTOF) #endif // GUI_STD_TEST - // ************************************************************************** // // TODO: broken under Python // ************************************************************************** // @@ -444,7 +442,6 @@ TEST_F(Std, FormFactorsWithAbsorption) } #endif // PYTHON_STD_TEST - // ************************************************************************** // // TODO: broken under GUI and Python // ************************************************************************** // diff --git a/Tests/UnitTests/Core/Parameters/ParameterPatternTest.cpp b/Tests/UnitTests/Core/Parameters/ParameterPatternTest.cpp index 224113a44415179eaf1d64cf5336a11f3a5a5603..0c6e16ae1e4a28a77dc4cce5ffad980d39e1964e 100644 --- a/Tests/UnitTests/Core/Parameters/ParameterPatternTest.cpp +++ b/Tests/UnitTests/Core/Parameters/ParameterPatternTest.cpp @@ -57,6 +57,6 @@ TEST_F(ParameterPatternTest, copyTest) EXPECT_EQ("/Desktop/BornAgain/Core/Tests", p3.toStdString()); // calls copy constructor - ParameterPattern p4 = ParameterPattern(p2); + ParameterPattern p4 = {p2}; EXPECT_EQ("/Desktop/BornAgain/Core/Tests", p4.toStdString()); } diff --git a/Tests/UnitTests/Core/Sample/LatticeTest.cpp b/Tests/UnitTests/Core/Sample/LatticeTest.cpp index de9cf801b406df1452ba5e8b31dd8859de68182b..7171def4bc0a72e12ab2af29c1fff85bca9e2f1c 100644 --- a/Tests/UnitTests/Core/Sample/LatticeTest.cpp +++ b/Tests/UnitTests/Core/Sample/LatticeTest.cpp @@ -23,7 +23,7 @@ TEST_F(LatticeTest, declarationTest) EXPECT_EQ(a3, l2.getBasisVectorC()); // calls and tests copy constructor - Lattice l3 = Lattice(l2); + Lattice l3 = {l2}; EXPECT_EQ(a1, l3.getBasisVectorA()); EXPECT_EQ(a2, l3.getBasisVectorB()); EXPECT_EQ(a3, l3.getBasisVectorC()); diff --git a/Tests/UnitTests/GUI/TestFitParameterModel.cpp b/Tests/UnitTests/GUI/TestFitParameterModel.cpp index 0e4ec9ffbeb3b2e47ca94f0c062ef8d9e6033a19..0fdd9445b78859c221928b7200ac4de686b0d39b 100644 --- a/Tests/UnitTests/GUI/TestFitParameterModel.cpp +++ b/Tests/UnitTests/GUI/TestFitParameterModel.cpp @@ -32,7 +32,7 @@ TEST_F(TestFitParameterModel, test_addFitParameter) // adding fit parameter SessionItem* fitPar0 = source.insertNewItem("FitParameter", container->index()); - fitPar0->setDisplayName(QStringLiteral("par")); + fitPar0->setDisplayName("par"); fitPar0->setItemValue(FitParameterItem::P_MIN, 1.0); fitPar0->setItemValue(FitParameterItem::P_MAX, 2.0); fitPar0->setItemValue(FitParameterItem::P_START_VALUE, 3.0); @@ -92,7 +92,7 @@ TEST_F(TestFitParameterModel, test_addFitParameter) // adding second fit parameter // ---------------------------------------------------- SessionItem* fitPar1 = source.insertNewItem("FitParameter", container->index()); - fitPar0->setDisplayName(QStringLiteral("par")); + fitPar0->setDisplayName("par"); fitPar0->setItemValue(FitParameterItem::P_MIN, 10.0); fitPar0->setItemValue(FitParameterItem::P_MAX, 20.0); fitPar0->setItemValue(FitParameterItem::P_START_VALUE, 30.0); @@ -136,7 +136,7 @@ TEST_F(TestFitParameterModel, test_addFitParameterAndLink) // adding fit parameter SessionItem* fitPar0 = source.insertNewItem("FitParameter", container->index()); - fitPar0->setDisplayName(QStringLiteral("par")); + fitPar0->setDisplayName("par"); fitPar0->setItemValue(FitParameterItem::P_MIN, 1.0); fitPar0->setItemValue(FitParameterItem::P_MAX, 2.0); fitPar0->setItemValue(FitParameterItem::P_START_VALUE, 3.0); diff --git a/Tests/UnitTests/GUI/TestRealSpaceBuilderUtils.cpp b/Tests/UnitTests/GUI/TestRealSpaceBuilderUtils.cpp index 9dc69a540a8cef5ac144adb5d51a2faf4229aa59..3cc5ab1a2f9e5ff738d116410b664fc15d8d3bee 100644 --- a/Tests/UnitTests/GUI/TestRealSpaceBuilderUtils.cpp +++ b/Tests/UnitTests/GUI/TestRealSpaceBuilderUtils.cpp @@ -86,7 +86,7 @@ TEST_F(TestRealSpaceBuilderUtils, test_Particle3DContainer) EXPECT_EQ(p2.particleType(), "Particle"); EXPECT_FALSE(p2.particle3DBlend(0u)); - Particle3DContainer p3 = Particle3DContainer(p1); + Particle3DContainer p3 = {p1}; EXPECT_EQ(p3.containerSize(), 1u); EXPECT_EQ(p3.cumulativeAbundance(), 1); diff --git a/Tests/UnitTests/GUI/TestSessionItem.cpp b/Tests/UnitTests/GUI/TestSessionItem.cpp index 60f553df7e9cad3d8b792b0f78d287a643ec3855..3df7393f5dc002edfa95a4b3cbd3147ecde196a0 100644 --- a/Tests/UnitTests/GUI/TestSessionItem.cpp +++ b/Tests/UnitTests/GUI/TestSessionItem.cpp @@ -224,16 +224,16 @@ TEST_F(TestSessionItem, takeRow) TEST_F(TestSessionItem, dataRoles) { std::unique_ptr<SessionItem> item(new SessionItem("Some model type")); - item->setData(Qt::DisplayRole, 1234); - EXPECT_TRUE(item->data(Qt::DisplayRole) == 1234); - EXPECT_TRUE(item->data(Qt::EditRole) == 1234); - item->setData(Qt::EditRole, 5432); - EXPECT_TRUE(item->data(Qt::DisplayRole) == 5432); - EXPECT_TRUE(item->data(Qt::EditRole) == 5432); + item->setRoleProperty(Qt::DisplayRole, 1234); + EXPECT_TRUE(item->roleProperty(Qt::DisplayRole) == 1234); + EXPECT_TRUE(item->roleProperty(Qt::EditRole) == 1234); + item->setRoleProperty(Qt::EditRole, 5432); + EXPECT_TRUE(item->roleProperty(Qt::DisplayRole) == 5432); + EXPECT_TRUE(item->roleProperty(Qt::EditRole) == 5432); for (int i = 0; i < 10; i++) { - EXPECT_TRUE(item->data(SessionFlags::EndSessionRoles + i).isValid() == false); - item->setData(SessionFlags::EndSessionRoles + i, i); - EXPECT_TRUE(item->data(SessionFlags::EndSessionRoles + i) == i); + EXPECT_TRUE(item->roleProperty(SessionFlags::EndSessionRoles + i).isValid() == false); + item->setRoleProperty(SessionFlags::EndSessionRoles + i, i); + EXPECT_TRUE(item->roleProperty(SessionFlags::EndSessionRoles + i) == i); } }