[PyQt] Re: QGraphicsScene addLine,
addRect draw order scrambled in Qt 4.4.3 on mac ?
denis
denis-bz-py at t-online.de
Tue Jun 9 10:41:37 BST 2009
bug: some addLines are hidden by previous addRects in Qt 4.4.3 + mac too,
differently in C and PyQt. The C testcase is below, please forward
(Nokia doesn't seem to respond to bugs that don't show up on handys :)
Thanks, cheers
// QGraphicsScene: some addLines are hidden by previous addRects
// C: 150 line under most rects, others ok
// pyqt: 0 120 150
// qt-mac-opensource-src-4.4.3 PyQt-mac-gpl-4.4.4 macosx 10.4.11, ppc, GEForce2
// denis-bz-py at t-online.de 9jun
#include <cmath>
#include <QtGui>
int main( int argc, char* argv[] )
{
qDebug() << "qVersion:" << qVersion();
QApplication app( argc, argv );
// zz.eqargs( ++ argv ); // args test=1 x=3 ... => Zval( x ) ...
int Size = 10;
int x0 = -500, y0 = -500, x1 = 500, y1 = 500;
QRectF scenerect( x0, y0, x1, y1 );
QGraphicsScene* scene = new QGraphicsScene( scenerect );
QGraphicsView* view = new QGraphicsView( scene );
view->centerOn( 0, 0 ); // ?
for( int j = x0/2; j < x1/2; j += Size ){
for( int k = y0/2; k < y1/2; k += Size ){
scene->addRect( j, k, Size-1, Size-1, Qt::NoPen, QBrush( "palegreen" ));
}
}
for( int angle = 0; angle < 180; angle += 30 ){
float c = cos( angle * M_PI / 180 ) * x1;
float s = sin( angle * M_PI / 180 ) * y1;
scene->addLine( -c, -s, c, s, QPen( "black" ));
}
view->show();
return app.exec();
}
More information about the PyQt
mailing list