Skip to content
Permalink
Browse files

uglily find qgisapp for attribute table, fixes #786

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@7613 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Nov 20, 2007
1 parent 73e2713 commit 30758ae85bee8baa7e48a4cfb8fb247a5843dec6
Showing with 15 additions and 1 deletion.
  1. +15 −1 src/app/legend/qgslegendlayerfile.cpp
@@ -243,9 +243,23 @@ void QgsLegendLayerFile::table()
{
// display the attribute table
QApplication::setOverrideCursor(Qt::waitCursor);

// TODO: pointer to QgisApp should be passed instead of NULL
// but we don't have pointer to it. [MD]
mTableDisplay = new QgsAttributeTableDisplay(vlayer, NULL);
// but be can get it using this ugly hack. [jef]
// TODO: do this cleanly
QgisApp *app = NULL;
QList<QWidget *> list = QApplication::topLevelWidgets();

int i;
for(i=0; i<list.size(); i++)
if( list[i]->windowTitle().startsWith("Quantum GIS") )
{
app=reinterpret_cast<QgisApp*>(list[i]);
break;
}

mTableDisplay = new QgsAttributeTableDisplay(vlayer, app);
mTableDisplay->table()->fillTable(vlayer);
mTableDisplay->table()->setSorting(true);

0 comments on commit 30758ae

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