On Thu, Sep 26, 2002 at 03:16:20PM -0400, Miller, Douglas K (JFTI) wrote: > If you have created an object of type QCanvasText, how do you orient the > text vertically instead of horizontally? I've tried researching it, but I'm > got no where. Thanks. >
The solution I found in Qt's documentation is the usage of a 2D transformation performed through a QWMatrix class. You can see here how it acts upon a Widget. Below there is a hint about applying a QWMatrix to a QPixmap. I don't think you can directly use a Matrix upon a Canvas Item but you might transform the string when it has been drawn into a pixmap, which than can be used as a QCanvasPixmap. MyWidget::paintEvent( QPaintEvent * ) { QPainter p; // our painter QWMatrix m; // our transformation matrix m.rotate( 22.5 ); // rotated coordinate system p.begin( this ); // start painting p.setWorldMatrix( m ); // use rotated coordinate system p.drawText( 30,20, "detator" ); // draw rotated text at 30,20 p.end(); // painting done } A matrix specifies how to translate, scale, shear or rotate the graphics; the actual transformation is performed by the drawing routines in QPainter and by QPixmap::xForm(). BYE INGO > _______________________________________________ > PyKDE mailing list [EMAIL PROTECTED] > http://mats.gmd.de/mailman/listinfo/pykde > _______________________________________________ PyKDE mailing list [EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde