Skip to content

Commit

Permalink
Fix for bug #753 'Problem in the overview'
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@7180 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Sep 6, 2007
1 parent c38d821 commit 0153c88
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 25 deletions.
16 changes: 16 additions & 0 deletions src/app/legend/qgslegend.cpp
Expand Up @@ -1356,6 +1356,22 @@ void QgsLegend::updateOverview()
mMapCanvas->updateOverview();
}

void QgsLegend::setOverviewAllLayers(bool inOverview)
{
QTreeWidgetItem* theItem = firstItem();
while(theItem)
{
QgsLegendLayerFile* llf = dynamic_cast<QgsLegendLayerFile*>(theItem);
if(llf)
{
llf->setInOverview(inOverview);
}
theItem = nextItem(theItem);
}
updateMapCanvasLayerSet();
updateOverview();
}

std::deque<QString> QgsLegend::layerIDs()
{
std::deque<QString> layers;
Expand Down
3 changes: 3 additions & 0 deletions src/app/legend/qgslegend.h
Expand Up @@ -147,6 +147,9 @@ class QgsLegend : public QTreeWidget
/**Updates overview*/
void updateOverview();

/**Show/remove all layer in/from overview*/
void setOverviewAllLayers(bool inOverview);

/**Adds an entry to mPixmapWidthValues*/
void addPixmapWidthValue(int width);

Expand Down
36 changes: 11 additions & 25 deletions src/app/qgisapp.cpp
Expand Up @@ -3219,40 +3219,26 @@ void QgisApp::saveMapAsImage(QString theImageFileNameQString, QPixmap * theQPixm
//reimplements method from base (gui) class
void QgisApp::addAllToOverview()
{
// TODO: move to legend
/*
std::map<QString, QgsMapLayer *> myMapLayers = QgsMapLayerRegistry::instance()->mapLayers();
std::map<QString, QgsMapLayer *>::iterator myMapIterator;
for ( myMapIterator = myMapLayers.begin(); myMapIterator != myMapLayers.end(); ++myMapIterator )
{
QgsMapLayer * myMapLayer = myMapIterator->second;
myMapLayer->inOverview(true); // won't do anything if already in overview
}
mMapCanvas->updateOverview();
if(mMapLegend)
{
mMapLegend->setOverviewAllLayers(true);
}

// notify the project we've made a change
QgsProject::instance()->dirty(true);
*/
}

//reimplements method from base (gui) class
void QgisApp::removeAllFromOverview()
{
// TODO: move to legend
/*
std::map<QString, QgsMapLayer *> myMapLayers = QgsMapLayerRegistry::instance()->mapLayers();
std::map<QString, QgsMapLayer *>::iterator myMapIterator;
for ( myMapIterator = myMapLayers.begin(); myMapIterator != myMapLayers.end(); ++myMapIterator )
{
QgsMapLayer * myMapLayer = myMapIterator->second;
myMapLayer->inOverview(false);
}
mMapCanvas->updateOverview();
if(mMapLegend)
{
mMapLegend->setOverviewAllLayers(false);
}

// notify the project we've made a change
QgsProject::instance()->dirty(true);
*/
} // QgisApp::removeAllFromOverview()
}


//reimplements method from base (gui) class
Expand Down

0 comments on commit 0153c88

Please sign in to comment.