33 #include <KDABLibFakes>
35 using namespace KDChart;
37 class RelativePosition::Private {
38 friend class ::KDChart::RelativePosition;
54 RelativePosition::Private::Private()
56 alignment( Qt::AlignCenter ),
62 RelativePosition::Private::~Private()
74 : _d( new Private( *r._d ) )
124 d->alignment = align;
132 d->horizontalPadding = pad;
136 return d->horizontalPadding;
140 d->verticalPadding = pad;
144 return d->verticalPadding;
158 bool useRect = (
d->area != 0 );
161 if (
const QWidget* widget = qobject_cast< const QWidget* >(
d->area ) ) {
162 const QLayout* layout = widget->layout();
163 rect = layout ? layout->geometry() : widget->geometry();
164 }
else if (
const AbstractArea* kdcArea = qobject_cast< const AbstractArea* >(
d->area ) ) {
165 rect = kdcArea->geometry();
176 pt =
d->points.point(
d->position );
177 angle =
d->points.degrees(
d->position.value() );
180 if ( polarDegrees ) {
181 *polarDegrees = angle;
194 if ( polarDegrees == 0.0 ) {
195 pt += QPointF( dx, dy );
197 const qreal rad = DEGTORAD( polarDegrees);
198 const qreal sinDeg = sin(rad);
199 const qreal cosDeg = cos(rad);
200 pt.setX( pt.x() + dx * cosDeg + dy * sinDeg );
201 pt.setY( pt.y() - dx * sinDeg + dy * cosDeg );
220 #if !defined(QT_NO_DEBUG_STREAM)
223 dbg <<
"KDChart::RelativePosition("