Skip to content
Browse files
Stop Qt complaining that showLegendLayerFileGroups(bool) has an incom…
…patible argument list to triggered() and therefore not connecting the signal to the slot. The "Show file groups" option in the legend right-click menu should now work better (even properly?).

git-svn-id: c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
morb_au committed Feb 20, 2006
1 parent 3b8feaa commit 6f42874
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
@@ -412,7 +412,7 @@ void QgsLegend::handleRightClickEvent(QTreeWidgetItem* item, const QPoint& posit
theMenu.addAction(QIcon(QPixmap(iconsPath+QString("/folder_new.png"))), tr("&Add group"), this, SLOT(addGroup()));
theMenu.addAction(QIcon(QPixmap(iconsPath+QString("/mActionExpandTree.png"))), tr("&Expand all"), this, SLOT(expandAll()));
theMenu.addAction(QIcon(QPixmap(iconsPath+QString("/mActionCollapseTree.png"))), tr("&Collapse all"), this, SLOT(collapseAll()));
QAction* showFileGroupsAction = theMenu.addAction(tr("Show file groups"), this, SLOT(showLegendLayerFileGroups(bool)));
QAction* showFileGroupsAction = theMenu.addAction(tr("Show file groups"), this, SLOT(showLegendLayerFileGroups()));
@@ -1325,18 +1325,20 @@ void QgsLegend::makeToTopLevelItem()

void QgsLegend::showLegendLayerFileGroups(bool show)
void QgsLegend::showLegendLayerFileGroups()
// Toggle the boolean associated with the checkbox
mShowLegendLayerFiles = !mShowLegendLayerFiles;

QgsLegendLayerFileGroup* theFileGroup = 0;
QTreeWidgetItem* theItem = firstItem();
theFileGroup = dynamic_cast<QgsLegendLayerFileGroup*>(theItem);
setItemHidden(theFileGroup, !show);
setItemHidden(theFileGroup, !mShowLegendLayerFiles);
while(theItem = nextItem(theItem));
mShowLegendLayerFiles = show;
@@ -240,7 +240,7 @@ this item may be moved back to the original position with resetToInitialPosition
/**Removes the current item and inserts it as a toplevel item at the end of the legend*/
void makeToTopLevelItem();
/**Show/ Hide the legend layer file groups*/
void showLegendLayerFileGroups(bool show);
void showLegendLayerFileGroups();

/**Pointer to QGisApp, needed for signal/slot reasons*/

0 comments on commit 6f42874

Please sign in to comment.