[Qt-interest] mapping between scene and view

Malyushytsky, Alex alex at wai.com
Sun Mar 14 08:55:47 CET 2010


I doubt anybody can explain better than documentation in this case.

http://doc.trolltech.com/4.6/graphicsview.html#the-graphics-view-coordinate-system

http://doc.trolltech.com/4.6/qgraphicsview.html#mapToScene

http://doc.trolltech.com/4.6/qgraphicsview.html#mapFromScene

What exactly you don't understand?

QGraphicsView* view = ...;

QPointF  pointInScene = ...;
QPoint pointInView =  view->mapFromScene (  pointInScene ) ;

QPointF  pointInScene2 =  view->mapToScene (  pointInView ) ;


Alex


-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Kari Laine
Sent: Saturday, March 13, 2010 7:34 AM
To: qt-interest
Subject: Re: [Qt-interest] mapping between scene and view

Hi Ramesh,

back again and hopefully some can give me pointers...

"QT\4.6.2\examples\animation\appchooser"

example doesn't seem to help in my question.
I tried again to inspect it and it does not help... but thanks
answering - now I know about state machine.


The originall question is:

I would need some help with mapping coordinates between QGraphicsScene
and QGraphicsView.
If someone could lay out the basic principle I would be very thankful.

Other need I have is to have QGraphicsItems stay put when I scroll the scene.
So scene will scroll behind these elements and I can move them in the view.

Oh well this was indeed a good excuse to update my machine to OpenSUSE
11.2 and then upgrade the QT to 4.6.2. The appchooser example caused
me to notice the state machine architechture which would have been
useful me if known earlier.

I have been thinking that I actually would require tutoring on this
QT. Anyone interested - I could not pay enormous sum of money but
something. Payment could propaply be organized through PayPal.

Thanks for all the help I have been getting on this list.

Best Regards
Kari

--
PIC - ARM - Microcontrollers - I2C - SPI
Keypads - USB-RS232 - USB-I2C - Accessories
http://www.byvac.com
I am just a happy customer
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest


---------------------------------------------------------------------------------------------------
Weidlinger Associates, Inc. made the following annotations.

"This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you."

"Please consider our environment before printing this email."




More information about the Qt-interest-old mailing list