|
16 | 16 | ***************************************************************************/
|
17 | 17 |
|
18 | 18 | #include <limits>
|
| 19 | +#include <typeinfo> |
19 | 20 |
|
20 | 21 | #include "qgsmaptopixel.h"
|
21 | 22 | #include "qgsmapcanvas.h"
|
@@ -294,6 +295,8 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer* lyr, QgsMapCanv
|
294 | 295 | }
|
295 | 296 | }
|
296 | 297 | on_mRenderTypeComboBox_currentIndexChanged( mRenderTypeComboBox->currentIndex() );
|
| 298 | + |
| 299 | + updatePipeList(); |
297 | 300 | } // QgsRasterLayerProperties ctor
|
298 | 301 |
|
299 | 302 |
|
@@ -1600,3 +1603,40 @@ void QgsRasterLayerProperties::toggleBuildPyramidsButton()
|
1600 | 1603 | }
|
1601 | 1604 | }
|
1602 | 1605 |
|
| 1606 | +void QgsRasterLayerProperties::updatePipeList() |
| 1607 | +{ |
| 1608 | + QgsDebugMsg("Entered"); |
| 1609 | + |
| 1610 | + mPipeTreeWidget->setColumnCount( 3 ); |
| 1611 | + //mPipeTreeWidget->header()->setResizeMode(0, QHeaderView::Stretch); |
| 1612 | + mPipeTreeWidget->header()->setResizeMode( QHeaderView::ResizeToContents ); |
| 1613 | + |
| 1614 | + QStringList labels; |
| 1615 | + labels << tr( "Filter" ) << tr("Bands") << tr( "Tot time" ) << tr( "Avg time" ); |
| 1616 | + mPipeTreeWidget->setHeaderLabels( labels ); |
| 1617 | + |
| 1618 | + QgsRasterPipe *pipe = mRasterLayer->pipe(); |
| 1619 | + for ( int i = 0; i < pipe->size(); i++ ) |
| 1620 | + { |
| 1621 | + QgsRasterInterface * filter = pipe->at(i); |
| 1622 | + QStringList texts; |
| 1623 | + QString name; |
| 1624 | + // Unfortunately at this moment not all filters inherits from QObject |
| 1625 | + QObject *o = dynamic_cast<QObject*>( filter); |
| 1626 | + if ( o ) |
| 1627 | + { |
| 1628 | + //name = o->objectName(); // gives empty with provider |
| 1629 | + name = o->metaObject()->className(); |
| 1630 | + } |
| 1631 | + else |
| 1632 | + { |
| 1633 | + name = QString(typeid(*filter).name()).replace ( QRegExp(".*Qgs"), "Qgs" ); |
| 1634 | + } |
| 1635 | + |
| 1636 | + texts << name << QString("%1").arg( filter->bandCount() ); |
| 1637 | + texts << QString("%1 ms").arg( filter->time(0) ) << QString("%1 ms").arg( filter->avgTime(), 0, 'd' ); |
| 1638 | + QTreeWidgetItem *item = new QTreeWidgetItem( texts ); |
| 1639 | + |
| 1640 | + mPipeTreeWidget->addTopLevelItem ( item ); |
| 1641 | + } |
| 1642 | +} |
0 commit comments