diff --git a/GUI/coregui/Models/BeamItems.cpp b/GUI/coregui/Models/BeamItems.cpp index 3f7d52b894bd77831e85c127b60d5d5b56aac2af..614aa117053609332e996db25808775047acfde4 100644 --- a/GUI/coregui/Models/BeamItems.cpp +++ b/GUI/coregui/Models/BeamItems.cpp @@ -43,7 +43,7 @@ const QString BeamItem::P_INTENSITY = QString::fromStdString("Intensity"); const QString BeamItem::P_WAVELENGTH = QString::fromStdString("Wavelength"); const QString BeamItem::P_INCLINATION_ANGLE = QString::fromStdString("InclinationAngle"); const QString BeamItem::P_AZIMUTHAL_ANGLE = QString::fromStdString("AzimuthalAngle"); -const QString BeamItem::P_POLARIZATION = QString("Polarization"); +const QString BeamItem::P_POLARIZATION = "Polarization"; BeamItem::BeamItem(const QString& beam_model) : SessionItem(beam_model) { @@ -132,7 +132,7 @@ void BeamItem::setWavelengthProperty(const QString& wavelength_type) // Specular beam item /* ------------------------------------------------------------------------- */ -const QString SpecularBeamItem::P_FOOPTPRINT = QString("Footprint"); +const QString SpecularBeamItem::P_FOOPTPRINT = "Footprint"; const QString footprint_group_label("Type"); diff --git a/GUI/coregui/Models/JobWorker.cpp b/GUI/coregui/Models/JobWorker.cpp index 071356ef595bd19ce870d560e6adc9684aaa0859..89dc47a09291f23151a431568f7032a5d7faef90 100644 --- a/GUI/coregui/Models/JobWorker.cpp +++ b/GUI/coregui/Models/JobWorker.cpp @@ -59,7 +59,7 @@ void JobWorker::start() m_job_status = "Failed"; m_percentage_done = 100; m_failure_message = - QString("JobRunner::start() -> Simulation failed with exception throw:\n\n"); + "JobRunner::start() -> Simulation failed with exception throw:\n\n"; m_failure_message.append(QString(ex.what())); } @@ -67,7 +67,7 @@ void JobWorker::start() } else { m_job_status = "Failed"; m_percentage_done = 100; - m_failure_message = QString("JobRunner::start() -> Error. Simulation doesn't exist."); + m_failure_message = "JobRunner::start() -> Error. Simulation doesn't exist."; } emit progressUpdate(); diff --git a/GUI/coregui/Models/SampleValidator.cpp b/GUI/coregui/Models/SampleValidator.cpp index 4999de4487c8c4e95dfbf57ab2f7e6af55b375eb..0438d5f277210e35335986fd59f5b2315f09c1a7 100644 --- a/GUI/coregui/Models/SampleValidator.cpp +++ b/GUI/coregui/Models/SampleValidator.cpp @@ -56,7 +56,7 @@ void SampleValidator::validateItem(const SessionItem* item) } if (!diagnosis.isEmpty()) { m_valid_sample = false; - m_validation_message += QString("* ") + diagnosis + QString("\n"); + m_validation_message += QString("* ") + diagnosis + "\n"; } } diff --git a/GUI/coregui/Views/IntensityDataWidgets/SavePlotAssistant.cpp b/GUI/coregui/Views/IntensityDataWidgets/SavePlotAssistant.cpp index a4ce2e4c14c1099a69cb104c3d53378b2702b40a..c8cc41a7d78bd67b736ec35e4ec714cb0e36edc0 100644 --- a/GUI/coregui/Views/IntensityDataWidgets/SavePlotAssistant.cpp +++ b/GUI/coregui/Views/IntensityDataWidgets/SavePlotAssistant.cpp @@ -55,7 +55,7 @@ void SavePlotAssistant::savePlot(const QString& dirname, QCustomPlot* plot, { QString selectedFilter("*.png"); - QString defaultName = dirname + QString("/untitled"); + QString defaultName = dirname + "/untitled"; QString fileName = QFileDialog::getSaveFileName(0, "Save Plot", defaultName, getFilterString(), &selectedFilter); diff --git a/GUI/coregui/Views/IntensityDataWidgets/SaveProjectionsAssistant.cpp b/GUI/coregui/Views/IntensityDataWidgets/SaveProjectionsAssistant.cpp index 31234ace333ee7d34be060417e40c75d3a674e26..48ff790fb12b4ece100903fe23d51b270bc837e6 100644 --- a/GUI/coregui/Views/IntensityDataWidgets/SaveProjectionsAssistant.cpp +++ b/GUI/coregui/Views/IntensityDataWidgets/SaveProjectionsAssistant.cpp @@ -51,7 +51,7 @@ void SaveProjectionsAssistant::saveProjections(QWidget* parent, IntensityDataIte { Q_ASSERT(intensityItem); - QString defaultName = ProjectUtils::userExportDir() + QString("/untitled.txt"); + QString defaultName = ProjectUtils::userExportDir() + "/untitled.txt"; QString fileName = QFileDialog::getSaveFileName(parent, "Save projections data", defaultName); if (fileName.isEmpty()) @@ -95,7 +95,7 @@ QString SaveProjectionsAssistant::projectionsToString(const QString& projections auto bin_centers = projData.bin_centers; for (int i_point = 0; i_point < bin_centers.size(); ++i_point) { - out << to_double_str(bin_centers[i_point]) << QString(" "); + out << to_double_str(bin_centers[i_point]) << " "; for (auto& data : projData.projections) { out << to_scientific_str(data.bin_values[i_point]); } diff --git a/GUI/coregui/Views/RealSpaceWidgets/RealSpaceCanvas.cpp b/GUI/coregui/Views/RealSpaceWidgets/RealSpaceCanvas.cpp index b39e89f89aa301c01ff5b76fbbea8f5a1a3d0bf5..94fbcd7ee89d3dfe43b62c10501ca9127654b09c 100644 --- a/GUI/coregui/Views/RealSpaceWidgets/RealSpaceCanvas.cpp +++ b/GUI/coregui/Views/RealSpaceWidgets/RealSpaceCanvas.cpp @@ -143,7 +143,7 @@ void RealSpaceCanvas::savePicture(const QPixmap& pixmap) QString dirname = AppSvc::projectManager()->userExportDir(); QString defaultExtension = ".png"; QString selectedFilter("*" + defaultExtension); - QString defaultName = dirname + QString("/untitled"); + QString defaultName = dirname + "/untitled"; QString fileName = QFileDialog::getSaveFileName(nullptr, "Save 3D real space view", defaultName, selectedFilter); QString nameToSave = diff --git a/GUI/coregui/Views/SampleDesigner/NodeEditorPort.h b/GUI/coregui/Views/SampleDesigner/NodeEditorPort.h index c3cd3fba08cbbe61d3939bbe80f4143b14dc12ae..33b5d4b19ff176421a11946d8104cf424770b011 100644 --- a/GUI/coregui/Views/SampleDesigner/NodeEditorPort.h +++ b/GUI/coregui/Views/SampleDesigner/NodeEditorPort.h @@ -38,7 +38,7 @@ public: //! port direction enum EPortDirection { INPUT, OUTPUT }; - NodeEditorPort(QGraphicsItem* parent = 0, const QString& name = QString("unnamed"), + NodeEditorPort(QGraphicsItem* parent = 0, const QString& name = "unnamed", EPortDirection direction = INPUT, EPortType port_type = DEFAULT); virtual ~NodeEditorPort(); diff --git a/GUI/coregui/Views/SimulationWidgets/PythonScriptWidget.cpp b/GUI/coregui/Views/SimulationWidgets/PythonScriptWidget.cpp index fe7f66ee9488e29a63a2202685e560798741bbe3..137b1ff15fc8847ba8fa3b997bd98801be6ba87a 100644 --- a/GUI/coregui/Views/SimulationWidgets/PythonScriptWidget.cpp +++ b/GUI/coregui/Views/SimulationWidgets/PythonScriptWidget.cpp @@ -112,7 +112,7 @@ void PythonScriptWidget::onExportToFileButton() QString filters("Python scripts (*.py)"); QString defaultFilter("Python scripts (*.py)"); - QString defaultName = dirname + QString("/untitled"); + QString defaultName = dirname + "/untitled"; QString fileName = QFileDialog::getSaveFileName(nullptr, "Save file", defaultName, filters, &defaultFilter); diff --git a/GUI/coregui/mainwindow/UpdateNotifier.cpp b/GUI/coregui/mainwindow/UpdateNotifier.cpp index 9278801b27c8c0c77bcdea2cb99a24e0529c2074..2f0d5ff43eb4625bdd4c3e7269442e770f685ff0 100644 --- a/GUI/coregui/mainwindow/UpdateNotifier.cpp +++ b/GUI/coregui/mainwindow/UpdateNotifier.cpp @@ -56,7 +56,7 @@ void UpdateNotifier::replyFinished(QNetworkReply* reply) QString myVersion = GUIHelpers::getBornAgainVersionString(); // Testwise degrade version - // myVersion = QString("1.1.0"); + // myVersion = "1.1.0"; if (GUIHelpers::versionCode(versionString) > GUIHelpers::versionCode(myVersion)) { QString message("New version is available: <a href=\""); diff --git a/GUI/coregui/mainwindow/projectdocument.cpp b/GUI/coregui/mainwindow/projectdocument.cpp index a50f72652d8addecf283b6a0b1951a8a020d2ea6..36aec7f4745de7d2c9c09d6181a96547f17bd1dc 100644 --- a/GUI/coregui/mainwindow/projectdocument.cpp +++ b/GUI/coregui/mainwindow/projectdocument.cpp @@ -76,7 +76,7 @@ void ProjectDocument::setProjectFileName(const QString& projectFileName) QString ProjectDocument::projectFileExtension() { - return QString(".pro"); + return ".pro"; } void ProjectDocument::setApplicationModels(ApplicationModels* applicationModels) diff --git a/GUI/coregui/utils/GUIHelpers.cpp b/GUI/coregui/utils/GUIHelpers.cpp index 23c06bcf537ca22e8bfe08b3c7659ab64fb337d4..29f2149dbdd52f0fc5630743992921b2e4f42501 100644 --- a/GUI/coregui/utils/GUIHelpers.cpp +++ b/GUI/coregui/utils/GUIHelpers.cpp @@ -29,13 +29,13 @@ namespace QMap<QString, QString> initializeCharacterMap() { QMap<QString, QString> result; - result["\\"] = QString("_backslash_"); - result["/"] = QString("_slash_"); - result["\""] = QString("_quote_"); - result["<"] = QString("_lessthan_"); - result[">"] = QString("_greaterthan_"); - result["|"] = QString("_pipe_"); - result["?"] = QString("_questionmark_"); + result["\\"] = "_backslash_"; + result["/"] = "_slash_"; + result["\""] = "_quote_"; + result["<"] = "_lessthan_"; + result[">"] = "_greaterthan_"; + result["|"] = "_pipe_"; + result["?"] = "_questionmark_"; return result; } diff --git a/Tests/UnitTests/GUI/TestComboProperty.cpp b/Tests/UnitTests/GUI/TestComboProperty.cpp index 0112417eafeb9a9ab6b60de99ab4f05c4e78bddf..c4cc3b27f99ac2655d90dc35df44a935dc39a47a 100644 --- a/Tests/UnitTests/GUI/TestComboProperty.cpp +++ b/Tests/UnitTests/GUI/TestComboProperty.cpp @@ -106,7 +106,7 @@ TEST_F(TestComboProperty, stringOfValues) EXPECT_EQ(combo.selectedIndices(), QVector<int>({0})); // setting new string of values, containing current value. Current values should remain. - stringOfValues = QString("c1;b1;c3"); + stringOfValues = "c1;b1;c3"; combo.setStringOfValues(stringOfValues); EXPECT_EQ(combo.stringOfValues(), stringOfValues); EXPECT_EQ(combo.getValue(), "b1"); diff --git a/Tests/UnitTests/GUI/TestExternalProperty.cpp b/Tests/UnitTests/GUI/TestExternalProperty.cpp index 4de88b559b59c00c73e52a176a59d84f6e35b6f6..13bc99481fcb3df616a3cfa22d570e24170378a0 100644 --- a/Tests/UnitTests/GUI/TestExternalProperty.cpp +++ b/Tests/UnitTests/GUI/TestExternalProperty.cpp @@ -27,7 +27,7 @@ TEST_F(TestExternalProperty, test_initialState) property.setColor(QColor()); EXPECT_TRUE(property.isValid() == false); property.setText("aaa"); - EXPECT_TRUE(property.text() == QString("aaa")); + EXPECT_TRUE(property.text() == "aaa"); EXPECT_TRUE(property.isValid() == true); property.setText(QString()); EXPECT_TRUE(property.isValid() == false); diff --git a/Tests/UnitTests/GUI/TestGUIHelpers.cpp b/Tests/UnitTests/GUI/TestGUIHelpers.cpp index 40574ee42f0098632ca0a8cab2ece7743f0ef99d..4135eda92999e799cd5c1d6d24920e25b28d99fe 100644 --- a/Tests/UnitTests/GUI/TestGUIHelpers.cpp +++ b/Tests/UnitTests/GUI/TestGUIHelpers.cpp @@ -9,12 +9,12 @@ TEST_F(TestGUIHelpers, test_VersionString) { int vmajor(0), vminor(0), vpatch(0); - EXPECT_EQ(true, GUIHelpers::parseVersion(QString("1.5.0"), vmajor, vminor, vpatch)); + EXPECT_EQ(true, GUIHelpers::parseVersion("1.5.0", vmajor, vminor, vpatch)); EXPECT_EQ(1, vmajor); EXPECT_EQ(5, vminor); EXPECT_EQ(0, vpatch); - EXPECT_FALSE(GUIHelpers::parseVersion(QString("15.0"), vmajor, vminor, vpatch)); + EXPECT_FALSE(GUIHelpers::parseVersion("15.0", vmajor, vminor, vpatch)); QString min_version("1.5.0"); EXPECT_EQ(GUIHelpers::isVersionMatchMinimal("1.5.0", min_version), true); diff --git a/Tests/UnitTests/GUI/TestParticleDistributionItem.cpp b/Tests/UnitTests/GUI/TestParticleDistributionItem.cpp index ad08f9eb788393b690d61d914dfd22c521545465..477e5ff7d3bd5f023bb53c5bac83d260f6e3eb51 100644 --- a/Tests/UnitTests/GUI/TestParticleDistributionItem.cpp +++ b/Tests/UnitTests/GUI/TestParticleDistributionItem.cpp @@ -252,7 +252,7 @@ TEST_F(TestParticleDistributionItem, test_FromDomainLinked) linkedProp = distItem->getItemValue(ParticleDistributionItem::P_LINKED_PARAMETER).value<ComboProperty>(); - QStringList expectedLinked = QStringList() << QString("Particle/Cylinder/Height"); + QStringList expectedLinked = QStringList() << "Particle/Cylinder/Height"; EXPECT_EQ(linkedProp.selectedValues(), expectedLinked); EXPECT_EQ(linkedProp.getValue(), expectedLinked.at(0)); } diff --git a/Tests/UnitTests/GUI/TestTranslations.cpp b/Tests/UnitTests/GUI/TestTranslations.cpp index 5070f82f505818419723592a782632083259d143..4b59647dd42b6c3122724efe16fcb514f02dcb90 100644 --- a/Tests/UnitTests/GUI/TestTranslations.cpp +++ b/Tests/UnitTests/GUI/TestTranslations.cpp @@ -26,7 +26,7 @@ TEST_F(TestTranslations, test_TranslatePosition) SessionItem* xItem = positionItem->getItem(VectorItem::P_X); EXPECT_EQ(ModelPath::itemPathTranslation(*xItem, multilayer->parent()), - QString("MultiLayer/Layer/ParticleLayout/Particle/PositionX")); + "MultiLayer/Layer/ParticleLayout/Particle/PositionX"); } TEST_F(TestTranslations, test_TranslateRotation) @@ -45,7 +45,7 @@ TEST_F(TestTranslations, test_TranslateRotation) SessionItem* angleItem = rotationItem->getItem(XRotationItem::P_ANGLE); EXPECT_EQ(ModelPath::itemPathTranslation(*angleItem, multilayer->parent()), - QString("MultiLayer/Layer/ParticleLayout/Particle/XRotation/Angle")); + "MultiLayer/Layer/ParticleLayout/Particle/XRotation/Angle"); } TEST_F(TestTranslations, test_BeamDistributionNone) @@ -61,12 +61,12 @@ TEST_F(TestTranslations, test_BeamDistributionNone) SessionItem* value = distr->getItem(DistributionNoneItem::P_MEAN); EXPECT_EQ(ModelPath::itemPathTranslation(*value, instrument->parent()), - QString("Instrument/Beam/Wavelength")); + "Instrument/Beam/Wavelength"); SessionItem* inclinationAngle = beam->getItem(BeamItem::P_INCLINATION_ANGLE); distr = inclinationAngle->getGroupItem(BeamDistributionItem::P_DISTRIBUTION); value = distr->getItem(DistributionNoneItem::P_MEAN); EXPECT_EQ(ModelPath::itemPathTranslation(*value, instrument->parent()), - QString("Instrument/Beam/InclinationAngle")); + "Instrument/Beam/InclinationAngle"); }