Hi Martin,<br><br>Thanks for reply......<br>Actually the application I am working on is similar to QGIS in which shapefiles are rendered using QT.<br>In between, I researched on the problem and find out that this issue is related to QGraphicsView architecture.<br>
In essence, when QGraphicsView is created , it create with origin(0,0) at <b>top left corner</b>. Due to which the positive quadrant is downwards and negative upwards ( What I think ) due to which when shapefiles are rendered according the coordinates position they draw in downward direction( because coordinates of shapefiles are positive) and they appear to inverted.I found scaling as a clutch which invert the the GraphicsView and line and polygon shapefiles are drawn properly but it invert the point shapefile. <br>
Due to this I reached to the possible solution that can be applied on application:-<br><br>--- One way can be that we create the QGraphicsView with origin(0,0) at bottom left corner.Due to this we will get the proper coordinate system for rendering. I have tried on it but not able to find the sol. how it will be implemented.<br>
<br>Have u any idea regarding this ?<br><br>Thanks<br><br><br><div class="gmail_quote">On Tue, Jun 17, 2008 at 3:23 AM, Martin Dobias <<a href="http://wonder.sk" target="_blank">wonder.sk</a>@<a href="http://gmail.com" target="_blank">gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
sorry but with this amount of information really none can help you.<br>
What exactly are you trying to do? Is it some QGIS-based application?<br>
Why don't you use directly map canvas? Some more code to see what<br>
actually is happening?<br>
<br>
Martin<br>
<div><div></div><div><br>
On Tue, Jun 10, 2008 at 8:20 AM, bargi john <<a href="mailto:bargi1981@gmail.com" target="_blank">bargi1981@gmail.com</a>> wrote:<br>
> Hi all,<br>
><br>
> I am trap in a strange problem while rendering shapefiles.<br>
><br>
> I am used some code of [quote]qgsmapcanvas.cpp [/quote] for creating<br>
> Graphicsview and QGraphicsScene.<br>
><br>
> The code I have wrote is as follow:<br>
> [code]<br>
> View::View( QWidget *parent ): QGraphicsView( parent )<br>
> {<br>
><br>
> m_scene = new QGraphicsScene();<br>
> setScene( m_scene );<br>
><br>
> setRenderHint( QPainter::Antialiasing );<br>
> setMouseTracking( true );<br>
><br>
> setFrameShadow( QFrame::Sunken );<br>
> setFrameShape ( QFrame::Panel );<br>
> }<br>
> [/code]<br>
><br>
> The m_scene set here is used in other CPP file where items are added to<br>
> scene. The code is as follow:<br>
><br>
> [code]<br>
><br>
> QGraphicsScene *Draw::scene() const<br>
> {<br>
> return m_scene; // This object is same as set in View.cpp<br>
> }<br>
><br>
> void Draw::render()<br>
> {<br>
> .........// logic to extract items<br>
><br>
> m_scene->addItem( item ); //Here item is QGraphicsItem<br>
> }<br>
> [/code]<br>
><br>
> The problem is that only point Shapfiles are drawing correctly.<br>
> The line and polygon shapefiles are drawn as inverted.<br>
> If I put clutch using [quote]scale(1,-1) [/quote] then it draw line and<br>
> polygon correct but point shapefiles inverted.<br>
><br>
> Can any body explain me this strange behavior and solution to it.<br>
><br>
> Thanks :(<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> Qgis-developer mailing list<br>
> <a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
><br>
><br>
</blockquote></div><br>