diff --git a/autotests/kconfig_compiler/test10.cpp.ref b/autotests/kconfig_compiler/test10.cpp.ref --- a/autotests/kconfig_compiler/test10.cpp.ref +++ b/autotests/kconfig_compiler/test10.cpp.ref @@ -11,6 +11,8 @@ public: Test10Helper() : q(nullptr) {} ~Test10Helper() { delete q; } + Test10Helper(const Test10Helper&) = delete; + Test10Helper& operator=(const Test10Helper&) = delete; Test10 *q; }; Q_GLOBAL_STATIC(Test10Helper, s_globalTest10) diff --git a/autotests/kconfig_compiler/test4.cpp.ref b/autotests/kconfig_compiler/test4.cpp.ref --- a/autotests/kconfig_compiler/test4.cpp.ref +++ b/autotests/kconfig_compiler/test4.cpp.ref @@ -11,6 +11,8 @@ public: Test4Helper() : q(nullptr) {} ~Test4Helper() { delete q; } + Test4Helper(const Test4Helper&) = delete; + Test4Helper& operator=(const Test4Helper&) = delete; Test4 *q; }; Q_GLOBAL_STATIC(Test4Helper, s_globalTest4) diff --git a/autotests/kconfig_compiler/test5.cpp.ref b/autotests/kconfig_compiler/test5.cpp.ref --- a/autotests/kconfig_compiler/test5.cpp.ref +++ b/autotests/kconfig_compiler/test5.cpp.ref @@ -11,6 +11,8 @@ public: Test5Helper() : q(nullptr) {} ~Test5Helper() { delete q; } + Test5Helper(const Test5Helper&) = delete; + Test5Helper& operator=(const Test5Helper&) = delete; Test5 *q; }; Q_GLOBAL_STATIC(Test5Helper, s_globalTest5) diff --git a/autotests/kconfig_compiler/test8b.cpp.ref b/autotests/kconfig_compiler/test8b.cpp.ref --- a/autotests/kconfig_compiler/test8b.cpp.ref +++ b/autotests/kconfig_compiler/test8b.cpp.ref @@ -11,6 +11,8 @@ public: Test8bHelper() : q(nullptr) {} ~Test8bHelper() { delete q; } + Test8bHelper(const Test8bHelper&) = delete; + Test8bHelper& operator=(const Test8bHelper&) = delete; Test8b *q; }; Q_GLOBAL_STATIC(Test8bHelper, s_globalTest8b) diff --git a/autotests/kconfig_compiler/test8c.cpp.ref b/autotests/kconfig_compiler/test8c.cpp.ref --- a/autotests/kconfig_compiler/test8c.cpp.ref +++ b/autotests/kconfig_compiler/test8c.cpp.ref @@ -13,6 +13,8 @@ public: Test8cHelper() : q(nullptr) {} ~Test8cHelper() { delete q; } + Test8cHelper(const Test8cHelper&) = delete; + Test8cHelper& operator=(const Test8cHelper&) = delete; Test8c *q; }; Q_GLOBAL_STATIC(Test8cHelper, s_globalTest8c) diff --git a/autotests/kconfig_compiler/test_dpointer.cpp.ref b/autotests/kconfig_compiler/test_dpointer.cpp.ref --- a/autotests/kconfig_compiler/test_dpointer.cpp.ref +++ b/autotests/kconfig_compiler/test_dpointer.cpp.ref @@ -50,6 +50,8 @@ public: TestDPointerHelper() : q(nullptr) {} ~TestDPointerHelper() { delete q; } + TestDPointerHelper(const TestDPointerHelper&) = delete; + TestDPointerHelper& operator=(const TestDPointerHelper&) = delete; TestDPointer *q; }; Q_GLOBAL_STATIC(TestDPointerHelper, s_globalTestDPointer) diff --git a/autotests/kconfig_compiler/test_signal.cpp.ref b/autotests/kconfig_compiler/test_signal.cpp.ref --- a/autotests/kconfig_compiler/test_signal.cpp.ref +++ b/autotests/kconfig_compiler/test_signal.cpp.ref @@ -11,6 +11,8 @@ public: TestSignalHelper() : q(nullptr) {} ~TestSignalHelper() { delete q; } + TestSignalHelper(const TestSignalHelper&) = delete; + TestSignalHelper& operator=(const TestSignalHelper&) = delete; TestSignal *q; }; Q_GLOBAL_STATIC(TestSignalHelper, s_globalTestSignal) diff --git a/src/kconfig_compiler/kconfig_compiler.cpp b/src/kconfig_compiler/kconfig_compiler.cpp --- a/src/kconfig_compiler/kconfig_compiler.cpp +++ b/src/kconfig_compiler/kconfig_compiler.cpp @@ -2300,6 +2300,8 @@ cpp << " public:" << endl; cpp << " " << cfg.className << "Helper() : q(nullptr) {}" << endl; cpp << " ~" << cfg.className << "Helper() { delete q; }" << endl; + cpp << " " << cfg.className << "Helper(const " << cfg.className << "Helper&) = delete;" << endl; + cpp << " " << cfg.className << "Helper& operator=(const " << cfg.className << "Helper&) = delete;" << endl; cpp << " " << cfg.className << " *q;" << endl; cpp << "};" << endl; endNamespaces(cfg.nameSpace, cpp);