diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2024-07-15 19:08:22 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2024-07-18 09:31:41 +0900 |
commit | a30f5359f03c3017fa19a6770fab32d25d22cb87 (patch) | |
tree | cb365dd7a1c3666e3f972c6cad04be7b8e846cba /doc/coordsys.doc | |
parent | 25ad1267da6916e738a126ff5a9b41cd686adfc6 (diff) | |
download | tqt-a30f5359.tar.gz tqt-a30f5359.zip |
Rename graphics class nt* related files to equivalent tq* (part 1)
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'doc/coordsys.doc')
-rw-r--r-- | doc/coordsys.doc | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/doc/coordsys.doc b/doc/coordsys.doc index 8e4421fd9..05a3bf9e7 100644 --- a/doc/coordsys.doc +++ b/doc/coordsys.doc @@ -41,9 +41,9 @@ \title The Coordinate System -A \link QPaintDevice paint device\endlink in TQt is a drawable 2D +A \link TQPaintDevice paint device\endlink in TQt is a drawable 2D surface. \l TQWidget, \l QPixmap, \l QPicture and \l QPrinter are all -paint devices. A \l QPainter is an object which can draw on such +paint devices. A \l TQPainter is an object which can draw on such devices. The default coordinate system of a paint device has its origin at the @@ -62,9 +62,9 @@ The rectangle and the line were drawn by this code (with the grid added and colors touched up in the illustration): \code - void MyWidget::paintEvent( QPaintEvent * ) + void MyWidget::paintEvent( TQPaintEvent * ) { - QPainter p( this ); + TQPainter p( this ); p.setPen( darkGray ); p.drawRect( 1,2, 5,4 ); p.setPen( lightGray ); @@ -75,7 +75,7 @@ added and colors touched up in the illustration): Note that all of the pixels drawn by drawRect() are inside the size specified (5*4 pixels). This is different from some toolkits; in Qt the size you specify exactly encompasses the pixels drawn. This -applies to all the relevant functions in QPainter. +applies to all the relevant functions in TQPainter. Similarly, the drawLine() call draws both endpoints of the line, not just one. @@ -88,7 +88,7 @@ system: \row \i \l QPoint \i A single 2D point in the coordinate system. Most functions in Qt that deal with points can accept either a QPoint argument - or two ints, for example \l QPainter::drawPoint(). + or two ints, for example \l TQPainter::drawPoint(). \row \i \l TQSize \i A single 2D vector. Internally, QPoint and TQSize are the same, but a point is not the same as a size, so both classes exist. @@ -102,17 +102,17 @@ system: operations, e.g. \l QRegion::intersect(), and also a less usual function to return a list of rectangles whose union is equal to the region. QRegion is used e.g. by \l - QPainter::setClipRegion(), \l TQWidget::repaint() and \l - QPaintEvent::region(). -\row \i \l QPainter + TQPainter::setClipRegion(), \l TQWidget::repaint() and \l + TQPaintEvent::region(). +\row \i \l TQPainter \i The class that paints. It can paint on any device with the same code. There are differences between devices, \l - QPrinter::newPage() is a good example, but QPainter works the + QPrinter::newPage() is a good example, but TQPainter works the same way on all devices. -\row \i \l QPaintDevice - \i A device on which QPainter can paint. There are two internal +\row \i \l TQPaintDevice + \i A device on which TQPainter can paint. There are two internal devices, both pixel-based, and two external devices, \l - QPrinter and \l QPicture (which records QPainter commands to a + QPrinter and \l QPicture (which records TQPainter commands to a file or other \l TQIODevice, and plays them back). Other devices can be defined. \endtable @@ -120,7 +120,7 @@ system: \section1 Transformations Although Qt's default coordinate system works as described above, \l -QPainter also supports arbitrary transformations. +TQPainter also supports arbitrary transformations. This transformation engine is a three-step pipeline, closely following the model outlined in books such as @@ -132,17 +132,17 @@ coverage; here we give just a brief overview and an example. The first step uses the world transformation matrix. Use this matrix to orient and position your objects in your model. TQt provides -methods such as \l QPainter::rotate(), \l QPainter::scale(), \l -QPainter::translate() and so on to operate on this matrix. +methods such as \l TQPainter::rotate(), \l TQPainter::scale(), \l +TQPainter::translate() and so on to operate on this matrix. -\l QPainter::save() and \l QPainter::restore() save and restore this +\l TQPainter::save() and \l TQPainter::restore() save and restore this matrix. You can also use \l QWMatrix objects, \l -QPainter::worldMatrix() and \l QPainter::setWorldMatrix() to store and +TQPainter::worldMatrix() and \l TQPainter::setWorldMatrix() to store and use named matrices. The second step uses the window. The window describes the view boundaries in model coordinates. The matrix positions the \e objects -and \l QPainter::setWindow() positions the \e window, deciding what +and \l TQPainter::setWindow() positions the \e window, deciding what coordinates will be visible. (If you have 3D experience, the window is what's usually called projection in 3D.) @@ -156,14 +156,14 @@ function is vital, since very few printers can print over the entire physical page. So each object to be drawn is transformed into model -coordinates using \l QPainter::worldMatrix(), then positioned -on the drawing device using \l QPainter::window() and -\l QPainter::viewport(). +coordinates using \l TQPainter::worldMatrix(), then positioned +on the drawing device using \l TQPainter::window() and +\l TQPainter::viewport(). It is perfectly possible to do without one or two of the stages. If, for example, your goal is to draw something scaled, then just using \l -QPainter::scale() makes perfect sense. If your goal is to use a -fixed-size coordinate system, \l QPainter::setWindow() is +TQPainter::scale() makes perfect sense. If your goal is to use a +fixed-size coordinate system, \l TQPainter::setWindow() is ideal. And so on. Here is a short example that uses all three mechanisms: the function |