/mvn"));
}
- addLabelAndWidget("Maven Path", m_mavenPath, layout, row);
+ addLabelAndWidget(QStringLiteral("Maven Path"), m_mavenPath, layout, row);
addHelpButton(
- "Maven Path",
- "Only required for indexing projects using Maven.
"
+ QStringLiteral("Maven Path"),
+ QStringLiteral("Only required for indexing projects using Maven.
"
"Provide the location of your installed Maven executable. You can also use the auto "
- "detection below.
",
+ "detection below."),
layout,
row);
row++;
@@ -418,25 +417,25 @@ void QtProjectWizardContentPreferences::populate(QGridLayout* layout, int& row)
addGap(layout, row);
- addTitle("Python", layout, row);
+ addTitle(QStringLiteral("Python"), layout, row);
m_pythonPostProcessing = addCheckBox(
- "Post Processing",
- "Add ambiguous edges for unsolved references (recommended)",
- "Enable a post processing step to solve unsolved references after the indexing is done. "
+ QStringLiteral("Post Processing"),
+ QStringLiteral("Add ambiguous edges for unsolved references (recommended)"),
+ QStringLiteral("
Enable a post processing step to solve unsolved references after the indexing is done. "
"
"
"These references will be marked \"ambiguous\" to indicate that some of these edges may "
"never "
"be encountered during runtime of the indexed code because the post processing only relies "
"on "
- "symbol names and types.
",
+ "symbol names and types."),
layout,
row);
addGap(layout, row);
- addTitle("C/C++", layout, row);
+ addTitle(QStringLiteral("C/C++"), layout, row);
}
void QtProjectWizardContentPreferences::load()
@@ -647,16 +646,17 @@ void QtProjectWizardContentPreferences::uiAutoScalingChanges(int index)
if (index == 0)
{
QString autoScale(qgetenv("QT_AUTO_SCREEN_SCALE_FACTOR_SOURCETRAIL"));
- if (autoScale == "1")
+ if (autoScale == QLatin1String("1"))
{
- autoScale = "on";
+ autoScale = QStringLiteral("on");
}
else
{
- autoScale = "off";
+ autoScale = QStringLiteral("off");
}
- m_screenAutoScalingInfoLabel->setText("detected: '" + autoScale + "'");
+ m_screenAutoScalingInfoLabel->setText(
+ QStringLiteral("detected: '") + autoScale + QStringLiteral("'"));
m_screenAutoScalingInfoLabel->show();
}
else
@@ -669,7 +669,7 @@ void QtProjectWizardContentPreferences::uiScaleFactorChanges(int index)
{
if (index == 0)
{
- QString scale = "100";
+ QString scale = QStringLiteral("100");
bool ok;
double scaleFactor = qgetenv("QT_SCALE_FACTOR_SOURCETRAIL").toDouble(&ok);
if (ok)
@@ -677,7 +677,8 @@ void QtProjectWizardContentPreferences::uiScaleFactorChanges(int index)
scale = QString::number(int(scaleFactor * 100));
}
- m_screenScaleFactorInfoLabel->setText("detected: '" + scale + "%'");
+ m_screenScaleFactorInfoLabel->setText(
+ QStringLiteral("detected: '") + scale + QStringLiteral("%'"));
m_screenScaleFactorInfoLabel->show();
}
else
@@ -694,7 +695,7 @@ void QtProjectWizardContentPreferences::addJavaPathDetection(QGridLayout* layout
return;
}
- QLabel* label = new QLabel("Auto detection from:");
+ QLabel* label = new QLabel(QStringLiteral("Auto detection from:"));
m_javaPathDetectorBox = new QComboBox();
@@ -703,8 +704,8 @@ void QtProjectWizardContentPreferences::addJavaPathDetection(QGridLayout* layout
m_javaPathDetectorBox->addItem(detectorName.c_str());
}
- QPushButton* button = new QPushButton("detect");
- button->setObjectName("windowButton");
+ QPushButton* button = new QPushButton(QStringLiteral("detect"));
+ button->setObjectName(QStringLiteral("windowButton"));
connect(
button,
&QPushButton::clicked,
@@ -734,7 +735,7 @@ void QtProjectWizardContentPreferences::addJreSystemLibraryPathsDetection(QGridL
return;
}
- QLabel* label = new QLabel("Auto detection from:");
+ QLabel* label = new QLabel(QStringLiteral("Auto detection from:"));
m_jreSystemLibraryPathsDetectorBox = new QComboBox();
@@ -743,8 +744,8 @@ void QtProjectWizardContentPreferences::addJreSystemLibraryPathsDetection(QGridL
m_jreSystemLibraryPathsDetectorBox->addItem(detectorName.c_str());
}
- QPushButton* button = new QPushButton("detect");
- button->setObjectName("windowButton");
+ QPushButton* button = new QPushButton(QStringLiteral("detect"));
+ button->setObjectName(QStringLiteral("windowButton"));
connect(
button,
&QPushButton::clicked,
@@ -773,7 +774,7 @@ void QtProjectWizardContentPreferences::addMavenPathDetection(QGridLayout* layou
return;
}
- QLabel* label = new QLabel("Auto detection from:");
+ QLabel* label = new QLabel(QStringLiteral("Auto detection from:"));
m_mavenPathDetectorBox = new QComboBox();
@@ -782,8 +783,8 @@ void QtProjectWizardContentPreferences::addMavenPathDetection(QGridLayout* layou
m_mavenPathDetectorBox->addItem(detectorName.c_str());
}
- QPushButton* button = new QPushButton("detect");
- button->setObjectName("windowButton");
+ QPushButton* button = new QPushButton(QStringLiteral("detect"));
+ button->setObjectName(QStringLiteral("windowButton"));
connect(
button,
&QPushButton::clicked,
@@ -935,7 +936,7 @@ QLineEdit* QtProjectWizardContentPreferences::addLineEdit(
QString label, QString helpText, QGridLayout* layout, int& row)
{
QLineEdit* lineEdit = new QLineEdit(this);
- lineEdit->setObjectName("name");
+ lineEdit->setObjectName(QStringLiteral("name"));
lineEdit->setAttribute(Qt::WA_MacShowFocusRect, 0);
addLabelAndWidget(label, lineEdit, layout, row);
diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentProjectData.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentProjectData.cpp
index fa6e8fd4..3d59ea60 100644
--- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentProjectData.cpp
+++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentProjectData.cpp
@@ -27,9 +27,9 @@ void QtProjectWizardContentProjectData::populate(QGridLayout* layout, int& row)
row++;
}
- QLabel* nameLabel = createFormLabel("Sourcetrail Project Name");
+ QLabel* nameLabel = createFormLabel(QStringLiteral("Sourcetrail Project Name"));
m_projectName = new QLineEdit();
- m_projectName->setObjectName("name");
+ m_projectName->setObjectName(QStringLiteral("name"));
m_projectName->setAttribute(Qt::WA_MacShowFocusRect, 0);
m_projectName->setEnabled(!m_disableNameEditing);
connect(
@@ -43,7 +43,7 @@ void QtProjectWizardContentProjectData::populate(QGridLayout* layout, int& row)
layout->setRowMinimumHeight(row, 30);
row++;
- QLabel* locationLabel = createFormLabel("Sourcetrail Project Location");
+ QLabel* locationLabel = createFormLabel(QStringLiteral("Sourcetrail Project Location"));
m_projectFileLocation = new QtLocationPicker(this);
m_projectFileLocation->setPickDirectory(true);
m_projectFileLocation->setEnabled(!m_disableNameEditing);
@@ -51,8 +51,8 @@ void QtProjectWizardContentProjectData::populate(QGridLayout* layout, int& row)
layout->addWidget(locationLabel, row, QtProjectWizardWindow::FRONT_COL, Qt::AlignRight);
layout->addWidget(m_projectFileLocation, row, QtProjectWizardWindow::BACK_COL, Qt::AlignTop);
addHelpButton(
- "Sourcetrail Project Location",
- "The directory the Sourcetrail project file (.srctrlprj) will be saved to.",
+ QStringLiteral("Sourcetrail Project Location"),
+ QStringLiteral("The directory the Sourcetrail project file (.srctrlprj) will be saved to."),
layout,
row);
layout->setRowMinimumHeight(row, 30);
@@ -84,7 +84,7 @@ bool QtProjectWizardContentProjectData::check()
if (m_projectName->text().isEmpty())
{
QMessageBox msgBox;
- msgBox.setText("Please enter a project name.");
+ msgBox.setText(QStringLiteral("Please enter a project name."));
msgBox.exec();
return false;
}
@@ -102,7 +102,7 @@ bool QtProjectWizardContentProjectData::check()
if (m_projectFileLocation->getText().isEmpty())
{
QMessageBox msgBox;
- msgBox.setText("Please define the location for the Sourcetrail project file.");
+ msgBox.setText(QStringLiteral("Please define the location for the Sourcetrail project file."));
msgBox.exec();
return false;
}
@@ -140,9 +140,9 @@ bool QtProjectWizardContentProjectData::check()
{
QMessageBox msgBox;
msgBox.setText(
- "The specified location does not exist. Do you want to create the directory?");
- msgBox.addButton("Abort", QMessageBox::ButtonRole::NoRole);
- QPushButton* createButton = msgBox.addButton("Create", QMessageBox::ButtonRole::YesRole);
+ QStringLiteral("The specified location does not exist. Do you want to create the directory?"));
+ msgBox.addButton(QStringLiteral("Abort"), QMessageBox::ButtonRole::NoRole);
+ QPushButton* createButton = msgBox.addButton(QStringLiteral("Create"), QMessageBox::ButtonRole::YesRole);
msgBox.setDefaultButton(createButton);
msgBox.setIcon(QMessageBox::Icon::Question);
int ret = msgBox.exec();
@@ -163,8 +163,8 @@ void QtProjectWizardContentProjectData::onProjectNameEdited(QString text)
{
const int cursorPosition = m_projectName->cursorPosition();
- QRegularExpression regex("[^A-Za-z0-9_.-]");
- text.replace(regex, "_");
+ QRegularExpression regex(QStringLiteral("[^A-Za-z0-9_.-]"));
+ text.replace(regex, QStringLiteral("_"));
m_projectName->setText(text);
m_projectName->setCursorPosition(cursorPosition);
diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSelect.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSelect.cpp
index e9c2ea5e..12640f35 100644
--- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSelect.cpp
+++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSelect.cpp
@@ -152,7 +152,7 @@ void QtProjectWizardContentSelect::populate(QGridLayout* layout, int& row)
for (auto& it: sourceGroupInfos)
{
QPushButton* b = new QPushButton(languageTypeToString(it.first).c_str(), this);
- b->setObjectName("menuButton");
+ b->setObjectName(QStringLiteral("menuButton"));
b->setCheckable(true);
b->setProperty("language_type", it.first);
m_languages->addButton(b);
@@ -194,7 +194,8 @@ void QtProjectWizardContentSelect::populate(QGridLayout* layout, int& row)
m_window->setNextEnabled(false);
m_title->setText("Source Group Types - " + m_languages->checkedButton()->text());
- m_description->setText(hasRecommeded ? "* recommended" : "");
+ m_description->setText(hasRecommeded ?
+ QStringLiteral("* recommended") : QLatin1String(""));
});
QtFlowLayout* flayout = new QtFlowLayout(10, 0, 0);
@@ -220,7 +221,7 @@ void QtProjectWizardContentSelect::populate(QGridLayout* layout, int& row)
if (sourceGroupIt.recommended)
{
- b->setStyleSheet("font-weight: bold");
+ b->setStyleSheet(QStringLiteral("font-weight: bold"));
}
b->setProperty("source_group_type", int(sourceGroupIt.type));
@@ -257,14 +258,14 @@ void QtProjectWizardContentSelect::populate(QGridLayout* layout, int& row)
containerLayout->setContentsMargins(0, 0, 0, 0);
QFrame* groupContainer = new QFrame();
- groupContainer->setObjectName("sourceGroupContainer");
+ groupContainer->setObjectName(QStringLiteral("sourceGroupContainer"));
groupContainer->setLayout(flayout);
containerLayout->addWidget(groupContainer, 0);
- m_description = new QLabel(" \n \n");
+ m_description = new QLabel(QStringLiteral(" \n \n"));
m_description->setWordWrap(true);
m_description->setOpenExternalLinks(true);
- m_description->setObjectName("sourceGroupDescription");
+ m_description->setObjectName(QStringLiteral("sourceGroupDescription"));
m_description->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse);
m_description->setMinimumHeight(80);
containerLayout->addWidget(m_description, 0);
@@ -272,8 +273,8 @@ void QtProjectWizardContentSelect::populate(QGridLayout* layout, int& row)
container->setLayout(containerLayout);
layout->addWidget(container, 0, QtProjectWizardWindow::BACK_COL);
- m_title = new QLabel("Source Group Types");
- m_title->setObjectName("sourceGroupTitle");
+ m_title = new QLabel(QStringLiteral("Source Group Types"));
+ m_title->setObjectName(QStringLiteral("sourceGroupTitle"));
layout->addWidget(m_title, 0, QtProjectWizardWindow::BACK_COL, Qt::AlignLeft | Qt::AlignTop);
@@ -321,7 +322,7 @@ bool QtProjectWizardContentSelect::check()
if (!sourceGroupChosen)
{
QMessageBox msgBox;
- msgBox.setText("Please choose a method of creating a new Source Group.");
+ msgBox.setText(QStringLiteral("Please choose a method of creating a new Source Group."));
msgBox.exec();
return false;
}
diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSourceGroupData.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSourceGroupData.cpp
index e489c187..e800b696 100644
--- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSourceGroupData.cpp
+++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSourceGroupData.cpp
@@ -15,24 +15,24 @@ QtProjectWizardContentSourceGroupData::QtProjectWizardContentSourceGroupData(
void QtProjectWizardContentSourceGroupData::populate(QGridLayout* layout, int& row)
{
m_name = new QLineEdit();
- m_name->setObjectName("name");
+ m_name->setObjectName(QStringLiteral("name"));
m_name->setAttribute(Qt::WA_MacShowFocusRect, 0);
connect(m_name, &QLineEdit::textEdited, this, &QtProjectWizardContentSourceGroupData::editedName);
layout->addWidget(
- createFormLabel("Source Group Name"), row, QtProjectWizardWindow::FRONT_COL, Qt::AlignRight);
+ createFormLabel(QStringLiteral("Source Group Name")), row, QtProjectWizardWindow::FRONT_COL, Qt::AlignRight);
layout->addWidget(m_name, row, QtProjectWizardWindow::BACK_COL);
row++;
- m_status = new QCheckBox("active");
+ m_status = new QCheckBox(QStringLiteral("active"));
connect(
m_status, &QCheckBox::toggled, this, &QtProjectWizardContentSourceGroupData::changedStatus);
layout->addWidget(
- createFormLabel("Status"), row, QtProjectWizardWindow::FRONT_COL, Qt::AlignRight);
+ createFormLabel(QStringLiteral("Status")), row, QtProjectWizardWindow::FRONT_COL, Qt::AlignRight);
layout->addWidget(m_status, row, QtProjectWizardWindow::BACK_COL);
addHelpButton(
- "Status",
+ QStringLiteral("Status"),
"Only source files of active Source Groups will be processed during indexing. "
"Inactive Source Groups will be ignored or cleared from the index.
Use this setting "
"to temporarily "
@@ -63,7 +63,7 @@ bool QtProjectWizardContentSourceGroupData::check()
if (m_name->text().isEmpty())
{
QMessageBox msgBox;
- msgBox.setText("Please enter a source group name.");
+ msgBox.setText(QStringLiteral("Please enter a source group name."));
msgBox.exec();
return false;
}
diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSourceGroupInfoText.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSourceGroupInfoText.cpp
index 08f14a07..babab833 100644
--- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSourceGroupInfoText.cpp
+++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSourceGroupInfoText.cpp
@@ -30,7 +30,7 @@ void QtProjectWizardContentSourceGroupInfoText::populate(QGridLayout* layout, in
"
Hint: If your project contains source code for multiple build targets, you can "
"add all of those source "
"files with one single source group as long as they all share the same parameters.
");
- infoLabel->setObjectName("info");
+ infoLabel->setObjectName(QStringLiteral("info"));
infoLabel->setWordWrap(true);
layoutHorz->addWidget(infoLabel);
diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentUnloadable.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentUnloadable.cpp
index 5ce35132..3762255a 100644
--- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentUnloadable.cpp
+++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentUnloadable.cpp
@@ -32,7 +32,7 @@ void QtProjectWizardContentUnloadable::populate(QGridLayout* layout, int& row)
QLabel* infoLabel = new QLabel(QString::fromStdString(
"The type \"" + m_settings->getTypeString() +
"\" of the selected Source Group is not supportetd by this version of Sourcetrail.
"));
- infoLabel->setObjectName("info");
+ infoLabel->setObjectName(QStringLiteral("info"));
infoLabel->setWordWrap(true);
layoutHorz->addWidget(infoLabel);
diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPaths.cpp b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPaths.cpp
index 497e5391..a7cb923b 100644
--- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPaths.cpp
+++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPaths.cpp
@@ -93,10 +93,10 @@ bool QtProjectWizardContentPaths::check()
"remove them before continuing?")
.arg(m_titleString));
msgBox.setDetailedText(missingPaths);
- QPushButton* removeButton = msgBox.addButton("Remove", QMessageBox::YesRole);
- QPushButton* keepButton = msgBox.addButton("Keep", QMessageBox::ButtonRole::NoRole);
+ QPushButton* removeButton = msgBox.addButton(QStringLiteral("Remove"), QMessageBox::YesRole);
+ QPushButton* keepButton = msgBox.addButton(QStringLiteral("Keep"), QMessageBox::ButtonRole::NoRole);
QPushButton* cancelButton = msgBox.addButton(
- "Cancel", QMessageBox::ButtonRole::RejectRole);
+ QStringLiteral("Cancel"), QMessageBox::ButtonRole::RejectRole);
msgBox.exec();
@@ -136,7 +136,7 @@ void QtProjectWizardContentPaths::addDetection(QGridLayout* layout, int row)
return;
}
- QLabel* label = new QLabel("Auto detection from:");
+ QLabel* label = new QLabel(QStringLiteral("Auto detection from:"));
m_detectorBox = new QComboBox();
@@ -145,8 +145,8 @@ void QtProjectWizardContentPaths::addDetection(QGridLayout* layout, int row)
m_detectorBox->addItem(detectorName.c_str());
}
- QPushButton* button = new QPushButton("detect");
- button->setObjectName("windowButton");
+ QPushButton* button = new QPushButton(QStringLiteral("detect"));
+ button->setObjectName(QStringLiteral("windowButton"));
connect(button, &QPushButton::clicked, this, &QtProjectWizardContentPaths::detectionClicked);
QHBoxLayout* hlayout = new QHBoxLayout();
diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsExclude.cpp b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsExclude.cpp
index 2482c159..85594df8 100644
--- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsExclude.cpp
+++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsExclude.cpp
@@ -10,7 +10,7 @@ QtProjectWizardContentPathsExclude::QtProjectWizardContentPathsExclude(
: QtProjectWizardContentPaths(
settings, window, QtPathListBox::SELECTION_POLICY_FILES_AND_DIRECTORIES, false)
{
- setTitleString("Excluded Files & Directories");
+ setTitleString(QStringLiteral("Excluded Files & Directories"));
setHelpString(
"These paths define the files and directories that will be left out from indexing.
"
"Hints:"
diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsSource.cpp b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsSource.cpp
index cbf81240..00705c49 100644
--- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsSource.cpp
+++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsSource.cpp
@@ -28,10 +28,10 @@ QtProjectWizardContentPathsSource::QtProjectWizardContentPathsSource(
: QtProjectWizardContentPaths(
settings, window, QtPathListBox::SELECTION_POLICY_FILES_AND_DIRECTORIES)
{
- m_showFilesString = "show files";
+ m_showFilesString = QStringLiteral("show files");
- setTitleString("Files & Directories to Index");
- setHelpString(
+ setTitleString(QStringLiteral("Files & Directories to Index"));
+ setHelpString(QStringLiteral(
"These paths define the files and directories that will be indexed by Sourcetrail. Provide "
"a directory to recursively "
"add all contained source and header files.
"
@@ -40,7 +40,7 @@ QtProjectWizardContentPathsSource::QtProjectWizardContentPathsSource(
"kept at a different location, "
"you will also need to add that directory.
"
"
"
- "You can make use of environment variables with ${ENV_VAR}.");
+ "You can make use of environment variables with ${ENV_VAR}."));
}
void QtProjectWizardContentPathsSource::load()
@@ -102,10 +102,10 @@ std::vector QtProjectWizardContentPathsSource::getFilePaths() const
QString QtProjectWizardContentPathsSource::getFileNamesTitle() const
{
- return "Indexed Files";
+ return QStringLiteral("Indexed Files");
}
QString QtProjectWizardContentPathsSource::getFileNamesDescription() const
{
- return " files will be indexed.";
+ return QStringLiteral(" files will be indexed.");
}
diff --git a/src/lib_gui/qt/utility/QtFileDialog.cpp b/src/lib_gui/qt/utility/QtFileDialog.cpp
index d6a3028a..835c34b0 100644
--- a/src/lib_gui/qt/utility/QtFileDialog.cpp
+++ b/src/lib_gui/qt/utility/QtFileDialog.cpp
@@ -22,7 +22,7 @@ QStringList QtFileDialog::getFileNamesAndDirectories(QWidget* parent, const File
dialog->setDirectory(dir);
}
- QListView* l = dialog->findChild("listView");
+ QListView* l = dialog->findChild(QStringLiteral("listView"));
if (l)
{
l->setSelectionMode(QAbstractItemView::ExtendedSelection);
@@ -73,8 +73,8 @@ QString QtFileDialog::showSaveFileDialog(
dialog.setWindowModality(Qt::WindowModal);
}
- QRegExp filter_regex(QLatin1String("(?:^\\*\\.(?!.*\\()|\\(\\*\\.)(\\w+)"));
- QStringList filters = filter.split(QLatin1String(";;"));
+ QRegExp filter_regex(QStringLiteral("(?:^\\*\\.(?!.*\\()|\\(\\*\\.)(\\w+)"));
+ QStringList filters = filter.split(QStringLiteral(";;"));
if (!filters.isEmpty())
{
@@ -93,7 +93,7 @@ QString QtFileDialog::showSaveFileDialog(
if (filter_regex.indexIn(dialog.selectedNameFilter()) != -1)
{
QString extension = filter_regex.cap(1);
- file_name += QLatin1String(".") + extension;
+ file_name += QStringLiteral(".") + extension;
}
}
return file_name;
diff --git a/src/lib_gui/qt/utility/QtFilesAndDirectoriesDialog.cpp b/src/lib_gui/qt/utility/QtFilesAndDirectoriesDialog.cpp
index 6fbb4cb9..d3e4854e 100644
--- a/src/lib_gui/qt/utility/QtFilesAndDirectoriesDialog.cpp
+++ b/src/lib_gui/qt/utility/QtFilesAndDirectoriesDialog.cpp
@@ -13,7 +13,7 @@ QtFilesAndDirectoriesDialog::QtFilesAndDirectoriesDialog(QWidget* parent): QFile
setOption(QFileDialog::DontUseNativeDialog, true);
for (QPushButton* button: findChildren())
{
- if (button->text().toLower().contains("open") || button->text().toLower().contains("choose"))
+ if (button->text().toLower().contains(QLatin1String("open")) || button->text().toLower().contains(QLatin1String("choose")))
{
button->installEventFilter(this);
button->disconnect(SIGNAL(clicked()));
diff --git a/src/lib_gui/qt/utility/QtHighlighter.cpp b/src/lib_gui/qt/utility/QtHighlighter.cpp
index b977be1b..82398751 100644
--- a/src/lib_gui/qt/utility/QtHighlighter.cpp
+++ b/src/lib_gui/qt/utility/QtHighlighter.cpp
@@ -119,11 +119,11 @@ void QtHighlighter::loadHighlightingRules()
QJsonObject ruleObj = value.toObject();
HighlightType type = highlightTypeFromString(
- ruleObj.value("type").toString().toStdString());
+ ruleObj.value(QStringLiteral("type")).toString().toStdString());
- bool priority = ruleObj.value("priority").toBool();
+ bool priority = ruleObj.value(QStringLiteral("priority")).toBool();
- QJsonArray patterns = ruleObj.value("patterns").toArray();
+ QJsonArray patterns = ruleObj.value(QStringLiteral("patterns")).toArray();
for (QJsonValueRef pattern: patterns)
{
if (pattern.isString())
@@ -132,7 +132,7 @@ void QtHighlighter::loadHighlightingRules()
}
}
- QJsonObject range = ruleObj.value("range").toObject();
+ QJsonObject range = ruleObj.value(QStringLiteral("range")).toObject();
if (!range.empty())
{
rules.push_back(HighlightingRule(
diff --git a/src/lib_gui/qt/view/QtBookmarkButtonsView.cpp b/src/lib_gui/qt/view/QtBookmarkButtonsView.cpp
index e18f9b67..1de8abf3 100644
--- a/src/lib_gui/qt/view/QtBookmarkButtonsView.cpp
+++ b/src/lib_gui/qt/view/QtBookmarkButtonsView.cpp
@@ -18,7 +18,7 @@ QtBookmarkButtonsView::QtBookmarkButtonsView(ViewLayout* viewLayout)
: BookmarkButtonsView(viewLayout), m_createButtonState(MessageBookmarkButtonState::CANNOT_CREATE)
{
m_widget = new QFrame();
- m_widget->setObjectName("bookmark_bar");
+ m_widget->setObjectName(QStringLiteral("bookmark_bar"));
QBoxLayout* layout = new QHBoxLayout();
layout->setSpacing(0);
@@ -28,8 +28,8 @@ QtBookmarkButtonsView::QtBookmarkButtonsView(ViewLayout* viewLayout)
m_createBookmarkButton = new QtSearchBarButton(
ResourcePaths::getGuiPath().concatenate(L"bookmark_view/images/edit_bookmark_icon.png"));
- m_createBookmarkButton->setObjectName("bookmark_button");
- m_createBookmarkButton->setToolTip("create a bookmark for the active symbol");
+ m_createBookmarkButton->setObjectName(QStringLiteral("bookmark_button"));
+ m_createBookmarkButton->setToolTip(QStringLiteral("create a bookmark for the active symbol"));
m_createBookmarkButton->setEnabled(false);
layout->addWidget(m_createBookmarkButton);
@@ -41,8 +41,8 @@ QtBookmarkButtonsView::QtBookmarkButtonsView(ViewLayout* viewLayout)
m_showBookmarksButton = new QtSearchBarButton(
ResourcePaths::getGuiPath().concatenate(L"bookmark_view/images/bookmark_list_icon.png"));
- m_showBookmarksButton->setObjectName("show_bookmark_button");
- m_showBookmarksButton->setToolTip("Show bookmarks");
+ m_showBookmarksButton->setObjectName(QStringLiteral("show_bookmark_button"));
+ m_showBookmarksButton->setToolTip(QStringLiteral("Show bookmarks"));
layout->addWidget(m_showBookmarksButton);
connect(
@@ -105,11 +105,11 @@ void QtBookmarkButtonsView::createBookmarkClicked()
else if (m_createButtonState == MessageBookmarkButtonState::ALREADY_CREATED)
{
QMessageBox msgBox;
- msgBox.setText("Edit Bookmark");
- msgBox.setInformativeText("Do you want to edit or delete the bookmark for this symbol?");
- msgBox.addButton("Edit", QMessageBox::ButtonRole::YesRole);
- msgBox.addButton("Delete", QMessageBox::ButtonRole::NoRole);
- QPushButton* cancelButton = msgBox.addButton("Cancel", QMessageBox::ButtonRole::RejectRole);
+ msgBox.setText(QStringLiteral("Edit Bookmark"));
+ msgBox.setInformativeText(QStringLiteral("Do you want to edit or delete the bookmark for this symbol?"));
+ msgBox.addButton(QStringLiteral("Edit"), QMessageBox::ButtonRole::YesRole);
+ msgBox.addButton(QStringLiteral("Delete"), QMessageBox::ButtonRole::NoRole);
+ QPushButton* cancelButton = msgBox.addButton(QStringLiteral("Cancel"), QMessageBox::ButtonRole::RejectRole);
msgBox.setDefaultButton(cancelButton);
msgBox.setIcon(QMessageBox::Icon::Question);
int ret = msgBox.exec();
diff --git a/src/lib_gui/qt/view/QtCustomTrailView.cpp b/src/lib_gui/qt/view/QtCustomTrailView.cpp
index 0a0da8a7..6d98ac11 100644
--- a/src/lib_gui/qt/view/QtCustomTrailView.cpp
+++ b/src/lib_gui/qt/view/QtCustomTrailView.cpp
@@ -24,7 +24,7 @@ QtCustomTrailView::QtCustomTrailView(ViewLayout* viewLayout)
, CustomTrailView(nullptr)
, m_controllerProxy(this, TabId::app())
{
- setWindowTitle("Custom Trail");
+ setWindowTitle(QStringLiteral("Custom Trail"));
setWindowFlags(Qt::Window);
QGridLayout* mainLayout = new QGridLayout();
@@ -40,13 +40,13 @@ QtCustomTrailView::QtCustomTrailView(ViewLayout* viewLayout)
QWidget* panelC2 = new QWidget();
QWidget* panelD = new QWidget();
- panelA1->setObjectName("panelA");
- panelA2->setObjectName("panelA");
- panelB1->setObjectName("panelB");
- panelB2->setObjectName("panelB");
- panelC1->setObjectName("panelA");
- panelC2->setObjectName("panelA");
- panelD->setObjectName("panelB2");
+ panelA1->setObjectName(QStringLiteral("panelA"));
+ panelA2->setObjectName(QStringLiteral("panelA"));
+ panelB1->setObjectName(QStringLiteral("panelB"));
+ panelB2->setObjectName(QStringLiteral("panelB"));
+ panelC1->setObjectName(QStringLiteral("panelA"));
+ panelC2->setObjectName(QStringLiteral("panelA"));
+ panelD->setObjectName(QStringLiteral("panelB2"));
mainLayout->addWidget(panelA1, 0, 0);
mainLayout->addWidget(panelA2, 0, 1);
@@ -62,10 +62,10 @@ QtCustomTrailView::QtCustomTrailView(ViewLayout* viewLayout)
hLayout->setContentsMargins(25, 10, 10, 10);
panelA1->setLayout(hLayout);
- m_searchBoxFrom = new QtSmartSearchBox("Start Symbol", false);
- m_searchBoxTo = new QtSmartSearchBox("Target Symbol", false);
+ m_searchBoxFrom = new QtSmartSearchBox(QStringLiteral("Start Symbol"), false);
+ m_searchBoxTo = new QtSmartSearchBox(QStringLiteral("Target Symbol"), false);
- hLayout->addWidget(new QLabel("From:"));
+ hLayout->addWidget(new QLabel(QStringLiteral("From:")));
hLayout->addWidget(createSearchBox(m_searchBoxFrom));
hLayout->addSpacing(15);
@@ -130,11 +130,11 @@ QtCustomTrailView::QtCustomTrailView(ViewLayout* viewLayout)
hLayout->setContentsMargins(25, 10, 10, 10);
panelB1->setLayout(hLayout);
- hLayout->addWidget(new QLabel("Max Depth:"));
+ hLayout->addWidget(new QLabel(QStringLiteral("Max Depth:")));
m_slider = new QSlider(Qt::Horizontal);
- m_slider->setObjectName("depth_slider");
- m_slider->setToolTip("adjust graph depth");
+ m_slider->setObjectName(QStringLiteral("depth_slider"));
+ m_slider->setToolTip(QStringLiteral("adjust graph depth"));
m_slider->setMinimum(1);
m_slider->setMaximum(51);
m_slider->setMinimumWidth(150);
@@ -149,7 +149,7 @@ QtCustomTrailView::QtCustomTrailView(ViewLayout* viewLayout)
connect(m_slider, &QSlider::valueChanged, [this, valueLabel](int) {
if (m_slider->value() == m_slider->maximum())
{
- valueLabel->setText("inf");
+ valueLabel->setText(QStringLiteral("inf"));
}
else
{
@@ -167,12 +167,12 @@ QtCustomTrailView::QtCustomTrailView(ViewLayout* viewLayout)
hLayout->setSpacing(15);
panelB2->setLayout(hLayout);
- m_horizontalButton = new QRadioButton("Horizontal");
- m_verticalButton = new QRadioButton("Vertical");
+ m_horizontalButton = new QRadioButton(QStringLiteral("Horizontal"));
+ m_verticalButton = new QRadioButton(QStringLiteral("Vertical"));
m_horizontalButton->setChecked(true);
- hLayout->addWidget(new QLabel("Layout Direction:"));
+ hLayout->addWidget(new QLabel(QStringLiteral("Layout Direction:")));
hLayout->addWidget(m_horizontalButton);
hLayout->addWidget(m_verticalButton);
@@ -219,7 +219,7 @@ QtCustomTrailView::QtCustomTrailView(ViewLayout* viewLayout)
QColor(scheme->getNodeTypeColor(t, "fill", ColorScheme::FOCUS).c_str()));
}
- QVBoxLayout* filterLayout = addFilters("Nodes:", nodeFilters, nodeColors, &m_nodeFilters, 11);
+ QVBoxLayout* filterLayout = addFilters(QStringLiteral("Nodes:"), nodeFilters, nodeColors, &m_nodeFilters, 11);
filterLayout->setContentsMargins(25, 10, 25, 10);
panelC1->setLayout(filterLayout);
}
@@ -255,24 +255,24 @@ QtCustomTrailView::QtCustomTrailView(ViewLayout* viewLayout)
edgeColors.push_back(QColor(scheme->getEdgeTypeColor(t, ColorScheme::FOCUS).c_str()));
}
- QVBoxLayout* filterLayout = addFilters("Edges:", edgeFilters, edgeColors, &m_edgeFilters, 5);
+ QVBoxLayout* filterLayout = addFilters(QStringLiteral("Edges:"), edgeFilters, edgeColors, &m_edgeFilters, 5);
filterLayout->setContentsMargins(10, 10, 25, 10);
panelC2->setLayout(filterLayout);
}
// controls
{
- QPushButton* cancelButton = new QPushButton("Cancel");
- QPushButton* searchButton = new QPushButton("Search");
+ QPushButton* cancelButton = new QPushButton(QStringLiteral("Cancel"));
+ QPushButton* searchButton = new QPushButton(QStringLiteral("Search"));
- cancelButton->setObjectName("button");
- searchButton->setObjectName("button");
+ cancelButton->setObjectName(QStringLiteral("button"));
+ searchButton->setObjectName(QStringLiteral("button"));
cancelButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
searchButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
m_errorLabel = new QLabel();
- m_errorLabel->setObjectName("error");
+ m_errorLabel->setObjectName(QStringLiteral("error"));
QHBoxLayout* hLayout = new QHBoxLayout();
hLayout->setContentsMargins(25, 15, 25, 15);
@@ -289,7 +289,7 @@ QtCustomTrailView::QtCustomTrailView(ViewLayout* viewLayout)
if (m_searchBoxFrom->getMatches().size() == 0 ||
m_searchBoxFrom->getMatches().front().tokenIds.size() == 0)
{
- setError("No 'Start Symbol' symbol found.");
+ setError(QStringLiteral("No 'Start Symbol' symbol found."));
return;
}
@@ -309,7 +309,7 @@ QtCustomTrailView::QtCustomTrailView(ViewLayout* viewLayout)
}
else
{
- setError("No 'Target Symbol' symbol found.");
+ setError(QStringLiteral("No 'Target Symbol' symbol found."));
return;
}
}
@@ -319,13 +319,13 @@ QtCustomTrailView::QtCustomTrailView(ViewLayout* viewLayout)
if (!nodeTypes)
{
- setError("No 'Nodes' selected.");
+ setError(QStringLiteral("No 'Nodes' selected."));
return;
}
if (!edgeTypes)
{
- setError("No 'Edges' selected.");
+ setError(QStringLiteral("No 'Edges' selected."));
return;
}
@@ -340,7 +340,7 @@ QtCustomTrailView::QtCustomTrailView(ViewLayout* viewLayout)
m_controllerProxy.executeAsTaskWithArgs(&CustomTrailController::activateTrail, message);
- setError("");
+ setError(QLatin1String(""));
hide();
});
@@ -464,7 +464,7 @@ void QtCustomTrailView::updateStyleSheet()
QWidget* QtCustomTrailView::createSearchBox(QtSmartSearchBox* searchBox) const
{
QWidget* searchBoxContainer = new QWidget();
- searchBoxContainer->setObjectName("search_box_container");
+ searchBoxContainer->setObjectName(QStringLiteral("search_box_container"));
searchBoxContainer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
searchBox->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Maximum);
@@ -516,7 +516,7 @@ QVBoxLayout* QtCustomTrailView::addFilters(
if (checkBoxes == &m_nodeFilters)
{
- m_nodeNonIndexed = new QCheckBox("non-indexed");
+ m_nodeNonIndexed = new QCheckBox(QStringLiteral("non-indexed"));
m_nodeNonIndexed->setChecked(true);
checkBoxes->push_back(m_nodeNonIndexed);
@@ -525,7 +525,7 @@ QVBoxLayout* QtCustomTrailView::addFilters(
}
else if (checkBoxes == &m_edgeFilters)
{
- m_edgeMember = new QCheckBox("member");
+ m_edgeMember = new QCheckBox(QStringLiteral("member"));
m_edgeMember->setChecked(true);
checkBoxes->push_back(m_edgeMember);
@@ -546,11 +546,11 @@ QHBoxLayout* QtCustomTrailView::addCheckButtons(const std::vector& c
{
QHBoxLayout* buttonLayout = new QHBoxLayout();
- QPushButton* checkButton = new QPushButton("Check All");
- QPushButton* uncheckButton = new QPushButton("Uncheck All");
+ QPushButton* checkButton = new QPushButton(QStringLiteral("Check All"));
+ QPushButton* uncheckButton = new QPushButton(QStringLiteral("Uncheck All"));
- checkButton->setObjectName("button_small");
- uncheckButton->setObjectName("button_small");
+ checkButton->setObjectName(QStringLiteral("button_small"));
+ uncheckButton->setObjectName(QStringLiteral("button_small"));
buttonLayout->addWidget(checkButton);
buttonLayout->addWidget(uncheckButton);
diff --git a/src/lib_gui/qt/view/QtDialogView.cpp b/src/lib_gui/qt/view/QtDialogView.cpp
index d8d58314..45ecbb1a 100644
--- a/src/lib_gui/qt/view/QtDialogView.cpp
+++ b/src/lib_gui/qt/view/QtDialogView.cpp
@@ -249,7 +249,7 @@ void QtDialogView::updateCustomIndexingDialog(
m_windowStack.getTopWindow());
if (window)
{
- window->updateTitle("Executing Commands");
+ window->updateTitle(QStringLiteral("Executing Commands"));
}
});
}
diff --git a/src/lib_gui/qt/view/QtErrorView.cpp b/src/lib_gui/qt/view/QtErrorView.cpp
index bbc6e5c3..94578961 100644
--- a/src/lib_gui/qt/view/QtErrorView.cpp
+++ b/src/lib_gui/qt/view/QtErrorView.cpp
@@ -57,13 +57,13 @@ QtErrorView::QtErrorView(ViewLayout* viewLayout)
m_table->setColumnHidden(Column::ID, true);
QStringList headers;
- headers << "ID"
- << "Type"
- << "Message"
- << "File"
- << "Line"
- << "Indexed"
- << "Translation Unit";
+ headers << QStringLiteral("ID")
+ << QStringLiteral("Type")
+ << QStringLiteral("Message")
+ << QStringLiteral("File")
+ << QStringLiteral("Line")
+ << QStringLiteral("Indexed")
+ << QStringLiteral("Translation Unit");
m_model->setHorizontalHeaderLabels(headers);
connect(m_table, &QTableView::clicked, [=](const QModelIndex& index) {
@@ -88,16 +88,16 @@ QtErrorView::QtErrorView(ViewLayout* viewLayout)
checkboxes->setSpacing(0);
{
- m_showFatals = createFilterCheckbox("Fatals", m_errorFilter.fatal, checkboxes);
- m_showErrors = createFilterCheckbox("Errors", m_errorFilter.error, checkboxes);
+ m_showFatals = createFilterCheckbox(QStringLiteral("Fatals"), m_errorFilter.fatal, checkboxes);
+ m_showErrors = createFilterCheckbox(QStringLiteral("Errors"), m_errorFilter.error, checkboxes);
m_showNonIndexedFatals = createFilterCheckbox(
- "Fatals in non-indexed files", m_errorFilter.unindexedFatal, checkboxes);
+ QStringLiteral("Fatals in non-indexed files"), m_errorFilter.unindexedFatal, checkboxes);
m_showNonIndexedErrors = createFilterCheckbox(
- "Errors in non-indexed files", m_errorFilter.unindexedError, checkboxes);
+ QStringLiteral("Errors in non-indexed files"), m_errorFilter.unindexedError, checkboxes);
m_helpButton = new QtHelpButton(
- "Fixing Errors",
- "Please read this if your project is showing errors after indexing.
"
+ QStringLiteral("Fixing Errors"),
+ QStringLiteral("Please read this if your project is showing errors after indexing.
"
"There are different types of errors:"
""
"- Fatals cause the indexer to stop. All or big parts of indexed information "
@@ -121,22 +121,22 @@ QtErrorView::QtErrorView(ViewLayout* viewLayout)
"
"
"You should be able to find information about errors you are not familiar with online. "
"Double click "
- "an error message in the table to select it for copying.
");
- m_helpButton->setObjectName("help_button");
+ "an error message in the table to select it for copying.
"));
+ m_helpButton->setObjectName(QStringLiteral("help_button"));
checkboxes->addWidget(m_helpButton);
}
checkboxes->addStretch();
{
- m_allLabel = new QLabel("");
+ m_allLabel = new QLabel(QLatin1String(""));
checkboxes->addWidget(m_allLabel);
m_allLabel->hide();
checkboxes->addSpacing(5);
- m_allButton = new QPushButton("");
- m_allButton->setObjectName("screen_button");
+ m_allButton = new QPushButton(QLatin1String(""));
+ m_allButton->setObjectName(QStringLiteral("screen_button"));
connect(m_allButton, &QPushButton::clicked, [=]() {
m_errorFilter.limit = 0;
errorFilterChanged();
@@ -144,7 +144,7 @@ QtErrorView::QtErrorView(ViewLayout* viewLayout)
checkboxes->addWidget(m_allButton);
m_allButton->hide();
- m_errorLabel = new QLabel("");
+ m_errorLabel = new QLabel(QLatin1String(""));
checkboxes->addWidget(m_errorLabel);
}
@@ -152,11 +152,11 @@ QtErrorView::QtErrorView(ViewLayout* viewLayout)
{
m_editButton = new QtSelfRefreshIconButton(
- "Edit Project",
+ QStringLiteral("Edit Project"),
ResourcePaths::getGuiPath().concatenate(L"code_view/images/edit.png"),
"window/button");
- m_editButton->setObjectName("screen_button");
- m_editButton->setToolTip("edit project");
+ m_editButton->setObjectName(QStringLiteral("screen_button"));
+ m_editButton->setToolTip(QStringLiteral("edit project"));
connect(m_editButton, &QPushButton::clicked, []() { MessageProjectEdit().dispatch(); });
checkboxes->addWidget(m_editButton);
@@ -222,7 +222,7 @@ void QtErrorView::addErrors(
m_errorLabel->setText(
"displaying " + QString::number(errorCount.total) + " error" +
(errorCount.total != 1 ? "s" : "") +
- (errorCount.fatal > 0 ? " (" + QString::number(errorCount.fatal) + " fatal)" : "") +
+ (errorCount.fatal > 0 ? " (" + QString::number(errorCount.fatal) + " fatal)" : QLatin1String("")) +
"");
});
}
@@ -279,6 +279,7 @@ void QtErrorView::setErrorFilter(const ErrorFilter& filter)
void QtErrorView::errorFilterChanged(int i)
{
+ Q_UNUSED(i)
m_table->selectionModel()->clearSelection();
m_errorFilter.error = m_showErrors->isChecked();
@@ -327,7 +328,8 @@ void QtErrorView::addErrorToTable(const ErrorInfo& error)
item->setData(QVariant(qlonglong(error.id)), Qt::DisplayRole);
m_model->setItem(rowNumber, Column::ID, item);
- m_model->setItem(rowNumber, Column::TYPE, new QStandardItem(error.fatal ? "FATAL" : "ERROR"));
+ m_model->setItem(rowNumber, Column::TYPE, new QStandardItem(error.fatal ?
+ QStringLiteral("FATAL") : QStringLiteral("ERROR")));
if (error.fatal)
{
m_model->item(rowNumber, Column::TYPE)->setForeground(QBrush(Qt::red));
@@ -345,7 +347,8 @@ void QtErrorView::addErrorToTable(const ErrorInfo& error)
item->setData(QVariant(qlonglong(error.lineNumber)), Qt::DisplayRole);
m_model->setItem(rowNumber, Column::LINE, item);
- m_model->setItem(rowNumber, Column::INDEXED, new QStandardItem(error.indexed ? "yes" : "no"));
+ m_model->setItem(rowNumber, Column::INDEXED, new QStandardItem(error.indexed ?
+ QStringLiteral("yes") : QStringLiteral("no")));
m_model->setItem(
rowNumber,
diff --git a/src/lib_gui/qt/view/QtGraphView.cpp b/src/lib_gui/qt/view/QtGraphView.cpp
index e047102e..d5c99260 100644
--- a/src/lib_gui/qt/view/QtGraphView.cpp
+++ b/src/lib_gui/qt/view/QtGraphView.cpp
@@ -80,11 +80,11 @@ QtGraphView::QtGraphView(ViewLayout* viewLayout)
{
m_expandButton = new QtSelfRefreshIconButton(
- "",
+ QLatin1String(""),
ResourcePaths::getGuiPath().concatenate(L"graph_view/images/graph.png"),
"search/button");
- m_expandButton->setObjectName("expand_button");
- m_expandButton->setToolTip("show trail controls");
+ m_expandButton->setObjectName(QStringLiteral("expand_button"));
+ m_expandButton->setToolTip(QStringLiteral("show trail controls"));
m_expandButton->setIconSize(QSize(16, 16));
m_expandButton->setGeometry(0, 0, 26, 26);
connect(m_expandButton, &QPushButton::clicked, this, &QtGraphView::clickedExpand);
@@ -97,44 +97,44 @@ QtGraphView::QtGraphView(ViewLayout* viewLayout)
stack->addWidget(ui);
m_collapseButton = new QtSelfRefreshIconButton(
- "",
+ QLatin1String(""),
ResourcePaths::getGuiPath().concatenate(L"graph_view/images/graph_arrow.png"),
"search/button",
ui);
- m_collapseButton->setObjectName("collapse_button");
- m_collapseButton->setToolTip("hide trail controls");
+ m_collapseButton->setObjectName(QStringLiteral("collapse_button"));
+ m_collapseButton->setToolTip(QStringLiteral("hide trail controls"));
m_collapseButton->setIconSize(QSize(16, 16));
connect(m_collapseButton, &QPushButton::clicked, this, &QtGraphView::clickedCollapse);
- m_customTrailButton = new QtSelfRefreshIconButton("", FilePath(), "search/button", ui);
- m_customTrailButton->setObjectName("trail_button");
+ m_customTrailButton = new QtSelfRefreshIconButton(QLatin1String(""), FilePath(), "search/button", ui);
+ m_customTrailButton->setObjectName(QStringLiteral("trail_button"));
m_customTrailButton->setIconSize(QSize(16, 16));
- m_customTrailButton->setToolTip("custom trail");
+ m_customTrailButton->setToolTip(QStringLiteral("custom trail"));
m_customTrailButton->setIconPath(
ResourcePaths::getGuiPath().concatenate(L"graph_view/images/graph_custom.png"));
connect(
m_customTrailButton, &QPushButton::clicked, this, &QtGraphView::clickedCustomTrail);
- m_forwardTrailButton = new QtSelfRefreshIconButton("", FilePath(), "search/button", ui);
- m_forwardTrailButton->setObjectName("trail_button");
+ m_forwardTrailButton = new QtSelfRefreshIconButton(QLatin1String(""), FilePath(), "search/button", ui);
+ m_forwardTrailButton->setObjectName(QStringLiteral("trail_button"));
m_forwardTrailButton->setIconSize(QSize(16, 16));
connect(
m_forwardTrailButton, &QPushButton::clicked, this, &QtGraphView::clickedForwardTrail);
- m_backwardTrailButton = new QtSelfRefreshIconButton("", FilePath(), "search/button", ui);
- m_backwardTrailButton->setObjectName("trail_button");
+ m_backwardTrailButton = new QtSelfRefreshIconButton(QLatin1String(""), FilePath(), "search/button", ui);
+ m_backwardTrailButton->setObjectName(QStringLiteral("trail_button"));
m_backwardTrailButton->setIconSize(QSize(16, 16));
connect(
m_backwardTrailButton, &QPushButton::clicked, this, &QtGraphView::clickedBackwardTrail);
m_trailDepthLabel = new QLabel(ui);
- m_trailDepthLabel->setObjectName("depth_label");
- m_trailDepthLabel->setToolTip("adjust trail depth");
+ m_trailDepthLabel->setObjectName(QStringLiteral("depth_label"));
+ m_trailDepthLabel->setToolTip(QStringLiteral("adjust trail depth"));
m_trailDepthLabel->setAlignment(Qt::AlignCenter);
m_trailDepthSlider = new QSlider(Qt::Vertical, ui);
- m_trailDepthSlider->setObjectName("depth_slider");
- m_trailDepthSlider->setToolTip("adjust trail depth");
+ m_trailDepthSlider->setObjectName(QStringLiteral("depth_slider"));
+ m_trailDepthSlider->setToolTip(QStringLiteral("adjust trail depth"));
m_trailDepthSlider->setMinimum(1);
m_trailDepthSlider->setMaximum(26);
m_trailDepthSlider->setValue(5);
@@ -171,19 +171,19 @@ QtGraphView::QtGraphView(ViewLayout* viewLayout)
// group controls
{
m_groupFileButton = new QtSelfRefreshIconButton(
- "",
+ QLatin1String(""),
ResourcePaths::getGuiPath().concatenate(L"graph_view/images/file.png"),
"search/button");
m_groupNamespaceButton = new QtSelfRefreshIconButton(
- "",
+ QLatin1String(""),
ResourcePaths::getGuiPath().concatenate(L"graph_view/images/group_namespace.png"),
"search/button");
- m_groupFileButton->setObjectName("group_right_button");
- m_groupNamespaceButton->setObjectName("group_left_button");
+ m_groupFileButton->setObjectName(QStringLiteral("group_right_button"));
+ m_groupNamespaceButton->setObjectName(QStringLiteral("group_left_button"));
- m_groupFileButton->setToolTip("group by file");
- m_groupNamespaceButton->setToolTip("group by package/namespace/module");
+ m_groupFileButton->setToolTip(QStringLiteral("group by file"));
+ m_groupNamespaceButton->setToolTip(QStringLiteral("group by package/namespace/module"));
m_groupFileButton->setCheckable(true);
m_groupNamespaceButton->setCheckable(true);
@@ -702,7 +702,7 @@ void QtGraphView::trailDepthChanged(int)
{
if (m_trailDepthSlider->value() == m_trailDepthSlider->maximum())
{
- m_trailDepthLabel->setText("inf");
+ m_trailDepthLabel->setText(QStringLiteral("inf"));
}
else
{
@@ -849,26 +849,26 @@ void QtGraphView::updateTrailButtons()
if (message.edgeTypes & Edge::EDGE_CALL)
{
- m_backwardTrailButton->setToolTip("show caller graph");
- m_forwardTrailButton->setToolTip("show callee graph");
+ m_backwardTrailButton->setToolTip(QStringLiteral("show caller graph"));
+ m_forwardTrailButton->setToolTip(QStringLiteral("show callee graph"));
}
else if (message.edgeTypes & Edge::EDGE_INHERITANCE)
{
- m_backwardTrailButton->setToolTip("show base hierarchy");
- m_forwardTrailButton->setToolTip("show derived hierarchy");
+ m_backwardTrailButton->setToolTip(QStringLiteral("show base hierarchy"));
+ m_forwardTrailButton->setToolTip(QStringLiteral("show derived hierarchy"));
backwardImagePath = L"graph_up.png";
forwardImagePath = L"graph_down.png";
}
else if (message.edgeTypes & Edge::EDGE_INCLUDE)
{
- m_backwardTrailButton->setToolTip("show including files hierarchy");
- m_forwardTrailButton->setToolTip("show included files hierarchy");
+ m_backwardTrailButton->setToolTip(QStringLiteral("show including files hierarchy"));
+ m_forwardTrailButton->setToolTip(QStringLiteral("show included files hierarchy"));
}
else
{
- m_backwardTrailButton->setToolTip("no trail for active symbol");
- m_forwardTrailButton->setToolTip("no trail for active symbol");
+ m_backwardTrailButton->setToolTip(QStringLiteral("no trail for active symbol"));
+ m_forwardTrailButton->setToolTip(QStringLiteral("no trail for active symbol"));
}
m_forwardTrailButton->setIconPath(
@@ -945,7 +945,7 @@ QtGraphicsView* QtGraphView::getView() const
{
QWidget* widget = QtViewWidgetWrapper::getWidgetOfView(this);
- QtGraphicsView* view = widget->findChild("");
+ QtGraphicsView* view = widget->findChild(QLatin1String(""));
if (!view)
{
@@ -1308,7 +1308,7 @@ void QtGraphView::createTransition()
for (QtGraphNode* node: vanishingNodes)
{
- QPropertyAnimation* anim = new QPropertyAnimation(node, "opacity");
+ QPropertyAnimation* anim = new QPropertyAnimation(node, QByteArrayLiteral("opacity"));
anim->setDuration(300);
anim->setStartValue(1.0f);
anim->setEndValue(0.0f);
@@ -1318,7 +1318,7 @@ void QtGraphView::createTransition()
for (QtGraphEdge* edge: m_oldEdges)
{
- QPropertyAnimation* anim = new QPropertyAnimation(edge, "opacity");
+ QPropertyAnimation* anim = new QPropertyAnimation(edge, QByteArrayLiteral("opacity"));
anim->setDuration(150);
anim->setStartValue(1.0f);
anim->setEndValue(0.0f);
@@ -1338,7 +1338,7 @@ void QtGraphView::createTransition()
QtGraphNode* newNode = p.first;
QtGraphNode* oldNode = p.second;
- QPropertyAnimation* anim = new QPropertyAnimation(oldNode, "pos");
+ QPropertyAnimation* anim = new QPropertyAnimation(oldNode, QByteArrayLiteral("pos"));
anim->setDuration(300);
anim->setStartValue(oldNode->pos());
anim->setEndValue(newNode->pos());
@@ -1349,7 +1349,7 @@ void QtGraphView::createTransition()
connect(anim, &QPropertyAnimation::finished, oldNode, &QtGraphNode::hideNode);
newNode->hide();
- anim = new QPropertyAnimation(oldNode, "size");
+ anim = new QPropertyAnimation(oldNode, QByteArrayLiteral("size"));
anim->setDuration(300);
anim->setStartValue(oldNode->size());
anim->setEndValue(newNode->size());
@@ -1363,7 +1363,7 @@ void QtGraphView::createTransition()
}
}
- QPropertyAnimation* anim = new QPropertyAnimation(view, "sceneRect");
+ QPropertyAnimation* anim = new QPropertyAnimation(view, QByteArrayLiteral("sceneRect"));
anim->setStartValue(view->sceneRect());
anim->setEndValue(getSceneRect(m_nodes));
diff --git a/src/lib_gui/qt/view/QtGraphViewStyleImpl.cpp b/src/lib_gui/qt/view/QtGraphViewStyleImpl.cpp
index 058f7753..022c3d13 100644
--- a/src/lib_gui/qt/view/QtGraphViewStyleImpl.cpp
+++ b/src/lib_gui/qt/view/QtGraphViewStyleImpl.cpp
@@ -9,7 +9,7 @@
float QtGraphViewStyleImpl::getCharWidth(const std::string& fontName, size_t fontSize)
{
return QFontMetrics(getFontForStyleType(fontName, fontSize))
- .width("QtGraphNode::QtGraphNode::QtGraphNode") /
+ .width(QStringLiteral("QtGraphNode::QtGraphNode::QtGraphNode")) /
37.0f;
}
diff --git a/src/lib_gui/qt/view/QtRefreshView.cpp b/src/lib_gui/qt/view/QtRefreshView.cpp
index b2039ea2..edb3c076 100644
--- a/src/lib_gui/qt/view/QtRefreshView.cpp
+++ b/src/lib_gui/qt/view/QtRefreshView.cpp
@@ -14,7 +14,7 @@
QtRefreshView::QtRefreshView(ViewLayout* viewLayout): RefreshView(viewLayout)
{
m_widget = new QFrame();
- m_widget->setObjectName("refresh_bar");
+ m_widget->setObjectName(QStringLiteral("refresh_bar"));
QBoxLayout* layout = new QHBoxLayout();
layout->setSpacing(0);
@@ -23,8 +23,8 @@ QtRefreshView::QtRefreshView(ViewLayout* viewLayout): RefreshView(viewLayout)
QtSearchBarButton* refreshButton = new QtSearchBarButton(
ResourcePaths::getGuiPath().concatenate(L"refresh_view/images/refresh.png"));
- refreshButton->setObjectName("refresh_button");
- refreshButton->setToolTip("refresh");
+ refreshButton->setObjectName(QStringLiteral("refresh_button"));
+ refreshButton->setToolTip(QStringLiteral("refresh"));
m_widget->connect(refreshButton, &QPushButton::clicked, []() {
MessageIndexingShowDialog().dispatch();
MessageRefresh().dispatch();
diff --git a/src/lib_gui/qt/view/QtScreenSearchView.cpp b/src/lib_gui/qt/view/QtScreenSearchView.cpp
index 66c5b6cc..6a60f785 100644
--- a/src/lib_gui/qt/view/QtScreenSearchView.cpp
+++ b/src/lib_gui/qt/view/QtScreenSearchView.cpp
@@ -16,7 +16,7 @@ QtScreenSearchView::QtScreenSearchView(ViewLayout* viewLayout)
m_widget = new QtScreenSearchBox(&m_controllerProxy);
m_bar = new QToolBar();
- m_bar->setObjectName("screen_search_bar");
+ m_bar->setObjectName(QStringLiteral("screen_search_bar"));
m_bar->setMovable(false);
m_bar->addWidget(m_widget);
diff --git a/src/lib_gui/qt/view/QtStatusView.cpp b/src/lib_gui/qt/view/QtStatusView.cpp
index f0fb2fea..003e874d 100644
--- a/src/lib_gui/qt/view/QtStatusView.cpp
+++ b/src/lib_gui/qt/view/QtStatusView.cpp
@@ -34,8 +34,8 @@ QtStatusView::QtStatusView(ViewLayout* viewLayout): StatusView(viewLayout)
// m_table->setColumnWidth(STATUSVIEW_COLUMN::STATUS, 150);
QStringList headers;
- headers << "Type"
- << "Message";
+ headers << QStringLiteral("Type")
+ << QStringLiteral("Message");
m_model->setHorizontalHeaderLabels(headers);
layout->addWidget(m_table);
@@ -46,13 +46,13 @@ QtStatusView::QtStatusView(ViewLayout* viewLayout): StatusView(viewLayout)
filters->setSpacing(25);
const StatusFilter filter = ApplicationSettings::getInstance()->getStatusFilter();
- m_showInfo = createFilterCheckbox("Info", filters, filter & StatusType::STATUS_INFO);
- m_showErrors = createFilterCheckbox("Error", filters, filter & StatusType::STATUS_ERROR);
+ m_showInfo = createFilterCheckbox(QStringLiteral("Info"), filters, filter & StatusType::STATUS_INFO);
+ m_showErrors = createFilterCheckbox(QStringLiteral("Error"), filters, filter & StatusType::STATUS_ERROR);
filters->addStretch();
- QPushButton* clearButton = new QPushButton("Clear Table");
- clearButton->setObjectName("screen_button");
+ QPushButton* clearButton = new QPushButton(QStringLiteral("Clear Table"));
+ clearButton->setObjectName(QStringLiteral("screen_button"));
connect(clearButton, &QPushButton::clicked, [=]() { MessageClearStatusView().dispatch(); });
filters->addWidget(clearButton);
@@ -107,7 +107,8 @@ void QtStatusView::addStatus(const std::vector& status)
m_model->insertRow(rowNumber);
}
- QString statusType = (s.type == StatusType::STATUS_ERROR ? "ERROR" : "INFO");
+ QString statusType = (s.type == StatusType::STATUS_ERROR ?
+ QStringLiteral("ERROR") : QStringLiteral("INFO"));
m_model->setItem(rowNumber, STATUSVIEW_COLUMN::TYPE, new QStandardItem(statusType));
m_model->setItem(
rowNumber,
diff --git a/src/lib_gui/qt/view/QtTabbedView.cpp b/src/lib_gui/qt/view/QtTabbedView.cpp
index d0752d59..f7c65b34 100644
--- a/src/lib_gui/qt/view/QtTabbedView.cpp
+++ b/src/lib_gui/qt/view/QtTabbedView.cpp
@@ -27,12 +27,12 @@ QtTabbedView::QtTabbedView(ViewLayout* viewLayout, const std::string& name)
layout->addWidget(m_widget);
m_closeButton = new QtSelfRefreshIconButton(
- "",
+ QLatin1String(""),
ResourcePaths::getGuiPath().concatenate(L"screen_search_view/images/close.png"),
"screen_search/button",
widget);
m_closeButton->setIconSize(QSize(15, 15));
- m_closeButton->setStyleSheet("background: transparent; border: none;");
+ m_closeButton->setStyleSheet(QStringLiteral("background: transparent; border: none;"));
widget->connect(m_closeButton, &QPushButton::clicked, [this]() { hideView(this); });
m_widget->tabBar()->installEventFilter(this);
@@ -49,7 +49,7 @@ void QtTabbedView::refreshView()
void QtTabbedView::addViewWidget(View* view)
{
QWidget* tabWidget = QtViewWidgetWrapper::getWidgetOfView(view);
- tabWidget->setObjectName("tab_content");
+ tabWidget->setObjectName(QStringLiteral("tab_content"));
m_widget->addTab(tabWidget, view->getName().c_str());
setStyleSheet();
diff --git a/src/lib_gui/qt/view/QtTabsView.cpp b/src/lib_gui/qt/view/QtTabsView.cpp
index 2f30d316..01602b74 100644
--- a/src/lib_gui/qt/view/QtTabsView.cpp
+++ b/src/lib_gui/qt/view/QtTabsView.cpp
@@ -27,7 +27,7 @@ QtTabsView::QtTabsView(ViewLayout* viewLayout)
QWidget* front = new QWidget();
front->setMinimumWidth(5);
- front->setObjectName("side_area");
+ front->setObjectName(QStringLiteral("side_area"));
layout->addWidget(front);
m_tabBar = new QtTabBar();
@@ -40,12 +40,12 @@ QtTabsView::QtTabsView(ViewLayout* viewLayout)
connect(m_tabBar, &QTabBar::currentChanged, this, &QtTabsView::changedTab);
QPushButton* addButton = new QtSelfRefreshIconButton(
- "", ResourcePaths::getGuiPath().concatenate(L"tabs_view/images/add.png"), "tab/bar/button");
- addButton->setObjectName("add_button");
+ QLatin1String(""), ResourcePaths::getGuiPath().concatenate(L"tabs_view/images/add.png"), "tab/bar/button");
+ addButton->setObjectName(QStringLiteral("add_button"));
addButton->setIconSize(QSize(14, 14));
QWidget* back = new QWidget();
- back->setObjectName("side_area");
+ back->setObjectName(QStringLiteral("side_area"));
QHBoxLayout* backLayout = new QHBoxLayout(back);
backLayout->setContentsMargins(3, 0, 5, 0);
backLayout->setSpacing(0);
@@ -141,11 +141,11 @@ void QtTabsView::insertTab(bool showTab, SearchMatch match)
m_insertedTabCount++;
int idx = match.isValid() ? m_tabBar->currentIndex() + m_insertedTabCount : m_tabBar->count() + 1;
- idx = m_tabBar->insertTab(idx, " Empty Tab ");
+ idx = m_tabBar->insertTab(idx, QStringLiteral(" Empty Tab "));
m_tabBar->setTabData(idx, QVariant(tabId));
QPushButton* typeCircle = new QPushButton();
- typeCircle->setObjectName("type_circle");
+ typeCircle->setObjectName(QStringLiteral("type_circle"));
m_tabBar->setTabButton(idx, QTabBar::LeftSide, typeCircle);
connect(typeCircle, &QPushButton::clicked, [tabId, this]() {
@@ -160,10 +160,10 @@ void QtTabsView::insertTab(bool showTab, SearchMatch match)
});
QPushButton* closeButton = new QtSelfRefreshIconButton(
- "",
+ QLatin1String(""),
ResourcePaths::getGuiPath().concatenate(L"tabs_view/images/close.png"),
"tab/bar/button");
- closeButton->setObjectName("close_button");
+ closeButton->setObjectName(QStringLiteral("close_button"));
closeButton->setIconSize(QSize(10, 10));
m_tabBar->setTabButton(idx, QTabBar::RightSide, closeButton);
@@ -257,10 +257,10 @@ void QtTabsView::setTabState(int idx, const std::vector& matches)
m_tabBar->setTabText(idx, ' ' + QString::fromStdWString(name) + ' ');
m_tabBar->tabButton(idx, QTabBar::LeftSide)
->setStyleSheet(
- "#type_circle { background-color: " + QString::fromStdString(color) +
- "; } "
- "#type_circle[selected=true] { background-color: " +
- QString::fromStdString(activeColor) + "; } ");
+ QStringLiteral("#type_circle { background-color: ") + QString::fromStdString(color) +
+ QStringLiteral("; } "
+ "#type_circle[selected=true] { background-color: ") +
+ QString::fromStdString(activeColor) + QStringLiteral("; } "));
}
void QtTabsView::setStyleSheet()
diff --git a/src/lib_gui/qt/window/QtAbout.cpp b/src/lib_gui/qt/window/QtAbout.cpp
index d66dad4e..86c13665 100644
--- a/src/lib_gui/qt/window/QtAbout.cpp
+++ b/src/lib_gui/qt/window/QtAbout.cpp
@@ -68,42 +68,42 @@ void QtAbout::setupAbout()
windowLayout->addLayout(layoutHorz1);
QLabel* companyLabel = new QLabel(
- "Coati Software KG
"
+ QStringLiteral("Coati Software KG
"
"Jakob-Haringer-Straße 1/127
"
"5020 Salzburg
"
"Austria
"
"support@sourcetrail.com
"
"sourcetrail.com");
+ "white;\">sourcetrail.com"));
companyLabel->setOpenExternalLinks(true);
layoutHorz1->addWidget(companyLabel);
layoutHorz1->addSpacing(120);
QLabel* developerLabel = new QLabel(
- "
"
+ QStringLiteral("
"
"Team:
"
"Manuel Dobusch
"
"Eberhard Gräther
"
"Malte Langkabel
"
"Viktoria Pfausler
"
- "Andreas Stallinger
");
- developerLabel->setObjectName("small");
+ "Andreas Stallinger
"));
+ developerLabel->setObjectName(QStringLiteral("small"));
layoutHorz1->addWidget(developerLabel);
}
windowLayout->addStretch();
QLabel* acknowledgementsLabel = new QLabel(
- "Acknowledgements:
"
+ QStringLiteral("Acknowledgements:
"
"Sourcetrail (aka Coati) 0.1 was created in the context of education at "
"Salzburg University "
"of Applied Sciences.
"
"Coati Software KG is member of Startup Salzburg.
"
"The development of Sourcetrail was funded by aws.");
- acknowledgementsLabel->setObjectName("small");
+ "white;\">aws."));
+ acknowledgementsLabel->setObjectName(QStringLiteral("small"));
acknowledgementsLabel->setWordWrap(true);
acknowledgementsLabel->setOpenExternalLinks(true);
windowLayout->addWidget(acknowledgementsLabel);
diff --git a/src/lib_gui/qt/window/QtBookmarkBrowser.cpp b/src/lib_gui/qt/window/QtBookmarkBrowser.cpp
index 0a66e03f..0b2d16dc 100644
--- a/src/lib_gui/qt/window/QtBookmarkBrowser.cpp
+++ b/src/lib_gui/qt/window/QtBookmarkBrowser.cpp
@@ -27,7 +27,7 @@ void QtBookmarkBrowser::setupBookmarkBrowser()
.c_str());
m_headerBackground = new QWidget(m_window);
- m_headerBackground->setObjectName("header_background");
+ m_headerBackground->setObjectName(QStringLiteral("header_background"));
m_headerBackground->setGeometry(0, 0, 0, 0);
m_headerBackground->lower();
@@ -46,21 +46,21 @@ void QtBookmarkBrowser::setupBookmarkBrowser()
headerLayout->addStrut(150);
- QLabel* title = new QLabel("Bookmarks");
- title->setObjectName("title");
+ QLabel* title = new QLabel(QStringLiteral("Bookmarks"));
+ title->setObjectName(QStringLiteral("title"));
headerLayout->addWidget(title);
headerLayout->addSpacing(40);
- QLabel* filterLabel = new QLabel("Show:");
- filterLabel->setObjectName("filter_label");
+ QLabel* filterLabel = new QLabel(QStringLiteral("Show:"));
+ filterLabel->setObjectName(QStringLiteral("filter_label"));
headerLayout->addWidget(filterLabel);
m_filterComboBox = new QComboBox();
- m_filterComboBox->addItem("All");
- m_filterComboBox->addItem("Nodes");
- m_filterComboBox->addItem("Edges");
- m_filterComboBox->setObjectName("filter_box");
+ m_filterComboBox->addItem(QStringLiteral("All"));
+ m_filterComboBox->addItem(QStringLiteral("Nodes"));
+ m_filterComboBox->addItem(QStringLiteral("Edges"));
+ m_filterComboBox->setObjectName(QStringLiteral("filter_box"));
headerLayout->addWidget(m_filterComboBox);
connect(
@@ -71,8 +71,8 @@ void QtBookmarkBrowser::setupBookmarkBrowser()
headerLayout->addSpacing(40);
- QLabel* orderLabel = new QLabel("Sort by:");
- orderLabel->setObjectName("order_label");
+ QLabel* orderLabel = new QLabel(QStringLiteral("Sort by:"));
+ orderLabel->setObjectName(QStringLiteral("order_label"));
headerLayout->addWidget(orderLabel);
m_orderNames.push_back("Name asc.");
@@ -86,7 +86,7 @@ void QtBookmarkBrowser::setupBookmarkBrowser()
m_orderComboBox->addItem(m_orderNames[2].c_str());
m_orderComboBox->addItem(m_orderNames[3].c_str());
m_orderComboBox->setCurrentIndex(3);
- m_orderComboBox->setObjectName("order_box");
+ m_orderComboBox->setObjectName(QStringLiteral("order_box"));
headerLayout->addWidget(m_orderComboBox);
connect(
@@ -104,12 +104,12 @@ void QtBookmarkBrowser::setupBookmarkBrowser()
layout->addLayout(bodyLayout);
m_bookmarkTree = new QTreeWidget();
- m_bookmarkTree->setObjectName("bookmark_tree");
+ m_bookmarkTree->setObjectName(QStringLiteral("bookmark_tree"));
m_bookmarkTree->setAttribute(Qt::WA_MacShowFocusRect, 0);
m_bookmarkTree->setSelectionMode(QAbstractItemView::SelectionMode::NoSelection);
m_bookmarkTree->header()->close();
m_bookmarkTree->setIndentation(0);
- m_bookmarkTree->setHeaderLabel("Bookmarks");
+ m_bookmarkTree->setHeaderLabel(QStringLiteral("Bookmarks"));
connect(m_bookmarkTree, &QTreeWidget::itemClicked, this, &QtBookmarkBrowser::treeItemClicked);
@@ -122,7 +122,7 @@ void QtBookmarkBrowser::setupBookmarkBrowser()
bodyLayout->addLayout(buttonLayout);
setPreviousVisible(false);
setCloseVisible(false);
- updateNextButton("Close");
+ updateNextButton(QStringLiteral("Close"));
}
}
diff --git a/src/lib_gui/qt/window/QtBookmarkCreator.cpp b/src/lib_gui/qt/window/QtBookmarkCreator.cpp
index 4a1cb221..aa64a882 100644
--- a/src/lib_gui/qt/window/QtBookmarkCreator.cpp
+++ b/src/lib_gui/qt/window/QtBookmarkCreator.cpp
@@ -29,8 +29,9 @@ void QtBookmarkCreator::setupBookmarkCreator()
{
// title
- QLabel* title = new QLabel(m_editBookmarkId ? "Edit Bookmark" : "Create Bookmark");
- title->setObjectName("creator_title_label");
+ QLabel* title = new QLabel(m_editBookmarkId ?
+ QStringLiteral("Edit Bookmark") : QStringLiteral("Create Bookmark"));
+ title->setObjectName(QStringLiteral("creator_title_label"));
mainLayout->addWidget(title);
}
@@ -39,13 +40,13 @@ void QtBookmarkCreator::setupBookmarkCreator()
{
// name
- QLabel* nameLabel = new QLabel("Name");
- nameLabel->setObjectName("creator_label");
+ QLabel* nameLabel = new QLabel(QStringLiteral("Name"));
+ nameLabel->setObjectName(QStringLiteral("creator_label"));
layout->addWidget(nameLabel);
m_displayName = new QLineEdit();
- m_displayName->setObjectName("creator_name_edit");
- m_displayName->setPlaceholderText("Name");
+ m_displayName->setObjectName(QStringLiteral("creator_name_edit"));
+ m_displayName->setPlaceholderText(QStringLiteral("Name"));
m_displayName->setAttribute(Qt::WA_MacShowFocusRect, 0);
layout->addWidget(m_displayName);
@@ -56,13 +57,13 @@ void QtBookmarkCreator::setupBookmarkCreator()
{
// comment
- QLabel* commentLabel = new QLabel("Comment");
- commentLabel->setObjectName("creator_label");
+ QLabel* commentLabel = new QLabel(QStringLiteral("Comment"));
+ commentLabel->setObjectName(QStringLiteral("creator_label"));
layout->addWidget(commentLabel);
m_commentBox = new QTextEdit();
- m_commentBox->setObjectName("creator_comment_box");
- m_commentBox->setPlaceholderText("Comment");
+ m_commentBox->setObjectName(QStringLiteral("creator_comment_box"));
+ m_commentBox->setPlaceholderText(QStringLiteral("Comment"));
layout->addWidget(m_commentBox);
layout->addSpacing(15);
@@ -70,15 +71,15 @@ void QtBookmarkCreator::setupBookmarkCreator()
{
// category
- QLabel* categoryLabel = new QLabel("Choose or Create Category");
- categoryLabel->setObjectName("creator_label");
+ QLabel* categoryLabel = new QLabel(QStringLiteral("Choose or Create Category"));
+ categoryLabel->setObjectName(QStringLiteral("creator_label"));
layout->addWidget(categoryLabel);
m_categoryBox = new QComboBox();
- m_categoryBox->setObjectName("creator_category_box");
- m_categoryBox->addItem("");
+ m_categoryBox->setObjectName(QStringLiteral("creator_category_box"));
+ m_categoryBox->addItem(QLatin1String(""));
m_categoryBox->setEditable(true);
- m_categoryBox->lineEdit()->setPlaceholderText("Category");
+ m_categoryBox->lineEdit()->setPlaceholderText(QStringLiteral("Category"));
m_categoryBox->setInsertPolicy(QComboBox::InsertPolicy::InsertAtTop);
layout->addWidget(m_categoryBox);
@@ -88,7 +89,7 @@ void QtBookmarkCreator::setupBookmarkCreator()
{
layout->addLayout(createButtons());
setPreviousVisible(false);
- updateNextButton(m_editBookmarkId ? "Save" : "Create");
+ updateNextButton(m_editBookmarkId ? QStringLiteral("Save") : QStringLiteral("Create"));
}
mainLayout->addLayout(layout);
diff --git a/src/lib_gui/qt/window/QtIndexingDialog.cpp b/src/lib_gui/qt/window/QtIndexingDialog.cpp
index 975c593d..1ab79f9c 100644
--- a/src/lib_gui/qt/window/QtIndexingDialog.cpp
+++ b/src/lib_gui/qt/window/QtIndexingDialog.cpp
@@ -9,10 +9,10 @@
#include "ResourcePaths.h"
#include "utilityQt.h"
-QLabel* QtIndexingDialog::createTitleLabel(QString title, QBoxLayout* layout)
+QLabel* QtIndexingDialog::createTitleLabel(const QString &title, QBoxLayout* layout)
{
QLabel* label = new QLabel(title);
- label->setObjectName("title");
+ label->setObjectName(QStringLiteral("title"));
label->setAlignment(Qt::AlignRight | Qt::AlignBottom);
if (layout)
@@ -26,7 +26,7 @@ QLabel* QtIndexingDialog::createTitleLabel(QString title, QBoxLayout* layout)
QLabel* QtIndexingDialog::createMessageLabel(QBoxLayout* layout)
{
QLabel* label = new QLabel();
- label->setObjectName("message");
+ label->setObjectName(QStringLiteral("message"));
label->setAlignment(Qt::AlignRight);
label->setWordWrap(true);
layout->addWidget(label);
@@ -41,14 +41,14 @@ QWidget* QtIndexingDialog::createErrorWidget(QBoxLayout* layout)
errorLayout->setSpacing(5);
QPushButton* errorCount = new QPushButton();
- errorCount->setObjectName("errorCount");
+ errorCount->setObjectName(QStringLiteral("errorCount"));
errorCount->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
errorCount->setIcon(QPixmap(QString::fromStdWString(
ResourcePaths::getGuiPath().concatenate(L"indexing_dialog/error.png").wstr())));
errorLayout->addWidget(errorCount);
- QtHelpButton* helpButton = new QtHelpButton("aaa", "bbb");
+ QtHelpButton* helpButton = new QtHelpButton(QStringLiteral("aaa"), QStringLiteral("bbb"));
helpButton->setColor(Qt::white);
helpButton->disconnect();
@@ -82,10 +82,10 @@ QtIndexingDialog::QtIndexingDialog(bool isSubWindow, QWidget* parent)
{
m_window->setStyleSheet(
m_window->styleSheet() +
- "#window { "
+ QStringLiteral("#window { "
"background: #2E3C86;"
"border: none;"
- "}");
+ "}"));
setStyleSheet(
(utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(L"window/window.css")) +
diff --git a/src/lib_gui/qt/window/QtIndexingDialog.h b/src/lib_gui/qt/window/QtIndexingDialog.h
index 2fe95c58..627fff69 100644
--- a/src/lib_gui/qt/window/QtIndexingDialog.h
+++ b/src/lib_gui/qt/window/QtIndexingDialog.h
@@ -19,7 +19,7 @@ class QtIndexingDialog: public QtWindowBase
protected:
static QBoxLayout* createLayout(QWidget* parent);
- static QLabel* createTitleLabel(QString title, QBoxLayout* layout);
+ static QLabel* createTitleLabel(const QString &title, QBoxLayout* layout);
static QLabel* createMessageLabel(QBoxLayout* layout);
static QWidget* createErrorWidget(QBoxLayout* layout);
static QLabel* createFlagLabel(QWidget* parent);
diff --git a/src/lib_gui/qt/window/QtIndexingProgressDialog.cpp b/src/lib_gui/qt/window/QtIndexingProgressDialog.cpp
index 50abe4b5..de2c000c 100644
--- a/src/lib_gui/qt/window/QtIndexingProgressDialog.cpp
+++ b/src/lib_gui/qt/window/QtIndexingProgressDialog.cpp
@@ -10,10 +10,10 @@ QtIndexingProgressDialog::QtIndexingProgressDialog(bool hideable, QWidget* paren
{
setSizeGripStyle(false);
- updateTitle("Indexing Files");
+ updateTitle(QStringLiteral("Indexing Files"));
m_filePathLabel = new QLabel();
- m_filePathLabel->setObjectName("filePath");
+ m_filePathLabel->setObjectName(QStringLiteral("filePath"));
m_filePathLabel->setAlignment(Qt::AlignRight);
m_layout->addWidget(m_filePathLabel);
@@ -25,15 +25,15 @@ QtIndexingProgressDialog::QtIndexingProgressDialog(bool hideable, QWidget* paren
{
QHBoxLayout* buttons = new QHBoxLayout();
- QPushButton* stopButton = new QPushButton("Stop");
- stopButton->setObjectName("windowButton");
+ QPushButton* stopButton = new QPushButton(QStringLiteral("Stop"));
+ stopButton->setObjectName(QStringLiteral("windowButton"));
connect(stopButton, &QPushButton::clicked, this, &QtIndexingProgressDialog::onStopPressed);
buttons->addWidget(stopButton);
buttons->addStretch();
- QPushButton* hideButton = new QPushButton("Hide");
- hideButton->setObjectName("windowButton");
+ QPushButton* hideButton = new QPushButton(QStringLiteral("Hide"));
+ hideButton->setObjectName(QStringLiteral("windowButton"));
hideButton->setDefault(true);
connect(hideButton, &QPushButton::clicked, this, &QtIndexingProgressDialog::onHidePressed);
buttons->addWidget(hideButton);
@@ -78,7 +78,7 @@ void QtIndexingProgressDialog::updateErrorCount(size_t errorCount, size_t fatalC
QString str = QString::number(errorCount) + " Error";
if (errorCount > 1)
{
- str += "s";
+ str += QLatin1String("s");
}
if (fatalCount)
@@ -86,7 +86,7 @@ void QtIndexingProgressDialog::updateErrorCount(size_t errorCount, size_t fatalC
str += " (" + QString::number(fatalCount) + " Fatal)";
}
- QPushButton* errorCount = m_errorWidget->findChild("errorCount");
+ QPushButton* errorCount = m_errorWidget->findChild(QStringLiteral("errorCount"));
errorCount->setText(str);
m_errorWidget->show();
diff --git a/src/lib_gui/qt/window/QtIndexingReportDialog.cpp b/src/lib_gui/qt/window/QtIndexingReportDialog.cpp
index 45028296..1ecaa617 100644
--- a/src/lib_gui/qt/window/QtIndexingReportDialog.cpp
+++ b/src/lib_gui/qt/window/QtIndexingReportDialog.cpp
@@ -23,30 +23,30 @@ QtIndexingReportDialog::QtIndexingReportDialog(
if (interrupted)
{
- QtIndexingDialog::createTitleLabel("Interrupted Indexing", m_layout);
+ QtIndexingDialog::createTitleLabel(QStringLiteral("Interrupted Indexing"), m_layout);
}
else if (shallow)
{
- QtIndexingDialog::createTitleLabel("Finished Shallow Indexing", m_layout);
+ QtIndexingDialog::createTitleLabel(QStringLiteral("Finished Shallow Indexing"), m_layout);
}
else
{
- QtIndexingDialog::createTitleLabel("Finished Indexing", m_layout);
+ QtIndexingDialog::createTitleLabel(QStringLiteral("Finished Indexing"), m_layout);
}
m_layout->addSpacing(5);
QtIndexingDialog::createMessageLabel(m_layout)->setText(
- "Source files indexed: " + QString::number(indexedFileCount) + "/" +
+ QStringLiteral("Source files indexed: ") + QString::number(indexedFileCount) + "/" +
QString::number(totalIndexedFileCount));
QtIndexingDialog::createMessageLabel(m_layout)->setText(
- "Total files completed: " + QString::number(completedFileCount) + "/" +
+ QStringLiteral("Total files completed: ") + QString::number(completedFileCount) + "/" +
QString::number(totalFileCount));
m_layout->addSpacing(12);
QtIndexingDialog::createMessageLabel(m_layout)->setText(
- "Time: " + QString::fromStdString(TimeStamp::secondsToString(time)));
+ QStringLiteral("Time: ") + QString::fromStdString(TimeStamp::secondsToString(time)));
m_layout->addSpacing(12);
m_errorWidget = QtIndexingDialog::createErrorWidget(m_layout);
@@ -55,9 +55,9 @@ QtIndexingReportDialog::QtIndexingReportDialog(
if (shallow)
{
- createMessageLabel(m_layout)->setText(
+ createMessageLabel(m_layout)->setText(QStringLiteral(
"You can now browse your project while running a second pass for in-depth "
- "indexing!");
+ "indexing!"));
m_layout->addSpacing(12);
}
@@ -65,16 +65,16 @@ QtIndexingReportDialog::QtIndexingReportDialog(
QHBoxLayout* buttons = new QHBoxLayout();
if (interrupted)
{
- QPushButton* discardButton = new QPushButton("Discard");
- discardButton->setObjectName("windowButton");
+ QPushButton* discardButton = new QPushButton(QStringLiteral("Discard"));
+ discardButton->setObjectName(QStringLiteral("windowButton"));
connect(
discardButton, &QPushButton::clicked, this, &QtIndexingReportDialog::onDiscardPressed);
buttons->addWidget(discardButton);
}
else if (shallow)
{
- QPushButton* startInDepthButton = new QPushButton("Start In-Depth Indexing");
- startInDepthButton->setObjectName("windowButton");
+ QPushButton* startInDepthButton = new QPushButton(QStringLiteral("Start In-Depth Indexing"));
+ startInDepthButton->setObjectName(QStringLiteral("windowButton"));
connect(
startInDepthButton,
&QPushButton::clicked,
@@ -86,8 +86,9 @@ QtIndexingReportDialog::QtIndexingReportDialog(
buttons->addStretch();
QPushButton* confirmButton = new QPushButton(
- interrupted ? "Keep" : (shallow ? "Later" : "OK"));
- confirmButton->setObjectName("windowButton");
+ interrupted ? QStringLiteral("Keep") :
+ (shallow ? QStringLiteral("Later") : QStringLiteral("OK")));
+ confirmButton->setObjectName(QStringLiteral("windowButton"));
confirmButton->setDefault(true);
connect(
confirmButton, &QPushButton::clicked, this, &QtIndexingReportDialog::onConfirmPressed);
@@ -113,18 +114,18 @@ void QtIndexingReportDialog::updateErrorCount(size_t errorCount, size_t fatalCou
{
if (m_errorWidget && errorCount)
{
- QString str = QString::number(errorCount) + " Error";
+ QString str = QString::number(errorCount) + QStringLiteral(" Error");
if (errorCount > 1)
{
- str += "s";
+ str += QStringLiteral("s");
}
if (fatalCount)
{
- str += " (" + QString::number(fatalCount) + " Fatal)";
+ str += QStringLiteral(" (") + QString::number(fatalCount) + QStringLiteral(" Fatal)");
}
- QPushButton* errorCount = m_errorWidget->findChild("errorCount");
+ QPushButton* errorCount = m_errorWidget->findChild(QStringLiteral("errorCount"));
errorCount->setText(str);
m_errorWidget->show();
diff --git a/src/lib_gui/qt/window/QtIndexingStartDialog.cpp b/src/lib_gui/qt/window/QtIndexingStartDialog.cpp
index d95ad2b5..56fc5ddf 100644
--- a/src/lib_gui/qt/window/QtIndexingStartDialog.cpp
+++ b/src/lib_gui/qt/window/QtIndexingStartDialog.cpp
@@ -17,7 +17,7 @@ QtIndexingStartDialog::QtIndexingStartDialog(
{
setSizeGripStyle(false);
- QtIndexingDialog::createTitleLabel("Start Indexing", m_layout);
+ QtIndexingDialog::createTitleLabel(QStringLiteral("Start Indexing"), m_layout);
m_layout->addSpacing(5);
m_clearLabel = QtIndexingDialog::createMessageLabel(m_layout);
@@ -38,11 +38,11 @@ QtIndexingStartDialog::QtIndexingStartDialog(
modeTitleLayout->setSpacing(7);
QLabel* modeLabel = QtIndexingDialog::createMessageLabel(modeTitleLayout);
- modeLabel->setText("Mode:");
+ modeLabel->setText(QStringLiteral("Mode:"));
modeLabel->setAlignment(Qt::AlignLeft);
QtHelpButton* helpButton = new QtHelpButton(
- "Indexing Modes",
+ QStringLiteral("Indexing Modes"),
QString("Updated files: Reindexes all files that were modified since the last "
"indexing, all new files and all files depending "
"on those.
"
@@ -67,10 +67,10 @@ QtIndexingStartDialog::QtIndexingStartDialog(
modeLayout->addLayout(modeTitleLayout);
modeLayout->addSpacing(5);
- m_refreshModeButtons.emplace(REFRESH_UPDATED_FILES, new QRadioButton("Updated files"));
+ m_refreshModeButtons.emplace(REFRESH_UPDATED_FILES, new QRadioButton(QStringLiteral("Updated files")));
m_refreshModeButtons.emplace(
- REFRESH_UPDATED_AND_INCOMPLETE_FILES, new QRadioButton("Incomplete && updated files"));
- m_refreshModeButtons.emplace(REFRESH_ALL_FILES, new QRadioButton("All files"));
+ REFRESH_UPDATED_AND_INCOMPLETE_FILES, new QRadioButton(QStringLiteral("Incomplete && updated files")));
+ m_refreshModeButtons.emplace(REFRESH_ALL_FILES, new QRadioButton(QStringLiteral("All files")));
std::function func = [=](bool checked) {
if (!checked)
@@ -91,7 +91,7 @@ QtIndexingStartDialog::QtIndexingStartDialog(
for (auto p: m_refreshModeButtons)
{
QRadioButton* button = p.second;
- button->setObjectName("option");
+ button->setObjectName(QStringLiteral("option"));
button->setEnabled(false);
if (p.first == initialMode)
{
@@ -108,7 +108,7 @@ QtIndexingStartDialog::QtIndexingStartDialog(
if (enabledShallowOption)
{
- QCheckBox* shallowIndexingCheckBox = new QCheckBox("Shallow Python Indexing");
+ QCheckBox* shallowIndexingCheckBox = new QCheckBox(QStringLiteral("Shallow Python Indexing"));
connect(shallowIndexingCheckBox, &QCheckBox::toggled, [=]() {
emit setShallowIndexing(shallowIndexingCheckBox->isChecked());
});
@@ -123,15 +123,15 @@ QtIndexingStartDialog::QtIndexingStartDialog(
{
QHBoxLayout* buttons = new QHBoxLayout();
- QPushButton* cancelButton = new QPushButton("Cancel");
- cancelButton->setObjectName("windowButton");
+ QPushButton* cancelButton = new QPushButton(QStringLiteral("Cancel"));
+ cancelButton->setObjectName(QStringLiteral("windowButton"));
connect(cancelButton, &QPushButton::clicked, this, &QtIndexingStartDialog::onCancelPressed);
buttons->addWidget(cancelButton);
buttons->addStretch();
- QPushButton* startButton = new QPushButton("Start");
- startButton->setObjectName("windowButton");
+ QPushButton* startButton = new QPushButton(QStringLiteral("Start"));
+ startButton->setObjectName(QStringLiteral("windowButton"));
startButton->setDefault(true);
connect(startButton, &QPushButton::clicked, this, &QtIndexingStartDialog::onStartPressed);
buttons->addWidget(startButton);
diff --git a/src/lib_gui/qt/window/QtKeyboardShortcuts.cpp b/src/lib_gui/qt/window/QtKeyboardShortcuts.cpp
index 27e17c60..2964cadf 100644
--- a/src/lib_gui/qt/window/QtKeyboardShortcuts.cpp
+++ b/src/lib_gui/qt/window/QtKeyboardShortcuts.cpp
@@ -38,8 +38,8 @@ void QtKeyboardShortcuts::populateWindow(QWidget* widget)
QVBoxLayout* layout = new QVBoxLayout(widget);
QLabel* generelLabel = new QLabel(this);
- generelLabel->setObjectName("general_label");
- generelLabel->setText("General Shortcuts");
+ generelLabel->setObjectName(QStringLiteral("general_label"));
+ generelLabel->setText(QStringLiteral("General Shortcuts"));
layout->addWidget(generelLabel);
layout->addWidget(createGenerelShortcutsTable());
@@ -47,8 +47,8 @@ void QtKeyboardShortcuts::populateWindow(QWidget* widget)
layout->addSpacing(20);
QLabel* codeLabel = new QLabel(this);
- codeLabel->setObjectName("code_label");
- codeLabel->setText("Code View Shortcuts");
+ codeLabel->setObjectName(QStringLiteral("code_label"));
+ codeLabel->setText(QStringLiteral("Code View Shortcuts"));
layout->addWidget(codeLabel);
layout->addWidget(createCodeViewShortcutsTable());
@@ -56,8 +56,8 @@ void QtKeyboardShortcuts::populateWindow(QWidget* widget)
layout->addSpacing(20);
QLabel* graphLabel = new QLabel(this);
- graphLabel->setObjectName("graph_label");
- graphLabel->setText("Graph View Shortcuts");
+ graphLabel->setObjectName(QStringLiteral("graph_label"));
+ graphLabel->setText(QStringLiteral("Graph View Shortcuts"));
layout->addWidget(graphLabel);
layout->addWidget(createGraphViewShortcutsTable());
@@ -71,8 +71,8 @@ void QtKeyboardShortcuts::populateWindow(QWidget* widget)
void QtKeyboardShortcuts::windowReady()
{
- updateTitle("Keyboard Shortcuts");
- updateCloseButton("Close");
+ updateTitle(QStringLiteral("Keyboard Shortcuts"));
+ updateCloseButton(QStringLiteral("Close"));
setNextVisible(false);
setPreviousVisible(false);
@@ -98,8 +98,8 @@ QtShortcutTable* QtKeyboardShortcuts::createTableWidget(const std::string& objec
table->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
table->setColumnCount(2);
- table->setHorizontalHeaderItem(0, new QTableWidgetItem("Command"));
- table->setHorizontalHeaderItem(1, new QTableWidgetItem("Shortcut"));
+ table->setHorizontalHeaderItem(0, new QTableWidgetItem(QStringLiteral("Command")));
+ table->setHorizontalHeaderItem(1, new QTableWidgetItem(QStringLiteral("Shortcut")));
return table;
}
@@ -110,24 +110,24 @@ QTableWidget* QtKeyboardShortcuts::createGenerelShortcutsTable()
table->setRowCount(17);
- table->setItem(0, 0, new QTableWidgetItem("Larger Font"));
- table->setItem(1, 0, new QTableWidgetItem("Smaller Font"));
- table->setItem(2, 0, new QTableWidgetItem("Reset Font Size"));
- table->setItem(3, 0, new QTableWidgetItem("Back"));
- table->setItem(4, 0, new QTableWidgetItem("Forward"));
- table->setItem(5, 0, new QTableWidgetItem("Refresh"));
- table->setItem(6, 0, new QTableWidgetItem("Full Refresh"));
- table->setItem(7, 0, new QTableWidgetItem("Find Symbol"));
- table->setItem(8, 0, new QTableWidgetItem("Find Text"));
- table->setItem(9, 0, new QTableWidgetItem("Find On-Screen"));
- table->setItem(10, 0, new QTableWidgetItem("New Project"));
- table->setItem(11, 0, new QTableWidgetItem("Open Project"));
- table->setItem(12, 0, new QTableWidgetItem("Close Window"));
- table->setItem(13, 0, new QTableWidgetItem("Hide Window"));
- table->setItem(14, 0, new QTableWidgetItem("To Overview"));
- table->setItem(15, 0, new QTableWidgetItem("Preferences"));
- table->setItem(16, 0, new QTableWidgetItem("Bookmark Active Symbol"));
- table->setItem(17, 0, new QTableWidgetItem("Bookmark Manager"));
+ table->setItem(0, 0, new QTableWidgetItem(QStringLiteral("Larger Font")));
+ table->setItem(1, 0, new QTableWidgetItem(QStringLiteral("Smaller Font")));
+ table->setItem(2, 0, new QTableWidgetItem(QStringLiteral("Reset Font Size")));
+ table->setItem(3, 0, new QTableWidgetItem(QStringLiteral("Back")));
+ table->setItem(4, 0, new QTableWidgetItem(QStringLiteral("Forward")));
+ table->setItem(5, 0, new QTableWidgetItem(QStringLiteral("Refresh")));
+ table->setItem(6, 0, new QTableWidgetItem(QStringLiteral("Full Refresh")));
+ table->setItem(7, 0, new QTableWidgetItem(QStringLiteral("Find Symbol")));
+ table->setItem(8, 0, new QTableWidgetItem(QStringLiteral("Find Text")));
+ table->setItem(9, 0, new QTableWidgetItem(QStringLiteral("Find On-Screen")));
+ table->setItem(10, 0, new QTableWidgetItem(QStringLiteral("New Project")));
+ table->setItem(11, 0, new QTableWidgetItem(QStringLiteral("Open Project")));
+ table->setItem(12, 0, new QTableWidgetItem(QStringLiteral("Close Window")));
+ table->setItem(13, 0, new QTableWidgetItem(QStringLiteral("Hide Window")));
+ table->setItem(14, 0, new QTableWidgetItem(QStringLiteral("To Overview")));
+ table->setItem(15, 0, new QTableWidgetItem(QStringLiteral("Preferences")));
+ table->setItem(16, 0, new QTableWidgetItem(QStringLiteral("Bookmark Active Symbol")));
+ table->setItem(17, 0, new QTableWidgetItem(QStringLiteral("Bookmark Manager")));
#if defined(Q_OS_MAC)
table->setItem(0, 1, new QTableWidgetItem("Cmd + +"));
@@ -149,28 +149,28 @@ QTableWidget* QtKeyboardShortcuts::createGenerelShortcutsTable()
table->setItem(16, 1, new QTableWidgetItem("Cmd + S"));
table->setItem(17, 1, new QTableWidgetItem("Cmd + B"));
#else
- table->setItem(0, 1, new QTableWidgetItem("Ctrl + +"));
- table->setItem(1, 1, new QTableWidgetItem("Ctrl + -"));
- table->setItem(2, 1, new QTableWidgetItem("Ctrl + 0"));
- table->setItem(3, 1, new QTableWidgetItem("Ctrl + Z | Backspace"));
- table->setItem(4, 1, new QTableWidgetItem("Ctrl + Shift + Z"));
- table->setItem(5, 1, new QTableWidgetItem("F5"));
- table->setItem(6, 1, new QTableWidgetItem("Shift + F5"));
- table->setItem(7, 1, new QTableWidgetItem("Ctrl + F"));
- table->setItem(8, 1, new QTableWidgetItem("Ctrl + Shift + F"));
- table->setItem(9, 1, new QTableWidgetItem("Ctrl + D | /"));
- table->setItem(10, 1, new QTableWidgetItem("Ctrl + N"));
- table->setItem(11, 1, new QTableWidgetItem("Ctrl + O"));
+ table->setItem(0, 1, new QTableWidgetItem(QStringLiteral("Ctrl + +")));
+ table->setItem(1, 1, new QTableWidgetItem(QStringLiteral("Ctrl + -")));
+ table->setItem(2, 1, new QTableWidgetItem(QStringLiteral("Ctrl + 0")));
+ table->setItem(3, 1, new QTableWidgetItem(QStringLiteral("Ctrl + Z | Backspace")));
+ table->setItem(4, 1, new QTableWidgetItem(QStringLiteral("Ctrl + Shift + Z")));
+ table->setItem(5, 1, new QTableWidgetItem(QStringLiteral("F5")));
+ table->setItem(6, 1, new QTableWidgetItem(QStringLiteral("Shift + F5")));
+ table->setItem(7, 1, new QTableWidgetItem(QStringLiteral("Ctrl + F")));
+ table->setItem(8, 1, new QTableWidgetItem(QStringLiteral("Ctrl + Shift + F")));
+ table->setItem(9, 1, new QTableWidgetItem(QStringLiteral("Ctrl + D | /")));
+ table->setItem(10, 1, new QTableWidgetItem(QStringLiteral("Ctrl + N")));
+ table->setItem(11, 1, new QTableWidgetItem(QStringLiteral("Ctrl + O")));
# if defined(Q_OS_WIN32)
table->setItem(12, 1, new QTableWidgetItem("Alt + F4"));
# else
- table->setItem(12, 1, new QTableWidgetItem("Ctrl + W"));
+ table->setItem(12, 1, new QTableWidgetItem(QStringLiteral("Ctrl + W")));
# endif
- table->setItem(13, 1, new QTableWidgetItem(""));
- table->setItem(14, 1, new QTableWidgetItem("Ctrl + Home"));
- table->setItem(15, 1, new QTableWidgetItem("Ctrl + ,"));
- table->setItem(16, 1, new QTableWidgetItem("Ctrl + S"));
- table->setItem(17, 1, new QTableWidgetItem("Ctrl + B"));
+ table->setItem(13, 1, new QTableWidgetItem(QLatin1String("")));
+ table->setItem(14, 1, new QTableWidgetItem(QStringLiteral("Ctrl + Home")));
+ table->setItem(15, 1, new QTableWidgetItem(QStringLiteral("Ctrl + ,")));
+ table->setItem(16, 1, new QTableWidgetItem(QStringLiteral("Ctrl + S")));
+ table->setItem(17, 1, new QTableWidgetItem(QStringLiteral("Ctrl + B")));
#endif
table->updateSize();
@@ -183,10 +183,10 @@ QTableWidget* QtKeyboardShortcuts::createCodeViewShortcutsTable()
QtShortcutTable* table = createTableWidget("table_code");
table->setRowCount(4);
- table->setItem(0, 0, new QTableWidgetItem("Next Reference"));
- table->setItem(1, 0, new QTableWidgetItem("Previous Reference"));
- table->setItem(2, 0, new QTableWidgetItem("Next Local Reference"));
- table->setItem(3, 0, new QTableWidgetItem("Previous Local Reference"));
+ table->setItem(0, 0, new QTableWidgetItem(QStringLiteral("Next Reference")));
+ table->setItem(1, 0, new QTableWidgetItem(QStringLiteral("Previous Reference")));
+ table->setItem(2, 0, new QTableWidgetItem(QStringLiteral("Next Local Reference")));
+ table->setItem(3, 0, new QTableWidgetItem(QStringLiteral("Previous Local Reference")));
#if defined(Q_OS_MAC)
table->setItem(0, 1, new QTableWidgetItem("Cmd + G"));
@@ -194,10 +194,10 @@ QTableWidget* QtKeyboardShortcuts::createCodeViewShortcutsTable()
table->setItem(2, 1, new QTableWidgetItem("Cmd + T"));
table->setItem(3, 1, new QTableWidgetItem("Cmd + Shift + T"));
#else
- table->setItem(0, 1, new QTableWidgetItem("Ctrl + G"));
- table->setItem(1, 1, new QTableWidgetItem("Ctrl + Shift + G"));
- table->setItem(2, 1, new QTableWidgetItem("Ctrl + T"));
- table->setItem(3, 1, new QTableWidgetItem("Ctrl + Shift + T"));
+ table->setItem(0, 1, new QTableWidgetItem(QStringLiteral("Ctrl + G")));
+ table->setItem(1, 1, new QTableWidgetItem(QStringLiteral("Ctrl + Shift + G")));
+ table->setItem(2, 1, new QTableWidgetItem(QStringLiteral("Ctrl + T")));
+ table->setItem(3, 1, new QTableWidgetItem(QStringLiteral("Ctrl + Shift + T")));
#endif
table->updateSize();
@@ -210,26 +210,26 @@ QTableWidget* QtKeyboardShortcuts::createGraphViewShortcutsTable()
QtShortcutTable* table = createTableWidget("table_graph");
table->setRowCount(7);
- table->setItem(0, 0, new QTableWidgetItem("Pan left"));
- table->setItem(1, 0, new QTableWidgetItem("Pan right"));
- table->setItem(2, 0, new QTableWidgetItem("Pan up"));
- table->setItem(3, 0, new QTableWidgetItem("Pan down"));
- table->setItem(4, 0, new QTableWidgetItem("Zoom in"));
- table->setItem(5, 0, new QTableWidgetItem("Zoom out"));
- table->setItem(6, 0, new QTableWidgetItem("Reset Zoom"));
+ table->setItem(0, 0, new QTableWidgetItem(QStringLiteral("Pan left")));
+ table->setItem(1, 0, new QTableWidgetItem(QStringLiteral("Pan right")));
+ table->setItem(2, 0, new QTableWidgetItem(QStringLiteral("Pan up")));
+ table->setItem(3, 0, new QTableWidgetItem(QStringLiteral("Pan down")));
+ table->setItem(4, 0, new QTableWidgetItem(QStringLiteral("Zoom in")));
+ table->setItem(5, 0, new QTableWidgetItem(QStringLiteral("Zoom out")));
+ table->setItem(6, 0, new QTableWidgetItem(QStringLiteral("Reset Zoom")));
- table->setItem(0, 1, new QTableWidgetItem("A"));
- table->setItem(1, 1, new QTableWidgetItem("D"));
- table->setItem(2, 1, new QTableWidgetItem("W"));
- table->setItem(3, 1, new QTableWidgetItem("S"));
+ table->setItem(0, 1, new QTableWidgetItem(QStringLiteral("A")));
+ table->setItem(1, 1, new QTableWidgetItem(QStringLiteral("D")));
+ table->setItem(2, 1, new QTableWidgetItem(QStringLiteral("W")));
+ table->setItem(3, 1, new QTableWidgetItem(QStringLiteral("S")));
#if defined(Q_OS_MAC)
table->setItem(4, 1, new QTableWidgetItem("Shift + W | Cmd + Mousewheel up"));
table->setItem(5, 1, new QTableWidgetItem("Shift + S | Cmd + Mousewheel down"));
#else
- table->setItem(4, 1, new QTableWidgetItem("Shift + W | Ctrl + Mousewheel up"));
- table->setItem(5, 1, new QTableWidgetItem("Shift + S | Ctrl + Mousewheel down"));
+ table->setItem(4, 1, new QTableWidgetItem(QStringLiteral("Shift + W | Ctrl + Mousewheel up")));
+ table->setItem(5, 1, new QTableWidgetItem(QStringLiteral("Shift + S | Ctrl + Mousewheel down")));
#endif
- table->setItem(6, 1, new QTableWidgetItem("0"));
+ table->setItem(6, 1, new QTableWidgetItem(QStringLiteral("0")));
table->updateSize();
diff --git a/src/lib_gui/qt/window/QtKnownProgressDialog.cpp b/src/lib_gui/qt/window/QtKnownProgressDialog.cpp
index 5fc531be..c1db135c 100644
--- a/src/lib_gui/qt/window/QtKnownProgressDialog.cpp
+++ b/src/lib_gui/qt/window/QtKnownProgressDialog.cpp
@@ -7,7 +7,7 @@ QtKnownProgressDialog::QtKnownProgressDialog(bool hideable, QWidget* parent)
{
setSizeGripStyle(false);
- updateTitle("Progress");
+ updateTitle(QStringLiteral("Progress"));
m_layout->addStretch();
@@ -16,8 +16,8 @@ QtKnownProgressDialog::QtKnownProgressDialog(bool hideable, QWidget* parent)
QHBoxLayout* buttons = new QHBoxLayout();
buttons->addStretch();
- QPushButton* hideButton = new QPushButton("Hide");
- hideButton->setObjectName("windowButton");
+ QPushButton* hideButton = new QPushButton(QStringLiteral("Hide"));
+ hideButton->setObjectName(QStringLiteral("windowButton"));
hideButton->setDefault(true);
connect(hideButton, &QPushButton::clicked, this, &QtKnownProgressDialog::onHidePressed);
buttons->addWidget(hideButton);
diff --git a/src/lib_gui/qt/window/QtLicenseWindow.cpp b/src/lib_gui/qt/window/QtLicenseWindow.cpp
index 50f66335..696c80d9 100644
--- a/src/lib_gui/qt/window/QtLicenseWindow.cpp
+++ b/src/lib_gui/qt/window/QtLicenseWindow.cpp
@@ -46,11 +46,11 @@ void QtLicenseWindow::populateWindow(QWidget* widget)
layout->addSpacing(30);
- QLabel* header3rdParties = new QLabel(
+ QLabel* header3rdParties = new QLabel(QStringLiteral(
"Copyrights and Licenses for Third Party Software Distributed with Sourcetrail:
"
"Sourcetaril contains code written by the following third parties that have
"
- "additional or alternate copyrights, licenses, and/or restrictions:");
+ "additional or alternate copyrights, licenses, and/or restrictions:"));
layout->addWidget(header3rdParties);
layout->addSpacing(30);
@@ -87,8 +87,8 @@ void QtLicenseWindow::populateWindow(QWidget* widget)
void QtLicenseWindow::windowReady()
{
- updateTitle("License");
- updateCloseButton("Close");
+ updateTitle(QStringLiteral("License"));
+ updateCloseButton(QStringLiteral("Close"));
setNextVisible(false);
setPreviousVisible(false);
diff --git a/src/lib_gui/qt/window/QtMainWindow.cpp b/src/lib_gui/qt/window/QtMainWindow.cpp
index f54453a3..e1530cc0 100644
--- a/src/lib_gui/qt/window/QtMainWindow.cpp
+++ b/src/lib_gui/qt/window/QtMainWindow.cpp
@@ -115,7 +115,7 @@ QtMainWindow::QtMainWindow()
, m_showDockWidgetTitleBars(true)
, m_windowStack(this)
{
- setObjectName("QtMainWindow");
+ setObjectName(QStringLiteral("QtMainWindow"));
setCentralWidget(nullptr);
setDockNestingEnabled(true);
@@ -167,13 +167,13 @@ QtMainWindow::~QtMainWindow()
void QtMainWindow::addView(View* view)
{
const QString name = QString::fromStdString(view->getName());
- if (name == "Tabs")
+ if (name == QLatin1String("Tabs"))
{
QToolBar* toolBar = new QToolBar();
toolBar->setObjectName("Tool" + name);
toolBar->setMovable(false);
toolBar->setFloatable(false);
- toolBar->setStyleSheet("* { margin: 0; }");
+ toolBar->setStyleSheet(QStringLiteral("* { margin: 0; }"));
toolBar->addWidget(QtViewWidgetWrapper::getWidgetOfView(view));
addToolBar(toolBar);
return;
@@ -189,7 +189,7 @@ void QtMainWindow::addView(View* view)
layout->addWidget(QtViewWidgetWrapper::getWidgetOfView(view));
// Disable un-intended vertical growth of search widget
- if (name == "Search")
+ if (name == QLatin1String("Search"))
{
dock->setSizePolicy(dock->sizePolicy().horizontalPolicy(), QSizePolicy::Fixed);
}
@@ -222,7 +222,7 @@ void QtMainWindow::addView(View* view)
void QtMainWindow::overrideView(View* view)
{
const QString name = QString::fromStdString(view->getName());
- if (name == "Tabs")
+ if (name == QLatin1String("Tabs"))
{
return;
}
@@ -299,14 +299,14 @@ void QtMainWindow::loadLayout()
QSettings settings(
QString::fromStdWString(UserPaths::getWindowSettingsPath().wstr()), QSettings::IniFormat);
- settings.beginGroup("MainWindow");
- resize(settings.value("size", QSize(600, 400)).toSize());
- move(settings.value("position", QPoint(200, 200)).toPoint());
- if (settings.value("maximized", false).toBool())
+ settings.beginGroup(QStringLiteral("MainWindow"));
+ resize(settings.value(QStringLiteral("size"), QSize(600, 400)).toSize());
+ move(settings.value(QStringLiteral("position"), QPoint(200, 200)).toPoint());
+ if (settings.value(QStringLiteral("maximized"), false).toBool())
{
showMaximized();
}
- setShowDockWidgetTitleBars(settings.value("showTitleBars", true).toBool());
+ setShowDockWidgetTitleBars(settings.value(QStringLiteral("showTitleBars"), true).toBool());
settings.endGroup();
loadDockWidgetLayout();
}
@@ -315,7 +315,7 @@ void QtMainWindow::loadDockWidgetLayout()
{
QSettings settings(
QString::fromStdWString(UserPaths::getWindowSettingsPath().wstr()), QSettings::IniFormat);
- this->restoreState(settings.value("DOCK_LOCATIONS").toByteArray());
+ this->restoreState(settings.value(QStringLiteral("DOCK_LOCATIONS")).toByteArray());
for (DockWidget dock: m_dockWidgets)
{
@@ -336,17 +336,17 @@ void QtMainWindow::saveLayout()
QSettings settings(
QString::fromStdWString(UserPaths::getWindowSettingsPath().wstr()), QSettings::IniFormat);
- settings.beginGroup("MainWindow");
- settings.setValue("maximized", isMaximized());
+ settings.beginGroup(QStringLiteral("MainWindow"));
+ settings.setValue(QStringLiteral("maximized"), isMaximized());
if (!isMaximized())
{
- settings.setValue("size", size());
- settings.setValue("position", pos());
+ settings.setValue(QStringLiteral("size"), size());
+ settings.setValue(QStringLiteral("position"), pos());
}
- settings.setValue("showTitleBars", m_showDockWidgetTitleBars);
+ settings.setValue(QStringLiteral("showTitleBars"), m_showDockWidgetTitleBars);
settings.endGroup();
- settings.setValue("DOCK_LOCATIONS", this->saveState());
+ settings.setValue(QStringLiteral("DOCK_LOCATIONS"), this->saveState());
}
void QtMainWindow::updateHistoryMenu(std::shared_ptr message)
@@ -504,7 +504,7 @@ void QtMainWindow::openSettings()
void QtMainWindow::showDocumentation()
{
- QDesktopServices::openUrl(QUrl("https://sourcetrail.com/documentation/"));
+ QDesktopServices::openUrl(QUrl(QStringLiteral("https://sourcetrail.com/documentation/")));
}
void QtMainWindow::showKeyboardShortcuts()
@@ -521,12 +521,12 @@ void QtMainWindow::showErrorHelpMessage()
void QtMainWindow::showChangelog()
{
QDesktopServices::openUrl(
- QUrl("https://github.com/CoatiSoftware/Sourcetrail/blob/master/CHANGELOG.md"));
+ QUrl(QStringLiteral("https://github.com/CoatiSoftware/Sourcetrail/blob/master/CHANGELOG.md")));
}
void QtMainWindow::showBugtracker()
{
- QDesktopServices::openUrl(QUrl("https://github.com/CoatiSoftware/Sourcetrail/issues"));
+ QDesktopServices::openUrl(QUrl(QStringLiteral("https://github.com/CoatiSoftware/Sourcetrail/issues")));
}
void QtMainWindow::showLicenses()
@@ -608,7 +608,7 @@ void QtMainWindow::newProjectFromCDB(const FilePath& filePath)
void QtMainWindow::openProject()
{
QString fileName = QtFileDialog::getOpenFileName(
- this, tr("Open File"), FilePath(), "Sourcetrail Project Files (*.srctrlprj)");
+ this, tr("Open File"), FilePath(), QStringLiteral("Sourcetrail Project Files (*.srctrlprj)"));
if (!fileName.isEmpty())
{
@@ -963,7 +963,7 @@ void QtMainWindow::setupViewMenu()
menu->addAction(tr("Show Start Window"), this, &QtMainWindow::showStartScreen);
- m_showTitleBarsAction = new QAction("Show Title Bars", this);
+ m_showTitleBarsAction = new QAction(QStringLiteral("Show Title Bars"), this);
m_showTitleBarsAction->setCheckable(true);
m_showTitleBarsAction->setChecked(m_showDockWidgetTitleBars);
connect(
diff --git a/src/lib_gui/qt/window/QtPathListDialog.cpp b/src/lib_gui/qt/window/QtPathListDialog.cpp
index 4cb1f77b..bf314d19 100644
--- a/src/lib_gui/qt/window/QtPathListDialog.cpp
+++ b/src/lib_gui/qt/window/QtPathListDialog.cpp
@@ -40,7 +40,7 @@ void QtPathListDialog::populateWindow(QWidget* widget)
layout->setContentsMargins(0, 0, 0, 0);
QLabel* description = new QLabel(m_description);
- description->setObjectName("description");
+ description->setObjectName(QStringLiteral("description"));
description->setWordWrap(true);
layout->addWidget(description);
@@ -55,8 +55,8 @@ void QtPathListDialog::populateWindow(QWidget* widget)
void QtPathListDialog::windowReady()
{
- updateNextButton("Save");
- updateCloseButton("Cancel");
+ updateNextButton(QStringLiteral("Save"));
+ updateCloseButton(QStringLiteral("Cancel"));
setPreviousVisible(false);
diff --git a/src/lib_gui/qt/window/QtPreferencesWindow.cpp b/src/lib_gui/qt/window/QtPreferencesWindow.cpp
index 46d60701..c1bb89fc 100644
--- a/src/lib_gui/qt/window/QtPreferencesWindow.cpp
+++ b/src/lib_gui/qt/window/QtPreferencesWindow.cpp
@@ -52,8 +52,8 @@ void QtPreferencesWindow::windowReady()
{
QtProjectWizardWindow::windowReady();
- updateTitle("PREFERENCES");
- updateNextButton("Save");
+ updateTitle(QStringLiteral("PREFERENCES"));
+ updateNextButton(QStringLiteral("Save"));
setPreviousVisible(false);
loadContent();
diff --git a/src/lib_gui/qt/window/QtProgressBarDialog.cpp b/src/lib_gui/qt/window/QtProgressBarDialog.cpp
index 2f420362..c8794d47 100644
--- a/src/lib_gui/qt/window/QtProgressBarDialog.cpp
+++ b/src/lib_gui/qt/window/QtProgressBarDialog.cpp
@@ -8,7 +8,7 @@ QtProgressBarDialog::QtProgressBarDialog(float topRatio, bool hideable, QWidget*
: QtIndexingDialog(true, parent), m_title(nullptr), m_topRatio(topRatio)
{
m_top = new QWidget(m_window);
- m_top->setObjectName("topHalf");
+ m_top->setObjectName(QStringLiteral("topHalf"));
m_top->setGeometry(0, 0, 0, 0);
m_top->show();
m_top->lower();
@@ -16,13 +16,13 @@ QtProgressBarDialog::QtProgressBarDialog(float topRatio, bool hideable, QWidget*
m_progressBar = new QtProgressBar(m_window);
m_progressBar->setGeometry(0, 0, 0, 0);
- m_title = new QLabel("", this);
- m_title->setObjectName("title");
+ m_title = new QLabel(QLatin1String(""), this);
+ m_title->setObjectName(QStringLiteral("title"));
m_title->setAlignment(Qt::AlignRight | Qt::AlignBottom);
m_title->show();
- m_percentLabel = new QLabel("0% Progress");
- m_percentLabel->setObjectName("percent");
+ m_percentLabel = new QLabel(QStringLiteral("0% Progress"));
+ m_percentLabel->setObjectName(QStringLiteral("percent"));
m_layout->addWidget(m_percentLabel, 0, Qt::AlignRight);
m_messageLabel = QtIndexingDialog::createMessageLabel(m_layout);
diff --git a/src/lib_gui/qt/window/QtSelectPathsDialog.cpp b/src/lib_gui/qt/window/QtSelectPathsDialog.cpp
index 195202e6..5ed29a79 100644
--- a/src/lib_gui/qt/window/QtSelectPathsDialog.cpp
+++ b/src/lib_gui/qt/window/QtSelectPathsDialog.cpp
@@ -58,7 +58,7 @@ void QtSelectPathsDialog::setPathsList(
if (!s.exists())
{
item->setTextColor(Qt::red);
- item->setToolTip("Path does not exist");
+ item->setToolTip(QStringLiteral("Path does not exist"));
item->setFlags(item->flags() & ~Qt::ItemIsEnabled);
item->setCheckState(Qt::Unchecked);
}
@@ -83,12 +83,12 @@ void QtSelectPathsDialog::populateWindow(QWidget* widget)
layout->setContentsMargins(0, 0, 0, 0);
QLabel* description = new QLabel(m_description);
- description->setObjectName("description");
+ description->setObjectName(QStringLiteral("description"));
description->setWordWrap(true);
layout->addWidget(description);
m_list = new QListWidget();
- m_list->setObjectName("pathList");
+ m_list->setObjectName(QStringLiteral("pathList"));
m_list->setEditTriggers(QAbstractItemView::NoEditTriggers);
m_list->setSelectionMode(QAbstractItemView::ExtendedSelection);
m_list->setAttribute(Qt::WA_MacShowFocusRect, 0);
@@ -97,8 +97,8 @@ void QtSelectPathsDialog::populateWindow(QWidget* widget)
QHBoxLayout* buttonLayout = new QHBoxLayout();
buttonLayout->setContentsMargins(0, 0, 0, 0);
- QPushButton* checkAllButton = new QPushButton("check all");
- checkAllButton->setObjectName("windowButton");
+ QPushButton* checkAllButton = new QPushButton(QStringLiteral("check all"));
+ checkAllButton->setObjectName(QStringLiteral("windowButton"));
connect(checkAllButton, &QPushButton::clicked, [=]() {
m_list->selectAll();
checkSelected(true);
@@ -106,8 +106,8 @@ void QtSelectPathsDialog::populateWindow(QWidget* widget)
});
buttonLayout->addWidget(checkAllButton);
- QPushButton* unCheckAllButton = new QPushButton("uncheck all");
- unCheckAllButton->setObjectName("windowButton");
+ QPushButton* unCheckAllButton = new QPushButton(QStringLiteral("uncheck all"));
+ unCheckAllButton->setObjectName(QStringLiteral("windowButton"));
connect(unCheckAllButton, &QPushButton::clicked, [=]() {
m_list->selectAll();
checkSelected(false);
@@ -115,13 +115,13 @@ void QtSelectPathsDialog::populateWindow(QWidget* widget)
});
buttonLayout->addWidget(unCheckAllButton);
- QPushButton* checkSelectedButton = new QPushButton("check selected");
- checkSelectedButton->setObjectName("windowButton");
+ QPushButton* checkSelectedButton = new QPushButton(QStringLiteral("check selected"));
+ checkSelectedButton->setObjectName(QStringLiteral("windowButton"));
connect(checkSelectedButton, &QPushButton::clicked, [=]() { checkSelected(true); });
buttonLayout->addWidget(checkSelectedButton);
- QPushButton* unCheckSelectedButton = new QPushButton("uncheck selected");
- unCheckSelectedButton->setObjectName("windowButton");
+ QPushButton* unCheckSelectedButton = new QPushButton(QStringLiteral("uncheck selected"));
+ unCheckSelectedButton->setObjectName(QStringLiteral("windowButton"));
connect(unCheckSelectedButton, &QPushButton::clicked, [=]() { checkSelected(false); });
buttonLayout->addWidget(unCheckSelectedButton);
@@ -132,8 +132,8 @@ void QtSelectPathsDialog::populateWindow(QWidget* widget)
void QtSelectPathsDialog::windowReady()
{
- updateNextButton("Save");
- updateCloseButton("Cancel");
+ updateNextButton(QStringLiteral("Save"));
+ updateCloseButton(QStringLiteral("Cancel"));
setPreviousVisible(false);
diff --git a/src/lib_gui/qt/window/QtStartScreen.cpp b/src/lib_gui/qt/window/QtStartScreen.cpp
index b05c9589..5622fdc6 100644
--- a/src/lib_gui/qt/window/QtStartScreen.cpp
+++ b/src/lib_gui/qt/window/QtStartScreen.cpp
@@ -50,13 +50,13 @@ void QtRecentProjectButton::handleButtonClick()
else
{
QMessageBox msgBox;
- msgBox.setText("Missing Project File");
+ msgBox.setText(QStringLiteral("Missing Project File"));
msgBox.setInformativeText(QString::fromStdWString(
L"Couldn't find \"" + m_projectFilePath.wstr() +
L"\" on your filesystem.
Do you want to remove it from recent project "
L"list?
"));
- msgBox.addButton("Remove", QMessageBox::ButtonRole::YesRole);
- msgBox.addButton("Keep", QMessageBox::ButtonRole::NoRole);
+ msgBox.addButton(QStringLiteral("Remove"), QMessageBox::ButtonRole::YesRole);
+ msgBox.addButton(QStringLiteral("Keep"), QMessageBox::ButtonRole::NoRole);
msgBox.setIcon(QMessageBox::Icon::Question);
int ret = msgBox.exec();
@@ -148,7 +148,7 @@ void QtStartScreen::updateButtons()
&QtRecentProjectButton::handleButtonClick);
if (button->projectExists())
{
- button->setObjectName("recentButton");
+ button->setObjectName(QStringLiteral("recentButton"));
connect(
button, &QtRecentProjectButton::clicked, this, &QtStartScreen::handleRecentButton);
}
@@ -156,7 +156,7 @@ void QtStartScreen::updateButtons()
{
connect(
button, &QtRecentProjectButton::updateButtons, this, &QtStartScreen::updateButtons);
- button->setObjectName("recentButtonMissing");
+ button->setObjectName(QStringLiteral("recentButtonMissing"));
}
}
else
@@ -188,7 +188,7 @@ void QtStartScreen::setupStartScreen()
QLabel* versionLabel = new QLabel(
("Version " + Version::getApplicationVersion().toDisplayString()).c_str(), this);
- versionLabel->setObjectName("boldLabel");
+ versionLabel->setObjectName(QStringLiteral("boldLabel"));
col->addWidget(versionLabel);
QtUpdateCheckerWidget* checker = new QtUpdateCheckerWidget(this);
@@ -196,35 +196,35 @@ void QtStartScreen::setupStartScreen()
col->addSpacing(15);
- QPushButton* githubButton = new QPushButton("Contribute on GitHub", this);
+ QPushButton* githubButton = new QPushButton(QStringLiteral("Contribute on GitHub"), this);
githubButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
- githubButton->setObjectName("infoButton");
+ githubButton->setObjectName(QStringLiteral("infoButton"));
githubButton->setIcon(m_githubIcon);
githubButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
connect(githubButton, &QPushButton::clicked, []() {
QDesktopServices::openUrl(
- QUrl("https://github.com/CoatiSoftware/Sourcetrail", QUrl::TolerantMode));
+ QUrl(QStringLiteral("https://github.com/CoatiSoftware/Sourcetrail"), QUrl::TolerantMode));
});
col->addWidget(githubButton);
col->addSpacing(8);
// QPushButton* patreonButton = new QPushButton("Support on Patreon", this);
- QPushButton* patreonButton = new QPushButton("Become a Patron", this);
+ QPushButton* patreonButton = new QPushButton(QStringLiteral("Become a Patron"), this);
patreonButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
- patreonButton->setObjectName("infoButton");
+ patreonButton->setObjectName(QStringLiteral("infoButton"));
patreonButton->setIcon(m_patreonIcon);
patreonButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
connect(patreonButton, &QPushButton::clicked, []() {
- QDesktopServices::openUrl(QUrl("https://www.patreon.com/sourcetrail", QUrl::TolerantMode));
+ QDesktopServices::openUrl(QUrl(QStringLiteral("https://www.patreon.com/sourcetrail"), QUrl::TolerantMode));
});
col->addWidget(patreonButton);
col->addSpacing(15);
{
- QLabel* newsHeader = new QLabel("News:");
- newsHeader->setObjectName("boldLabel");
+ QLabel* newsHeader = new QLabel(QStringLiteral("News:"));
+ newsHeader->setObjectName(QStringLiteral("boldLabel"));
col->addWidget(newsHeader);
QtNewsWidget* newsWidget = new QtNewsWidget(this);
@@ -237,9 +237,9 @@ void QtStartScreen::setupStartScreen()
col->addSpacing(35);
col->addStretch();
- QPushButton* newProjectButton = new QPushButton("New Project", this);
+ QPushButton* newProjectButton = new QPushButton(QStringLiteral("New Project"), this);
newProjectButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
- newProjectButton->setObjectName("projectButton");
+ newProjectButton->setObjectName(QStringLiteral("projectButton"));
newProjectButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
connect(
newProjectButton, &QPushButton::clicked, this, &QtStartScreen::handleNewProjectButton);
@@ -247,9 +247,9 @@ void QtStartScreen::setupStartScreen()
col->addSpacing(8);
- QPushButton* openProjectButton = new QPushButton("Open Project", this);
+ QPushButton* openProjectButton = new QPushButton(QStringLiteral("Open Project"), this);
openProjectButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
- openProjectButton->setObjectName("projectButton");
+ openProjectButton->setObjectName(QStringLiteral("projectButton"));
openProjectButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
connect(
openProjectButton, &QPushButton::clicked, this, &QtStartScreen::handleOpenProjectButton);
@@ -262,8 +262,8 @@ void QtStartScreen::setupStartScreen()
QVBoxLayout* col = new QVBoxLayout();
layout->addLayout(col, 1);
- QLabel* recentProjectsLabel = new QLabel("Recent Projects: ", this);
- recentProjectsLabel->setObjectName("titleLabel");
+ QLabel* recentProjectsLabel = new QLabel(QStringLiteral("Recent Projects: "), this);
+ recentProjectsLabel->setObjectName(QStringLiteral("titleLabel"));
col->addWidget(recentProjectsLabel);
col->addSpacing(20);
@@ -275,7 +275,7 @@ void QtStartScreen::setupStartScreen()
button->setIcon(m_projectIcon);
button->setIconSize(QSize(30, 30));
button->setMinimumSize(button->fontMetrics().width(button->text()) + 45, 40);
- button->setObjectName("recentButtonMissing");
+ button->setObjectName(QStringLiteral("recentButtonMissing"));
button->minimumSizeHint(); // force font loading
m_recentProjectsButtons.push_back(button);
col->addWidget(button);
diff --git a/src/lib_gui/qt/window/QtTextEditDialog.cpp b/src/lib_gui/qt/window/QtTextEditDialog.cpp
index 303afe08..6f666df3 100644
--- a/src/lib_gui/qt/window/QtTextEditDialog.cpp
+++ b/src/lib_gui/qt/window/QtTextEditDialog.cpp
@@ -29,11 +29,11 @@ void QtTextEditDialog::setReadOnly(bool readOnly)
if (readOnly)
{
- updateNextButton("OK");
+ updateNextButton(QStringLiteral("OK"));
}
else
{
- updateNextButton("Save");
+ updateNextButton(QStringLiteral("Save"));
}
}
@@ -43,12 +43,12 @@ void QtTextEditDialog::populateWindow(QWidget* widget)
layout->setContentsMargins(0, 0, 0, 0);
QLabel* description = new QLabel(m_description);
- description->setObjectName("description");
+ description->setObjectName(QStringLiteral("description"));
description->setWordWrap(true);
layout->addWidget(description);
m_text = new QPlainTextEdit();
- m_text->setObjectName("textField");
+ m_text->setObjectName(QStringLiteral("textField"));
m_text->setLineWrapMode(QPlainTextEdit::NoWrap);
m_text->setTabStopWidth(8 * m_text->fontMetrics().width('9'));
layout->addWidget(m_text);
@@ -58,8 +58,8 @@ void QtTextEditDialog::populateWindow(QWidget* widget)
void QtTextEditDialog::windowReady()
{
- updateNextButton("Save");
- updateCloseButton("Cancel");
+ updateNextButton(QStringLiteral("Save"));
+ updateCloseButton(QStringLiteral("Cancel"));
setPreviousVisible(false);
diff --git a/src/lib_gui/qt/window/QtUnknownProgressDialog.cpp b/src/lib_gui/qt/window/QtUnknownProgressDialog.cpp
index a6794380..1528f225 100644
--- a/src/lib_gui/qt/window/QtUnknownProgressDialog.cpp
+++ b/src/lib_gui/qt/window/QtUnknownProgressDialog.cpp
@@ -7,7 +7,7 @@ QtUnknownProgressDialog::QtUnknownProgressDialog(bool hideable, QWidget* parent)
{
setSizeGripStyle(false);
- updateTitle("Status");
+ updateTitle(QStringLiteral("Status"));
m_layout->addStretch();
@@ -16,8 +16,8 @@ QtUnknownProgressDialog::QtUnknownProgressDialog(bool hideable, QWidget* parent)
QHBoxLayout* buttons = new QHBoxLayout();
buttons->addStretch();
- QPushButton* hideButton = new QPushButton("Hide");
- hideButton->setObjectName("windowButton");
+ QPushButton* hideButton = new QPushButton(QStringLiteral("Hide"));
+ hideButton->setObjectName(QStringLiteral("windowButton"));
hideButton->setDefault(true);
connect(hideButton, &QPushButton::clicked, this, &QtUnknownProgressDialog::onHidePressed);
buttons->addWidget(hideButton);
diff --git a/src/lib_gui/qt/window/QtWindow.cpp b/src/lib_gui/qt/window/QtWindow.cpp
index fe8b0088..a3ebb941 100644
--- a/src/lib_gui/qt/window/QtWindow.cpp
+++ b/src/lib_gui/qt/window/QtWindow.cpp
@@ -35,13 +35,13 @@ void QtWindow::setup()
hlayout->setContentsMargins(0, 0, 0, 0);
m_title = new QLabel();
- m_title->setObjectName("title");
+ m_title->setObjectName(QStringLiteral("title"));
hlayout->addWidget(m_title);
hlayout->addStretch();
m_subTitle = new QLabel();
- m_subTitle->setObjectName("subTitle");
+ m_subTitle->setObjectName(QStringLiteral("subTitle"));
hlayout->addWidget(m_subTitle);
layout->addLayout(hlayout);
@@ -50,13 +50,13 @@ void QtWindow::setup()
layout->addSpacing(10);
QWidget* contentWidget = new QWidget();
- contentWidget->setObjectName("form");
+ contentWidget->setObjectName(QStringLiteral("form"));
populateWindow(contentWidget);
QScrollArea* scrollArea = new QScrollArea();
scrollArea->setFrameShadow(QFrame::Plain);
- scrollArea->setObjectName("formArea");
+ scrollArea->setObjectName(QStringLiteral("formArea"));
scrollArea->setWidgetResizable(true);
scrollArea->setWidget(contentWidget);
@@ -69,7 +69,7 @@ void QtWindow::setup()
}
else
{
- scrollArea->setObjectName("scrollArea");
+ scrollArea->setObjectName(QStringLiteral("scrollArea"));
}
QHBoxLayout* buttonLayout = createButtons();
@@ -361,16 +361,16 @@ void QtWindow::addLogo()
QHBoxLayout* QtWindow::createButtons()
{
- m_nextButton = new QPushButton("Next");
- m_nextButton->setObjectName("windowButton");
+ m_nextButton = new QPushButton(QStringLiteral("Next"));
+ m_nextButton->setObjectName(QStringLiteral("windowButton"));
connect(m_nextButton, &QPushButton::clicked, this, &QtWindow::handleNextPress);
- m_previousButton = new QPushButton("Previous");
- m_previousButton->setObjectName("windowButton");
+ m_previousButton = new QPushButton(QStringLiteral("Previous"));
+ m_previousButton->setObjectName(QStringLiteral("windowButton"));
connect(m_previousButton, &QPushButton::clicked, this, &QtWindow::handlePreviousPress);
- m_closeButton = new QPushButton("Cancel");
- m_closeButton->setObjectName("windowButton");
+ m_closeButton = new QPushButton(QStringLiteral("Cancel"));
+ m_closeButton->setObjectName(QStringLiteral("windowButton"));
connect(m_closeButton, &QPushButton::clicked, this, &QtWindow::handleClosePress);
QHBoxLayout* buttons = new QHBoxLayout();
diff --git a/src/lib_gui/qt/window/QtWindowBase.cpp b/src/lib_gui/qt/window/QtWindowBase.cpp
index 9bc9b416..f89b26ea 100644
--- a/src/lib_gui/qt/window/QtWindowBase.cpp
+++ b/src/lib_gui/qt/window/QtWindowBase.cpp
@@ -28,7 +28,7 @@ QtWindowBase::QtWindowBase(bool isSubWindow, QWidget* parent)
}
m_window = new QWidget(this);
- m_window->setObjectName("window");
+ m_window->setObjectName(QStringLiteral("window"));
QVBoxLayout* layout = new QVBoxLayout(m_window);
layout->setSpacing(0);
diff --git a/src/lib_gui/utility/utilityApp.cpp b/src/lib_gui/utility/utilityApp.cpp
index 4c70a593..af515f00 100644
--- a/src/lib_gui/utility/utilityApp.cpp
+++ b/src/lib_gui/utility/utilityApp.cpp
@@ -70,7 +70,8 @@ std::pair utility::executeProcess(
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
QStringList envlist = env.toStringList();
envlist.replaceInStrings(
- QRegularExpression("^(?i)PATH=(.*)"), "PATH=/opt/local/bin:/usr/local/bin:$HOME/bin:\\1");
+ QRegularExpression(QStringLiteral("^(?i)PATH=(.*)")),
+ QStringLiteral("PATH=/opt/local/bin:/usr/local/bin:$HOME/bin:\\1"));
process.setEnvironment(envlist);
{
@@ -108,7 +109,8 @@ std::string utility::executeProcessUntilNoOutput(
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
QStringList envlist = env.toStringList();
envlist.replaceInStrings(
- QRegularExpression("^(?i)PATH=(.*)"), "PATH=/opt/local/bin:/usr/local/bin:$HOME/bin:\\1");
+ QRegularExpression(QStringLiteral("^(?i)PATH=(.*)")),
+ QStringLiteral("PATH=/opt/local/bin:/usr/local/bin:$HOME/bin:\\1"));
process.setEnvironment(envlist);
{
@@ -209,7 +211,8 @@ int utility::executeProcessAndGetExitCode(
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
QStringList envlist = env.toStringList();
envlist.replaceInStrings(
- QRegularExpression("^(?i)PATH=(.*)"), "PATH=/opt/local/bin:/usr/local/bin:$HOME/bin:\\1");
+ QRegularExpression(QStringLiteral("^(?i)PATH=(.*)")),
+ QStringLiteral("PATH=/opt/local/bin:/usr/local/bin:$HOME/bin:\\1"));
process.setEnvironment(envlist);
{