Example #1
0
void tst_QLine::testSet()
{
    {
        QLine l;
        l.setP1(QPoint(1, 2));
        l.setP2(QPoint(3, 4));

        QCOMPARE(l.x1(), 1);
        QCOMPARE(l.y1(), 2);
        QCOMPARE(l.x2(), 3);
        QCOMPARE(l.y2(), 4);

        l.setPoints(QPoint(5, 6), QPoint(7, 8));
        QCOMPARE(l.x1(), 5);
        QCOMPARE(l.y1(), 6);
        QCOMPARE(l.x2(), 7);
        QCOMPARE(l.y2(), 8);

        l.setLine(9, 10, 11, 12);
        QCOMPARE(l.x1(), 9);
        QCOMPARE(l.y1(), 10);
        QCOMPARE(l.x2(), 11);
        QCOMPARE(l.y2(), 12);
    }

    {
        QLineF l;
        l.setP1(QPointF(1, 2));
        l.setP2(QPointF(3, 4));

        QCOMPARE(l.x1(), 1.0);
        QCOMPARE(l.y1(), 2.0);
        QCOMPARE(l.x2(), 3.0);
        QCOMPARE(l.y2(), 4.0);

        l.setPoints(QPointF(5, 6), QPointF(7, 8));
        QCOMPARE(l.x1(), 5.0);
        QCOMPARE(l.y1(), 6.0);
        QCOMPARE(l.x2(), 7.0);
        QCOMPARE(l.y2(), 8.0);

        l.setLine(9.0, 10.0, 11.0, 12.0);
        QCOMPARE(l.x1(), 9.0);
        QCOMPARE(l.y1(), 10.0);
        QCOMPARE(l.x2(), 11.0);
        QCOMPARE(l.y2(), 12.0);
    }

}
Example #2
0
QPointF Edge::qualityTextPoint(const QLineF &linePos) {
	QPointF middlePoint;
	middlePoint.setX((linePos.x1() + linePos.x2()) / 2);
	middlePoint.setY((linePos.y1() + linePos.y2()) / 2);
	middlePoint.setY(middlePoint.y()-20);
	return middlePoint;
}
Example #3
0
void MainWindow::drawLine(double rangle, int i,int n,int x2, int y2, double length, double angle, QGraphicsScene *scene)
{
    //base case, we recurse back out once this condition reached
    if (i == n)
        return;
    else{
        //create new line, based on previously drawn line
        QLineF q2;
        q2.setP1(QPointF(x2,y2));
        q2.setLength(length*.95);
        q2.setAngle(angle +rangle);
        scene->addLine(q2);
        QLineF q3;
        q3.setP1(QPointF(x2,y2));
        q3.setLength(length*.95);
        q3.setAngle(angle -rangle);
        scene->addLine(q3);
        QLineF q;
        q.setP1(QPointF(x2,y2));
        q.setLength(length*.95);
        q.setAngle(angle);
        scene->addLine(q);
        ui->graphicsView->setScene(scene);
        x2 = q.x2();
        y2 = q.y2();
        i = i+1;
        //call drawLine again, using new values
        drawLine(rangle, i,n,x2,y2,q.length(),q.angle(), scene);
    }
}
void QgsComposerItem::setItemPosition( double x, double y, double width, double height, ItemPositionMode itemPoint, bool posIncludesFrame, int page )
{
  double upperLeftX = x;
  double upperLeftY = y;

  if ( page > 0 )
  {
    double h = composition()->paperHeight() + composition()->spaceBetweenPages();
    upperLeftY += ( page - 1 ) * h;
  }

  //store the item position mode
  mLastUsedPositionMode = itemPoint;

  //adjust x-coordinate if placement is not done to a left point
  if ( itemPoint == UpperMiddle || itemPoint == Middle || itemPoint == LowerMiddle )
  {
    upperLeftX -= width / 2.0;
  }
  else if ( itemPoint == UpperRight || itemPoint == MiddleRight || itemPoint == LowerRight )
  {
    upperLeftX -= width;
  }

  //adjust y-coordinate if placement is not done to an upper point
  if ( itemPoint == MiddleLeft || itemPoint == Middle || itemPoint == MiddleRight )
  {
    upperLeftY -= height / 2.0;
  }
  else if ( itemPoint == LowerLeft || itemPoint == LowerMiddle || itemPoint == LowerRight )
  {
    upperLeftY -= height;
  }

  if ( posIncludesFrame )
  {
    //adjust position to account for frame size

    if ( mItemRotation == 0 )
    {
      upperLeftX += estimatedFrameBleed();
      upperLeftY += estimatedFrameBleed();
    }
    else
    {
      //adjust position for item rotation
      QLineF lineToItemOrigin = QLineF( 0, 0, estimatedFrameBleed(), estimatedFrameBleed() );
      lineToItemOrigin.setAngle( -45 - mItemRotation );
      upperLeftX += lineToItemOrigin.x2();
      upperLeftY += lineToItemOrigin.y2();
    }

    width -= 2 * estimatedFrameBleed();
    height -= 2 * estimatedFrameBleed();
  }

  setSceneRect( QRectF( upperLeftX, upperLeftY, width, height ) );
}
QRectF UBGeometryUtils::lineToInnerRect(const QLineF& pLine, const qreal& pWidth)
{
    qreal centerX = (pLine.x1() + pLine.x2()) / 2;
    qreal centerY = (pLine.y1() + pLine.y2()) / 2;

    qreal side = sqrt((pWidth * pWidth) / 2);
        qreal halfSide = side / 2;

    return QRectF(centerX - halfSide, centerY - halfSide, side, side);
}
Example #6
0
void QTableManager::EUpdate(QgraphicsItemTable *table, qreal Vx, qreal Vy)
    {
        QRectF *up = new QRectF(table->GetUpRect());
        QRectF *down = new QRectF(table->GetDownRect());
        QRectF *right = new QRectF(table->GetRightRect());
        QRectF *left = new QRectF(table->GetLeftRect());


        //QPointF  sbottom = sec->bottomRight()
        for ( int i = 0 ; i<ProjectData->NodeCount();i++){

            QLineF line = ProjectData->getNode(i)->link->line();

            QPointF *point  = new QPointF(line.x1(),line.y1());
            QPointF *point2 = new QPointF(line.x2(),line.y2());
           qreal xbottom = 0 ;
           qreal ybottom  = 0 ;

            if (ProjectData->getNode(i)->start==table){

                            xbottom = point->x();
                            ybottom = point->y();

                          //  ProjectData->getNode(i)->link->setLine(xbottom,ybottom,point2->x(),point2->y());
                        }
            if (ProjectData->getNode(i)->end==table){
                            xbottom = point2->x();
                            ybottom = point2->y();
                            //xbottom = (bottom.x()*xbottom)/(bottom.x()+Vx);
                          //  ybottom = (bottom.y()*ybottom)/(bottom.y()+Vy);
                           // ProjectData->getNode(i)->link->setLine(point->x(),point->y(),point2->x()+Vx,point2->y()+Vy);
                            }
            if ((xbottom!=0 || ybottom !=0)){
                if (right->contains(*point)||right->contains(*point2) ){
                    xbottom+=Vx;
                    // y media.
                }
                if (up->contains(*point)|| up->contains(*point2)){
                    // media x

                }
                if (down->contains(*point)|| down->contains(*point2)){
                    // media x
                    ybottom +=Vy;
                }
               if (left->contains(*point)||left->contains(*point2) ){
                   // media y.
            }
               if (ProjectData->getNode(i)->end==table)
            ProjectData->getNode(i)->link->setLine(point->x(),point->y(),point2->x()+Vx/2,point2->y()+Vy/2);
            else
            ProjectData->getNode(i)->link->setLine(xbottom,ybottom,point2->x(),point2->y());
            }
}
}
QPointF LineObject::objectEndPoint2() const
{
    QLineF lyne = line();
    qreal rot = radians(rotation());
    qreal cosRot = qCos(rot);
    qreal sinRot = qSin(rot);
    qreal x2 = lyne.x2()*scale();
    qreal y2 = lyne.y2()*scale();
    qreal rotEnd2X = x2*cosRot - y2*sinRot;
    qreal rotEnd2Y = x2*sinRot + y2*cosRot;

    return (scenePos() + QPointF(rotEnd2X, rotEnd2Y));
}
Example #8
0
void GraphViewer::onSceneMouseRelease(QGraphicsSceneMouseEvent *mouseEvent)
{

    // need to put the connecting line on the background otherwise it is detected under the mouse
    _drawingEdge->setZValue(EDGE_LINE_Z);

    QGraphicsItem * item = _scene.itemAt(mouseEvent->scenePos(), QTransform());
    if (qgraphicsitem_cast<QGraphicsEllipseItem*>(item)
            || qgraphicsitem_cast<QGraphicsSimpleTextItem*>(item))
    {
        QGraphicsEllipseItem* vertex = qgraphicsitem_cast<QGraphicsEllipseItem*>(item->parentItem());
        if (!vertex)
            vertex = qgraphicsitem_cast<QGraphicsEllipseItem*>(item);

        if (vertex)
        {
            double x = _drawingEdge->transform().dx();
            double y = _drawingEdge->transform().dy();
            _drawingEdge->setLine(0.0,0.0, vertex->scenePos().x()-x, vertex->scenePos().y()-y);
            _drawingEdge->setZValue(EDGE_LINE_Z);

            if (_drawingEdge->data(KEY_EDGE_VERTEX1) == vertex->data(KEY_EDGE_VERTEX1))
                _scene.removeItem(_drawingEdge);
            else
            {
                int defaultWeight = 1;
                _drawingEdge->setData(KEY_EDGE_VERTEX2, vertex->data(KEY_VERTEX_ID));
                _drawingEdge->setData(KEY_EDGE_WEIGHT, defaultWeight);
                // draw edge weight
                QGraphicsSimpleTextItem * edgeWeight = _scene.addSimpleText(QString("%1").arg(defaultWeight));
                edgeWeight->setParentItem(_drawingEdge);
                edgeWeight->setBrush(Qt::blue);
                QLineF line = _drawingEdge->line();
                edgeWeight->setTransform(
                            QTransform::fromScale(0.005, 0.005)
                            * QTransform::fromTranslate(line.x2()*0.5, line.y2()*0.5)
                            );
                edgeWeight->setZValue(EDGE_TEXT_Z);
                // add to graph edges
                _edges << _drawingEdge;
            }
        }
    }
    else
    {
        _scene.removeItem(_drawingEdge);
    }
    _isDrawingEdge=false;
    _drawingEdge=0;
}
static QLineF preciselyMap( const QTransform& transform, const QLineF& line )
{
    qreal fx1 = line.x1();
    qreal fy1 = line.y1();
    qreal fx2 = line.x2();
    qreal fy2 = line.y2();

    qreal x1 = transform.m11() * fx1 + transform.m21() * fy1 + transform.dx();
    qreal y1 = transform.m12() * fx1 + transform.m22() * fy1 + transform.dy();
    qreal x2 = transform.m11() * fx2 + transform.m21() * fy2 + transform.dx();
    qreal y2 = transform.m12() * fx2 + transform.m22() * fy2 + transform.dy();

    return QLineF( x1, y1, x2, y2 );
}
Example #10
0
void PSV_ChartItem::updateCurrentMes(const QPointF &point)
{
    QLineF vLine = m_vLineItem->line();
    vLine.setP1(QPointF(point.x(),vLine.y1()));
    vLine.setP2(QPointF(point.x(),vLine.y2()));
    m_vLineItem->setLine(vLine);

    QLineF hLine = m_hLineItem->line();
    hLine.setP1(QPointF(hLine.x1(),point.y()));
    hLine.setP2(QPointF(hLine.x2(),point.y()));
    m_hLineItem->setLine(hLine);

    m_currentMesItem->setHtml(getCurrentHtmMes(point.x()));
    m_currentMesItem->setPos(point.x(),point.y()+10);
}
Example #11
0
void tst_QLine::testAngle2()
{
    QFETCH(qreal, x1);
    QFETCH(qreal, y1);
    QFETCH(qreal, x2);
    QFETCH(qreal, y2);
    QFETCH(qreal, angle);

    QLineF line(x1, y1, x2, y2);
    QCOMPARE(line.angle(), angle);

    QLineF polar = QLineF::fromPolar(line.length(), angle);

    QVERIFY(qAbs(line.x1() - polar.x1()) < epsilon);
    QVERIFY(qAbs(line.y1() - polar.y1()) < epsilon);
    QVERIFY(qAbs(line.x2() - polar.x2()) < epsilon);
    QVERIFY(qAbs(line.y2() - polar.y2()) < epsilon);
}
Example #12
0
void WatchPaintEngine::damagePenStroke(const QLineF &line)
{
	if (!_hasPen) return;

	const qreal a = line.angle();
	const qreal sn = sinf(a);
	const qreal cs = cosf(a);
	const qreal w = _penWidth == 0.0 ? 1.0 : _penWidth;
	const qreal x1 = line.x1();
	const qreal x2 = line.x2();
	const qreal y1 = line.y1();
	const qreal y2 = line.y2();

	QPointF p1(x1-(w*sn/2.0f), y1+(w*cs/2.0f));
	QPointF p2(x2+(w*sn/2.0f), y2-(w*cs/2.0f));
	QRectF r = QRectF(p1, p2).normalized();
	damageRect(r);
}
Example #13
0
qreal PortHandler::nearestPointOfLinePort(int linePortNumber, QPointF const &location) const
{
	qreal nearestPointOfLinePort = 0;
	QLineF linePort = transformPortForNodeSize(mLinePorts[linePortNumber]);
	qreal const y1 = linePort.y1();
	qreal const y2 = linePort.y2();
	qreal const x1 = linePort.x1();
	qreal const x2 = linePort.x2();

	if (x1 == x2) {
		nearestPointOfLinePort = (location.y() - y1) / (y2 - y1);
	} else if (y1 == y2) {
		nearestPointOfLinePort = (location.x() - x1) / (x2 - x1);
	} else {
		qreal const k = (y2 - y1) / (x2 - x1);
		qreal const b2 = location.y() + 1 / k * location.x();
		qreal const b = y1 - k * x1;
		qreal const x3 = k / (1 + k * k) * (b2 - b);
		nearestPointOfLinePort = (x3 - x1) / (x2 - x1);
	}
	return nearestPointOfLinePort;
}
Example #14
0
QPolygonF UBGeometryUtils::lineToPolygon(const QLineF& pLine, const qreal& pWidth)
{
    qreal x1 = pLine.x1();
    qreal y1 = pLine.y1();

    qreal x2 = pLine.x2();
    qreal y2 = pLine.y2();

    qreal alpha = (90.0 - pLine.angle()) * PI / 180.0;
    qreal hypothenuse = pWidth / 2;

    // TODO UB 4.x PERF cache sin/cos table
    qreal opposite = sin(alpha) * hypothenuse;
    qreal adjacent = cos(alpha) * hypothenuse;

    QPointF p1a(x1 - adjacent, y1 - opposite);
    QPointF p1b(x1 + adjacent, y1 + opposite);

    QPointF p2a(x2 - adjacent, y2 - opposite);
    QPointF p2b(x2 + adjacent, y2 + opposite);

    QPainterPath painterPath;

    painterPath.moveTo(p1a);
    painterPath.lineTo(p2a);

    painterPath.arcTo(x2 - hypothenuse, y2 - hypothenuse, pWidth, pWidth, (90.0 + pLine.angle()), -180.0);

    //painterPath.lineTo(p2b);
    painterPath.lineTo(p1b);

    painterPath.arcTo(x1 - hypothenuse, y1 - hypothenuse, pWidth, pWidth, -1 * (90.0 - pLine.angle()), -180.0);

    painterPath.closeSubpath();

    return painterPath.toFillPolygon();
}
Example #15
0
static bool lineYLessThan(const QLineF &firstLine, const QLineF &secondLine)
{
    return firstLine.y1() < secondLine.y2();
}
Example #16
0
void QgsAnnotationItem::updateBalloon()
{
  //first test if the point is in the frame. In that case we don't need a balloon.
  if ( !mMapPositionFixed ||
       ( mOffsetFromReferencePoint.x() < 0 && ( mOffsetFromReferencePoint.x() + mFrameSize.width() ) > 0
         && mOffsetFromReferencePoint.y() < 0 && ( mOffsetFromReferencePoint.y() + mFrameSize.height() ) > 0 ) )
  {
    mBalloonSegment = -1;
    return;
  }

  //edge list
  QList<QLineF> segmentList;
  segmentList << segment( 0 );
  segmentList << segment( 1 );
  segmentList << segment( 2 );
  segmentList << segment( 3 );

  //find  closest edge / closest edge point
  double minEdgeDist = DBL_MAX;
  int minEdgeIndex = -1;
  QLineF minEdge;
  QgsPoint minEdgePoint;
  QgsPoint origin( 0, 0 );

  for ( int i = 0; i < 4; ++i )
  {
    QLineF currentSegment = segmentList.at( i );
    QgsPoint currentMinDistPoint;
    double currentMinDist = origin.sqrDistToSegment( currentSegment.x1(), currentSegment.y1(), currentSegment.x2(), currentSegment.y2(), currentMinDistPoint );
    if ( currentMinDist < minEdgeDist )
    {
      minEdgeIndex = i;
      minEdgePoint = currentMinDistPoint;
      minEdgeDist = currentMinDist;
      minEdge = currentSegment;
    }
  }

  if ( minEdgeIndex < 0 )
  {
    return;
  }

  //make that configurable for the item
  double segmentPointWidth = 10;

  mBalloonSegment = minEdgeIndex;
  QPointF minEdgeEnd = minEdge.p2();
  mBalloonSegmentPoint1 = QPointF( minEdgePoint.x(), minEdgePoint.y() );
  if ( sqrt( minEdgePoint.sqrDist( minEdgeEnd.x(), minEdgeEnd.y() ) ) < segmentPointWidth )
  {
    mBalloonSegmentPoint1 = pointOnLineWithDistance( minEdge.p2(), minEdge.p1(), segmentPointWidth );
  }

  mBalloonSegmentPoint2 = pointOnLineWithDistance( mBalloonSegmentPoint1, minEdge.p2(), 10 );
}
Example #17
0
void TOSMWidget::drawLine(QPainter &painter, QLineF line)
{
    painter.drawLine(w2s_x(line.x1()), w2s_y(line.y1()), w2s_x(line.x2()), w2s_y(line.y2()));
}
WWorldLineF transform(const QLineF& line)
{
	return WWorldLineF(line.x1(), line.y1(), line.x2(), line.y2());
}
Example #19
0
void tst_QLine::testIntersection_data()
{
    QTest::addColumn<double>("xa1");
    QTest::addColumn<double>("ya1");
    QTest::addColumn<double>("xa2");
    QTest::addColumn<double>("ya2");
    QTest::addColumn<double>("xb1");
    QTest::addColumn<double>("yb1");
    QTest::addColumn<double>("xb2");
    QTest::addColumn<double>("yb2");
    QTest::addColumn<int>("type");
    QTest::addColumn<double>("ix");
    QTest::addColumn<double>("iy");

    QTest::newRow("parallel") << 1.0 << 1.0 << 3.0 << 4.0
                           << 5.0 << 6.0 << 7.0 << 9.0
                           << int(QLineF::NoIntersection) << 0.0 << 0.0;
    QTest::newRow("unbounded") << 1.0 << 1.0 << 5.0 << 5.0
                            << 0.0 << 4.0 << 3.0 << 4.0
                            << int(QLineF::UnboundedIntersection) << 4.0 << 4.0;
    QTest::newRow("bounded") << 1.0 << 1.0 << 5.0 << 5.0
                          << 0.0 << 4.0 << 5.0 << 4.0
                          << int(QLineF::BoundedIntersection) << 4.0 << 4.0;

    QTest::newRow("almost vertical") << 0.0 << 10.0 << 20.0000000000001 << 10.0
                                     << 10.0 << 0.0 << 10.0 << 20.0
                                     << int(QLineF::BoundedIntersection) << 10.0 << 10.0;

    QTest::newRow("almost horizontal") << 0.0 << 10.0 << 20.0 << 10.0
                                       << 10.0000000000001 << 0.0 << 10.0 << 20.0
                                       << int(QLineF::BoundedIntersection) << 10.0 << 10.0;

    QTest::newRow("long vertical") << 100.1599256468623
                                   << 100.7861905065196
                                   << 100.1599256468604
                                   << -9999.78619050651
                                   << 10.0 << 50.0 << 190.0 << 50.0
                                   << int(QLineF::BoundedIntersection)
                                   << 100.1599256468622
                                   << 50.0;

    QLineF baseA(0, -50, 0, 50);
    QLineF baseB(-50, 0, 50, 0);

    for (int i = 0; i < 1000; ++i) {
        QLineF a = QLineF::fromPolar(50, i);
        a.setP1(-a.p2());

        QLineF b = QLineF::fromPolar(50, i * 0.997 + 90);
        b.setP1(-b.p2());

        // make the qFuzzyCompare be a bit more lenient
        a = a.translated(1, 1);
        b = b.translated(1, 1);

        QTest::newRow(("rotation-" + QByteArray::number(i)).constData())
            << (double)a.x1() << (double)a.y1() << (double)a.x2() << (double)a.y2()
            << (double)b.x1() << (double)b.y1() << (double)b.x2() << (double)b.y2()
            << int(QLineF::BoundedIntersection)
            << 1.0
            << 1.0;
    }
}
Example #20
0
/*!
 * \brief Places a line into given rectangle
 * \param the line
 * \param the rectangle
 * \return QLineF beginning and ending at the edges of the rectangle.
 */
