コード例 #1
0
/*!
   Calculate the minimum length that is needed to draw the scale

   \param font Font used for painting the labels

   \sa extent()
*/
int QwtScaleDraw::minLength( const QFont &font ) const
{
    int startDist, endDist;
    getBorderDistHint( font, startDist, endDist );

    const QwtScaleDiv &sd = scaleDiv();

    const uint minorCount =
        sd.ticks( QwtScaleDiv::MinorTick ).count() +
        sd.ticks( QwtScaleDiv::MediumTick ).count();
    const uint majorCount =
        sd.ticks( QwtScaleDiv::MajorTick ).count();

    int lengthForLabels = 0;
    if ( hasComponent( QwtAbstractScaleDraw::Labels ) )
    {
        if ( majorCount >= 2 )
            lengthForLabels = minLabelDist( font ) * ( majorCount - 1 );
    }

    int lengthForTicks = 0;
    if ( hasComponent( QwtAbstractScaleDraw::Ticks ) )
    {
        const double pw = qMax( 1, penWidth() );  // penwidth can be zero
        lengthForTicks = qCeil( ( majorCount + minorCount ) * ( pw + 1.0 ) );
    }

    return startDist + endDist + qMax( lengthForLabels, lengthForTicks );
}
コード例 #2
0
/*!
   Calculate the width/height that is needed for a
   vertical/horizontal scale.

   The extent is calculated from the pen width of the backbone,
   the major tick length, the spacing and the maximum width/height
   of the labels.

   \param font Font used for painting the labels

   \sa minLength()
*/
double QwtScaleDraw::extent( const QFont &font ) const
{
    double d = 0;

    if ( hasComponent( QwtAbstractScaleDraw::Labels ) )
    {
        if ( orientation() == Qt::Vertical )
            d = maxLabelWidth( font );
        else
            d = maxLabelHeight( font );

        if ( d > 0 )
            d += spacing();
    }

    if ( hasComponent( QwtAbstractScaleDraw::Ticks ) )
    {
        d += majTickLength();
    }

    if ( hasComponent( QwtAbstractScaleDraw::Backbone ) )
    {
        const double pw = qMax( 1, penWidth() );  // penwidth can be zero
        d += pw;
    }

    d = qMax( d, minimumExtent() );
    return d;
}
コード例 #3
0
ファイル: Style.cpp プロジェクト: dhaumann/tikzkit
tikz::Value Style::outerSep() const
{
    if (!propertySet(s_outerSep)) {
        return 0.5 * penWidth();
    }
    return d->outerSep;
}
コード例 #4
0
/*!
   Calculate the extent of the scale

   The extent is the distance between the baseline to the outermost
   pixel of the scale draw. radius() + extent() is an upper limit
   for the radius of the bounding circle.

   \param font Font used for painting the labels

   \sa setMinimumExtent(), minimumExtent()
   \warning The implemented algo is not too smart and
            calculates only an upper limit, that might be a
            few pixels too large
*/
double QwtRoundScaleDraw::extent( const QFont &font ) const
{
    double d = 0.0;

    if ( hasComponent( QwtAbstractScaleDraw::Labels ) )
    {
        const QwtScaleDiv &sd = scaleDiv();
        const QList<double> &ticks = sd.ticks( QwtScaleDiv::MajorTick );
        for ( int i = 0; i < ticks.count(); i++ )
        {
            const double value = ticks[i];
            if ( !sd.contains( value ) )
                continue;

            const QwtText label = tickLabel( font, value );
            if ( label.isEmpty() )
                continue;

            const double tval = scaleMap().transform( value );
            if ( ( tval < d_data->startAngle + 360 * 16 )
                && ( tval > d_data->startAngle - 360 * 16 ) )
            {
                const double arc = tval / 16.0 / 360.0 * 2 * M_PI;

                const QSizeF sz = label.textSize( font );
                const double off = qMax( sz.width(), sz.height() );

                double x = off * qSin( arc );
                double y = off * qCos( arc );

                const double dist = qSqrt( x * x + y * y );
                if ( dist > d )
                    d = dist;
            }
        }
    }

    if ( hasComponent( QwtAbstractScaleDraw::Ticks ) )
    {
        d += maxTickLength();
    }

    if ( hasComponent( QwtAbstractScaleDraw::Backbone ) )
    {
        const double pw = qMax( 1, penWidth() );  // penwidth can be zero
        d += pw;
    }

    if ( hasComponent( QwtAbstractScaleDraw::Labels ) &&
        ( hasComponent( QwtAbstractScaleDraw::Ticks ) ||
            hasComponent( QwtAbstractScaleDraw::Backbone ) ) )
    {
        d += spacing();
    }

    d = qMax( d, minimumExtent() );

    return d;
}
コード例 #5
0
void DrawingPolyItem::writeXmlAttributes(QXmlStreamWriter& xmlWriter, const QList<DrawingItem*>& items)
{
	DrawingItem::writeXmlAttributes(xmlWriter, items);

	xmlWriter.writeAttribute("penColor", Drawing::colorToString(penColor()));
	xmlWriter.writeAttribute("penWidth", QString::number(penWidth()));
	xmlWriter.writeAttribute("penStyle", QString::number((unsigned int)penStyle()));
	xmlWriter.writeAttribute("penCapStyle", QString::number((unsigned int)penCapStyle()));
	xmlWriter.writeAttribute("penJoinStyle", QString::number((unsigned int)penJoinStyle()));
}
コード例 #6
0
MarkerContainer::MarkerContainer() {
	auto s = Settings("MarkerL");
	myColor1 = s.color1();
	myColor2 = s.color2();
	myPenWidth = s.penWidth();
	myFont = s.font();
	myFontSize = s.fontSize();
	mySize = s.size();
	myHasBackground = s.hasBackground();
	myType = 0;
	visible = true;
}
コード例 #7
0
QVariant DrawingPolyItem::aboutToChangeEvent(Reason reason, const QVariant& value)
{
	if (reason == UnitsChange)
	{
		DrawingUnits newUnits = (DrawingUnits)value.toInt();
		qreal scaleFactor = Drawing::unitsScale(units(), newUnits);

		setPenWidth(penWidth() * scaleFactor);
	}

	return value;
}
コード例 #8
0
ファイル: scribble.cpp プロジェクト: AliYousuf/univ-aca-mips
void Canvas::mouseMoveEvent( QMouseEvent *e )
{
    if ( mousePressed ) {
	QPainter painter;
	painter.begin( &buffer );
	painter.setPen( pen );
	polyline[2] = polyline[1];
	polyline[1] = polyline[0];
	polyline[0] = e->pos();
	painter.drawPolyline( polyline );
	painter.end();

	QRect r = polyline.boundingRect();
	r = r.normalize();
	r.setLeft( r.left() - penWidth() );
	r.setTop( r.top() - penWidth() );
	r.setRight( r.right() + penWidth() );
	r.setBottom( r.bottom() + penWidth() );

	bitBlt( this, r.x(), r.y(), &buffer, r.x(), r.y(), r.width(), r.height() );
    }
}
コード例 #9
0
ファイル: scribblescripter.cpp プロジェクト: aschet/qsaqt5
void Canvas::mouseMoveEvent( QMouseEvent *e )
{
    if ( mousePressed ) {
	QPainter painter;
	painter.begin( &buffer );
        painter.setRenderHint(QPainter::Antialiasing);
	painter.setPen( pen );
	polyline[2] = polyline[1];
	polyline[1] = polyline[0];
	polyline[0] = e->pos();
	painter.drawPolyline( polyline );
	painter.end();

	QRect r = polyline.boundingRect();
	r = r.normalized();
	r.setLeft( r.left() - penWidth() );
	r.setTop( r.top() - penWidth() );
	r.setRight( r.right() + penWidth() );
	r.setBottom( r.bottom() + penWidth() );

	update();
    }
}
コード例 #10
0
LegendGroup::LegendGroup(const QPointF& Clicked, MarkerModel* model, QGraphicsItem* parent):
	QGraphicsItemGroup(parent), origin(Clicked), model(model)
{
	mySize = 20;
	frame = new RectItem(QRectF());
	frame->setBrush(QColor(255, 255, 255, 192));
	setFlags(QGraphicsItem::ItemIsSelectable | QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemSendsGeometryChanges);
	addToGroup(frame);
	auto s = Settings("LegendL");
	myPenWidth = s.penWidth();
	mySize = s.size();
	myFont = s.font();
	myFontSize = s.fontSize();
	updateModel();
}
コード例 #11
0
ファイル: ap_item.cpp プロジェクト: HeryLong/booxsdk
void WifiAPItem::paintEvent(QPaintEvent *e)
{
    if (profile_.bssid().isEmpty() && profile_.isPresent())
    {
        return;
    }

    QPainter painter(this);
    QPainterPath path;
    path.addRoundedRect(rect().adjusted(2, 2, -2, -2), 8, 8, Qt::AbsoluteSize);

    if (isSelected() || isAPChecked())
    {
        painter.fillPath(path, QBrush(SELECTED_BK_COLOR));
    }
    else
    {
        painter.fillPath(path, QBrush(NORMAL_BK_COLOR));
    }

    if (isSelected())
    {
        if (!selected_pixmap_)
        {
            selected_pixmap_.reset(new QPixmap(":/images/selected.png"));
        }
        painter.drawPixmap(SPACING, (height() - selected_pixmap_->height()) / 2, *selected_pixmap_);
    }

    QPen pen;
    pen.setWidth(penWidth());

    if (hasFocus())
    {
        pen.setColor(Qt::black);
        painter.setPen(pen);
        painter.drawPath(path);
    }
    else
    {
        pen.setColor(Qt::white);
        painter.setPen(pen);
        painter.drawPath(path);
    }
}
コード例 #12
0
/*!
   Find the position, where to paint a label

   The position has a distance of majTickLength() + spacing() + 1
   from the backbone. The direction depends on the alignment()

   \param value Value
*/
QPointF QwtScaleDraw::labelPosition( double value ) const
{
    const double tval = map().transform( value );
    double dist = spacing();
    if ( hasComponent( QwtAbstractScaleDraw::Backbone ) )
        dist += qMax( 1, penWidth() );

    if ( hasComponent( QwtAbstractScaleDraw::Ticks ) )
        dist += majTickLength();

    double px = 0;
    double py = 0;

    switch ( alignment() )
    {
        case RightScale:
        {
            px = d_data->pos.x() + dist;
            py = tval;
            break;
        }
        case LeftScale:
        {
            px = d_data->pos.x() - dist;
            py = tval;
            break;
        }
        case BottomScale:
        {
            px = tval;
            py = d_data->pos.y() + dist;
            break;
        }
        case TopScale:
        {
            px = tval;
            py = d_data->pos.y() - dist;
            break;
        }
    }

    return QPointF( px, py );
}
コード例 #13
0
ファイル: NodeConnectorView.cpp プロジェクト: k0zmo/mouve
NodeConnectorView::NodeConnectorView(bool isOutput, QGraphicsItem* parent)
    : QGraphicsWidget(parent, 0)
    , mRect(NodeStyle::SocketSize)
    , mPen(NodeStyle::SocketPen)
    , mAnimation(this, "penWidth")
    , mTemporaryLink(nullptr)
    , mHoveredConnector(nullptr)
    , mAnnotation(new QGraphicsSimpleTextItem(this))
    , mIsOutput(isOutput)
{
    setBrushGradient(Qt::white, Qt::black);
    setPenWidth(NodeStyle::NodeSocketPenWidth);
    setAnnotation(QString());
    setCursor(Qt::PointingHandCursor);

    setAcceptHoverEvents(true);

    mAnimation.setDuration(250);
    mAnimation.setEasingCurve(QEasingCurve::InOutQuad);
    mAnimation.setStartValue(penWidth());

    connect(this, SIGNAL(draggingLinkDropped(QGraphicsWidget*, QGraphicsWidget*)),
        Controller::instancePtr(), SLOT(draggingLinkDropped(QGraphicsWidget*, QGraphicsWidget*)));
}
コード例 #14
0
void DrawingBoard::mouseReleaseEvent(QMouseEvent *event)
{
    if(myLine){
        if (event->button() == Qt::LeftButton && drawing) {
           // backUp.push_back(image);
            store();

            drawLineThru(startPoint, event->pos());
istore();
            drawing = false;
            }
        else if (event->button() == Qt::RightButton) {
           // QString str1 = QString::number(myPenWidth);
           // myPenWidth = 1;
           // QString str2 = QString::(myPenColor);

           // myPenColor = Qt::red;
            bool ok;
            int newWidth = QInputDialog::getInt(this, tr("Line Size"),
                                                tr("Select the size of line:"),
                                                penWidth(),
                                                1, 50, 1, &ok);
              // bool ok;
            //QString item = QInputDialog::getItem(this, tr("QInputDialog::getItem()"),
                       //                             tr("Season:"), items, 0, false, &ok);

            if (ok){
                setPenWidth(newWidth);
               // statusBar()->showMessage(tr("qweewqewdasdsakdl"));
            }
        }
    }
    else  if(myRect){
          if ((event->buttons() & Qt::LeftButton) && drawing){
             // backUp.push_back(image);
            // store();

          drawRectTo(event->pos());
        //   istore();
          drawing = false;

          }
          else if (event->button() == Qt::RightButton) {

              bool ok;
              int newWidth = QInputDialog::getInt(this, tr("Rectangle border size"),
                                                  tr("Select the size of the border:"),
                                                  penWidth(),
                                                  1, 50, 1, &ok);
                // bool ok;
              //QString item = QInputDialog::getItem(this, tr("QInputDialog::getItem()"),
                         //                             tr("Season:"), items, 0, false, &ok);

              if (ok){
                  setPenWidth(newWidth);
                 // statusBar()->showMessage(tr("qweewqewdasdsakdl"));
              }
          }
      }

    else if(myText){
        if ((event->buttons() & Qt::LeftButton) && drawing){
           // backUp.push_back(image);
            store();

        drawTexts(event->pos(),QString::fromStdString(text));
        istore();
        drawing = false;

        }
        else if (event->button() == Qt::RightButton) {
           // QString str =QString::fromStdString(text);
            bool ok;
            QString txt = QInputDialog::getText(this, tr("Enter the text you want to print"),
                                                 tr("Message"), QLineEdit::Normal,tr("Type your message"),
                                                  &ok);
            if (ok){
                text=txt.toStdString();
                //text=txt;
        }}
    }
    else if(myPen)
    {
    if (event->button() == Qt::LeftButton && drawing) {
       // backUp.push_back(image);
        store();

        drawLineTo(event->pos());
istore();
        drawing = false;
    }
    else if (event->button() == Qt::RightButton) {

        bool ok;
        int newWidth = QInputDialog::getInt(this, tr("Pen Size"),
                                            tr("Select the size of pen:"),
                                            penWidth(),
                                            1, 50, 1, &ok);
          // bool ok;
          // QString item = QInputDialog::getItem(this, tr("QInputDialog::getItem()"),
                       //                         tr("Season:"), items, 0, false, &ok);

        if (ok){
            setPenWidth(newWidth);
           // statusBar()->showMessage(tr("qweewqewdasdsakdl"));
        }
        //QMessageBox::about(this, tr("Pen tool properties"),
             //   tr("You have Clicked right button. To draw Please press left button on mouse"));
    }
    }
    else if(mypLine){
        if (event->button() == Qt::LeftButton && drawing) {
           // backUp.push_back(image);
            store();

            drawLineTemp(startPoint, event->pos());
            istore();
            drawing = false;
            }
        else if (event->button() == Qt::RightButton) {
            bool ok;
            int newWidth = QInputDialog::getInt(this, tr("Select polyline Size"),
                                                tr("Select the size of Polyline:"),
                                                penWidth(),
                                                1, 50, 1, &ok);
            if (ok)
                setPenWidth(newWidth);
          //  QMessageBox::about(this, tr("PolyLine tool properties"),
            //        tr("You have Clicked right button. To draw Please press left button on mouse"));
        }
    }
    else if(myRub)
    {
    if (event->button() == Qt::LeftButton && drawing) {
      //  backUp.push_back(image);
        store();

        erase(event->pos());//to change
istore();
        drawing = false;
    }
    else if (event->button() == Qt::RightButton) {

        bool ok;
        int newWidth = QInputDialog::getInt(this, tr("Eraser Size"),
                                            tr("Select the size of Eraser:"),
                                            rubWidth(),
                                            1, 50, 1, &ok);
        if (ok)
            setRubWidth(newWidth);
    }
    }
    else
    {
        if (event->button() == Qt::LeftButton) {
        QMessageBox::about(this, tr("Mouse Event detection"),
                tr("You have Clicked Left Button. Now, close and select your preferences"));
    }

        else if (event->button() == Qt::RightButton) {

            QMessageBox::about(this, tr("Mouse Event1 detection"),
                    tr("You have Clicked right button. Now, close and select your preferences to see the properties of tool"));
        }

}
}
コード例 #15
0
        connect(action, SIGNAL(triggered()), this, SLOT(save()));
        saveAsActs.append(action);
    }

    printAct = new QAction(tr("&Print..."), this);
    connect(printAct, SIGNAL(triggered()), scribbleArea, SLOT(print()));

    exitAct = new QAction(tr("E&xit"), this);
    exitAct->setShortcuts(QKeySequence::Quit);
    connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));

    penColorAct = new QAction(tr("&Pen Color..."), this);
    connect(penColorAct, SIGNAL(triggered()), this, SLOT(penColor()));

    penWidthAct = new QAction(tr("Pen &Width..."), this);
    connect(penWidthAct, SIGNAL(triggered()), this, SLOT(penWidth()));

    clearScreenAct = new QAction(tr("&Clear Screen"), this);
    clearScreenAct->setShortcut(tr("Ctrl+L"));
    connect(clearScreenAct, SIGNAL(triggered()),
            scribbleArea, SLOT(clearImage()));

    aboutAct = new QAction(tr("&About"), this);
    connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));

    aboutQtAct = new QAction(tr("About &Qt"), this);
    connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
}
//! [14]

