Hi,
This is a pretty simple code, used for checking drawing:
Assume I have a list of polygons: PolygonList;
Assume the polygons are inside 0.5 of a degree, and the whole scene is a rect (-180,-90, 360,180), so polygons are invisible when the whole scene is drawn, but I have to zoom in about 200 times, etc.
// First I have some code to set brush color
QBrush br
= _painter
->brush
();
br.setStyle(Qt::Dense4Pattern);
_painter->setBrush(br);
for(int i=0;i<PolygonList.size();++i)
{
_painter->drawPolygon(PolygonList.at(i));
}
// First I have some code to set brush color
QBrush br = _painter->brush();
br.setStyle(Qt::Dense4Pattern);
_painter->setBrush(br);
for(int i=0;i<PolygonList.size();++i)
{
_painter->drawPolygon(PolygonList.at(i));
}
To copy to clipboard, switch view to plain text mode
What this code does is:
When I fit my chart(set of polygons) into scene, so all polygons are visible the brush is ok, and my polygons are filled with the given brush, but when I zoom in the polygons are not filled with any color, are transparent. Then, when I zoom out, and zoom out, and zoom out, the polygons are filled with color. Still, when I fit my chart in the scene and try to zoom in the polygons are not filled with any color.
THIS IS BASICALLY WHAT I need to to achieve: the same brush no matter the scale of the chart(zooming in /out )
Should the brush be scaled as well as the scene? I have started Brush in depth study, so this question may be trivial.
Any ideas.
Thanks
Bookmarks