From 4300f6e9ccf37c16ebde53e1c73cd8e8cfd2cd35 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 27 Feb 2015 21:11:29 +0100 Subject: [PATCH] QColorDialog: move all helper classes into the unnamed namespace Effects on Linux GCC 4.9 stripped release builds: text -984B data +-0B relocs +-0 Change-Id: Iff914e745939f183ba51b4e625ff795d6b44023a Reviewed-by: Friedemann Kleint --- src/widgets/dialogs/qcolordialog.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp index 0a159117b3..914ee8ec9c 100644 --- a/src/widgets/dialogs/qcolordialog.cpp +++ b/src/widgets/dialogs/qcolordialog.cpp @@ -67,11 +67,13 @@ QT_BEGIN_NAMESPACE +namespace { class QColorLuminancePicker; class QColorPicker; class QColorShower; class QWellArray; class QColorPickingEventFilter; +} // unnamed namespace class QColorDialogPrivate : public QDialogPrivate { @@ -181,6 +183,8 @@ private: //////////// QWellArray BEGIN +namespace { + struct QWellArrayData; class QWellArray : public QWidget @@ -562,6 +566,8 @@ private: QColorDialogPrivate *m_dp; }; +} // unnamed namespace + /*! Returns the number of custom colors supported by QColorDialog. All color dialogs share the same custom colors. @@ -622,6 +628,8 @@ static inline void rgb2hsv(QRgb rgb, int &h, int &s, int &v) c.getHsv(&h, &s, &v); } +namespace { + class QColorWell : public QWellArray { public: @@ -1091,8 +1099,8 @@ private: QColorDialog *colorDialog; QGridLayout *gl; - friend class QColorDialog; - friend class QColorDialogPrivate; + friend class QT_PREPEND_NAMESPACE(QColorDialog); + friend class QT_PREPEND_NAMESPACE(QColorDialogPrivate); }; class QColorShowLabel : public QFrame @@ -1381,6 +1389,8 @@ QColorShower::QColorShower(QColorDialog *parent) retranslateStrings(); } +} // unnamed namespace + inline QRgb QColorDialogPrivate::currentColor() const { return cs->currentColor(); } inline int QColorDialogPrivate::currentAlpha() const { return cs->currentAlpha(); } inline void QColorDialogPrivate::setCurrentAlpha(int a) { cs->setCurrentAlpha(a); }