QColorDialogOptionsPrivate: clean up inheritance and RO5

It's unclear why the class inherits from QSharedData, since it's
never used as a refcounted entity. Instead, for some reason,
QColorDialogOptions+QColorDialogOptionsPrivate are combined into
one struct (ColorDialogCombined). Therefore, drop the inheritance
from QSharedData. Other platform dialog classes have the same issue,
will tackle them in a follow-up commit.

QColorDialogOptionsPrivate also declares a destructor. Since apparently
copies are needed, redeclare them, but suppress assignments (uncertain
use case). This fixes Clang's -Wdeprecated-copy-with-user-provided-dtor.

Change-Id: I335ef0e8ef541762fd03bf76b3e4fd4dd0828505
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Giuseppe D'Angelo 2025-01-13 14:31:09 +01:00
parent 4275dfb7bf
commit fe95781897

View File

@ -287,12 +287,16 @@ void QColorDialogStaticData::writeSettings() const
Q_GLOBAL_STATIC(QColorDialogStaticData, qColorDialogStaticData)
class QColorDialogOptionsPrivate : public QSharedData
class QColorDialogOptionsPrivate
{
public:
QColorDialogOptionsPrivate() = default;
// Write out settings around destruction of dialogs
~QColorDialogOptionsPrivate() { qColorDialogStaticData()->writeSettings(); }
QColorDialogOptionsPrivate(const QColorDialogOptionsPrivate &) = default;
QColorDialogOptionsPrivate(QColorDialogOptionsPrivate &&) = default;
QColorDialogOptionsPrivate &operator=(const QColorDialogOptionsPrivate &) = delete;
QColorDialogOptionsPrivate &operator=(QColorDialogOptionsPrivate &&) = delete;
QColorDialogOptions::ColorDialogOptions options;
QString windowTitle;