fixed bug about restoring projects with single marker renderers

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@1347 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
mhugent 2004-05-08 14:07:09 +00:00
parent 3a0b5f4839
commit f7b057732b
4 changed files with 23 additions and 13 deletions

View File

@ -168,6 +168,9 @@ void QgsGraMaExtensionWidget::selectMarker()
adjustMarker(indexnumber);
}
qWarning("The size of the layout is: "+QString::number(mGridLayout->geometry().width())+"/"+QString::number(mGridLayout->geometry().height()));
resizeContents(mGridLayout->geometry().width(),mGridLayout->geometry().height());
updateContents();
setActiveWindow();
}
@ -183,6 +186,9 @@ void QgsGraMaExtensionWidget::adjustMarkers()
{
adjustMarker(i);
}
qWarning("The size of the layout is: "+QString::number(mGridLayout->geometry().width())+"/"+QString::number(mGridLayout->geometry().height()));
resizeContents(mGridLayout->geometry().width(),mGridLayout->geometry().height());
updateContents();
}
void QgsGraMaExtensionWidget::adjustMarker(int row)
@ -224,4 +230,7 @@ void QgsGraMaExtensionWidget::handleReturnPressed()
}
}
adjustMarker(indexnumber);
qWarning("The size of the layout is: "+QString::number(mGridLayout->geometry().width())+"/"+QString::number(mGridLayout->geometry().height()));
resizeContents(900,300);//mGridLayout->geometry().width(),mGridLayout->geometry().height());
updateContents();
}

View File

@ -61,7 +61,7 @@ class QgsGraMaExtensionWidget: public QScrollView
QgsVectorLayer* mVectorLayer;
/**Pointers to the widgets are stored so that they are accessible for other classes*/
std::vector<QWidget*> mWidgetVector;
virtual void resizeEvent (QResizeEvent* e);
virtual void resizeEvent(QResizeEvent* e);
protected slots:
void selectMarker();

View File

@ -600,9 +600,9 @@ void QgsRasterLayer::drawSingleBandGray(QPainter * theQPainter, RasterViewPort *
double myRangeDouble = myRasterBandStats.rangeDouble;
// print each point in myGdalScanData with equal parts R, G ,B o make it show as gray
for (int myColumnInt = 0; myColumnInt < theRasterViewPort->drawableAreaYDimInt; myColumnInt++)
for (int myColumnInt = 0; myColumnInt < theRasterViewPort->drawableAreaYDimInt; ++myColumnInt)
{
for (int myRowInt = 0; myRowInt < theRasterViewPort->drawableAreaXDimInt; myRowInt++)
for (int myRowInt = 0; myRowInt < theRasterViewPort->drawableAreaXDimInt; ++myRowInt)
{
int myGrayValInt = myGdalScanData[myColumnInt * theRasterViewPort->drawableAreaXDimInt + myRowInt];
//remove these lines!
@ -709,9 +709,9 @@ void QgsRasterLayer::drawSingleBandPseudoColor(QPainter * theQPainter, RasterVie
myQImage.setAlphaBuffer(true);
for (int myColumnInt = 0; myColumnInt < theRasterViewPort->drawableAreaYDimInt; myColumnInt++)
for (int myColumnInt = 0; myColumnInt < theRasterViewPort->drawableAreaYDimInt; ++myColumnInt)
{
for (int myRowInt = 0; myRowInt < theRasterViewPort->drawableAreaXDimInt; myRowInt++)
for (int myRowInt = 0; myRowInt < theRasterViewPort->drawableAreaXDimInt; ++myRowInt)
{
//hardcoding to white to start with
myRedInt = 255;
@ -877,9 +877,9 @@ void QgsRasterLayer::drawPalettedSingleBandGray(QPainter * theQPainter,
for (int myColumnInt = 0; myColumnInt < theRasterViewPort->drawableAreaYDimInt; myColumnInt++)
for (int myColumnInt = 0; myColumnInt < theRasterViewPort->drawableAreaYDimInt; ++myColumnInt)
{
for (int myRowInt = 0; myRowInt < theRasterViewPort->drawableAreaXDimInt; myRowInt++)
for (int myRowInt = 0; myRowInt < theRasterViewPort->drawableAreaXDimInt; ++myRowInt)
{
const GDALColorEntry *myColorEntry =
GDALGetColorEntry(colorTable, myGdalScanData[myColumnInt * theRasterViewPort->drawableAreaXDimInt + myRowInt]);
@ -1004,9 +1004,9 @@ void QgsRasterLayer::drawPalettedSingleBandPseudoColor(QPainter * theQPainter,
for (int myColumnInt = 0; myColumnInt < theRasterViewPort->drawableAreaYDimInt; myColumnInt++)
for (int myColumnInt = 0; myColumnInt < theRasterViewPort->drawableAreaYDimInt; ++myColumnInt)
{
for (int myRowInt = 0; myRowInt < theRasterViewPort->drawableAreaXDimInt; myRowInt++)
for (int myRowInt = 0; myRowInt < theRasterViewPort->drawableAreaXDimInt; ++myRowInt)
{
int myInt = 0;
const GDALColorEntry *myColorEntry =
@ -1194,9 +1194,9 @@ void QgsRasterLayer::drawPalettedMultiBandColor(QPainter * theQPainter, RasterVi
QImage myQImage = QImage(theRasterViewPort->drawableAreaXDimInt, theRasterViewPort->drawableAreaYDimInt, 32);
myQImage.fill(0);
myQImage.setAlphaBuffer(true);
for (int myColumnInt = 0; myColumnInt < theRasterViewPort->drawableAreaYDimInt; myColumnInt++)
for (int myColumnInt = 0; myColumnInt < theRasterViewPort->drawableAreaYDimInt; ++myColumnInt)
{
for (int myRowInt = 0; myRowInt < theRasterViewPort->drawableAreaXDimInt; myRowInt++)
for (int myRowInt = 0; myRowInt < theRasterViewPort->drawableAreaXDimInt; ++myRowInt)
{
const GDALColorEntry *colorEntry =
GDALGetColorEntry(colorTable, myGdalScanData[myColumnInt * theRasterViewPort->drawableAreaXDimInt + myRowInt]);
@ -1323,9 +1323,9 @@ void QgsRasterLayer::drawMultiBandColor(QPainter * theQPainter, RasterViewPort *
QImage myQImage = QImage(theRasterViewPort->drawableAreaXDimInt, theRasterViewPort->drawableAreaYDimInt, 32);
myQImage.fill(0);
myQImage.setAlphaBuffer(true);
for (int myColumnInt = 0; myColumnInt < theRasterViewPort->drawableAreaYDimInt; myColumnInt++)
for (int myColumnInt = 0; myColumnInt < theRasterViewPort->drawableAreaYDimInt; ++myColumnInt)
{
for (int myRowInt = 0; myRowInt < theRasterViewPort->drawableAreaXDimInt; myRowInt++)
for (int myRowInt = 0; myRowInt < theRasterViewPort->drawableAreaXDimInt; ++myRowInt)
{
//pull the rgb values from each band
int myRedValueInt = myGdalRedData[myColumnInt * theRasterViewPort->drawableAreaXDimInt + myRowInt];

View File

@ -79,6 +79,7 @@ QgsSiMaDialog::QgsSiMaDialog(QgsVectorLayer* vectorlayer): QgsSiMaDialogBase(),
p.scale(scalefactor,scalefactor);
p.drawPicture(0,0,pic);
pmPreview->setPixmap(pixmap);
pmPreview->setName(svgfile);
}
else