Skip to content

Commit

Permalink
Fix the 'Object::connect: No such signal QgsRasterLayer::drawingProgr…
Browse files Browse the repository at this point in the history
…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/qgis@6265 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Dec 15, 2006
1 parent 74b5109 commit e07bffb
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 22 deletions.
8 changes: 4 additions & 4 deletions src/gui/qgisapp.cpp
Expand Up @@ -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()));
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsmaplayer.h
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/gui/qgsmaprender.cpp
Expand Up @@ -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)
Expand Down Expand Up @@ -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))
Expand All @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsmaprender.h
Expand Up @@ -75,7 +75,7 @@ class QgsMapRender : public QObject

signals:

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

void updateMap();

Expand Down
3 changes: 0 additions & 3 deletions src/gui/qgsvectorlayer.h
Expand Up @@ -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 */
Expand Down
20 changes: 10 additions & 10 deletions src/raster/qgsrasterlayer.cpp
Expand Up @@ -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));
Expand Down Expand Up @@ -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++ )
{
Expand Down Expand Up @@ -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++ )
{
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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);

Expand All @@ -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."),
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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++;
Expand All @@ -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();
}

Expand Down

0 comments on commit e07bffb

Please sign in to comment.