" << QCoreApplication::translate("QtVersion", "Name:")
+ str << "| " << Tr::tr("Name:")
<< " | " << displayName() << " | ";
if (!isValid()) {
str << "| "
- << QCoreApplication::translate("QtVersion", "Invalid Qt version")
+ << Tr::tr("Invalid Qt version")
<< " | ";
} else {
- str << "" << QCoreApplication::translate("QtVersion", "ABI:")
+ str << "| " << Tr::tr("ABI:")
<< " | ";
const Abis abis = qtAbis();
if (abis.isEmpty()) {
@@ -938,23 +940,23 @@ QString QtVersion::toHtml(bool verbose) const
}
}
const OsType osType = d->m_qmakeCommand.osType();
- str << " " << QCoreApplication::translate("QtVersion", "Source:")
+ str << "| " << Tr::tr("Source:")
<< " | " << sourcePath().toUserOutput() << " | ";
- str << "" << QCoreApplication::translate("QtVersion", "mkspec:")
+ str << "| " << Tr::tr("mkspec:")
<< " | " << QDir::toNativeSeparators(mkspec()) << " | ";
- str << "" << QCoreApplication::translate("QtVersion", "qmake:")
+ str << "| " << Tr::tr("qmake:")
<< " | " << d->m_qmakeCommand.toUserOutput() << " | ";
ensureMkSpecParsed();
if (!mkspecPath().isEmpty()) {
if (d->m_defaultConfigIsDebug || d->m_defaultConfigIsDebugAndRelease) {
- str << "| " << QCoreApplication::translate("QtVersion", "Default:") << " | "
+ str << " | | " << Tr::tr("Default:") << " | "
<< (d->m_defaultConfigIsDebug ? "debug" : "release");
if (d->m_defaultConfigIsDebugAndRelease)
str << " debug_and_release";
str << " | ";
} // default config.
}
- str << "" << QCoreApplication::translate("QtVersion", "Version:")
+ str << "| " << Tr::tr("Version:")
<< " | " << qtVersionString() << " | ";
if (verbose) {
const QHash vInfo = d->versionInfo();
@@ -1478,146 +1480,139 @@ QtVersion::createMacroExpander(const std::function &qtVersi
};
};
std::unique_ptr expander(new MacroExpander);
- expander->setDisplayName(QtKitAspect::tr("Qt version"));
+ expander->setDisplayName(Tr::tr("Qt version"));
expander->registerVariable("Qt:Version",
- QtKitAspect::tr("The version string of the current Qt version."),
+ Tr::tr("The version string of the current Qt version."),
versionProperty([](const QtVersion *version) {
return version->qtVersionString();
}));
expander->registerVariable(
"Qt:Type",
- QtKitAspect::tr("The type of the current Qt version."),
+ Tr::tr("The type of the current Qt version."),
versionProperty([](const QtVersion *version) {
return version->type();
}));
expander->registerVariable(
"Qt:Mkspec",
- QtKitAspect::tr("The mkspec of the current Qt version."),
+ Tr::tr("The mkspec of the current Qt version."),
versionProperty([](const QtVersion *version) {
return QDir::toNativeSeparators(version->mkspec());
}));
expander->registerVariable("Qt:QT_INSTALL_PREFIX",
- QtKitAspect::tr(
- "The installation prefix of the current Qt version."),
+ Tr::tr("The installation prefix of the current Qt version."),
versionProperty([](const QtVersion *version) {
return version->prefix().path();
}));
expander->registerVariable("Qt:QT_INSTALL_DATA",
- QtKitAspect::tr(
+ Tr::tr(
"The installation location of the current Qt version's data."),
versionProperty([](const QtVersion *version) {
return version->dataPath().path();
}));
expander->registerVariable("Qt:QT_HOST_PREFIX",
- QtKitAspect::tr(
- "The host location of the current Qt version."),
+ Tr::tr("The host location of the current Qt version."),
versionProperty([](const QtVersion *version) {
return version->hostPrefixPath().path();
}));
expander->registerVariable("Qt:QT_HOST_LIBEXECS",
- QtKitAspect::tr("The installation location of the current Qt "
- "version's internal host executable files."),
+ Tr::tr("The installation location of the current Qt "
+ "version's internal host executable files."),
versionProperty([](const QtVersion *version) {
return version->hostLibexecPath().path();
}));
expander->registerVariable(
"Qt:QT_INSTALL_HEADERS",
- QtKitAspect::tr("The installation location of the current Qt version's header files."),
+ Tr::tr("The installation location of the current Qt version's header files."),
versionProperty(
[](const QtVersion *version) { return version->headerPath().path(); }));
expander->registerVariable(
"Qt:QT_INSTALL_LIBS",
- QtKitAspect::tr("The installation location of the current Qt version's library files."),
+ Tr::tr("The installation location of the current Qt version's library files."),
versionProperty(
[](const QtVersion *version) { return version->libraryPath().path(); }));
expander->registerVariable(
"Qt:QT_INSTALL_DOCS",
- QtKitAspect::tr(
- "The installation location of the current Qt version's documentation files."),
+ Tr::tr("The installation location of the current Qt version's documentation files."),
versionProperty(
[](const QtVersion *version) { return version->docsPath().path(); }));
expander->registerVariable(
"Qt:QT_INSTALL_BINS",
- QtKitAspect::tr("The installation location of the current Qt version's executable files."),
+ Tr::tr("The installation location of the current Qt version's executable files."),
versionProperty([](const QtVersion *version) { return version->binPath().path(); }));
expander->registerVariable(
"Qt:QT_INSTALL_LIBEXECS",
- QtKitAspect::tr(
- "The installation location of the current Qt version's internal executable files."),
+ Tr::tr("The installation location of the current Qt version's internal executable files."),
versionProperty(
[](const QtVersion *version) { return version->libExecPath().path(); }));
expander
->registerVariable("Qt:QT_INSTALL_PLUGINS",
- QtKitAspect::tr(
- "The installation location of the current Qt version's plugins."),
+ Tr::tr("The installation location of the current Qt version's plugins."),
versionProperty([](const QtVersion *version) {
return version->pluginPath().path();
}));
expander
->registerVariable("Qt:QT_INSTALL_QML",
- QtKitAspect::tr(
- "The installation location of the current Qt version's QML files."),
+ Tr::tr("The installation location of the current Qt version's QML files."),
versionProperty([](const QtVersion *version) {
return version->qmlPath().path();
}));
expander
->registerVariable("Qt:QT_INSTALL_IMPORTS",
- QtKitAspect::tr(
- "The installation location of the current Qt version's imports."),
+ Tr::tr("The installation location of the current Qt version's imports."),
versionProperty([](const QtVersion *version) {
return version->importsPath().path();
}));
expander->registerVariable(
"Qt:QT_INSTALL_TRANSLATIONS",
- QtKitAspect::tr("The installation location of the current Qt version's translation files."),
+ Tr::tr("The installation location of the current Qt version's translation files."),
versionProperty(
[](const QtVersion *version) { return version->translationsPath().path(); }));
expander->registerVariable(
"Qt:QT_INSTALL_CONFIGURATION",
- QtKitAspect::tr("The installation location of the current Qt version's translation files."),
+ Tr::tr("The installation location of the current Qt version's translation files."),
versionProperty(
[](const QtVersion *version) { return version->configurationPath().path(); }));
expander
->registerVariable("Qt:QT_INSTALL_EXAMPLES",
- QtKitAspect::tr(
+ Tr::tr(
"The installation location of the current Qt version's examples."),
versionProperty([](const QtVersion *version) {
return version->examplesPath().path();
}));
expander->registerVariable("Qt:QT_INSTALL_DEMOS",
- QtKitAspect::tr(
+ Tr::tr(
"The installation location of the current Qt version's demos."),
versionProperty([](const QtVersion *version) {
return version->demosPath().path();
}));
expander->registerVariable("Qt:QMAKE_MKSPECS",
- QtKitAspect::tr("The current Qt version's default mkspecs (Qt 4)."),
+ Tr::tr("The current Qt version's default mkspecs (Qt 4)."),
versionProperty([](const QtVersion *version) {
return version->d->qmakeProperty("QMAKE_MKSPECS");
}));
expander->registerVariable("Qt:QMAKE_SPEC",
- QtKitAspect::tr(
+ Tr::tr(
"The current Qt version's default mkspec (Qt 5; host system)."),
versionProperty([](const QtVersion *version) {
return version->d->qmakeProperty("QMAKE_SPEC");
@@ -1625,21 +1620,20 @@ QtVersion::createMacroExpander(const std::function &qtVersi
expander
->registerVariable("Qt:QMAKE_XSPEC",
- QtKitAspect::tr(
- "The current Qt version's default mkspec (Qt 5; target system)."),
+ Tr::tr("The current Qt version's default mkspec (Qt 5; target system)."),
versionProperty([](const QtVersion *version) {
return version->d->qmakeProperty("QMAKE_XSPEC");
}));
expander->registerVariable("Qt:QMAKE_VERSION",
- QtKitAspect::tr("The current Qt's qmake version."),
+ Tr::tr("The current Qt's qmake version."),
versionProperty([](const QtVersion *version) {
return version->d->qmakeProperty("QMAKE_VERSION");
}));
// FIXME: Re-enable once we can detect expansion loops.
// expander->registerVariable("Qt:Name",
- // QtKitAspect::tr("The display name of the current Qt version."),
+ // Tr::tr("The display name of the current Qt version."),
// versionProperty([](QtVersion *version) {
// return version->displayName();
// }));
@@ -1757,14 +1751,14 @@ Tasks QtVersion::reportIssuesImpl(const QString &proFile, const QString &buildDi
if (!isValid()) {
//: %1: Reason for being invalid
- const QString msg = QCoreApplication::translate("QmakeProjectManager::QtVersion", "The Qt version is invalid: %1").arg(invalidReason());
+ const QString msg = Tr::tr("The Qt version is invalid: %1").arg(invalidReason());
results.append(BuildSystemTask(Task::Error, msg));
}
FilePath qmake = qmakeFilePath();
if (!qmake.isExecutableFile()) {
//: %1: Path to qmake executable
- const QString msg = QCoreApplication::translate("QmakeProjectManager::QtVersion",
+ const QString msg = Tr::tr(
"The qmake command \"%1\" was not found or is not executable.").arg(qmake.displayName());
results.append(BuildSystemTask(Task::Error, msg));
}
@@ -1802,19 +1796,17 @@ static QByteArray runQmakeQuery(const FilePath &binary, const Environment &env,
process.start();
if (!process.waitForFinished()) {
- *error = QCoreApplication::translate("QtVersion", "Timeout running \"%1\".")
- .arg(binary.displayName());
+ *error = Tr::tr("Timeout running \"%1\".").arg(binary.displayName());
return {};
}
if (process.exitStatus() != QProcess::NormalExit) {
- *error = QCoreApplication::translate("QtVersion", "\"%1\" crashed.")
- .arg(binary.displayName());
+ *error = Tr::tr("\"%1\" crashed.").arg(binary.displayName());
return {};
}
const QByteArray out = process.readAllStandardOutput();
if (out.isEmpty()) {
- *error = QCoreApplication::translate("QtVersion", "\"%1\" produced no output: %2.")
+ *error = Tr::tr("\"%1\" produced no output: %2.")
.arg(binary.displayName(), process.cleanedStdErr());
return {};
}
@@ -1824,15 +1816,14 @@ static QByteArray runQmakeQuery(const FilePath &binary, const Environment &env,
}
bool QtVersionPrivate::queryQMakeVariables(const FilePath &binary, const Environment &env,
- QHash *versionInfo, QString *error)
+ QHash *versionInfo, QString *error)
{
QString tmp;
if (!error)
error = &tmp;
if (!binary.isExecutableFile()) {
- *error = QCoreApplication::translate("QtVersion", "qmake \"%1\" is not an executable.")
- .arg(binary.displayName());
+ *error = Tr::tr("qmake \"%1\" is not an executable.").arg(binary.displayName());
return false;
}
@@ -2036,7 +2027,7 @@ bool QtVersion::isQmlDebuggingSupported(const Kit *k, QString *reason)
QtVersion *version = QtKitAspect::qtVersion(k);
if (!version) {
if (reason)
- *reason = QCoreApplication::translate("QtVersion", "No Qt version.");
+ *reason = Tr::tr("No Qt version.");
return false;
}
return version->isQmlDebuggingSupported(reason);
@@ -2046,13 +2037,13 @@ bool QtVersion::isQmlDebuggingSupported(QString *reason) const
{
if (!isValid()) {
if (reason)
- *reason = QCoreApplication::translate("QtVersion", "Invalid Qt version.");
+ *reason = Tr::tr("Invalid Qt version.");
return false;
}
if (qtVersion() < QtVersionNumber(5, 0, 0)) {
if (reason)
- *reason = QCoreApplication::translate("QtVersion", "Requires Qt 5.0.0 or newer.");
+ *reason = Tr::tr("Requires Qt 5.0.0 or newer.");
return false;
}
@@ -2065,7 +2056,7 @@ bool QtVersion::isQtQuickCompilerSupported(const Kit *k, QString *reason)
QtVersion *version = QtKitAspect::qtVersion(k);
if (!version) {
if (reason)
- *reason = QCoreApplication::translate("QtVersion", "No Qt version.");
+ *reason = Tr::tr("No Qt version.");
return false;
}
return version->isQtQuickCompilerSupported(reason);
@@ -2075,20 +2066,20 @@ bool QtVersion::isQtQuickCompilerSupported(QString *reason) const
{
if (!isValid()) {
if (reason)
- *reason = QCoreApplication::translate("QtVersion", "Invalid Qt version.");
+ *reason = Tr::tr("Invalid Qt version.");
return false;
}
if (qtVersion() < QtVersionNumber(5, 3, 0)) {
if (reason)
- *reason = QCoreApplication::translate("QtVersion", "Requires Qt 5.3.0 or newer.");
+ *reason = Tr::tr("Requires Qt 5.3.0 or newer.");
return false;
}
const QString qtQuickCompilerPrf = mkspecsPath().toString() + "/features/qtquickcompiler.prf";
if (!QFileInfo::exists(qtQuickCompilerPrf)) {
if (reason)
- *reason = QCoreApplication::translate("QtVersion", "This Qt Version does not contain Qt Quick Compiler.");
+ *reason = Tr::tr("This Qt Version does not contain Qt Quick Compiler.");
return false;
}
@@ -2374,8 +2365,7 @@ QtVersion *QtVersionFactory::createQtVersionFromQMakePath
}
ProFileCacheManager::instance()->decRefCount();
if (error) {
- *error = QCoreApplication::translate("QtSupport::QtVersionFactory",
- "No factory found for qmake: \"%1\"").arg(qmakePath.displayName());
+ *error = Tr::tr("No factory found for qmake: \"%1\"").arg(qmakePath.displayName());
}
return nullptr;
}
diff --git a/src/plugins/qtsupport/baseqtversion.h b/src/plugins/qtsupport/baseqtversion.h
index 269a6507168..416e54c536c 100644
--- a/src/plugins/qtsupport/baseqtversion.h
+++ b/src/plugins/qtsupport/baseqtversion.h
@@ -87,8 +87,6 @@ class QtVersionPrivate;
class QTSUPPORT_EXPORT QtVersion
{
- Q_DECLARE_TR_FUNCTIONS(QtSupport::QtVersion)
-
public:
using Predicate = std::function;
diff --git a/src/plugins/qtsupport/codegensettings.cpp b/src/plugins/qtsupport/codegensettings.cpp
index df96cc8a24a..aa984f107fe 100644
--- a/src/plugins/qtsupport/codegensettings.cpp
+++ b/src/plugins/qtsupport/codegensettings.cpp
@@ -30,29 +30,28 @@
#include
-static const char CODE_GEN_GROUP[] = "FormClassWizardPage";
-static const char TRANSLATION_KEY[] = "RetranslationSupport";
-static const char EMBEDDING_KEY[] = "Embedding";
-static const char INCLUDE_QT_MODULE_KEY[] = "IncludeQtModule";
-static const char ADD_QT_VERSION_CHECK_KEY[] = "AddQtVersionCheck";
-
-static const bool retranslationSupportDefault = false;
-static const QtSupport::CodeGenSettings::UiClassEmbedding embeddingDefault
- = QtSupport::CodeGenSettings::PointerAggregatedUiClass;
-static const bool includeQtModuleDefault = false;
-static const bool addQtVersionCheckDefault = false;
-
using namespace Utils;
namespace QtSupport {
+const char CODE_GEN_GROUP[] = "FormClassWizardPage";
+const char TRANSLATION_KEY[] = "RetranslationSupport";
+const char EMBEDDING_KEY[] = "Embedding";
+const char INCLUDE_QT_MODULE_KEY[] = "IncludeQtModule";
+const char ADD_QT_VERSION_CHECK_KEY[] = "AddQtVersionCheck";
+
+const bool retranslationSupportDefault = false;
+const CodeGenSettings::UiClassEmbedding embeddingDefault
+ = CodeGenSettings::PointerAggregatedUiClass;
+const bool includeQtModuleDefault = false;
+const bool addQtVersionCheckDefault = false;
+
CodeGenSettings::CodeGenSettings()
: embedding(embeddingDefault)
, retranslationSupport(retranslationSupportDefault)
, includeQtModule(includeQtModuleDefault)
, addQtVersionCheck(addQtVersionCheckDefault)
{
-
}
bool CodeGenSettings::equals(const CodeGenSettings &rhs) const
diff --git a/src/plugins/qtsupport/codegensettingspage.cpp b/src/plugins/qtsupport/codegensettingspage.cpp
index c7c26ad14a2..bf7622c06f6 100644
--- a/src/plugins/qtsupport/codegensettingspage.cpp
+++ b/src/plugins/qtsupport/codegensettingspage.cpp
@@ -27,6 +27,7 @@
#include "codegensettings.h"
#include "qtsupportconstants.h"
+#include "qtsupporttr.h"
#include
@@ -35,15 +36,12 @@
#include
#include
-#include
#include
namespace QtSupport::Internal {
class CodeGenSettingsPageWidget : public Core::IOptionsPageWidget
{
- Q_DECLARE_TR_FUNCTIONS(QtSupport::Internal::CodeGenSettingsPage)
-
public:
CodeGenSettingsPageWidget();
@@ -69,31 +67,31 @@ CodeGenSettingsPageWidget::CodeGenSettingsPageWidget()
using namespace Utils::Layouting;
- m_ptrAggregationRadioButton = new QRadioButton(tr("Aggregation as a pointer member"));
+ m_ptrAggregationRadioButton = new QRadioButton(Tr::tr("Aggregation as a pointer member"));
m_ptrAggregationRadioButton->setChecked
(parameters.embedding == CodeGenSettings::PointerAggregatedUiClass);
- m_aggregationButton = new QRadioButton(tr("Aggregation"));
+ m_aggregationButton = new QRadioButton(Tr::tr("Aggregation"));
m_aggregationButton->setChecked
(parameters.embedding == CodeGenSettings::AggregatedUiClass);
- m_multipleInheritanceButton = new QRadioButton(tr("Multiple inheritance"));
+ m_multipleInheritanceButton = new QRadioButton(Tr::tr("Multiple inheritance"));
m_multipleInheritanceButton->setChecked
(parameters.embedding == CodeGenSettings::InheritedUiClass);
- m_retranslateCheckBox = new QCheckBox(tr("Support for changing languages at runtime"));
+ m_retranslateCheckBox = new QCheckBox(Tr::tr("Support for changing languages at runtime"));
m_retranslateCheckBox->setChecked(parameters.retranslationSupport);
- m_includeQtModuleCheckBox = new QCheckBox(tr("Use Qt module name in #include-directive"));
+ m_includeQtModuleCheckBox = new QCheckBox(Tr::tr("Use Qt module name in #include-directive"));
m_includeQtModuleCheckBox->setChecked(parameters.includeQtModule);
- m_addQtVersionCheckBox = new QCheckBox(tr("Add Qt version #ifdef for module names"));
+ m_addQtVersionCheckBox = new QCheckBox(Tr::tr("Add Qt version #ifdef for module names"));
m_addQtVersionCheckBox->setChecked(parameters.addQtVersionCheck);
m_addQtVersionCheckBox->setEnabled(false);
Column {
Group {
- Title(tr("Embedding of the UI Class")),
+ Title(Tr::tr("Embedding of the UI Class")),
Column {
m_ptrAggregationRadioButton,
m_aggregationButton,
@@ -101,7 +99,7 @@ CodeGenSettingsPageWidget::CodeGenSettingsPageWidget()
}
},
Group {
- Title(tr("Code Generation")),
+ Title(Tr::tr("Code Generation")),
Column {
m_retranslateCheckBox,
m_includeQtModuleCheckBox,
@@ -139,7 +137,7 @@ int CodeGenSettingsPageWidget::uiEmbedding() const
CodeGenSettingsPage::CodeGenSettingsPage()
{
setId(Constants::CODEGEN_SETTINGS_PAGE_ID);
- setDisplayName(QCoreApplication::translate("QtSupport", "Qt Class Generation"));
+ setDisplayName(Tr::tr("Qt Class Generation"));
setCategory(CppEditor::Constants::CPP_SETTINGS_CATEGORY);
setDisplayCategory(
QCoreApplication::translate("CppEditor", CppEditor::Constants::CPP_SETTINGS_NAME));
diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp
index 404a565463e..cd87a872458 100644
--- a/src/plugins/qtsupport/exampleslistmodel.cpp
+++ b/src/plugins/qtsupport/exampleslistmodel.cpp
@@ -43,7 +43,6 @@
#include
#include
-#include
#include
#include
#include
diff --git a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp
index ffe3262b7ce..c924c03e6ff 100644
--- a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp
+++ b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp
@@ -26,6 +26,7 @@
#include "gettingstartedwelcomepage.h"
#include "exampleslistmodel.h"
+#include "qtsupporttr.h"
#include
#include
@@ -73,7 +74,7 @@ ExamplesWelcomePage::ExamplesWelcomePage(bool showExamples)
QString ExamplesWelcomePage::title() const
{
- return m_showExamples ? tr("Examples") : tr("Tutorials");
+ return m_showExamples ? Tr::tr("Examples") : Tr::tr("Tutorials");
}
int ExamplesWelcomePage::priority() const
@@ -92,22 +93,22 @@ QString ExamplesWelcomePage::copyToAlternativeLocation(const QFileInfo& proFileI
QDialog d(ICore::dialogParent());
auto lay = new QGridLayout(&d);
auto descrLbl = new QLabel;
- d.setWindowTitle(tr("Copy Project to writable Location?"));
+ d.setWindowTitle(Tr::tr("Copy Project to writable Location?"));
descrLbl->setTextFormat(Qt::RichText);
descrLbl->setWordWrap(false);
const QString nativeProjectDir = QDir::toNativeSeparators(projectDir);
descrLbl->setText(QString::fromLatin1("%1 ").arg(nativeProjectDir));
descrLbl->setMinimumWidth(descrLbl->sizeHint().width());
descrLbl->setWordWrap(true);
- descrLbl->setText(tr("The project you are about to open is located in the "
- "write-protected location: %1 "
- "Please select a writable location below and click \"Copy Project and Open\" "
- "to open a modifiable copy of the project or click \"Keep Project and Open\" "
- "to open the project in location. Note: You will not "
- "be able to alter or compile your project in the current location. ")
+ descrLbl->setText(Tr::tr("The project you are about to open is located in the "
+ "write-protected location: %1 "
+ "Please select a writable location below and click \"Copy Project and Open\" "
+ "to open a modifiable copy of the project or click \"Keep Project and Open\" "
+ "to open the project in location. Note: You will not "
+ "be able to alter or compile your project in the current location. ")
.arg(nativeProjectDir));
lay->addWidget(descrLbl, 0, 0, 1, 2);
- auto txt = new QLabel(tr("&Location:"));
+ auto txt = new QLabel(Tr::tr("&Location:"));
auto chooser = new PathChooser;
txt->setBuddy(chooser);
chooser->setExpectedKind(PathChooser::ExistingDirectory);
@@ -119,10 +120,10 @@ QString ExamplesWelcomePage::copyToAlternativeLocation(const QFileInfo& proFileI
lay->addWidget(chooser, 1, 1);
enum { Copy = QDialog::Accepted + 1, Keep = QDialog::Accepted + 2 };
auto bb = new QDialogButtonBox;
- QPushButton *copyBtn = bb->addButton(tr("&Copy Project and Open"), QDialogButtonBox::AcceptRole);
+ QPushButton *copyBtn = bb->addButton(Tr::tr("&Copy Project and Open"), QDialogButtonBox::AcceptRole);
connect(copyBtn, &QAbstractButton::released, &d, [&d] { d.done(Copy); });
copyBtn->setDefault(true);
- QPushButton *keepBtn = bb->addButton(tr("&Keep Project and Open"), QDialogButtonBox::RejectRole);
+ QPushButton *keepBtn = bb->addButton(Tr::tr("&Keep Project and Open"), QDialogButtonBox::RejectRole);
connect(keepBtn, &QAbstractButton::released, &d, [&d] { d.done(Keep); });
lay->addWidget(bb, 2, 0, 1, 2);
connect(chooser, &PathChooser::validChanged, copyBtn, &QWidget::setEnabled);
@@ -135,9 +136,9 @@ QString ExamplesWelcomePage::copyToAlternativeLocation(const QFileInfo& proFileI
if (toDirWithExamplesDir.cd(exampleDirName)) {
toDirWithExamplesDir.cdUp(); // step out, just to not be in the way
QMessageBox::warning(ICore::dialogParent(),
- tr("Cannot Use Location"),
- tr("The specified location already exists. "
- "Please specify a valid location."),
+ Tr::tr("Cannot Use Location"),
+ Tr::tr("The specified location already exists. "
+ "Please specify a valid location."),
QMessageBox::Ok,
QMessageBox::NoButton);
return QString();
@@ -157,7 +158,7 @@ QString ExamplesWelcomePage::copyToAlternativeLocation(const QFileInfo& proFileI
if (!FileUtils::copyRecursively(FilePath::fromString(dependency), targetFile,
&error)) {
QMessageBox::warning(ICore::dialogParent(),
- tr("Cannot Copy Project"),
+ Tr::tr("Cannot Copy Project"),
error);
// do not fail, just warn;
}
@@ -166,7 +167,7 @@ QString ExamplesWelcomePage::copyToAlternativeLocation(const QFileInfo& proFileI
return targetDir + QLatin1Char('/') + proFileInfo.fileName();
} else {
- QMessageBox::warning(ICore::dialogParent(), tr("Cannot Copy Project"), error);
+ QMessageBox::warning(ICore::dialogParent(), Tr::tr("Cannot Copy Project"), error);
}
}
@@ -295,7 +296,7 @@ public:
auto hbox = new QHBoxLayout(searchBar);
hbox->setContentsMargins(0, 0, 0, 0);
if (m_isExamples) {
- m_searcher->setPlaceholderText(ExamplesWelcomePage::tr("Search in Examples..."));
+ m_searcher->setPlaceholderText(Tr::tr("Search in Examples..."));
auto exampleSetSelector = new QComboBox(this);
QPalette pal = exampleSetSelector->palette();
@@ -315,7 +316,7 @@ public:
hbox->setSpacing(Core::WelcomePageHelpers::HSpacing);
hbox->addWidget(exampleSetSelector);
} else {
- m_searcher->setPlaceholderText(ExamplesWelcomePage::tr("Search in Tutorials..."));
+ m_searcher->setPlaceholderText(Tr::tr("Search in Tutorials..."));
}
hbox->addWidget(searchBox);
grid->addWidget(WelcomePageHelpers::panelBar(this), 0, 0);
diff --git a/src/plugins/qtsupport/qtbuildaspects.cpp b/src/plugins/qtsupport/qtbuildaspects.cpp
index d1cbfbf8300..67f610ea4d8 100644
--- a/src/plugins/qtsupport/qtbuildaspects.cpp
+++ b/src/plugins/qtsupport/qtbuildaspects.cpp
@@ -26,6 +26,7 @@
#include "qtbuildaspects.h"
#include "baseqtversion.h"
+#include "qtsupporttr.h"
#include
#include
@@ -47,7 +48,7 @@ QmlDebuggingAspect::QmlDebuggingAspect(BuildConfiguration *buildConfig)
: m_buildConfig(buildConfig)
{
setSettingsKey("EnableQmlDebugging");
- setDisplayName(tr("QML debugging and profiling:"));
+ setDisplayName(Tr::tr("QML debugging and profiling:"));
setValue(ProjectExplorerPlugin::buildPropertiesSettings().qmlDebugging.value());
}
@@ -66,8 +67,8 @@ void QmlDebuggingAspect::addToLayout(LayoutBuilder &builder)
if (!supported) {
setValue(TriState::Default);
} else if (value() == TriState::Enabled) {
- warningText = tr("Might make your application vulnerable. "
- "Only use in a safe environment.");
+ warningText = Tr::tr("Might make your application vulnerable. "
+ "Only use in a safe environment.");
}
warningLabel->setText(warningText);
setVisible(supported);
@@ -84,7 +85,7 @@ QtQuickCompilerAspect::QtQuickCompilerAspect(BuildConfiguration *buildConfig)
: m_buildConfig(buildConfig)
{
setSettingsKey("QtQuickCompiler");
- setDisplayName(tr("Qt Quick Compiler:"));
+ setDisplayName(Tr::tr("Qt Quick Compiler:"));
setValue(ProjectExplorerPlugin::buildPropertiesSettings().qtQuickCompiler.value());
}
@@ -106,7 +107,7 @@ void QtQuickCompilerAspect::addToLayout(LayoutBuilder &builder)
if (value() == TriState::Enabled) {
if (auto qmlDebuggingAspect = m_buildConfig->aspect()) {
if (qmlDebuggingAspect->value() == TriState::Enabled)
- warningText = tr("Disables QML debugging. QML profiling will still work.");
+ warningText = Tr::tr("Disables QML debugging. QML profiling will still work.");
}
}
warningLabel->setText(warningText);
diff --git a/src/plugins/qtsupport/qtkitinformation.cpp b/src/plugins/qtsupport/qtkitinformation.cpp
index 3df7a70f8f3..ece06b7f8c6 100644
--- a/src/plugins/qtsupport/qtkitinformation.cpp
+++ b/src/plugins/qtsupport/qtkitinformation.cpp
@@ -25,10 +25,11 @@
#include "qtkitinformation.h"
-#include "qtsupportconstants.h"
-#include "qtversionmanager.h"
#include "qtparser.h"
+#include "qtsupportconstants.h"
+#include "qtsupporttr.h"
#include "qttestparser.h"
+#include "qtversionmanager.h"
#include
#include
@@ -51,13 +52,12 @@ namespace Internal {
class QtKitAspectWidget final : public KitAspectWidget
{
- Q_DECLARE_TR_FUNCTIONS(QtSupport::QtKitAspectWidget)
public:
QtKitAspectWidget(Kit *k, const KitAspect *ki) : KitAspectWidget(k, ki)
{
m_combo = createSubWidget();
m_combo->setSizePolicy(QSizePolicy::Ignored, m_combo->sizePolicy().verticalPolicy());
- m_combo->addItem(tr("None"), -1);
+ m_combo->addItem(Tr::tr("None"), -1);
QList versionIds = Utils::transform(QtVersionManager::versions(), &QtVersion::uniqueId);
versionsChanged(versionIds, QList(), QList());
@@ -100,7 +100,7 @@ private:
QTC_ASSERT(v, return QString());
QString name = v->displayName();
if (!v->isValid())
- name = tr("%1 (invalid)").arg(v->displayName());
+ name = Tr::tr("%1 (invalid)").arg(v->displayName());
return name;
}
@@ -148,10 +148,10 @@ QtKitAspect::QtKitAspect()
{
setObjectName(QLatin1String("QtKitAspect"));
setId(QtKitAspect::id());
- setDisplayName(tr("Qt version"));
- setDescription(tr("The Qt library to use for all projects using this kit. "
- "A Qt version is required for qmake-based projects "
- "and optional when using other build systems."));
+ setDisplayName(Tr::tr("Qt version"));
+ setDescription(Tr::tr("The Qt library to use for all projects using this kit. "
+ "A Qt version is required for qmake-based projects "
+ "and optional when using other build systems."));
setPriority(26000);
connect(KitManager::instance(), &KitManager::kitsLoaded,
@@ -275,7 +275,7 @@ QString QtKitAspect::displayNamePostfix(const Kit *k) const
KitAspect::ItemList QtKitAspect::toUserOutput(const Kit *k) const
{
QtVersion *version = qtVersion(k);
- return {{tr("Qt version"), version ? version->displayName() : tr("None")}};
+ return {{Tr::tr("Qt version"), version ? version->displayName() : Tr::tr("None")}};
}
void QtKitAspect::addToBuildEnvironment(const Kit *k, Environment &env) const
@@ -313,12 +313,12 @@ void QtKitAspect::addToMacroExpander(Kit *kit, MacroExpander *expander) const
QTC_ASSERT(kit, return);
expander->registerSubProvider(QtMacroSubProvider(kit));
- expander->registerVariable("Qt:Name", tr("Name of Qt Version"),
+ expander->registerVariable("Qt:Name", Tr::tr("Name of Qt Version"),
[kit]() -> QString {
QtVersion *version = qtVersion(kit);
- return version ? version->displayName() : tr("unknown");
+ return version ? version->displayName() : Tr::tr("unknown");
});
- expander->registerVariable("Qt:qmakeExecutable", tr("Path to the qmake executable"),
+ expander->registerVariable("Qt:qmakeExecutable", Tr::tr("Path to the qmake executable"),
[kit]() -> QString {
QtVersion *version = qtVersion(kit);
return version ? version->qmakeFilePath().path() : QString();
diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp
index 09c053daedf..a5af4d83d79 100644
--- a/src/plugins/qtsupport/qtoptionspage.cpp
+++ b/src/plugins/qtsupport/qtoptionspage.cpp
@@ -27,6 +27,7 @@
#include "qtconfigwidget.h"
#include "qtsupportconstants.h"
+#include "qtsupporttr.h"
#include "qtversionmanager.h"
#include "qtversionfactory.h"
@@ -76,13 +77,10 @@ using namespace Utils;
const char kInstallSettingsKey[] = "Settings/InstallSettings";
-namespace QtSupport {
-namespace Internal {
+namespace QtSupport::Internal {
class QtVersionItem : public TreeItem
{
- Q_DECLARE_TR_FUNCTIONS(QtSupport::QtVersion)
-
public:
explicit QtVersionItem(QtVersion *version)
: m_version(version)
@@ -134,8 +132,8 @@ public:
const QString row = "%1:"
"%2";
return QString(""
- + row.arg(tr("Qt Version"), m_version->qtVersionString())
- + row.arg(tr("Location of qmake"), m_version->qmakeFilePath().toUserOutput())
+ + row.arg(Tr::tr("Qt Version"), m_version->qtVersionString())
+ + row.arg(Tr::tr("Location of qmake"), m_version->qmakeFilePath().toUserOutput())
+ " ");
}
@@ -179,8 +177,6 @@ private:
class QtOptionsPageWidget : public Core::IOptionsPageWidget
{
- Q_DECLARE_TR_FUNCTIONS(QtSupport::Internal::QtOptionsPageWidget)
-
public:
QtOptionsPageWidget();
~QtOptionsPageWidget();
@@ -253,7 +249,7 @@ private:
};
QtOptionsPageWidget::QtOptionsPageWidget()
- : m_specifyNameString(tr(""))
+ : m_specifyNameString(Tr::tr(""))
, m_infoBrowser(new QTextBrowser)
, m_invalidVersionIcon(Utils::Icons::CRITICAL.icon())
, m_warningVersionIcon(Utils::Icons::WARNING.icon())
@@ -270,10 +266,10 @@ QtOptionsPageWidget::QtOptionsPageWidget()
m_documentationSetting = new QComboBox(this);
- auto addButton = new QPushButton(tr("Add..."));
- m_delButton = new QPushButton(tr("Remove"));
- m_linkWithQtButton = new QPushButton(tr("Link with Qt..."));
- m_cleanUpButton = new QPushButton(tr("Clean Up"));
+ auto addButton = new QPushButton(Tr::tr("Add..."));
+ m_delButton = new QPushButton(Tr::tr("Remove"));
+ m_linkWithQtButton = new QPushButton(Tr::tr("Link with Qt..."));
+ m_cleanUpButton = new QPushButton(Tr::tr("Clean Up"));
m_nameEdit = new QLineEdit;
@@ -281,7 +277,7 @@ QtOptionsPageWidget::QtOptionsPageWidget()
m_qmakePath->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
m_qmakePath->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse);
- m_editPathPushButton = new QPushButton(tr("Edit"));
+ m_editPathPushButton = new QPushButton(Tr::tr("Edit"));
m_editPathPushButton->setText(PathChooser::browseButtonLabel());
m_errorLabel = new QLabel;
@@ -289,20 +285,23 @@ QtOptionsPageWidget::QtOptionsPageWidget()
using namespace Utils::Layouting;
auto versionInfoWidget = new QWidget;
+ // clang-format off
Form {
- tr("Name:"), m_nameEdit, br,
- tr("qmake path:"), Row { m_qmakePath, m_editPathPushButton }, br,
+ Tr::tr("Name:"), m_nameEdit, br,
+ Tr::tr("qmake path:"), Row { m_qmakePath, m_editPathPushButton }, br,
Span(2, m_errorLabel)
}.attachTo(versionInfoWidget, false);
+ // clang-format on
m_formLayout = qobject_cast(versionInfoWidget->layout());
+ // clang-format off
Row {
Column {
m_qtdirList,
m_versionInfoWidget,
m_infoWidget,
- Row { tr("Register documentation:"), m_documentationSetting, st }
+ Row { Tr::tr("Register documentation:"), m_documentationSetting, st }
},
Column {
@@ -314,6 +313,7 @@ QtOptionsPageWidget::QtOptionsPageWidget()
st,
}
}.attachTo(this);
+ // clang-format on
setupLinkWithQtButton();
@@ -333,7 +333,7 @@ QtOptionsPageWidget::QtOptionsPageWidget()
m_manualItem = new StaticTreeItem(ProjectExplorer::Constants::msgManual());
m_model = new TreeModel();
- m_model->setHeader({tr("Name"), tr("qmake Path")});
+ m_model->setHeader({Tr::tr("Name"), Tr::tr("qmake Path")});
m_model->rootItem()->appendChild(m_autoItem);
m_model->rootItem()->appendChild(m_manualItem);
@@ -353,10 +353,10 @@ QtOptionsPageWidget::QtOptionsPageWidget()
m_qtdirList->setTextElideMode(Qt::ElideMiddle);
m_qtdirList->sortByColumn(0, Qt::AscendingOrder);
- m_documentationSetting->addItem(tr("Highest Version Only"),
+ m_documentationSetting->addItem(Tr::tr("Highest Version Only"),
int(QtVersionManager::DocumentationSetting::HighestOnly));
- m_documentationSetting->addItem(tr("All"), int(QtVersionManager::DocumentationSetting::All));
- m_documentationSetting->addItem(tr("None"),
+ m_documentationSetting->addItem(Tr::tr("All"), int(QtVersionManager::DocumentationSetting::All));
+ m_documentationSetting->addItem(Tr::tr("None"),
int(QtVersionManager::DocumentationSetting::None));
const int selectedIndex = m_documentationSetting->findData(
int(QtVersionManager::documentationSetting()));
@@ -436,10 +436,10 @@ void QtOptionsPageWidget::cleanUpQtVersions()
return;
- if (QMessageBox::warning(nullptr, tr("Remove Invalid Qt Versions"),
- tr("Do you want to remove all invalid Qt Versions? "
- " "
- "will be removed.").arg(text),
+ if (QMessageBox::warning(nullptr, Tr::tr("Remove Invalid Qt Versions"),
+ Tr::tr("Do you want to remove all invalid Qt Versions? "
+ " "
+ "will be removed.").arg(text),
QMessageBox::Yes, QMessageBox::No) == QMessageBox::No)
return;
@@ -490,7 +490,7 @@ QtOptionsPageWidget::ValidityInfo QtOptionsPageWidget::validInformation(const Qt
if (!version)
return info;
- info.description = tr("Qt version %1 for %2").arg(version->qtVersionString(), version->description());
+ info.description = Tr::tr("Qt version %1 for %2").arg(version->qtVersionString(), version->description());
if (!version->isValid()) {
info.icon = m_invalidVersionIcon;
info.message = version->invalidReason();
@@ -515,20 +515,20 @@ QtOptionsPageWidget::ValidityInfo QtOptionsPageWidget::validInformation(const Qt
bool useable = true;
QStringList warnings;
if (!isNameUnique(version))
- warnings << tr("Display Name is not unique.");
+ warnings << Tr::tr("Display Name is not unique.");
if (!missingToolChains.isEmpty()) {
if (missingToolChains.count() == qtAbis.size()) {
// Yes, this Qt version can't be used at all!
info.message =
- tr("No compiler can produce code for this Qt version."
- " Please define one or more compilers for: %1").arg(formatAbiHtmlList(qtAbis));
+ Tr::tr("No compiler can produce code for this Qt version."
+ " Please define one or more compilers for: %1").arg(formatAbiHtmlList(qtAbis));
info.icon = m_invalidVersionIcon;
useable = false;
} else {
// Yes, some ABIs are unsupported
- warnings << tr("Not all possible target environments can be supported due to missing compilers.");
- info.toolTip = tr("The following ABIs are currently not supported: %1")
+ warnings << Tr::tr("Not all possible target environments can be supported due to missing compilers.");
+ info.toolTip = Tr::tr("The following ABIs are currently not supported: %1")
.arg(formatAbiHtmlList(missingToolChains));
info.icon = m_warningVersionIcon;
}
@@ -637,7 +637,7 @@ void QtOptionsPageWidget::addQtDir()
{
FilePath qtVersion
= FileUtils::getOpenFilePath(this,
- tr("Select a qmake Executable"),
+ Tr::tr("Select a qmake Executable"),
{},
BuildableHelperLibrary::filterForQmakeFileDialog(),
nullptr,
@@ -669,8 +669,8 @@ void QtOptionsPageWidget::addQtDir()
if (alreadyExists) {
// Already exist
- QMessageBox::warning(this, tr("Qt Version Already Known"),
- tr("This Qt version was already registered as \"%1\".")
+ QMessageBox::warning(this, Tr::tr("Qt Version Already Known"),
+ Tr::tr("This Qt version was already registered as \"%1\".")
.arg(otherName));
return;
}
@@ -686,8 +686,8 @@ void QtOptionsPageWidget::addQtDir()
m_nameEdit->setFocus();
m_nameEdit->selectAll();
} else {
- QMessageBox::warning(this, tr("Qmake Not Executable"),
- tr("The qmake executable %1 could not be added: %2").arg(qtVersion.toUserOutput()).arg(error));
+ QMessageBox::warning(this, Tr::tr("Qmake Not Executable"),
+ Tr::tr("The qmake executable %1 could not be added: %2").arg(qtVersion.toUserOutput()).arg(error));
return;
}
updateCleanUpButton();
@@ -709,7 +709,7 @@ void QtOptionsPageWidget::editPath()
QtVersion *current = currentVersion();
FilePath qtVersion =
FileUtils::getOpenFilePath(this,
- tr("Select a qmake Executable"),
+ Tr::tr("Select a qmake Executable"),
current->qmakeFilePath().absolutePath(),
BuildableHelperLibrary::filterForQmakeFileDialog(),
nullptr,
@@ -722,8 +722,8 @@ void QtOptionsPageWidget::editPath()
// Same type? then replace!
if (current->type() != version->type()) {
// not the same type, error out
- QMessageBox::critical(this, tr("Incompatible Qt Versions"),
- tr("The Qt version selected must match the device type."),
+ QMessageBox::critical(this, Tr::tr("Incompatible Qt Versions"),
+ Tr::tr("The Qt version selected must match the device type."),
QMessageBox::Ok);
delete version;
return;
@@ -853,7 +853,7 @@ static Utils::optional currentlyLinkedQtDir(bool *hasInstallSettings)
static QString linkingPurposeText()
{
- return QtOptionsPageWidget::tr(
+ return Tr::tr(
"Linking with a Qt installation automatically registers Qt versions and kits, and other "
"tools that were installed with that Qt installer, in this Qt Creator installation. Other "
"Qt Creator installations are not affected.");
@@ -869,7 +869,7 @@ static bool canLinkWithQt(QString *toolTip)
tip << linkingPurposeText();
if (!Core::ICore::resourcePath().isWritableDir()) {
canLink = false;
- tip << QtOptionsPageWidget::tr("%1's resource directory is not writable.")
+ tip << Tr::tr("%1's resource directory is not writable.")
.arg(Core::Constants::IDE_DISPLAY_NAME);
}
// guard against redirecting Qt Creator that is part of a Qt installations
@@ -877,12 +877,12 @@ static bool canLinkWithQt(QString *toolTip)
// TODO this will fail when make Qt Creator non-required in the Qt installers
if (installSettingsExist && !installSettingsValue) {
canLink = false;
- tip << QtOptionsPageWidget::tr("%1 is part of a Qt installation.")
+ tip << Tr::tr("%1 is part of a Qt installation.")
.arg(Core::Constants::IDE_DISPLAY_NAME);
}
const FilePath link = installSettingsValue ? *installSettingsValue : FilePath();
if (!link.isEmpty())
- tip << QtOptionsPageWidget::tr("%1 is currently linked to \"%2\".")
+ tip << Tr::tr("%1 is currently linked to \"%2\".")
.arg(QString(Core::Constants::IDE_DISPLAY_NAME), link.toUserOutput());
if (toolTip)
*toolTip = tip.join("\n\n");
@@ -970,7 +970,7 @@ static bool validateQtInstallDir(FancyLineEdit *input, QString *errorString)
if (!settingsDirForQtDir(qtDir)) {
if (errorString) {
const QStringList filesToCheck = settingsFilesToCheck() + qtversionFilesToCheck();
- *errorString = "" + QtOptionsPageWidget::tr(
+ *errorString = "" + Tr::tr(
"Qt installation information was not found in \"%1\". "
"Choose a directory that contains one of the files %2")
.arg(qtDir, "" + filesToCheck.join('\n') + "");
@@ -989,8 +989,8 @@ static FilePath defaultQtInstallationPath()
void QtOptionsPageWidget::linkWithQt()
{
- const QString title = tr("Choose Qt Installation");
- const QString restartText = tr("The change will take effect after restart.");
+ const QString title = Tr::tr("Choose Qt Installation");
+ const QString restartText = Tr::tr("The change will take effect after restart.");
bool askForRestart = false;
QDialog dialog(Core::ICore::dialogParent());
dialog.setWindowTitle(title);
@@ -1001,9 +1001,9 @@ void QtOptionsPageWidget::linkWithQt()
layout->addWidget(tipLabel);
auto pathLayout = new QHBoxLayout;
layout->addLayout(pathLayout);
- auto pathLabel = new QLabel(tr("Qt installation path:"));
+ auto pathLabel = new QLabel(Tr::tr("Qt installation path:"));
pathLabel->setToolTip(
- tr("Choose the Qt installation directory, or a directory that contains \"%1\".")
+ Tr::tr("Choose the Qt installation directory, or a directory that contains \"%1\".")
.arg(settingsFile("")));
pathLayout->addWidget(pathLabel);
auto pathInput = new PathChooser;
@@ -1023,11 +1023,11 @@ void QtOptionsPageWidget::linkWithQt()
auto buttons = new QDialogButtonBox;
layout->addStretch(10);
layout->addWidget(buttons);
- auto linkButton = buttons->addButton(tr("Link with Qt"), QDialogButtonBox::AcceptRole);
+ auto linkButton = buttons->addButton(Tr::tr("Link with Qt"), QDialogButtonBox::AcceptRole);
connect(linkButton, &QPushButton::clicked, &dialog, &QDialog::accept);
- auto cancelButton = buttons->addButton(tr("Cancel"), QDialogButtonBox::RejectRole);
+ auto cancelButton = buttons->addButton(Tr::tr("Cancel"), QDialogButtonBox::RejectRole);
connect(cancelButton, &QPushButton::clicked, &dialog, &QDialog::reject);
- auto unlinkButton = buttons->addButton(tr("Remove Link"), QDialogButtonBox::DestructiveRole);
+ auto unlinkButton = buttons->addButton(Tr::tr("Remove Link"), QDialogButtonBox::DestructiveRole);
unlinkButton->setEnabled(currentLink.has_value());
connect(unlinkButton, &QPushButton::clicked, &dialog, [&dialog, &askForRestart] {
bool removeSettingsFile = false;
@@ -1066,7 +1066,7 @@ void QtOptionsPageWidget::linkWithQt()
QtOptionsPage::QtOptionsPage()
{
setId(Constants::QTVERSION_SETTINGS_PAGE_ID);
- setDisplayName(QCoreApplication::translate("QtSupport", "Qt Versions"));
+ setDisplayName(Tr::tr("Qt Versions"));
setCategory(ProjectExplorer::Constants::KITS_SETTINGS_CATEGORY);
setWidgetCreator([] { return new QtOptionsPageWidget; });
}
@@ -1086,5 +1086,4 @@ void QtOptionsPage::linkWithQt()
QtOptionsPageWidget::linkWithQt();
}
-} // namespace Internal
-} // namespace QtSupport
+} // QtSupport::Internal
diff --git a/src/plugins/qtsupport/qtoptionspage.h b/src/plugins/qtsupport/qtoptionspage.h
index 6f5599f51a1..c4b44dbfa4c 100644
--- a/src/plugins/qtsupport/qtoptionspage.h
+++ b/src/plugins/qtsupport/qtoptionspage.h
@@ -27,8 +27,7 @@
#include
-namespace QtSupport {
-namespace Internal {
+namespace QtSupport::Internal {
class QtOptionsPage final : public Core::IOptionsPage
{
@@ -40,5 +39,4 @@ public:
static void linkWithQt();
};
-} // Internal
-} // QtSupport
+} // QtSupport::Internal
diff --git a/src/plugins/qtsupport/qtsupportplugin.cpp b/src/plugins/qtsupport/qtsupportplugin.cpp
index 442175a30f7..c1b53f9a240 100644
--- a/src/plugins/qtsupport/qtsupportplugin.cpp
+++ b/src/plugins/qtsupport/qtsupportplugin.cpp
@@ -33,7 +33,7 @@
#include "qtkitinformation.h"
#include "qtoptionspage.h"
#include "qtoutputformatter.h"
-#include "qtsupportconstants.h"
+#include "qtsupporttr.h"
#include "qtversionmanager.h"
#include "qtversions.h"
#include "translationwizardpage.h"
@@ -117,11 +117,11 @@ static void askAboutQtInstallation()
Utils::InfoBarEntry info(
kLinkWithQtInstallationSetting,
- QtSupportPlugin::tr(
+ Tr::tr(
"Link with a Qt installation to automatically register Qt versions and kits? To do "
"this later, select Edit > Preferences > Kits > Qt Versions > Link with Qt."),
Utils::InfoBarEntry::GlobalSuppression::Enabled);
- info.addCustomButton(QtSupportPlugin::tr("Link with Qt"), [] {
+ info.addCustomButton(Tr::tr("Link with Qt"), [] {
ICore::infoBar()->removeInfo(kLinkWithQtInstallationSetting);
QTimer::singleShot(0, ICore::dialogParent(), &QtOptionsPage::linkWithQt);
});
@@ -141,8 +141,8 @@ void QtSupportPlugin::extensionsInitialized()
static const char kCurrentHostBins[] = "CurrentDocument:Project:QT_HOST_BINS";
expander->registerVariable(
kCurrentHostBins,
- tr("Full path to the host bin directory of the Qt version in the active kit "
- "of the project containing the current document."),
+ Tr::tr("Full path to the host bin directory of the Qt version in the active kit "
+ "of the project containing the current document."),
[]() {
const QtVersion * const qt = currentQtVersion();
return qt ? qt->hostBinPath().toUserOutput() : QString();
@@ -150,8 +150,8 @@ void QtSupportPlugin::extensionsInitialized()
expander->registerVariable(
"CurrentDocument:Project:QT_INSTALL_BINS",
- tr("Full path to the target bin directory of the Qt version in the active kit "
- "of the project containing the current document. You probably want %1 instead.")
+ Tr::tr("Full path to the target bin directory of the Qt version in the active kit "
+ "of the project containing the current document. You probably want %1 instead.")
.arg(QString::fromLatin1(kCurrentHostBins)),
[]() {
const QtVersion * const qt = currentQtVersion();
@@ -160,8 +160,8 @@ void QtSupportPlugin::extensionsInitialized()
expander->registerVariable(
"CurrentDocument:Project:QT_HOST_LIBEXECS",
- tr("Full path to the host libexec directory of the Qt version in the active kit "
- "of the project containing the current document."),
+ Tr::tr("Full path to the host libexec directory of the Qt version in the active kit "
+ "of the project containing the current document."),
[]() {
const QtVersion *const qt = currentQtVersion();
return qt ? qt->hostLibexecPath().toUserOutput() : QString();
@@ -176,8 +176,8 @@ void QtSupportPlugin::extensionsInitialized()
static const char kActiveHostBins[] = "ActiveProject:QT_HOST_BINS";
expander->registerVariable(
kActiveHostBins,
- tr("Full path to the host bin directory of the Qt version in the active kit "
- "of the active project."),
+ Tr::tr("Full path to the host bin directory of the Qt version in the active kit "
+ "of the active project."),
[]() {
const QtVersion * const qt = activeQtVersion();
return qt ? qt->hostBinPath().toUserOutput() : QString();
@@ -185,8 +185,8 @@ void QtSupportPlugin::extensionsInitialized()
expander->registerVariable(
"ActiveProject:QT_INSTALL_BINS",
- tr("Full path to the target bin directory of the Qt version in the active kit "
- "of the active project. You probably want %1 instead.")
+ Tr::tr("Full path to the target bin directory of the Qt version in the active kit "
+ "of the active project. You probably want %1 instead.")
.arg(QString::fromLatin1(kActiveHostBins)),
[]() {
const QtVersion * const qt = activeQtVersion();
@@ -195,8 +195,8 @@ void QtSupportPlugin::extensionsInitialized()
expander->registerVariable(
"ActiveProject::QT_HOST_LIBEXECS",
- tr("Full path to the libexec bin directory of the Qt version in the active kit "
- "of the active project."),
+ Tr::tr("Full path to the libexec bin directory of the Qt version in the active kit "
+ "of the active project."),
[]() {
const QtVersion *const qt = activeQtVersion();
return qt ? qt->hostLibexecPath().toUserOutput() : QString();
diff --git a/src/plugins/qtsupport/qtversions.cpp b/src/plugins/qtsupport/qtversions.cpp
index 12a73e73355..c5b0bb456ec 100644
--- a/src/plugins/qtsupport/qtversions.cpp
+++ b/src/plugins/qtsupport/qtversions.cpp
@@ -27,6 +27,7 @@
#include "baseqtversion.h"
#include "qtsupportconstants.h"
+#include "qtsupporttr.h"
#include
#include
@@ -39,11 +40,7 @@
#include
#include
-#include
-#include
-
-namespace QtSupport {
-namespace Internal {
+namespace QtSupport::Internal {
class DesktopQtVersion : public QtVersion
{
@@ -63,14 +60,14 @@ QStringList DesktopQtVersion::warningReason() const
QStringList ret = QtVersion::warningReason();
if (qtVersion() >= QtVersionNumber(5, 0, 0)) {
if (qmlRuntimeFilePath().isEmpty())
- ret << QCoreApplication::translate("QtVersion", "No QML utility installed.");
+ ret << Tr::tr("No QML utility installed.");
}
return ret;
}
QString DesktopQtVersion::description() const
{
- return QCoreApplication::translate("QtVersion", "Desktop", "Qt Version is meant for the desktop");
+ return Tr::tr("Desktop", "Qt Version is meant for the desktop");
}
QSet DesktopQtVersion::availableFeatures() const
@@ -111,8 +108,7 @@ public:
QString description() const override
{
- return QCoreApplication::translate("QtVersion", "Embedded Linux",
- "Qt Version is used for embedded Linux development");
+ return Tr::tr("Embedded Linux", "Qt Version is used for embedded Linux development");
}
QSet targetDeviceTypes() const override
@@ -130,5 +126,4 @@ EmbeddedLinuxQtVersionFactory::EmbeddedLinuxQtVersionFactory()
setRestrictionChecker([](const SetupData &) { return false; });
}
-} // Internal
-} // QtSupport
+} // QtSupport::Internal
diff --git a/src/plugins/qtsupport/qtversions.h b/src/plugins/qtsupport/qtversions.h
index eb939816d48..621710b1129 100644
--- a/src/plugins/qtsupport/qtversions.h
+++ b/src/plugins/qtsupport/qtversions.h
@@ -27,8 +27,7 @@
#include "qtversionfactory.h"
-namespace QtSupport {
-namespace Internal {
+namespace QtSupport::Internal {
class DesktopQtVersionFactory : public QtVersionFactory
{
@@ -42,5 +41,4 @@ public:
EmbeddedLinuxQtVersionFactory();
};
-} // Internal
-} // QtSupport
+} // QtSupport::Internal
diff --git a/src/plugins/qtsupport/translationwizardpage.cpp b/src/plugins/qtsupport/translationwizardpage.cpp
index 36386bc4b25..fa7ea814bd1 100644
--- a/src/plugins/qtsupport/translationwizardpage.cpp
+++ b/src/plugins/qtsupport/translationwizardpage.cpp
@@ -25,9 +25,12 @@
#include "translationwizardpage.h"
+#include "qtsupporttr.h"
+
#include
+
#include
-#include
+#include
#include
#include
@@ -88,14 +91,14 @@ TranslationWizardPage::TranslationWizardPage(const QString &enabledExpr)
{
const auto mainLayout = new QVBoxLayout(this);
const auto descriptionLabel = new QLabel(
- tr("If you plan to provide translations for your project's "
- "user interface via the Qt Linguist tool, please select a language here. "
- "A corresponding translation (.ts) file will be generated for you."));
+ Tr::tr("If you plan to provide translations for your project's "
+ "user interface via the Qt Linguist tool, please select a language here. "
+ "A corresponding translation (.ts) file will be generated for you."));
descriptionLabel->setWordWrap(true);
mainLayout->addWidget(descriptionLabel);
const auto formLayout = new QFormLayout;
mainLayout->addLayout(formLayout);
- m_languageComboBox.addItem(tr(""));
+ m_languageComboBox.addItem(Tr::tr(""));
QList allLocales = QLocale::matchingLocales(
QLocale::AnyLanguage, QLocale::AnyScript, QLocale::AnyCountry);
allLocales.removeOne(QLocale::C);
@@ -113,12 +116,12 @@ TranslationWizardPage::TranslationWizardPage(const QString &enabledExpr)
localeStrings.end());
for (const LocalePair &lp : qAsConst(localeStrings))
m_languageComboBox.addItem(lp.first, lp.second);
- formLayout->addRow(tr("Language:"), &m_languageComboBox);
+ formLayout->addRow(Tr::tr("Language:"), &m_languageComboBox);
const auto fileNameLayout = new QHBoxLayout;
m_fileNameLineEdit.setReadOnly(true);
fileNameLayout->addWidget(&m_fileNameLineEdit);
fileNameLayout->addStretch(1);
- formLayout->addRow(tr("Translation file:"), fileNameLayout);
+ formLayout->addRow(Tr::tr("Translation file:"), fileNameLayout);
connect(&m_languageComboBox, &QComboBox::currentIndexChanged,
this, &TranslationWizardPage::updateLineEdit);
}
@@ -154,7 +157,7 @@ void TranslationWizardPage::updateLineEdit()
m_fileNameLineEdit.setText(projectName + '_' + m_languageComboBox.currentData().toString());
} else {
m_fileNameLineEdit.clear();
- m_fileNameLineEdit.setPlaceholderText(tr(""));
+ m_fileNameLineEdit.setPlaceholderText(Tr::tr(""));
}
emit completeChanged();
}
| | | | | |