PDA

View Full Version : documentation issues



Gh0str1d3r
25th August 2010, 19:59
Hi,

is it possible that there are some function, in particular in the QGraphicsView framework, that are not documented? For instance, I had to go through the header files to find out that there is a


void setPos(const QPointF &pos);

function in the class QGraphicsSceneMouseEvent.

Lykurg
25th August 2010, 21:50
There are function such as your found one that are internal, and so they marked in the cpp file. The purpose is to hide these functions for normal users, since they normal should not use that functions...

Gh0str1d3r
26th August 2010, 09:25
Then I don't get why it is intended to hide such a useful function.

SixDegrees
26th August 2010, 09:36
Go ahead an use it if you want to. When it is removed or renamed or gets a different function signature, thought, don't complain about having to rewrite your code.

There are many functions in Qt that aren't documented, for many reasons. Quite often, undocumented functions are in a pre-release state and haven't been thoroughly tested, or haven't had their design fully defined.

It isn't clear why you would ever want to set your own position on a mouse event. Mouse position is normally determined by the mouse (and OS); it isn't something users would normally fiddle with. If you need to modify a position within your own handler, feel free to do so - there are plenty of functions that will tell you where the event took place. If you want to modify the position within the event, that suggests you want to pass the event along to another handler with a (now corrupted) sense of position, which doesn't strike me as a good idea.

Gh0str1d3r
26th August 2010, 10:59
I am working on a QGraphicsItem that is a coordinator of a set of child items. Events should be distributed from and to the coordinator and to other children. Now, the event coordinates are by default in the local coordinate system of the item. Child items should not care about coordinate system conversion, so I don't want to use scenePos() if there are other ways. So in my software, the coordinator perform the transformation of the event's coordinates to his own system and to the child's system. As far as I understood, this is what the scene does to distribute the widget mouse event to the items.

So I agree it hardly makes sense to modify the coordinates of a normal mouse event (even though there may be applications for that), but I think it does make sense in the context of this graphicsView stuff.