Results 1 to 3 of 3

Thread: QMatrix rotate on QGraphicsTextItem speed on render..

  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

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QMatrix rotate on QGraphicsTextItem speed on render..

    I don't know about the others, but at least I can't really make sense of what you wrote (English). (Did you use an automated translation software?)
    Could you try to restate the question?
    What I understand is that you have two problems, one that has to do with QProcess, and the other with timing of the transformation, but other then that I really don't understand what the actual problem is.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

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

    Default Re: QMatrix rotate on QGraphicsTextItem speed on render..

    Tanks i resolve this , with adding a small hack ... && wake-up QGraphicsView speed
    to rotate elements and item....

    if qApp->processEvents() or scaleView resolve the problem, i dont know..

    now QProcess from the first application sender make correct job and grab pdf...


    Qt Code:
    1. /* if start main apps having a direct order to generate pdf.. from fop file
    2.   like apache Fop command to render direct file .
    3.   http://xmlgraphics.apache.org/fop/0.94/running.html
    4.   */
    5.  
    6. if (order_args_pdf_from_main.size() > 0) {
    7. Current_file_from_Main_to_PDF = order_args_pdf_from_main;
    8. /* wait to rotate layer! :-) */
    9. PrePareToprintPaint(); /* remove drag, hover and move borders by edit */
    10. scaleView(0.46); /* wake up all rotate elements */
    11. qApp->processEvents();
    12. PrePareToprintPaint();
    13. scaleView(1.01); //// QGraphicsView
    14. QTimer::singleShot(800, this, SLOT(PrintPdfCurrentMainFile()));
    15. }
    To copy to clipboard, switch view to plain text mode 

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.