Results 1 to 3 of 3

Thread: QMatrix rotate on QGraphicsTextItem speed on render..

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QMatrix rotate on QGraphicsTextItem speed on render..

    I render direct a XML file to pdf on MiniScribus ( http://code.google.com/p/fop-miniscribus/ ) from the application A i call a QProcess to Application B MiniScribus... all work fine but all QMatrix rotate 90° not become time to make its.... why? is the a signal if QGraphicsTextItem as successful rotate?

    i call only
    QStringList cmd;
    #if defined Q_WS_WIN
    cmd.append("\""+Foppath+"\"");
    cmd.append("-pdf");
    cmd.append("\""+fopresultpdf+"\"");
    cmd.append("\""+fopdestination+"\"");
    #else
    cmd.append(Foppath);
    cmd.append("-pdf");
    cmd.append(fopresultpdf);
    cmd.append(fopdestination);
    #endif

    from the application A ... i tested to grep pdf after 1 Min. ... the result is same as 0.01 Min.... why?

    IMO svn source:
    svn co http://fop-miniscribus.googlecode.co...scribus.1.0.0/ miniscribus


    Qt Code:
    1. void FloatDiagram::paint(QPainter *painter,const QStyleOptionGraphicsItem *option,QWidget *widget)
    2. {
    3. /* QColor ground; */
    4. const QPointF obsect = QPointF(wi/2,hi/2);
    5. painter->setRenderHint(QPainter::Antialiasing, true);
    6. painter->setBrush(QBrush(BGColor));
    7. QPen pen;
    8. if (modus == M_HOVER) {
    9. if (PaintLockStaus) {
    10. pen.setStyle( Qt::DotLine );
    11. pen.setWidth( 2 );
    12. pen.setColor( Qt::red );
    13. painter->setPen( pen);
    14. painter->drawRect(boundingRect());
    15. }
    16. } else if (modus == M_MOVE_ALL) {
    17. if (PaintLockStaus) {
    18. pen.setStyle( Qt::DotLine );
    19. pen.setWidth( 2 );
    20. pen.setColor( Qt::red );
    21. painter->setPen( pen);
    22. painter->drawRect(boundingRect());
    23. }
    24. }
    25. if (BorderDicks > 0) {
    26. pen.setStyle( Qt::SolidLine );
    27. pen.setWidth( BorderDicks );
    28. pen.setColor(MarginColor);
    29. painter->setPen(pen);
    30. } else {
    31. painter->setPen(Qt::NoPen);
    32. }
    33. painter->setBrush(QBrush(BGColor));
    34. painter->drawRect(boundingRect());
    35.  
    36.  
    37. if (PaintLockStaus) {
    38. if (modus == M_LOCK) {
    39. painter->drawPixmap(QPointF (wi - 18,3),QPixmap(":/img/lock_0.png"));
    40. }
    41. if (modus == M_WRITTELN) {
    42. painter->drawPixmap(QPointF (wi - 18,3),QPixmap(":/img/_writteln.png"));
    43. }
    44. }
    45.  
    46. setTransform(ActualMatrixe(BoxRotate),false);
    47.  
    48. if (BorderDicks < 1) {
    49. painter->setPen(Qt::NoPen);
    50. }
    51. setToolTip(DefaultMessage);
    52. QGraphicsTextItem::paint(painter,option,widget);
    53. }
    54.  
    55. QTransform FloatDiagram::ActualMatrixRotate( int r )
    56. {
    57. QMatrix matrix;
    58. matrix.translate ( boundingRect().center().x() , boundingRect().center().y() );
    59. matrix.rotate(r);
    60. matrix.translate ( - boundingRect().center().x() , - boundingRect().center().y() );
    61. return QTransform(matrix);
    62. }
    To copy to clipboard, switch view to plain text mode 
    Attached Images Attached Images

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.