Skip to content
Permalink
Browse files

Fix the 'Object::connect: No such signal QgsRasterLayer::drawingProgr…

…ess()'

warnings. The raster and vector layer code were using a different signal name
for drawing progress


git-svn-id: http://svn.osgeo.org/qgis/trunk@6265 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m
g_j_m committed Dec 15, 2006
1 parent 21b42c7 commit d96ece99ffef1cab74f0475f88a1aa1dfdd3f758
Showing with 19 additions and 22 deletions.
  1. +4 −4 src/gui/qgisapp.cpp
  2. +1 −1 src/gui/qgsmaplayer.h
  3. +3 −3 src/gui/qgsmaprender.cpp
  4. +1 −1 src/gui/qgsmaprender.h
  5. +0 −3 src/gui/qgsvectorlayer.h
  6. +10 −10 src/raster/qgsrasterlayer.cpp
@@ -1061,7 +1061,7 @@ void QgisApp::setupConnections()
//signal when mouse moved over window (coords display in status bar)
connect(mMapCanvas, SIGNAL(xyCoordinates(QgsPoint &)), this, SLOT(showMouseCoordinate(QgsPoint &)));
//signal when mouse in capturePoint mode and mouse clicked on canvas
connect(mMapCanvas->mapRender(), SIGNAL(setProgress(int,int)), this, SLOT(showProgress(int,int)));
connect(mMapCanvas->mapRender(), SIGNAL(drawingProgress(int,int)), this, SLOT(showProgress(int,int)));
connect(mMapCanvas, SIGNAL(extentsChanged(QgsRect )),this,SLOT(showExtents(QgsRect )));
connect(mMapCanvas, SIGNAL(scaleChanged(QString)), this, SLOT(showScale(QString)));
connect(mMapCanvas, SIGNAL(scaleChanged(QString)), this, SLOT(updateMouseCoordinatePrecision()));
@@ -4552,7 +4552,7 @@ void QgisApp::projectionsEnabled(bool theFlag)
void QgisApp::showProgress(int theProgress, int theTotalSteps)
{
#ifdef QGISDEBUG
std::cout << "setProgress called with " << theProgress << "/" << theTotalSteps << std::endl;
std::cout << "showProgress called with " << theProgress << "/" << theTotalSteps << std::endl;
#endif

if (theProgress==theTotalSteps)
@@ -4952,7 +4952,7 @@ bool QgisApp::addRasterLayer(QgsRasterLayer * theRasterLayer, bool theForceRedra

// connect up any request the raster may make to update the app progress
QObject::connect(theRasterLayer,
SIGNAL(setProgress(int,int)),
SIGNAL(drawingProgress(int,int)),
this,
SLOT(showProgress(int,int)));
// connect up any request the raster may make to update the statusbar message
@@ -5109,7 +5109,7 @@ void QgisApp::addRasterLayer(QString const & rasterLayerPath,

// connect up any request the raster may make to update the app progress
QObject::connect(layer,
SIGNAL(setProgress(int,int)),
SIGNAL(drawingProgress(int,int)),
this,
SLOT(showProgress(int,int)));
// connect up any request the raster may make to update the statusbar message
@@ -378,7 +378,7 @@ public slots:
void visibilityChanged(void);

/** \brief emit a signal to notify of a progress event */
void setProgress(int theProgress, int theTotalSteps);
void drawingProgress(int theProgress, int theTotalSteps);

/** \brief emit a signal to be caught by gisapp and display a msg on status bar */
void setStatus(QString theStatusQString);
@@ -217,7 +217,7 @@ void QgsMapRender::render(QPainter* painter)
// added these comments and debug statement to help others...
QgsDebugMsg("If there is a QPaintEngine error here, it is caused by an emit call");

//emit setProgress(myRenderCounter++,layers.size());
//emit drawingProgress(myRenderCounter++,layers.size());
QgsMapLayer *ml = QgsMapLayerRegistry::instance()->mapLayer(*li);

if (!ml)
@@ -289,7 +289,7 @@ visibility scale range");
li = layers.begin();
while (li != layers.end())
{
// TODO: emit setProgress((myRenderCounter++),zOrder.size());
// TODO: emit drawingProgress((myRenderCounter++),zOrder.size());
QgsMapLayer *ml = QgsMapLayerRegistry::instance()->mapLayer(*li);

if (ml && ml->visible() && (ml->type() != QgsMapLayer::RASTER))
@@ -312,7 +312,7 @@ visibility scale range");
} // if (!mOverview)

// make sure progress bar arrives at 100%!
emit setProgress(1,1);
emit drawingProgress(1,1);

#ifdef QGISDEBUG
QgsDebugMsg("Rendering done in " + QString("%1").arg(renderTime.elapsed() / 1000.0) + " seconds");
@@ -75,7 +75,7 @@ class QgsMapRender : public QObject

signals:

void setProgress(int current, int total);
void drawingProgress(int current, int total);

void updateMap();

@@ -183,9 +183,6 @@ class QgsVectorLayer : public QgsMapLayer
/** This signal is emited when selection was changed */
void selectionChanged();

/** This signal is emitted when drawing features to tell current progress */
void drawingProgress(int current, int total);

public slots:

/** \brief Mutator for transparency level. Should be between 0 and 255 */
@@ -2732,7 +2732,7 @@ const QgsRasterBandStats QgsRasterLayer::getRasterBandStats(int theBandNoInt)

emit setStatus(QString("Calculating stats for ")+name());
//reset the main app progress bar
emit setProgress(0,0);
emit drawingProgress(0,0);

// let the user know we're going to possibly be taking a while
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
@@ -2802,7 +2802,7 @@ const QgsRasterBandStats QgsRasterLayer::getRasterBandStats(int theBandNoInt)

for( int iYBlock = 0; iYBlock < myNYBlocks; iYBlock++ )
{
emit setProgress ( iYBlock, myNYBlocks * 2 );
emit drawingProgress ( iYBlock, myNYBlocks * 2 );

for( int iXBlock = 0; iXBlock < myNXBlocks; iXBlock++ )
{
@@ -2874,7 +2874,7 @@ const QgsRasterBandStats QgsRasterLayer::getRasterBandStats(int theBandNoInt)
//for the second pass we will get the sum of the squares / mean
for( int iYBlock = 0; iYBlock < myNYBlocks; iYBlock++ )
{
emit setProgress ( iYBlock+myNYBlocks, myNYBlocks * 2 );
emit drawingProgress ( iYBlock+myNYBlocks, myNYBlocks * 2 );

for( int iXBlock = 0; iXBlock < myNXBlocks; iXBlock++ )
{
@@ -2960,7 +2960,7 @@ const QgsRasterBandStats QgsRasterLayer::getRasterBandStats(int theBandNoInt)
QgsDebugMsg("adding stats to stats collection at position " + QString::number(theBandNoInt - 1));
//add this band to the class stats map
rasterStatsVector[theBandNoInt - 1] = myRasterBandStats;
emit setProgress(rasterYDimInt, rasterYDimInt); //reset progress
emit drawingProgress(rasterYDimInt, rasterYDimInt); //reset progress
QApplication::restoreOverrideCursor(); //restore the cursor
QgsDebugMsg("Stats collection completed returning");
return myRasterBandStats;
@@ -3687,7 +3687,7 @@ void QgsRasterLayer::initContextMenu_(QgisApp * theApp)
void QgsRasterLayer::updateProgress(int theProgress, int theMax)
{
//simply propogate it on!
emit setProgress (theProgress,theMax);
emit drawingProgress (theProgress,theMax);
}

void QgsRasterLayer::popupTransparencySliderMoved(int theInt)
@@ -4125,7 +4125,7 @@ QString QgsRasterLayer::getMetadata()
void QgsRasterLayer::buildPyramids(RasterPyramidList const & theRasterPyramidList,
QString const & theResamplingMethod)
{
emit setProgress(0,0);
emit drawingProgress(0,0);
//first test if the file is writeable
QFileInfo myQFile(dataSource);

@@ -4151,7 +4151,7 @@ void QgsRasterLayer::buildPyramids(RasterPyramidList const & theRasterPyramidLis

// if the dataset couldn't be opened in read / write mode, tell the user
if (!gdalDataset) {
emit setProgress(0,0);
emit drawingProgress(0,0);
QApplication::restoreOverrideCursor();
QMessageBox myMessageBox( tr("Building pyramids failed."),
tr("The file was not writeable. Some formats can not be written to, only read. You can also try to check the permissions and then try again."),
@@ -4185,7 +4185,7 @@ void QgsRasterLayer::buildPyramids(RasterPyramidList const & theRasterPyramidLis
if ((*myRasterPyramidIterator).existsFlag)
{
QgsDebugMsg("Building.....");
emit setProgress(myCountInt,myTotalInt);
emit drawingProgress(myCountInt,myTotalInt);
int myOverviewLevelsIntArray[1] = {(*myRasterPyramidIterator).levelInt };
/* From : http://remotesensing.org/gdal/classGDALDataset.html#a23
* pszResampling : one of "NEAREST", "AVERAGE" or "MODE" controlling the downsampling method applied.
@@ -4231,7 +4231,7 @@ void QgsRasterLayer::buildPyramids(RasterPyramidList const & theRasterPyramidLis
myMessageBox.exec();
delete gdalDataset;
gdalDataset = (GDALDataset *) GDALOpen(QFile::encodeName(dataSource).constData(), GA_ReadOnly);
emit setProgress(0,0);
emit drawingProgress(0,0);
return;
}
myCountInt++;
@@ -4248,7 +4248,7 @@ void QgsRasterLayer::buildPyramids(RasterPyramidList const & theRasterPyramidLis
//close the gdal dataset and reopen it in read only mode
delete gdalDataset;
gdalDataset = (GDALDataset *) GDALOpen(QFile::encodeName(dataSource).constData(), GA_ReadOnly);
emit setProgress(0,0);
emit drawingProgress(0,0);
QApplication::restoreOverrideCursor();
}

0 comments on commit d96ece9

Please sign in to comment.
You can’t perform that action at this time.