summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2024-04-05 15:15:13 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2024-04-09 16:41:27 +0200
commit21ef6d930ad3eb2fb435cd601692cb5cc1726bd8 (patch)
tree770180be398262d3c24c316fba5de83e556bcfee
parentb2c648c57261550474308aee09bfc1054818fb60 (diff)
QSystemLocale(): disable copy and move
Axivion (SV546) points out (based on a clazy "rule of three" that might be rule of five by now) the lack of move and copy assignment and construction. We don't want those anyway, so tell the compiler not to create them. Pick-to: 6.7 6.5 Task-number: QTBUG-122619 Change-Id: Ie951a2c3d60d76ad3448310d3f9bbda22190015b Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/corelib/text/qlocale_p.h1
-rw-r--r--src/plugins/platforms/android/qandroidsystemlocale.h1
-rw-r--r--tests/auto/corelib/text/qlocale/tst_qlocale.cpp1
3 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/text/qlocale_p.h b/src/corelib/text/qlocale_p.h
index fb312c5dfb..905b45e5e9 100644
--- a/src/corelib/text/qlocale_p.h
+++ b/src/corelib/text/qlocale_p.h
@@ -105,6 +105,7 @@ struct QLocaleData;
// Subclassed by Android platform plugin:
class Q_CORE_EXPORT QSystemLocale
{
+ Q_DISABLE_COPY_MOVE(QSystemLocale)
QSystemLocale *next = nullptr; // Maintains a stack.
public:
diff --git a/src/plugins/platforms/android/qandroidsystemlocale.h b/src/plugins/platforms/android/qandroidsystemlocale.h
index 48e1d94a56..b4a4070bd5 100644
--- a/src/plugins/platforms/android/qandroidsystemlocale.h
+++ b/src/plugins/platforms/android/qandroidsystemlocale.h
@@ -11,6 +11,7 @@ QT_BEGIN_NAMESPACE
class QAndroidSystemLocale : public QSystemLocale
{
+ Q_DISABLE_COPY_MOVE(QAndroidSystemLocale)
public:
QAndroidSystemLocale();
diff --git a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp
index 8cc7f9af6e..de07684f84 100644
--- a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp
+++ b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp
@@ -4012,6 +4012,7 @@ void tst_QLocale::bcp47Name()
# ifdef QT_BUILD_INTERNAL
class MySystemLocale : public QSystemLocale
{
+ Q_DISABLE_COPY_MOVE(MySystemLocale)
public:
MySystemLocale(const QString &locale)
: m_name(locale), m_id(QLocaleId::fromName(locale)), m_locale(locale)