Can we see the exact code reproducing the problem?
Can we see the exact code reproducing the problem?
I belive that the code is not a problem, rather the understanding of coordinates system.
I am passing from signal to slot the:
scenePos().x() in the qDebug() show the int, so I belive that I am reading only int values, but need to also read the decimal fraction.
How to do it is the problem.
But...when I zoom, let's say 3 times, I get high precision coordinates.(because the distance between 2 point is bigger, and this maybe be the reason).
Last edited by maverick_pol; 17th August 2007 at 13:30.
wysotaQt allows you to use everything you want
--------------------------------------------------------------------------------
#if defined(Q_OS_UNIX) && defined(QT_DEBUG)
abort(); // trap; generates core dump
#else
exit(1); // goodbye cruel world
#endif
You are getting an integer, because the fraction part is zero. Pixels on the screen are so big (the scale can be 1:1 or smaller) compared to the scene coordinates, that you can't "click" on points that have noninteger coordinates.
Ok, that's a good point, but I have an application written in MFC that uses CDC to paint my map and show the .xxx values.
And I am suppose to do the same.
Ok, I have just discoverd one thing. When I start the application I get only the INT part of the coordinate, but when I zoom In I get the high precision float(good). Not all.
When I zoom out(the map the same as when I start the app) I get the same high precision float(good), not the INT,even though the map scale is the same as at the begining. ?!!!!!
I have attached screen(when apps start(INT VAL) and after zooming iN/out). Map has the same scale but coords are shown with a different precision)
Maverick
Last edited by maverick_pol; 17th August 2007 at 14:39.
wysotaQt allows you to use everything you want
--------------------------------------------------------------------------------
#if defined(Q_OS_UNIX) && defined(QT_DEBUG)
abort(); // trap; generates core dump
#else
exit(1); // goodbye cruel world
#endif
Could you please ask your application to report the scene size and coordinates on every mouse click or so? My opinion is that your scene size varies and that causes the "malfunction".
Hi,
While using fitInView(QRect) the scene is being scaled and rotated(if needed) to ensure that the rect is visible(but not always); there are some flags that help to set the best needed transformation.
I am sure that the scene has different size while zooming, etc.
The main question is, why after zooming In and then zooming out I can see the high precision coordinates when the size of the scene is the same as during the app start?
Why I can't see the fraction just after the app starts?
Maybe there is somekind of flag/attribute that changes during the zoomIn/Out connected with coordinates precision?
Maverick
wysotaQt allows you to use everything you want
--------------------------------------------------------------------------------
#if defined(Q_OS_UNIX) && defined(QT_DEBUG)
abort(); // trap; generates core dump
#else
exit(1); // goodbye cruel world
#endif
You can really not respond to my question in your posts, but I'll keep asking the same question over and over - could you report the scene size right after creating it and after each zooming operation? The most probable cause is that the scale of the view changes because of some event that happens during execution of the application (like because the scene size changes) and it causes "fractions" to become available. Could you please use qDebug to report the scene size like I asked you here and in the other thread? Because right now we're getting nowhere.
Hi,
Excuse me for not being very precise in my posts. I will try to give more details.
Scene/View/_rectangle size :
http://www.qtcentre.org/forum/f-qt-p...html#post46345
Maverick
wysotaQt allows you to use everything you want
--------------------------------------------------------------------------------
#if defined(Q_OS_UNIX) && defined(QT_DEBUG)
abort(); // trap; generates core dump
#else
exit(1); // goodbye cruel world
#endif
any other ideas?
Beforehand thanks!
Maverick
wysotaQt allows you to use everything you want
--------------------------------------------------------------------------------
#if defined(Q_OS_UNIX) && defined(QT_DEBUG)
abort(); // trap; generates core dump
#else
exit(1); // goodbye cruel world
#endif
Solve the problem from the other thread first.
I will try to solve the other thread, but that thread seems to be "dead". You were the only person helping me there for a long time. After including the problematic code, noone responded to it.
Maverick
wysotaQt allows you to use everything you want
--------------------------------------------------------------------------------
#if defined(Q_OS_UNIX) && defined(QT_DEBUG)
abort(); // trap; generates core dump
#else
exit(1); // goodbye cruel world
#endif
The thread seems very much alive...
maverick_pol (28th August 2007)
Bookmarks