Go to the documentation of this file.
23 #include <qstyleoption.h>
24 #include <qapplication.h>
118 const int flags = Qt::AlignHCenter
119 | Qt::TextExpandTabs | Qt::TextWordWrap;
123 QSizePolicy policy( QSizePolicy::MinimumExpanding,
124 QSizePolicy::Fixed );
128 setSizePolicy( policy );
130 setAttribute( Qt::WA_WState_OwnSizePolicy,
false );
193 const int flags =
title.
renderFlags() & ~( Qt::AlignTop | Qt::AlignBottom );
216 if ( !testAttribute( Qt::WA_WState_OwnSizePolicy ) )
218 QSizePolicy policy( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed );
222 setSizePolicy( policy );
224 setAttribute( Qt::WA_WState_OwnSizePolicy,
false );
418 QPainter painter(
this );
419 painter.setClipRegion( event->region() );
423 style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter,
this);
441 QRect r = contentsRect();
522 if ( event->type() == QEvent::LocaleChange )
527 QWidget::changeEvent( event );
561 const QRectF r = contentsRect();
567 length = r.height() - ( bd0 + bd1 );
577 length = r.width() - ( bd0 + bd1 );
593 if ( update_geometry )
603 if ( QWidget* w = parentWidget() )
605 if ( !w->isVisible() && w->layout() == NULL )
607 if ( w->testAttribute( Qt::WA_WState_Polished ) )
608 QApplication::postEvent( w,
new QEvent( QEvent::LayoutRequest ) );
651 ~( Qt::AlignTop | Qt::AlignBottom | Qt::AlignVCenter );
657 flags |= Qt::AlignTop;
658 r.setRect( r.left(), r.bottom(),
664 flags |= Qt::AlignTop;
671 flags |= Qt::AlignBottom;
678 flags |= Qt::AlignTop;
689 r.setRect( r.x() + r.height(), r.y() - r.width(),
690 r.width(), r.height() );
695 painter->setFont( font() );
696 painter->setPen( palette().color( QPalette::Text ) );
698 painter->translate( r.x(), r.y() );
700 painter->rotate( angle );
704 title.
draw( painter, QRectF( 0.0, 0.0, r.width(), r.height() ) );
754 QSize
size( length + 2, dim );
755 if ( o == Qt::Vertical )
758 const QMargins m = contentsMargins();
759 return size + QSize( m.left() + m.right(), m.top() + m.bottom() );
819 if ( start < m_data->minBorderDist[0] )
822 if ( end < m_data->minBorderDist[1] )
981 #include "moc_qwt_scale_widget.cpp"
virtual void draw(QPainter *, const QPalette &) const
Draw the scale.
A class for drawing scales.
Alignment alignment() const
@ RightScale
The scale is right.
void setText(const QString &, QwtText::TextFormat textFormat=AutoText)
void setTransformation(QwtTransform *)
QwtLinearColorMap builds a color map from color stops.
@ LeftScale
The scale is left.
const QwtScaleMap & scaleMap() const
void setScaleDiv(const QwtScaleDiv &)
Qt::Orientation orientation() const
const QwtScaleDiv & scaleDiv() const
void setRenderFlags(int)
Change the render flags.
A scale engine for linear scales.
void setLabelRotation(double rotation)
void getBorderDistHint(const QFont &, int &start, int &end) const
Determine the minimum border distance.
span_constexpr std::size_t size(span< T, Extent > const &spn)
A class representing an interval.
void update(const std::string &key, const XmlRpc::XmlRpcValue &v)
A class representing a text.
@ TopScale
The scale is above.
void move(double x, double y)
virtual double extent(const QFont &) const QWT_OVERRIDE
double heightForWidth(double width) const
int minLength(const QFont &) const
void setFont(const QFont &)
@ BottomScale
The scale is below.
void setLabelAlignment(Qt::Alignment)
Change the label flags.
QwtInterval normalized() const
Normalize the limits of the interval.
void draw(QPainter *painter, const QRectF &rect) const
QwtColorMap is used to map values into colors.
static void drawColorBar(QPainter *, const QwtColorMap &, const QwtInterval &, const QwtScaleMap &, Qt::Orientation, const QRectF &)
A class representing a scale division.
const QwtTransform * transformation() const
Get the transformation.
void setAlignment(Alignment)
void setLength(double length)
plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:46