[Qgis-developer] Problem in shapefiles rendering

bargi john bargi1981 at gmail.com
Tue Jun 10 02:20:47 EDT 2008


Hi all,

I am trap in a strange problem while rendering shapefiles.

I am used some code of [quote]qgsmapcanvas.cpp [/quote] for creating
Graphicsview and QGraphicsScene.

The code I have wrote is as follow:
[code]
View::View( QWidget *parent ): QGraphicsView( parent )
{

    m_scene = new QGraphicsScene();
    setScene( m_scene );

    setRenderHint( QPainter::Antialiasing );
    setMouseTracking( true );

    setFrameShadow( QFrame::Sunken );
    setFrameShape ( QFrame::Panel  );
}
[/code]

The m_scene  set here is used in other CPP file where items are added to
scene. The code is as follow:

[code]

QGraphicsScene *Draw::scene() const
{
    return m_scene; // This object is same as set in View.cpp
}

void Draw::render()
{
 .........//  logic to extract items

  m_scene->addItem( item ); //Here item is QGraphicsItem
}
[/code]

The problem is that only point Shapfiles are drawing correctly.
The line and polygon shapefiles are drawn   as inverted.
If I put clutch using [quote]scale(1,-1) [/quote]  then it draw line and
polygon correct but point shapefiles inverted.

Can any body explain me this strange behavior   and solution to it.

Thanks :(
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20080610/6f4e97c7/attachment.html


More information about the Qgis-developer mailing list