22 #include <qstyleoption.h> 117 const int flags = Qt::AlignHCenter
118 | Qt::TextExpandTabs | Qt::TextWordWrap;
122 QSizePolicy policy( QSizePolicy::MinimumExpanding,
123 QSizePolicy::Fixed );
127 setSizePolicy( policy );
129 setAttribute( Qt::WA_WState_OwnSizePolicy,
false );
190 const int flags = title.
renderFlags() & ~( Qt::AlignTop | Qt::AlignBottom );
211 if ( !testAttribute( Qt::WA_WState_OwnSizePolicy ) )
213 QSizePolicy policy( QSizePolicy::MinimumExpanding,
214 QSizePolicy::Fixed );
218 setSizePolicy( policy );
220 setAttribute( Qt::WA_WState_OwnSizePolicy,
false );
264 margin = qMax( 0, margin );
279 spacing = qMax( 0, spacing );
414 QPainter painter(
this );
415 painter.setClipRegion( event->region() );
419 style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter,
this);
437 QRect r = contentsRect();
518 if ( event->type() == QEvent::LocaleChange )
523 QWidget::changeEvent( event );
557 const QRectF r = contentsRect();
563 length = r.height() - ( bd0 + bd1 );
573 length = r.width() - ( bd0 + bd1 );
589 if ( update_geometry )
630 ~( Qt::AlignTop | Qt::AlignBottom | Qt::AlignVCenter );
636 flags |= Qt::AlignTop;
637 r.setRect( r.left(), r.bottom(),
643 flags |= Qt::AlignTop;
650 flags |= Qt::AlignBottom;
657 flags |= Qt::AlignTop;
668 r.setRect( r.x() + r.height(), r.y() - r.width(),
669 r.width(), r.height() );
674 painter->setFont( font() );
675 painter->setPen( palette().color( QPalette::Text ) );
677 painter->translate( r.x(), r.y() );
679 painter->rotate( angle );
683 title.
draw( painter, QRectF( 0.0, 0.0, r.width(), r.height() ) );
733 QSize
size( length + 2, dim );
734 if ( o == Qt::Vertical )
737 int left, right, top, bottom;
738 getContentsMargins( &left, &top, &right, &bottom );
739 return size + QSize( left + right, top + bottom );
799 if ( start < d_data->minBorderDist[0] )
802 if ( end < d_data->minBorderDist[1] )
QwtInterval normalized() const
Normalize the limits of the interval.
void setAlignment(Alignment)
void setLength(double length)
void setFont(const QFont &)
virtual double extent(const QFont &) const
A class representing an interval.
void setText(const QString &, QwtText::TextFormat textFormat=AutoText)
void draw(QPainter *painter, const QRectF &rect) const
A class representing a scale division.
const QwtScaleMap & scaleMap() const
void getBorderDistHint(const QFont &, int &start, int &end) const
Determine the minimum border distance.
TFSIMD_FORCE_INLINE const tfScalar & y() const
int minLength(const QFont &) const
TFSIMD_FORCE_INLINE tfScalar angle(const Quaternion &q1, const Quaternion &q2)
void update(const std::string &key, const XmlRpc::XmlRpcValue &v)
Alignment alignment() const
void setRenderFlags(int flags)
Change the render flags.
const QwtScaleDiv & scaleDiv() const
A class representing a text.
QwtColorMap is used to map values into colors.
TFSIMD_FORCE_INLINE const tfScalar & x() const
void setLabelRotation(double rotation)
const QwtTransform * transformation() const
Get the transformation.
QwtLinearColorMap builds a color map from color stops.
Qt::Orientation orientation() const
virtual void draw(QPainter *, const QPalette &) const
Draw the scale.
static void drawColorBar(QPainter *painter, const QwtColorMap &, const QwtInterval &, const QwtScaleMap &, Qt::Orientation, const QRectF &)
void setScaleDiv(const QwtScaleDiv &s)
void setTransformation(QwtTransform *)
A class for drawing scales.
A scale engine for linear scales.
void setLabelAlignment(Qt::Alignment)
Change the label flags.
double heightForWidth(double width, const QFont &=QFont()) const
void move(double x, double y)