PDA

View Full Version : QMatrix rotate on QGraphicsTextItem speed on render..



patrik08
20th December 2007, 19:25
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.com/svn/trunk/fop_miniscribus.1.0.0/ miniscribus





void FloatDiagram::paint(QPainter *painter,const QStyleOptionGraphicsItem *option,QWidget *widget)
{
/* QColor ground; */
const QPointF obsect = QPointF(wi/2,hi/2);
painter->setRenderHint(QPainter::Antialiasing, true);
painter->setBrush(QBrush(BGColor));
QPen pen;
if (modus == M_HOVER) {
if (PaintLockStaus) {
pen.setStyle( Qt::DotLine );
pen.setWidth( 2 );
pen.setColor( Qt::red );
painter->setPen( pen);
painter->drawRect(boundingRect());
}
} else if (modus == M_MOVE_ALL) {
if (PaintLockStaus) {
pen.setStyle( Qt::DotLine );
pen.setWidth( 2 );
pen.setColor( Qt::red );
painter->setPen( pen);
painter->drawRect(boundingRect());
}
}
if (BorderDicks > 0) {
pen.setStyle( Qt::SolidLine );
pen.setWidth( BorderDicks );
pen.setColor(MarginColor);
painter->setPen(pen);
} else {
painter->setPen(Qt::NoPen);
}
painter->setBrush(QBrush(BGColor));
painter->drawRect(boundingRect());


if (PaintLockStaus) {
if (modus == M_LOCK) {
painter->drawPixmap(QPointF (wi - 18,3),QPixmap(":/img/lock_0.png"));
}
if (modus == M_WRITTELN) {
painter->drawPixmap(QPointF (wi - 18,3),QPixmap(":/img/_writteln.png"));
}
}

setTransform(ActualMatrixe(BoxRotate),false);

if (BorderDicks < 1) {
painter->setPen(Qt::NoPen);
}
setToolTip(DefaultMessage);
QGraphicsTextItem::paint(painter,option,widget);
}

QTransform FloatDiagram::ActualMatrixRotate( int r )
{
QMatrix matrix;
matrix.translate ( boundingRect().center().x() , boundingRect().center().y() );
matrix.rotate(r);
matrix.translate ( - boundingRect().center().x() , - boundingRect().center().y() );
return QTransform(matrix);
}

high_flyer
21st December 2007, 10:02
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.

patrik08
22nd December 2007, 19:46
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..:rolleyes:

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




/* if start main apps having a direct order to generate pdf.. from fop file
like apache Fop command to render direct file .
http://xmlgraphics.apache.org/fop/0.94/running.html
*/

if (order_args_pdf_from_main.size() > 0) {
Current_file_from_Main_to_PDF = order_args_pdf_from_main;
/* wait to rotate layer! :-) */
PrePareToprintPaint(); /* remove drag, hover and move borders by edit */
scaleView(0.46); /* wake up all rotate elements */
qApp->processEvents();
PrePareToprintPaint();
scaleView(1.01); //// QGraphicsView
QTimer::singleShot(800, this, SLOT(PrintPdfCurrentMainFile()));
}