From 70df82a919a584a8e691d9aef633fe7a2e3e0d30 Mon Sep 17 00:00:00 2001 From: Ahmed Kerimov Date: Thu, 19 Oct 2023 02:17:58 +0300 Subject: [PATCH] Prefer using override instead of virtual in qdbusxml2cpp In C++ 11 override keyword was introduced to allow overridden functions to be marked appropriately. Its presence allows compilers to verify that an overridden function correctly overrides a base class implementation. This can be useful as compilers can generate a compile time error when: - The base class implementation function signature changes. - The user has not created the override with the correct signature. This commit improves the D-Bus interface code generation. Change-Id: I0353575c3f70277d04e41b8fa0096c1b2b28058a Reviewed-by: Thiago Macieira --- src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp b/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp index b2e59eef31e..54fd7b2c7c6 100644 --- a/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp +++ b/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp @@ -950,7 +950,7 @@ void QDBusXmlToCpp::writeAdaptor(const QString &filename, << " \"\")\n" "public:\n" " " << className << "(" << parent << " *parent);\n" - " virtual ~" << className << "();\n\n"; + " ~" << className << "() override;\n\n"; if (!parentClassName.isEmpty()) hs << " inline " << parent << " *parent() const\n"