From 1a60dc756f35b3b19a444c976dcb547f51c30d76 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 27 Nov 2017 17:22:09 +0100 Subject: SimpleTextViewer example: Remove QObject::tr antipattern Change-Id: I8e7d1dcf9cd2a5a1ccc563032324528fe3262611 Reviewed-by: Jarek Kobus --- examples/assistant/simpletextviewer/assistant.cpp | 5 +++-- examples/assistant/simpletextviewer/assistant.h | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'examples/assistant') diff --git a/examples/assistant/simpletextviewer/assistant.cpp b/examples/assistant/simpletextviewer/assistant.cpp index 9e668bb7f..58103c14a 100644 --- a/examples/assistant/simpletextviewer/assistant.cpp +++ b/examples/assistant/simpletextviewer/assistant.cpp @@ -108,8 +108,9 @@ bool Assistant::startAssistant() proc->start(app, args); if (!proc->waitForStarted()) { - QMessageBox::critical(nullptr, QObject::tr("Simple Text Viewer"), - QObject::tr("Unable to launch Qt Assistant (%1)").arg(app)); + QMessageBox::critical(nullptr, + tr("Simple Text Viewer"), + tr("Unable to launch Qt Assistant (%1)").arg(app)); return false; } } diff --git a/examples/assistant/simpletextviewer/assistant.h b/examples/assistant/simpletextviewer/assistant.h index dada5a1ee..1ea7dd78f 100644 --- a/examples/assistant/simpletextviewer/assistant.h +++ b/examples/assistant/simpletextviewer/assistant.h @@ -51,6 +51,7 @@ #ifndef ASSISTANT_H #define ASSISTANT_H +#include #include QT_BEGIN_NAMESPACE @@ -59,6 +60,8 @@ QT_END_NAMESPACE class Assistant { + Q_DECLARE_TR_FUNCTIONS(Assistant) + public: Assistant(); ~Assistant(); -- cgit v1.2.3