Skip to content

Commit

Permalink
layer info to html table
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@4978 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek committed Mar 6, 2006
1 parent 22a67d0 commit e036c9b
Showing 1 changed file with 31 additions and 8 deletions.
39 changes: 31 additions & 8 deletions src/plugins/grass/qgsgrassmodel.cpp
Expand Up @@ -74,6 +74,8 @@ class QgsGrassModelItem
QVariant data (int role = Qt::DisplayRole);
QString name();
QString info();
QString htmlTableRow ( QString s1, QString s2 );
QString htmlTableRow ( QStringList list );

int mType;

Expand Down Expand Up @@ -151,14 +153,17 @@ QString QgsGrassModelItem::info()
}
else
{
str += QString::number(head.rows) + " rows" + nl;
str += QString::number(head.cols) + " columns" + nl;
str += QString::number(head.ns_res) + " N-S resolution" + nl;
str += QString::number(head.ew_res) + " E-W resolution" + nl;
str += QString::number(head.north) + " noth" + nl;
str += QString::number(head.south) + " south" + nl;
str += QString::number(head.east) + " east" + nl;
str += QString::number(head.west) + " west" + nl;
//str += QString::number(head.rows) + " rows" + nl;
str += "<table border=1 cellspacing=1 cellpadding=1>";
str += htmlTableRow ( "rows", QString::number(head.rows));
str += htmlTableRow ( "columns", QString::number(head.cols) );
str += htmlTableRow ( "N-S resolution", QString::number(head.ns_res) );
str += htmlTableRow ( "E-W resolution", QString::number(head.ew_res) );
str += htmlTableRow ( "north", QString::number(head.north) );
str += htmlTableRow ( "south", QString::number(head.south) );
str += htmlTableRow ( "east", QString::number(head.east) );
str += htmlTableRow ( "west", QString::number(head.west) );
str += "</table>";

int rasterType = G_raster_map_type( mMap.toLocal8Bit().data(),
mMapset.toLocal8Bit().data() );
Expand Down Expand Up @@ -219,6 +224,24 @@ QString QgsGrassModelItem::info()
return QString();
}

QString QgsGrassModelItem::htmlTableRow ( QString s1, QString s2 )
{
QStringList sl (s1);
sl.append (s2);
return htmlTableRow (sl);
}

QString QgsGrassModelItem::htmlTableRow ( QStringList list )
{
QString s = "<tr>";
for ( int i = 0; i < list.size(); i++ )
{
s.append ( "<td>" + list.at(i) + "</td>" );
}
s.append ( "</tr>" );
return s;
}

QString QgsGrassModelItem::name()
{
switch ( mType )
Expand Down

0 comments on commit e036c9b

Please sign in to comment.