[Qt-interest] Coordinate system decision

Bastian Bense bastibense at gmail.com
Mon Mar 30 12:29:21 CEST 2009


Hey folks,

I'm about to begin an implementation for a work project which manages
layouts and layout contents, and I've got to make a technical decision
about wether to use coordinates beginning at the top-left or
bottom-left corner.

The coordinate data I have to work with (importing, exporting) is 99%
based on a bottom-left coordinate system. I'll also have to control a
PDF library in order generate preview sheets and the PDF-library
(normal for PDF and PostScript) also is based on a bottom-left
coordinate system.

User feedback and bug reports usually provide bottom-left coordinates,
so that would help with the debugging.

Qt offers a number of classes for managing coordinates and objects,
such as QRect(), QPoint(), etc, but most of them rely on a top-left
coordinate system - especially the methods of QRect(), such as
setRight(), setBottom(). I think it would be nice to be able to use
them, though.

I once made a bad decision in the past by internally managing all
coordinates in a top-left coordinate system to have less problems
displaying them - but that resulted in A LOT more work when importing,
exporting and actually working with the data.

One idea is to use QTransform to help a bit with the exporting of
rotated, recursive objects (layouts within layouts).

Any suggestions, ideas, feedback? I'd love to hear your thoughts, so I
can make the best decision possible.

Thanks in advance,
Bastian



More information about the Qt-interest-old mailing list