QLineF GT::intersectLineRect(const QLineF &st, const QRectF &rect) {
  QLineF start = st;
  QPointF iss[3];
  int i = 0;
  // Půlnoční velkorysý odhad:
  double longEnough = fabs(rect.bottom()) + fabs(rect.top()) + fabs(rect.left()) + fabs(rect.right()) + fabs(start.x1()) + fabs(start.x2()) + fabs(start.y1()) + fabs(start.y2());
  start.setLength(longEnough);
  if (QLineF::BoundedIntersection == start.intersect(QLineF(rect.bottomLeft(),rect.bottomRight()), iss + i)) i++;
  if (QLineF::BoundedIntersection == start.intersect(QLineF(rect.bottomLeft(),rect.topLeft()), iss + i)) i++;
  if (QLineF::BoundedIntersection == start.intersect(QLineF(rect.topRight(),rect.bottomRight()), iss + i)) i++;
  if (QLineF::BoundedIntersection == start.intersect(QLineF(rect.topRight(),rect.topLeft()), iss + i)) i++;

  start.setLength(-longEnough);
  if (QLineF::BoundedIntersection == start.intersect(QLineF(rect.bottomLeft(),rect.bottomRight()), iss + i)) i++;
  if (QLineF::BoundedIntersection == start.intersect(QLineF(rect.bottomLeft(),rect.topLeft()), iss + i)) i++;
  if (QLineF::BoundedIntersection == start.intersect(QLineF(rect.topRight(),rect.bottomRight()), iss + i)) i++;
  if (QLineF::BoundedIntersection == start.intersect(QLineF(rect.topRight(),rect.topLeft()), iss + i)) i++;

  if (2 == i)
    return QLineF(iss[0],iss[1]);
  else return QLineF();
}
Example #21
0
QTCEXPORT(void,qtc_QGraphicsLineItem_line_qth)(void* x0, double* _ret_x1, double* _ret_y1, double* _ret_x2, double* _ret_y2) {
  QLineF tc = ((QGraphicsLineItem*)x0)->line();
  *_ret_x1 = tc.x1(); *_ret_y1 = tc.y1(); *_ret_x2 = tc.x2(); *_ret_y2 = tc.y2();
  return;
}
Example #22
0
void PSV_Public::printMes(const QVariant &mes, const QString &frefix)
{    
    QString message;
    int type = mes.type();
    switch(type)
    {
    case QVariant::Bool :
        message = mes.toBool() ? "true":"false";
        break;
    case QVariant::Color :
    {
        QColor color = mes.value<QColor>();
        message = QObject::tr("colorname:%1,r=%2,g=%3,b=%4")
                .arg(color.name())
                .arg(color.red())
                .arg(color.green())
                .arg(color.blue());
    }
        break;
    case QVariant::Date:
        message = mes.toDate().toString("yyyy-MM-dd");
        break;
    case QVariant::DateTime:
        message = mes.toDateTime().toString("yyyy-MM-dd hh:mm:ss");
        break;
    case QVariant::Double:
        message = QString::number(mes.toDouble());
        break;
    case QVariant::UInt:
    case QVariant::Int:
        message = QString::number(mes.toInt());
        break;
    case QVariant::ULongLong:
    case QVariant::LongLong:
        message = QString::number(mes.toLongLong());
        break;
    case QVariant::Line:
    {
        QLine line = mes.toLine();
        message = QObject::tr("Line x1=%1,y1=%2,x2=%3,y2=%4")
                .arg(line.x1()).arg(line.y1()).arg(line.x2()).arg(line.y2());
    }
        break;
    case QVariant::LineF:
    {
        QLineF lineF = mes.toLineF();
        message = QObject::tr("LineF x1=%1,y1=%2,x2=%3,y2=%4")
                .arg(lineF.x1()).arg(lineF.y1()).arg(lineF.x2()).arg(lineF.y2());
    }
        break;
    case QVariant::Point:
    {
        QPoint point = mes.toPoint();
        message = QObject::tr("point x=%1,y=%2")
                .arg(point.x()).arg(point.y());
    }
        break;
    case QVariant::PointF:
    {
        QPointF pointF = mes.toPointF();
        message = QObject::tr("pointF x=%1,y=%2")
                .arg(pointF.x()).arg(pointF.y());
    }
        break;
    case QVariant::Rect:
    {
        QRect rect = mes.toRect();
        message = QObject::tr("rect x=%1,y=%2,width=%3,height=%4")
                .arg(rect.x()).arg(rect.y()).arg(rect.width()).arg(rect.height());
    }
        break;
    case QVariant::RectF:
    {
        QRectF rectF = mes.toRect();
        message = QObject::tr("rectF x=%1,y=%2,width=%3,height=%4")
                .arg(rectF.x()).arg(rectF.y()).arg(rectF.width()).arg(rectF.height());
    }
        break;

    default:
        message = QObject::tr("type = %1,<%2>").arg(type).arg(mes.toString());
        break;
    }
    QString outMes = QObject::tr("%1 %2").arg(frefix).arg(message);

    qDebug()<<QObject::tr("PSV_LIB:<%1>%2").arg(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss")).arg(outMes);
}