summaryrefslogtreecommitdiff
path: root/src/designer/src
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2023-01-24 16:18:53 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2023-01-30 08:53:32 +0100
commit2f0522b7eff5c10c37e06dcef9d3e5dacaf97d23 (patch)
tree5578de93454891751382afa79cc1c31cf5684bd4 /src/designer/src
parent6a2639b51574dfa9837defeea6371a37620f4e0e (diff)
downloadqttools-2f0522b7eff5c10c37e06dcef9d3e5dacaf97d23.tar.gz
Qt Designer: Fix CMake Unity (Jumbo) build warnings about members from anonymous namespaces
Concatenating source files with several anonymous namespaces triggers warnings: src/designer/src/lib/shared/previewmanager.cpp:525:7: warning: qdesigner_internal::PreviewManagerPrivate has a field qdesigner_internal::PreviewManagerPrivate::m_previews whose type uses the anonymous namespace [-Wsubobject-linkage] 525 | class PreviewManagerPrivate { | ^~~~~~~~~~~~~~~~~~~~~ src/designer/src/lib/shared/qtresourceeditordialog.cpp:767:7: warning: QtResourceEditorDialogPrivate has a field QtResourceEditorDialogPrivate::m_qrcManager whose type uses the anonymous namespace [-Wsubobject-linkage] 767 | class QtResourceEditorDialogPrivate Move the classes to namespace qdesigner_internal. Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: Ie7e15039bd8824fb94c1dddb1f47f75609bdf833 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Diffstat (limited to 'src/designer/src')
-rw-r--r--src/designer/src/lib/shared/previewmanager.cpp5
-rw-r--r--src/designer/src/lib/shared/qtresourceeditordialog.cpp27
2 files changed, 21 insertions, 11 deletions
diff --git a/src/designer/src/lib/shared/previewmanager.cpp b/src/designer/src/lib/shared/previewmanager.cpp
index c8f5a4484..e4ab1526d 100644
--- a/src/designer/src/lib/shared/previewmanager.cpp
+++ b/src/designer/src/lib/shared/previewmanager.cpp
@@ -48,7 +48,7 @@ static inline int compare(const qdesigner_internal::PreviewConfiguration &pc1, c
return pc1.deviceSkin().compare(pc2.deviceSkin());
}
-namespace {
+namespace qdesigner_internal {
// ------ PreviewData (data associated with a preview window)
struct PreviewData {
PreviewData(const QPointer<QWidget> &widget, const QDesignerFormWindowInterface *formWindow, const qdesigner_internal::PreviewConfiguration &pc);
@@ -65,9 +65,6 @@ namespace {
m_configuration(pc)
{
}
-}
-
-namespace qdesigner_internal {
/* In designer, we have the situation that laid-out maincontainers have
* a geometry set (which might differ from their sizeHint()). The QGraphicsItem
diff --git a/src/designer/src/lib/shared/qtresourceeditordialog.cpp b/src/designer/src/lib/shared/qtresourceeditordialog.cpp
index 11908fbf9..5c318d563 100644
--- a/src/designer/src/lib/shared/qtresourceeditordialog.cpp
+++ b/src/designer/src/lib/shared/qtresourceeditordialog.cpp
@@ -44,7 +44,7 @@ static QString msgTagMismatch(const QString &got, const QString &expected)
return QCoreApplication::translate("QtResourceEditorDialog", "The file does not appear to be a resource file; element '%1' was found where '%2' was expected.").arg(got, expected);
}
-namespace {
+namespace qdesigner_internal {
// below 3 data classes should be derived from QSharedData and made implicit shared class
struct QtResourceFileData {
@@ -72,7 +72,14 @@ struct QtQrcFileData {
{ return qrcPath == other.qrcPath && resourceList == other.resourceList; }
};
-bool loadResourceFileData(const QDomElement &fileElem, QtResourceFileData *fileData, QString *errorMessage)
+} // namespace qdesigner_internal
+
+using QtResourcePrefixData = qdesigner_internal::QtResourcePrefixData;
+using QtResourceFileData = qdesigner_internal::QtResourceFileData;
+using QtQrcFileData = qdesigner_internal::QtQrcFileData;
+
+static bool loadResourceFileData(const QDomElement &fileElem, QtResourceFileData *fileData,
+ QString *errorMessage)
{
if (!fileData)
return false;
@@ -142,7 +149,7 @@ static bool loadQrcFileData(const QDomDocument &doc, const QString &path, QtQrcF
return true;
}
-QDomElement saveResourceFileData(QDomDocument &doc, const QtResourceFileData &fileData)
+static QDomElement saveResourceFileData(QDomDocument &doc, const QtResourceFileData &fileData)
{
QDomElement fileElem = doc.createElement(QLatin1String(rccFileTag));
if (!fileData.alias.isEmpty())
@@ -154,7 +161,7 @@ QDomElement saveResourceFileData(QDomDocument &doc, const QtResourceFileData &fi
return fileElem;
}
-QDomElement saveResourcePrefixData(QDomDocument &doc, const QtResourcePrefixData &prefixData)
+static QDomElement saveResourcePrefixData(QDomDocument &doc, const QtResourcePrefixData &prefixData)
{
QDomElement prefixElem = doc.createElement(QLatin1String(rccTag));
if (!prefixData.prefix.isEmpty())
@@ -170,7 +177,7 @@ QDomElement saveResourcePrefixData(QDomDocument &doc, const QtResourcePrefixData
return prefixElem;
}
-QDomDocument saveQrcFileData(const QtQrcFileData &qrcFileData)
+static QDomDocument saveQrcFileData(const QtQrcFileData &qrcFileData)
{
QDomDocument doc;
QDomElement docElem = doc.createElement(QLatin1String(rccRootTag));
@@ -183,6 +190,9 @@ QDomDocument saveQrcFileData(const QtQrcFileData &qrcFileData)
return doc;
}
+
+namespace qdesigner_internal {
+
// --------------- QtResourceFile
class QtResourceFile {
public:
@@ -759,9 +769,12 @@ void QtQrcManager::removeResourceFile(QtResourceFile *resourceFile)
delete resourceFile;
}
+} // namespace qdesigner_internal
-
-}
+using QtResourceFile = qdesigner_internal::QtResourceFile;
+using QtResourcePrefix = qdesigner_internal::QtResourcePrefix;
+using QtQrcFile = qdesigner_internal::QtQrcFile;
+using QtQrcManager = qdesigner_internal::QtQrcManager;
// ----------------- QtResourceEditorDialogPrivate
class QtResourceEditorDialogPrivate