//! [15]
コード例 #16
0
ファイル: executer.cpp プロジェクト: KDE/kturtle
void Executer::executePenWidth(TreeNode* node) {
//	//qDebug() << "called";
	if (!checkParameterQuantity(node, 1, 20000+Token::PenWidth*100+90) ||
		!checkParameterType(node, Value::Number, 20000+Token::PenWidth*100+91)) return;
	emit penWidth(node->child(0)->value()->number());
}
コード例 #17
0
ファイル: canvas.cpp プロジェクト: serghei/kde3-qt
void Canvas::tabletEvent( QTabletEvent *e )
{
    e->accept();
    // change the width based on range of pressure
    if ( e->device() == QTabletEvent::Stylus )	{
        if ( e->pressure() >= 0 && e->pressure() <= 32 )
            pen.setColor( saveColor.light(175) );
        else if ( e->pressure() > 32 && e->pressure() <= 64 )
            pen.setColor( saveColor.light(150) );
        else if ( e->pressure() > 64  && e->pressure() <= 96 )
            pen.setColor( saveColor.light(125) );
        else if ( e->pressure() > 96 && e->pressure() <= 128 )
            pen.setColor( saveColor );
        else if ( e->pressure() > 128 && e->pressure() <= 160 )
            pen.setColor( saveColor.dark(150) );
        else if ( e->pressure() > 160 && e->pressure() <= 192 )
            pen.setColor( saveColor.dark(200) );
        else if ( e->pressure() > 192 && e->pressure() <= 224 )
            pen.setColor( saveColor.dark(250) );
        else // pressure > 224
            pen.setColor( saveColor.dark(300) );
    } else if ( e->device() == QTabletEvent::Eraser
                && pen.color() != backgroundColor() ) {
        pen.setColor( backgroundColor() );
    }

    int xt = e->xTilt();
    int yt = e->yTilt();
    if ( ( xt > -15 && xt < 15 ) && ( yt > -15 && yt < 15 ) )
        pen.setWidth( 3 );
    else if ( ((xt < -15 && xt > -30) || (xt > 15 && xt < 30)) &&
              ((yt < -15 && yt > -30) || (yt > 15 && yt < 30 )) )
        pen.setWidth( 6 );
    else if ( ((xt < -30 && xt > -45) || (xt > 30 && xt < 45)) &&
              ((yt < -30 && yt > -45) || (yt > 30 && yt < 45)) )
        pen.setWidth( 9 );
    else if (  (xt < -45 || xt > 45 ) && ( yt < -45 || yt > 45 ) )
        pen.setWidth( 12 );

    switch ( e->type() ) {
    case QEvent::TabletPress:
        mousePressed = TRUE;
        polyline[2] = polyline[1] = polyline[0] = e->pos();
        break;
    case QEvent::TabletRelease:
        mousePressed = FALSE;
        break;
    case QEvent::TabletMove:
        if ( mousePressed ) {
            QPainter painter;
            painter.begin( &buffer );
            painter.setPen( pen );
            polyline[2] = polyline[1];
            polyline[1] = polyline[0];
            polyline[0] = e->pos();
            painter.drawPolyline( polyline );
            painter.end();

            QRect r = polyline.boundingRect();
            r = r.normalize();
            r.setLeft( r.left() - penWidth() );
            r.setTop( r.top() - penWidth() );
            r.setRight( r.right() + penWidth() );
            r.setBottom( r.bottom() + penWidth() );

            bitBlt( this, r.x(), r.y(), &buffer, r.x(), r.y(), r.width(),
                    r.height() );
        }
        break;
    default:
        break;
    }
}
コード例 #18
0
QPen DrawingPolyItem::pen() const
{
	return QPen(penColor(), penWidth(), penStyle(), penCapStyle(), penJoinStyle());
}
コード例 #19
0
/*!
   Draws the baseline of the scale
   \param painter Painter

   \sa drawTick(), drawLabel()
*/
void QwtScaleDraw::drawBackbone( QPainter *painter ) const
{
    const bool doAlign = QwtPainter::roundingAlignment( painter );

    const QPointF &pos = d_data->pos;
    const double len = d_data->len;
    const int pw = qMax( penWidth(), 1 );

    // pos indicates a border not the center of the backbone line
    // so we need to shift its position depending on the pen width
    // and the alignment of the scale

    double off;
    if ( doAlign )
    {
        if ( alignment() == LeftScale || alignment() == TopScale )
            off = ( pw - 1 ) / 2;
        else
            off = pw / 2;
    }
    else
    {
        off = 0.5 * penWidth();
    }

    switch ( alignment() )
    {
        case LeftScale:
        {
            double x = pos.x() - off;
            if ( doAlign )
                x = qRound( x );

            QwtPainter::drawLine( painter, x, pos.y(), x, pos.y() + len );
            break;
        }
        case RightScale:
        {
            double x = pos.x() + off;
            if ( doAlign )
                x = qRound( x );

            QwtPainter::drawLine( painter, x, pos.y(), x, pos.y() + len );
            break;
        }
        case TopScale:
        {
            double y = pos.y() - off;
            if ( doAlign )
                y = qRound( y );

            QwtPainter::drawLine( painter, pos.x(), y, pos.x() + len, y );
            break;
        }
        case BottomScale:
        {
            double y = pos.y() + off;
            if ( doAlign )
                y = qRound( y );

            QwtPainter::drawLine( painter, pos.x(), y, pos.x() + len, y );
            break;
        }
    }
}
コード例 #20
0
/*!
   Draw a tick

   \param painter Painter
   \param value Value of the tick
   \param len Lenght of the tick

   \sa drawBackbone(), drawLabel()
*/
void QwtScaleDraw::drawTick( QPainter *painter, double value, double len ) const
{
    if ( len <= 0 )
        return;

    const bool roundingAlignment = QwtPainter::roundingAlignment( painter );

    QwtScaleMap scaleMap = map();
    QPointF pos = d_data->pos;

    double tval = scaleMap.transform( value );
    if ( roundingAlignment )
        tval = qRound( tval );

    const int pw = penWidth();
    int a = 0;
    if ( pw > 1 && roundingAlignment )
        a = 1;

    switch ( alignment() )
    {
        case LeftScale:
        {
            double x1 = pos.x() + a;
            double x2 = pos.x() + a - pw - len;
            if ( roundingAlignment )
            {
                x1 = qRound( x1 );
                x2 = qRound( x2 );
            }

            QwtPainter::drawLine( painter, x1, tval, x2, tval );
            break;
        }

        case RightScale:
        {
            double x1 = pos.x();
            double x2 = pos.x() + pw + len;
            if ( roundingAlignment )
            {
                x1 = qRound( x1 );
                x2 = qRound( x2 );
            }

            QwtPainter::drawLine( painter, x1, tval, x2, tval );
            break;
        }

        case BottomScale:
        {
            double y1 = pos.y();
            double y2 = pos.y() + pw + len;
            if ( roundingAlignment )
            {
                y1 = qRound( y1 );
                y2 = qRound( y2 );
            }

            QwtPainter::drawLine( painter, tval, y1, tval, y2 );
            break;
        }

        case TopScale:
        {
            double y1 = pos.y() + a;
            double y2 = pos.y() - pw - len + a;
            if ( roundingAlignment )
            {
                y1 = qRound( y1 );
                y2 = qRound( y2 );
            }

            QwtPainter::drawLine( painter, tval, y1, tval, y2 );
            break;
        }
    }
}