summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qimage.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2012-04-27 23:12:13 +0200
committerQt by Nokia <qt-info@nokia.com>2012-04-28 01:16:20 +0200
commit600e193bbc10939f5789bc29c7d1193bd158dce1 (patch)
tree2452c98ef0e79bc28b56491abae7e6598fea128f /src/gui/image/qimage.h
parent9d1f1b09014c03cba323346252c11c6c52e579bd (diff)
Don't generate compiler warnings for using deprecated methods
We need to construct QImageTextKeyLang objects for the deprecated method in QImage. That's impossible to do if we don't have a constructor for the class that's non deprecated. So add a private constructor and make QImage a fried of the class so it can use that constructor. Change-Id: I6359e9943fe031ed3dca85479ee9ec47ceaf776b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/image/qimage.h')
-rw-r--r--src/gui/image/qimage.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h
index e59aa20549..db549699a7 100644
--- a/src/gui/image/qimage.h
+++ b/src/gui/image/qimage.h
@@ -83,6 +83,9 @@ public:
{ return key==other.key && lang==other.lang; }
inline bool operator!= (const QImageTextKeyLang &other) const
{ return !operator==(other); }
+private:
+ friend class QImage;
+ QImageTextKeyLang(bool /*dummy*/) {}
};
#endif
@@ -338,7 +341,7 @@ inline QList<QImageTextKeyLang> QImage::textList() const
for (int i = 0; i < keys.size(); ++i) {
int index = keys.at(i).indexOf(QLatin1Char('/'));
if (index > 0) {
- QImageTextKeyLang tkl;
+ QImageTextKeyLang tkl(true);
tkl.key = keys.at(i).left(index).toAscii();
tkl.lang = keys.at(i).mid(index+1).toAscii();
imageTextKeys += tkl;