summaryrefslogtreecommitdiffstats
path: root/src/gui/styles
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-07-30 11:55:17 (GMT)
committerGunnar Sletta <gunnar@trolltech.com>2009-07-30 11:57:36 (GMT)
commit9fb11e5c2e8127e2916e1cf9b51f676effc9d31e (patch)
treeb699875ecbc50d83688d8a9770aa6b40c659966e /src/gui/styles
parent04f7834fcd8db4ecb6a4c53de42ac83f571b37c8 (diff)
downloadQt-9fb11e5c2e8127e2916e1cf9b51f676effc9d31e.zip
Qt-9fb11e5c2e8127e2916e1cf9b51f676effc9d31e.tar.gz
Qt-9fb11e5c2e8127e2916e1cf9b51f676effc9d31e.tar.bz2
Reviewed-by: Thomas H.
Squashed commit of the following: commit fcf7e8cab339d0cf9f3f2a9756d7754c54c4d934 Author: Gunnar Sletta <gunnar@trolltech.com> Date: Thu Jul 30 13:15:13 2009 +0200 note in the changes file... commit 2c9c3880215988e6609c290a8e738b228736e601 Author: Gunnar Sletta <gunnar@trolltech.com> Date: Thu Jul 30 12:51:42 2009 +0200 Don't leak native window HRGN handles commit 6bb30d2075dd1d71a8a600d25f413a38af7f2f2c Author: Gunnar Sletta <gunnar@trolltech.com> Date: Thu Jul 30 11:09:22 2009 +0200 Moved qregion_wince.cpp -> qregion_win.cpp, platforms are identical now commit 173fcc5baec73a198167985c6f777987e6015a71 Author: Gunnar Sletta <gunnar@trolltech.com> Date: Thu Jul 30 09:42:06 2009 +0200 win32 calls on QRegion.handle() is no longer supported, use from HRGN commit d7ddcce4ba29b70ed81f85274208b388a2bb9d4d Author: Gunnar Sletta <gunnar@trolltech.com> Date: Thu Jul 30 09:41:37 2009 +0200 Added convenience function to convert from HRGN to QRegion commit 2fc53ac3d59a9c42bb4154fff7557610092b7946 Author: Gunnar Sletta <gunnar@trolltech.com> Date: Wed Jul 29 09:28:10 2009 +0200 Kill qregion_win.cpp and use the unix code instead
Diffstat (limited to 'src/gui/styles')
-rw-r--r--src/gui/styles/qwindowsxpstyle.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/gui/styles/qwindowsxpstyle.cpp b/src/gui/styles/qwindowsxpstyle.cpp
index 9560c4b..ad87354 100644
--- a/src/gui/styles/qwindowsxpstyle.cpp
+++ b/src/gui/styles/qwindowsxpstyle.cpp
@@ -134,6 +134,7 @@ static const int windowsRightBorder = 12; // right border on windows
// External function calls
extern Q_GUI_EXPORT HDC qt_win_display_dc();
+extern QRegion qt_region_from_HRGN(HRGN rgn);
@@ -445,6 +446,7 @@ bool QWindowsXPStylePrivate::isTransparent(XPThemeData &themeData)
themeData.stateId);
}
+
/*! \internal
Returns a QRegion of the region of the part
*/
@@ -456,12 +458,18 @@ QRegion QWindowsXPStylePrivate::region(XPThemeData &themeData)
themeData.stateId, &rect, &hRgn)))
return QRegion();
- QRegion rgn = QRegion(0,0,1,1);
- const bool success = CombineRgn(rgn.handle(), hRgn, 0, RGN_COPY) != ERROR;
- DeleteObject(hRgn);
+ HRGN dest = CreateRectRgn(0, 0, 0, 0);
+ const bool success = CombineRgn(dest, hRgn, 0, RGN_COPY) != ERROR;
+
+ QRegion region;
+
if (success)
- return rgn;
- return QRegion();
+ region = qt_region_from_HRGN(dest);
+
+ DeleteObject(hRgn);
+ DeleteObject(dest);
+
+ return region;
}
/*! \internal