there is no moc file generated for this class
[kdegraphics.git] / kolourpaint / compat / kpBug.h
blob0452d7c7b1db8cbb53d28a8c2efaeaecbc9fa58d
2 /*
3 Copyright (c) 2003-2007 Clarence Dang <dang@kde.org>
4 All rights reserved.
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions
8 are met:
10 1. Redistributions of source code must retain the above copyright
11 notice, this list of conditions and the following disclaimer.
12 2. Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in the
14 documentation and/or other materials provided with the distribution.
16 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 #ifndef KP_BUG_H
30 #define KP_BUG_H
33 class QAbstractButton;
34 class QButtonGroup;
35 class QRect;
38 /**
39 * @short Hacks around Qt and KDE library bugs (until they're fixed).
41 * SYNC: Remove hacks when fixed.
43 * @author Clarence Dang <dang@kde.org>
45 class kpBug
47 public:
48 // http://www.trolltech.com/developer/tasktracker.html?method=entry&id=108906:
50 // Qt 4.1.1 QButtonGroup::checkedButton() does not return 0 after a
51 // button is unchecked.
54 // QButtonGroup_CheckedButton() will return 0 correctly.
55 static QAbstractButton *QButtonGroup_CheckedButton (const QButtonGroup *buttonGroup);
57 // From: Clarence Dang <dang@kde.org>
58 // To: qt-bugs@trolltech.com
59 // Subject: Re: [Issue N108897] Dangerous, subtle change to QRect::normalize()
60 // Date: Fri, 31 Mar 2006 20:51:36 +1000
61 // Cc: kde-core-devel@kde.org
63 // Thread extracts:
65 // Qt 4.1.1 qt-copy/src/corelib/tools/qrect.cpp:
67 // QRect QRect::normalized() const
68 // {
69 // if (isNull() || width() == 0 || height() == 0)
70 // return *this;
72 // This check was not in Qt3.  It is also wrong.
74 // e.g. QRect rect = QRect (thisPoint, lastPoint).normalize ()
76 // This innocent looking line will work for all values of "thisPoint" and
77 // "lastPoint", _except_ for 5 special cases by my count:
79 // +++
80 // +*
81 // +
83 // Where "*" is the topLeft point and "+" are the troublesome bottomRight
84 // points.
87 // QRect_Normalized() will use the Qt3 behaviour and therefore, work for
88 // all input.
89 static QRect QRect_Normalized (const QRect &rect);
93 #endif // KP_BUG_H