From f92a7c128835ec9ce144d6f717af267491f14a60 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Mon, 16 Sep 2019 15:10:20 +0200 Subject: I18N: Load qtbase_ translation catalogs in examples ...instead of the qt_ meta catalogs. The qt_ catalogs are needed for backwards compatibility and depend on translations for now deprecated modules, such as qtscript, that might not be installed in the system. This causes loading the translation to fail. Instead of the qt_ catalogs, the examples should use the translation files for the Qt modules used, here qtbase_. Task-number: QTBUG-69203 Change-Id: I13f5a3d6653cef8379a712fbc02ec320eea4e51a Reviewed-by: Kai Koehne Reviewed-by: Edward Welbourne --- examples/widgets/dialogs/classwizard/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/widgets/dialogs/classwizard') diff --git a/examples/widgets/dialogs/classwizard/main.cpp b/examples/widgets/dialogs/classwizard/main.cpp index 03ffe97a23..221e81aae4 100644 --- a/examples/widgets/dialogs/classwizard/main.cpp +++ b/examples/widgets/dialogs/classwizard/main.cpp @@ -64,7 +64,7 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); #ifndef QT_NO_TRANSLATION - QString translatorFileName = QLatin1String("qt_"); + QString translatorFileName = QLatin1String("qtbase_"); translatorFileName += QLocale::system().name(); QTranslator *translator = new QTranslator(&app); if (translator->load(translatorFileName, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) -- cgit v1.2.3 From 4af00753fad57989a6ae366cc3dbfc56d88508f4 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Fri, 6 Sep 2019 23:24:56 +0200 Subject: Cleanup QtWidgets examples Cleanup QtWidgets examples: - use nullptr (clang-tidy) - use member-initialization - adjust the style - fix includes Change-Id: Ic5448606aacc525ea60b615a69227017aa2b821a Reviewed-by: Paul Wicking --- examples/widgets/dialogs/classwizard/classwizard.cpp | 4 ++-- examples/widgets/dialogs/classwizard/classwizard.h | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'examples/widgets/dialogs/classwizard') diff --git a/examples/widgets/dialogs/classwizard/classwizard.cpp b/examples/widgets/dialogs/classwizard/classwizard.cpp index 81adf85b0d..8421289eab 100644 --- a/examples/widgets/dialogs/classwizard/classwizard.cpp +++ b/examples/widgets/dialogs/classwizard/classwizard.cpp @@ -118,9 +118,9 @@ void ClassWizard::accept() block += "public:\n"; if (field("qobjectCtor").toBool()) { - block += " " + className + "(QObject *parent = 0);\n"; + block += " " + className + "(QObject *parent = nullptr);\n"; } else if (field("qwidgetCtor").toBool()) { - block += " " + className + "(QWidget *parent = 0);\n"; + block += " " + className + "(QWidget *parent = nullptr);\n"; } else if (field("defaultCtor").toBool()) { block += " " + className + "();\n"; if (field("copyCtor").toBool()) { diff --git a/examples/widgets/dialogs/classwizard/classwizard.h b/examples/widgets/dialogs/classwizard/classwizard.h index fee0f6df66..0c386f0553 100644 --- a/examples/widgets/dialogs/classwizard/classwizard.h +++ b/examples/widgets/dialogs/classwizard/classwizard.h @@ -67,7 +67,7 @@ class ClassWizard : public QWizard Q_OBJECT public: - ClassWizard(QWidget *parent = 0); + ClassWizard(QWidget *parent = nullptr); void accept() override; }; @@ -79,7 +79,7 @@ class IntroPage : public QWizardPage Q_OBJECT public: - IntroPage(QWidget *parent = 0); + IntroPage(QWidget *parent = nullptr); private: QLabel *label; @@ -92,7 +92,7 @@ class ClassInfoPage : public QWizardPage Q_OBJECT public: - ClassInfoPage(QWidget *parent = 0); + ClassInfoPage(QWidget *parent = nullptr); private: QLabel *classNameLabel; @@ -114,7 +114,7 @@ class CodeStylePage : public QWizardPage Q_OBJECT public: - CodeStylePage(QWidget *parent = 0); + CodeStylePage(QWidget *parent = nullptr); protected: void initializePage() override; @@ -135,7 +135,7 @@ class OutputFilesPage : public QWizardPage Q_OBJECT public: - OutputFilesPage(QWidget *parent = 0); + OutputFilesPage(QWidget *parent = nullptr); protected: void initializePage() override; @@ -154,7 +154,7 @@ class ConclusionPage : public QWizardPage Q_OBJECT public: - ConclusionPage(QWidget *parent = 0); + ConclusionPage(QWidget *parent = nullptr); protected: void initializePage() override; -- cgit v1.2.3