Merge branch 'histogramwidget' of ../qgis-etiennesky
@ -303,43 +303,43 @@ void QgsComposer::setupTheme()
|
||||
{
|
||||
//now set all the icons - getThemeIcon will fall back to default theme if its
|
||||
//missing from active theme
|
||||
mActionQuit->setIcon( QgisApp::getThemeIcon( "/mActionFileExit.png" ) );
|
||||
mActionLoadFromTemplate->setIcon( QgisApp::getThemeIcon( "/mActionFileOpen.png" ) );
|
||||
mActionSaveAsTemplate->setIcon( QgisApp::getThemeIcon( "/mActionFileSaveAs.png" ) );
|
||||
mActionExportAsImage->setIcon( QgisApp::getThemeIcon( "/mActionSaveMapAsImage.png" ) );
|
||||
mActionExportAsSVG->setIcon( QgisApp::getThemeIcon( "/mActionSaveAsSVG.png" ) );
|
||||
mActionExportAsPDF->setIcon( QgisApp::getThemeIcon( "/mActionSaveAsPDF.png" ) );
|
||||
mActionPrint->setIcon( QgisApp::getThemeIcon( "/mActionFilePrint.png" ) );
|
||||
mActionZoomAll->setIcon( QgisApp::getThemeIcon( "/mActionZoomFullExtent.png" ) );
|
||||
mActionZoomIn->setIcon( QgisApp::getThemeIcon( "/mActionZoomIn.png" ) );
|
||||
mActionZoomOut->setIcon( QgisApp::getThemeIcon( "/mActionZoomOut.png" ) );
|
||||
mActionRefreshView->setIcon( QgisApp::getThemeIcon( "/mActionDraw.png" ) );
|
||||
mActionUndo->setIcon( QgisApp::getThemeIcon( "/mActionUndo.png" ) );
|
||||
mActionRedo->setIcon( QgisApp::getThemeIcon( "/mActionRedo.png" ) );
|
||||
mActionAddImage->setIcon( QgisApp::getThemeIcon( "/mActionAddImage.png" ) );
|
||||
mActionAddNewMap->setIcon( QgisApp::getThemeIcon( "/mActionAddMap.png" ) );
|
||||
mActionAddNewLabel->setIcon( QgisApp::getThemeIcon( "/mActionLabel.png" ) );
|
||||
mActionAddNewLegend->setIcon( QgisApp::getThemeIcon( "/mActionAddLegend.png" ) );
|
||||
mActionAddNewScalebar->setIcon( QgisApp::getThemeIcon( "/mActionScaleBar.png" ) );
|
||||
mActionAddRectangle->setIcon( QgisApp::getThemeIcon( "/mActionAddBasicShape.png" ) );
|
||||
mActionAddTriangle->setIcon( QgisApp::getThemeIcon( "/mActionAddBasicShape.png" ) );
|
||||
mActionAddEllipse->setIcon( QgisApp::getThemeIcon( "/mActionAddBasicShape.png" ) );
|
||||
mActionAddArrow->setIcon( QgisApp::getThemeIcon( "/mActionAddArrow.png" ) );
|
||||
mActionAddTable->setIcon( QgisApp::getThemeIcon( "/mActionOpenTable.png" ) );
|
||||
mActionSelectMoveItem->setIcon( QgisApp::getThemeIcon( "/mActionSelectPan.png" ) );
|
||||
mActionMoveItemContent->setIcon( QgisApp::getThemeIcon( "/mActionMoveItemContent.png" ) );
|
||||
mActionGroupItems->setIcon( QgisApp::getThemeIcon( "/mActionGroupItems.png" ) );
|
||||
mActionUngroupItems->setIcon( QgisApp::getThemeIcon( "/mActionUngroupItems.png" ) );
|
||||
mActionRaiseItems->setIcon( QgisApp::getThemeIcon( "/mActionRaiseItems.png" ) );
|
||||
mActionLowerItems->setIcon( QgisApp::getThemeIcon( "/mActionLowerItems.png" ) );
|
||||
mActionMoveItemsToTop->setIcon( QgisApp::getThemeIcon( "/mActionMoveItemsToTop.png" ) );
|
||||
mActionMoveItemsToBottom->setIcon( QgisApp::getThemeIcon( "/mActionMoveItemsToBottom.png" ) );
|
||||
mActionAlignLeft->setIcon( QgisApp::getThemeIcon( "/mActionAlignLeft.png" ) );
|
||||
mActionAlignHCenter->setIcon( QgisApp::getThemeIcon( "/mActionAlignHCenter.png" ) );
|
||||
mActionAlignRight->setIcon( QgisApp::getThemeIcon( "/mActionAlignRight.png" ) );
|
||||
mActionAlignTop->setIcon( QgisApp::getThemeIcon( "/mActionAlignTop.png" ) );
|
||||
mActionAlignVCenter->setIcon( QgisApp::getThemeIcon( "/mActionAlignVCenter.png" ) );
|
||||
mActionAlignBottom->setIcon( QgisApp::getThemeIcon( "/mActionAlignBottom.png" ) );
|
||||
mActionQuit->setIcon( QgsApplication::getThemeIcon( "/mActionFileExit.png" ) );
|
||||
mActionLoadFromTemplate->setIcon( QgsApplication::getThemeIcon( "/mActionFileOpen.png" ) );
|
||||
mActionSaveAsTemplate->setIcon( QgsApplication::getThemeIcon( "/mActionFileSaveAs.png" ) );
|
||||
mActionExportAsImage->setIcon( QgsApplication::getThemeIcon( "/mActionSaveMapAsImage.png" ) );
|
||||
mActionExportAsSVG->setIcon( QgsApplication::getThemeIcon( "/mActionSaveAsSVG.png" ) );
|
||||
mActionExportAsPDF->setIcon( QgsApplication::getThemeIcon( "/mActionSaveAsPDF.png" ) );
|
||||
mActionPrint->setIcon( QgsApplication::getThemeIcon( "/mActionFilePrint.png" ) );
|
||||
mActionZoomAll->setIcon( QgsApplication::getThemeIcon( "/mActionZoomFullExtent.png" ) );
|
||||
mActionZoomIn->setIcon( QgsApplication::getThemeIcon( "/mActionZoomIn.png" ) );
|
||||
mActionZoomOut->setIcon( QgsApplication::getThemeIcon( "/mActionZoomOut.png" ) );
|
||||
mActionRefreshView->setIcon( QgsApplication::getThemeIcon( "/mActionDraw.png" ) );
|
||||
mActionUndo->setIcon( QgsApplication::getThemeIcon( "/mActionUndo.png" ) );
|
||||
mActionRedo->setIcon( QgsApplication::getThemeIcon( "/mActionRedo.png" ) );
|
||||
mActionAddImage->setIcon( QgsApplication::getThemeIcon( "/mActionAddImage.png" ) );
|
||||
mActionAddNewMap->setIcon( QgsApplication::getThemeIcon( "/mActionAddMap.png" ) );
|
||||
mActionAddNewLabel->setIcon( QgsApplication::getThemeIcon( "/mActionLabel.png" ) );
|
||||
mActionAddNewLegend->setIcon( QgsApplication::getThemeIcon( "/mActionAddLegend.png" ) );
|
||||
mActionAddNewScalebar->setIcon( QgsApplication::getThemeIcon( "/mActionScaleBar.png" ) );
|
||||
mActionAddRectangle->setIcon( QgsApplication::getThemeIcon( "/mActionAddBasicShape.png" ) );
|
||||
mActionAddTriangle->setIcon( QgsApplication::getThemeIcon( "/mActionAddBasicShape.png" ) );
|
||||
mActionAddEllipse->setIcon( QgsApplication::getThemeIcon( "/mActionAddBasicShape.png" ) );
|
||||
mActionAddArrow->setIcon( QgsApplication::getThemeIcon( "/mActionAddArrow.png" ) );
|
||||
mActionAddTable->setIcon( QgsApplication::getThemeIcon( "/mActionOpenTable.png" ) );
|
||||
mActionSelectMoveItem->setIcon( QgsApplication::getThemeIcon( "/mActionSelectPan.png" ) );
|
||||
mActionMoveItemContent->setIcon( QgsApplication::getThemeIcon( "/mActionMoveItemContent.png" ) );
|
||||
mActionGroupItems->setIcon( QgsApplication::getThemeIcon( "/mActionGroupItems.png" ) );
|
||||
mActionUngroupItems->setIcon( QgsApplication::getThemeIcon( "/mActionUngroupItems.png" ) );
|
||||
mActionRaiseItems->setIcon( QgsApplication::getThemeIcon( "/mActionRaiseItems.png" ) );
|
||||
mActionLowerItems->setIcon( QgsApplication::getThemeIcon( "/mActionLowerItems.png" ) );
|
||||
mActionMoveItemsToTop->setIcon( QgsApplication::getThemeIcon( "/mActionMoveItemsToTop.png" ) );
|
||||
mActionMoveItemsToBottom->setIcon( QgsApplication::getThemeIcon( "/mActionMoveItemsToBottom.png" ) );
|
||||
mActionAlignLeft->setIcon( QgsApplication::getThemeIcon( "/mActionAlignLeft.png" ) );
|
||||
mActionAlignHCenter->setIcon( QgsApplication::getThemeIcon( "/mActionAlignHCenter.png" ) );
|
||||
mActionAlignRight->setIcon( QgsApplication::getThemeIcon( "/mActionAlignRight.png" ) );
|
||||
mActionAlignTop->setIcon( QgsApplication::getThemeIcon( "/mActionAlignTop.png" ) );
|
||||
mActionAlignVCenter->setIcon( QgsApplication::getThemeIcon( "/mActionAlignVCenter.png" ) );
|
||||
mActionAlignBottom->setIcon( QgsApplication::getThemeIcon( "/mActionAlignBottom.png" ) );
|
||||
}
|
||||
|
||||
void QgsComposer::setIconSizes( int size )
|
||||
|
@ -674,13 +674,13 @@ void QgsLegend::handleRightClickEvent( QTreeWidgetItem* item, const QPoint& posi
|
||||
}
|
||||
else if ( li->type() == QgsLegendItem::LEGEND_GROUP )
|
||||
{
|
||||
theMenu.addAction( QgisApp::getThemeIcon( "/mActionZoomToLayer.png" ),
|
||||
theMenu.addAction( QgsApplication::getThemeIcon( "/mActionZoomToLayer.png" ),
|
||||
tr( "Zoom to Group" ), this, SLOT( legendLayerZoom() ) );
|
||||
|
||||
// use QGisApp::removeLayer() to remove all selected layers+groups
|
||||
theMenu.addAction( QgisApp::getThemeIcon( "/mActionRemoveLayer.png" ), tr( "&Remove" ), QgisApp::instance(), SLOT( removeLayer() ) );
|
||||
theMenu.addAction( QgsApplication::getThemeIcon( "/mActionRemoveLayer.png" ), tr( "&Remove" ), QgisApp::instance(), SLOT( removeLayer() ) );
|
||||
|
||||
theMenu.addAction( QgisApp::getThemeIcon( "/mActionSetCRS.png" ),
|
||||
theMenu.addAction( QgsApplication::getThemeIcon( "/mActionSetCRS.png" ),
|
||||
tr( "&Set Group CRS" ), this, SLOT( legendGroupSetCRS() ) );
|
||||
}
|
||||
|
||||
@ -709,11 +709,11 @@ void QgsLegend::handleRightClickEvent( QTreeWidgetItem* item, const QPoint& posi
|
||||
}
|
||||
}
|
||||
|
||||
theMenu.addAction( QgisApp::getThemeIcon( "/folder_new.png" ), tr( "&Add New Group" ), this, SLOT( addGroupToCurrentItem() ) );
|
||||
theMenu.addAction( QgisApp::getThemeIcon( "/mActionExpandTree.png" ), tr( "&Expand All" ), this, SLOT( expandAll() ) );
|
||||
theMenu.addAction( QgisApp::getThemeIcon( "/mActionCollapseTree.png" ), tr( "&Collapse All" ), this, SLOT( collapseAll() ) );
|
||||
theMenu.addAction( QgsApplication::getThemeIcon( "/folder_new.png" ), tr( "&Add New Group" ), this, SLOT( addGroupToCurrentItem() ) );
|
||||
theMenu.addAction( QgsApplication::getThemeIcon( "/mActionExpandTree.png" ), tr( "&Expand All" ), this, SLOT( expandAll() ) );
|
||||
theMenu.addAction( QgsApplication::getThemeIcon( "/mActionCollapseTree.png" ), tr( "&Collapse All" ), this, SLOT( collapseAll() ) );
|
||||
|
||||
QAction *updateDrawingOrderAction = theMenu.addAction( QgisApp::getThemeIcon( "/mUpdateDrawingOrder.png" ), tr( "&Update Drawing Order" ), this, SLOT( toggleDrawingOrderUpdate() ) );
|
||||
QAction *updateDrawingOrderAction = theMenu.addAction( QgsApplication::getThemeIcon( "/mUpdateDrawingOrder.png" ), tr( "&Update Drawing Order" ), this, SLOT( toggleDrawingOrderUpdate() ) );
|
||||
updateDrawingOrderAction->setCheckable( true );
|
||||
updateDrawingOrderAction->setChecked( mUpdateDrawingOrder );
|
||||
|
||||
@ -722,10 +722,10 @@ void QgsLegend::handleRightClickEvent( QTreeWidgetItem* item, const QPoint& posi
|
||||
|
||||
void QgsLegend::initPixmaps()
|
||||
{
|
||||
mPixmaps.mOriginalPixmap = QgisApp::getThemePixmap( "/mActionFileSmall.png" );
|
||||
mPixmaps.mInOverviewPixmap = QgisApp::getThemePixmap( "/mActionInOverview.png" );
|
||||
mPixmaps.mEditablePixmap = QgisApp::getThemePixmap( "/mIconEditable.png" );
|
||||
mPixmaps.mProjectionErrorPixmap = QgisApp::getThemePixmap( "/mIconProjectionProblem.png" );
|
||||
mPixmaps.mOriginalPixmap = QgsApplication::getThemePixmap( "/mActionFileSmall.png" );
|
||||
mPixmaps.mInOverviewPixmap = QgsApplication::getThemePixmap( "/mActionInOverview.png" );
|
||||
mPixmaps.mEditablePixmap = QgsApplication::getThemePixmap( "/mIconEditable.png" );
|
||||
mPixmaps.mProjectionErrorPixmap = QgsApplication::getThemePixmap( "/mIconProjectionProblem.png" );
|
||||
}
|
||||
|
||||
Qt::CheckState QgsLegend::layerCheckState( QgsMapLayer * layer )
|
||||
|
@ -25,7 +25,7 @@ QgsLegendGroup::QgsLegendGroup( QTreeWidgetItem * theItem, QString theName )
|
||||
mType = LEGEND_GROUP;
|
||||
setFlags( Qt::ItemIsEditable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable );
|
||||
setCheckState( 0, Qt::Checked );
|
||||
QIcon myIcon = QgisApp::getThemeIcon( "/mActionFolder.png" );
|
||||
QIcon myIcon = QgsApplication::getThemeIcon( "/mActionFolder.png" );
|
||||
setIcon( 0, myIcon );
|
||||
}
|
||||
QgsLegendGroup::QgsLegendGroup( QTreeWidget* theListView, QString theString )
|
||||
@ -34,7 +34,7 @@ QgsLegendGroup::QgsLegendGroup( QTreeWidget* theListView, QString theString )
|
||||
mType = LEGEND_GROUP;
|
||||
setFlags( Qt::ItemIsEditable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable );
|
||||
setCheckState( 0, Qt::Checked );
|
||||
QIcon myIcon = QgisApp::getThemeIcon( "/mActionFolder.png" );
|
||||
QIcon myIcon = QgsApplication::getThemeIcon( "/mActionFolder.png" );
|
||||
setIcon( 0, myIcon );
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ QgsLegendGroup::QgsLegendGroup( QString name ): QgsLegendItem()
|
||||
mType = LEGEND_GROUP;
|
||||
setFlags( Qt::ItemIsEditable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable );
|
||||
setCheckState( 0, Qt::Checked );
|
||||
QIcon myIcon = QgisApp::getThemeIcon( + "/mActionFolder.png" );
|
||||
QIcon myIcon = QgsApplication::getThemeIcon( + "/mActionFolder.png" );
|
||||
setText( 0, name );
|
||||
setIcon( 0, myIcon );
|
||||
}
|
||||
|
@ -325,7 +325,7 @@ void QgsLegendLayer::updateIcon()
|
||||
if ( theFile->isInOverview() )
|
||||
{
|
||||
// Overlay the overview icon on the default icon
|
||||
QPixmap myPixmap = QgisApp::getThemePixmap( "/mIconOverview.png" );
|
||||
QPixmap myPixmap = QgsApplication::getThemePixmap( "/mIconOverview.png" );
|
||||
QPainter p( &newIcon );
|
||||
p.drawPixmap( 0, 0, myPixmap );
|
||||
p.end();
|
||||
@ -334,7 +334,7 @@ void QgsLegendLayer::updateIcon()
|
||||
//editable
|
||||
if ( theLayer->isEditable() )
|
||||
{
|
||||
QPixmap myPixmap = QgisApp::getThemePixmap( "/mIconEditable.png" );
|
||||
QPixmap myPixmap = QgsApplication::getThemePixmap( "/mIconEditable.png" );
|
||||
// use editable icon instead of the layer's type icon
|
||||
newIcon = myPixmap;
|
||||
|
||||
@ -371,15 +371,15 @@ QPixmap QgsLegendLayer::getOriginalPixmap()
|
||||
switch ( vlayer->geometryType() )
|
||||
{
|
||||
case QGis::Point:
|
||||
return QgisApp::getThemePixmap( "/mIconPointLayer.png" );
|
||||
return QgsApplication::getThemePixmap( "/mIconPointLayer.png" );
|
||||
case QGis::Line:
|
||||
return QgisApp::getThemePixmap( "/mIconLineLayer.png" );
|
||||
return QgsApplication::getThemePixmap( "/mIconLineLayer.png" );
|
||||
case QGis::Polygon:
|
||||
return QgisApp::getThemePixmap( "/mIconPolygonLayer.png" );
|
||||
return QgsApplication::getThemePixmap( "/mIconPolygonLayer.png" );
|
||||
case QGis::NoGeometry:
|
||||
return QgisApp::getThemePixmap( "/mIconTableLayer.png" );
|
||||
return QgsApplication::getThemePixmap( "/mIconTableLayer.png" );
|
||||
default:
|
||||
return QgisApp::getThemePixmap( "/mIconLayer.png" );
|
||||
return QgsApplication::getThemePixmap( "/mIconLayer.png" );
|
||||
}
|
||||
}
|
||||
else if ( theLayer->type() == QgsMapLayer::RasterLayer )
|
||||
@ -400,7 +400,7 @@ QPixmap QgsLegendLayer::getOriginalPixmap()
|
||||
}
|
||||
|
||||
// undefined - should never reach this
|
||||
return QgisApp::getThemePixmap( "/mIconLayer.png" );
|
||||
return QgsApplication::getThemePixmap( "/mIconLayer.png" );
|
||||
}
|
||||
|
||||
void QgsLegendLayer::addToPopupMenu( QMenu& theMenu )
|
||||
@ -409,7 +409,7 @@ void QgsLegendLayer::addToPopupMenu( QMenu& theMenu )
|
||||
QAction *toggleEditingAction = QgisApp::instance()->actionToggleEditing();
|
||||
|
||||
// zoom to layer extent
|
||||
theMenu.addAction( QgisApp::getThemeIcon( "/mActionZoomToLayer.png" ),
|
||||
theMenu.addAction( QgsApplication::getThemeIcon( "/mActionZoomToLayer.png" ),
|
||||
tr( "&Zoom to Layer Extent" ), legend(), SLOT( legendLayerZoom() ) );
|
||||
if ( lyr->type() == QgsMapLayer::RasterLayer )
|
||||
{
|
||||
@ -430,13 +430,13 @@ void QgsLegendLayer::addToPopupMenu( QMenu& theMenu )
|
||||
showInOverviewAction->blockSignals( false );
|
||||
|
||||
// remove from canvas
|
||||
theMenu.addAction( QgisApp::getThemeIcon( "/mActionRemoveLayer.png" ), tr( "&Remove" ), QgisApp::instance(), SLOT( removeLayer() ) );
|
||||
theMenu.addAction( QgsApplication::getThemeIcon( "/mActionRemoveLayer.png" ), tr( "&Remove" ), QgisApp::instance(), SLOT( removeLayer() ) );
|
||||
|
||||
// set layer crs
|
||||
theMenu.addAction( QgisApp::getThemeIcon( "/mActionSetCRS.png" ), tr( "&Set Layer CRS" ), QgisApp::instance(), SLOT( setLayerCRS() ) );
|
||||
theMenu.addAction( QgsApplication::getThemeIcon( "/mActionSetCRS.png" ), tr( "&Set Layer CRS" ), QgisApp::instance(), SLOT( setLayerCRS() ) );
|
||||
|
||||
// assign layer crs to project
|
||||
theMenu.addAction( QgisApp::getThemeIcon( "/mActionSetProjectCRS.png" ), tr( "Set &Project CRS from Layer" ), QgisApp::instance(), SLOT( setProjectCRSFromLayer() ) );
|
||||
theMenu.addAction( QgsApplication::getThemeIcon( "/mActionSetProjectCRS.png" ), tr( "Set &Project CRS from Layer" ), QgisApp::instance(), SLOT( setProjectCRSFromLayer() ) );
|
||||
|
||||
theMenu.addSeparator();
|
||||
|
||||
@ -445,7 +445,7 @@ void QgsLegendLayer::addToPopupMenu( QMenu& theMenu )
|
||||
QgsVectorLayer* vlayer = qobject_cast<QgsVectorLayer *>( lyr );
|
||||
|
||||
// attribute table
|
||||
theMenu.addAction( QgisApp::getThemeIcon( "/mActionOpenTable.png" ), tr( "&Open Attribute Table" ),
|
||||
theMenu.addAction( QgsApplication::getThemeIcon( "/mActionOpenTable.png" ), tr( "&Open Attribute Table" ),
|
||||
QgisApp::instance(), SLOT( attributeTable() ) );
|
||||
|
||||
// allow editing
|
||||
|
@ -22,7 +22,7 @@ QgsLegendPropertyGroup::QgsLegendPropertyGroup( QTreeWidgetItem* theLegendItem,
|
||||
: QgsLegendItem( theLegendItem, theString )
|
||||
{
|
||||
mType = LEGEND_PROPERTY_GROUP;
|
||||
QIcon myIcon = QgisApp::getThemeIcon( "/mIconProperties.png" );
|
||||
QIcon myIcon = QgsApplication::getThemeIcon( "/mIconProperties.png" );
|
||||
setText( 0, theString );
|
||||
setIcon( 0, myIcon );
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ QgsLegendSymbologyGroup::QgsLegendSymbologyGroup( QTreeWidgetItem * theItem, QSt
|
||||
: QgsLegendItem( theItem, theString )
|
||||
{
|
||||
mType = LEGEND_SYMBOL_GROUP;
|
||||
QIcon myIcon = QgisApp::getThemeIcon( "/mIconSymbology.png" );
|
||||
QIcon myIcon = QgsApplication::getThemeIcon( "/mIconSymbology.png" );
|
||||
setText( 0, theString );
|
||||
setIcon( 0, myIcon );
|
||||
}
|
||||
|
@ -68,6 +68,7 @@
|
||||
#include <QThread>
|
||||
|
||||
#include <qgsnetworkaccessmanager.h>
|
||||
#include <qgsapplication.h>
|
||||
|
||||
#include <QNetworkReply>
|
||||
#include <QNetworkProxy>
|
||||
@ -1336,7 +1337,7 @@ void QgisApp::createStatusBar()
|
||||
mToggleExtentsViewButton->setObjectName( "mToggleExtentsViewButton" );
|
||||
mToggleExtentsViewButton->setMaximumWidth( 20 );
|
||||
mToggleExtentsViewButton->setMaximumHeight( 20 );
|
||||
mToggleExtentsViewButton->setIcon( getThemeIcon( "tracking.png" ) );
|
||||
mToggleExtentsViewButton->setIcon( QgsApplication::getThemeIcon( "tracking.png" ) );
|
||||
mToggleExtentsViewButton->setToolTip( tr( "Toggle extents and mouse position display" ) );
|
||||
mToggleExtentsViewButton->setCheckable( true );
|
||||
connect( mToggleExtentsViewButton, SIGNAL( toggled( bool ) ), this, SLOT( extentsViewToggled( bool ) ) );
|
||||
@ -1414,7 +1415,7 @@ void QgisApp::createStatusBar()
|
||||
mStopRenderButton->setObjectName( "mStopRenderButton" );
|
||||
mStopRenderButton->setMaximumWidth( 20 );
|
||||
mStopRenderButton->setMaximumHeight( 20 );
|
||||
mStopRenderButton->setIcon( getThemeIcon( "mIconStopRendering.png" ) );
|
||||
mStopRenderButton->setIcon( QgsApplication::getThemeIcon( "mIconStopRendering.png" ) );
|
||||
mStopRenderButton->setToolTip( tr( "Stop map rendering" ) );
|
||||
statusBar()->addPermanentWidget( mStopRenderButton, 0 );
|
||||
// render suppression status bar widget
|
||||
@ -1448,7 +1449,7 @@ void QgisApp::createStatusBar()
|
||||
// Maintain uniform widget height in status bar by setting button height same as labels
|
||||
// For Qt/Mac 3.3, the default toolbutton height is 30 and labels were expanding to match
|
||||
mOnTheFlyProjectionStatusButton->setMaximumHeight( mScaleLabel->height() );
|
||||
mOnTheFlyProjectionStatusButton->setIcon( getThemeIcon( "mIconProjectionEnabled.png" ) );
|
||||
mOnTheFlyProjectionStatusButton->setIcon( QgsApplication::getThemeIcon( "mIconProjectionEnabled.png" ) );
|
||||
mOnTheFlyProjectionStatusButton->setWhatsThis( tr( "This icon shows whether "
|
||||
"on the fly coordinate reference system transformation is enabled or not. "
|
||||
"Click the icon to bring up "
|
||||
@ -1503,114 +1504,114 @@ void QgisApp::setTheme( QString theThemeName )
|
||||
*/
|
||||
QgsApplication::setThemeName( theThemeName );
|
||||
//QgsDebugMsg("Setting theme to \n" + theThemeName);
|
||||
mActionNewProject->setIcon( getThemeIcon( "/mActionFileNew.png" ) );
|
||||
mActionOpenProject->setIcon( getThemeIcon( "/mActionFileOpen.png" ) );
|
||||
mActionSaveProject->setIcon( getThemeIcon( "/mActionFileSave.png" ) );
|
||||
mActionSaveProjectAs->setIcon( getThemeIcon( "/mActionFileSaveAs.png" ) );
|
||||
mActionNewPrintComposer->setIcon( getThemeIcon( "/mActionNewComposer.png" ) );
|
||||
mActionShowComposerManager->setIcon( getThemeIcon( "/mActionComposerManager.png" ) );
|
||||
mActionSaveMapAsImage->setIcon( getThemeIcon( "/mActionSaveMapAsImage.png" ) );
|
||||
mActionExit->setIcon( getThemeIcon( "/mActionFileExit.png" ) );
|
||||
mActionAddOgrLayer->setIcon( getThemeIcon( "/mActionAddOgrLayer.png" ) );
|
||||
mActionAddRasterLayer->setIcon( getThemeIcon( "/mActionAddRasterLayer.png" ) );
|
||||
mActionNewProject->setIcon( QgsApplication::getThemeIcon( "/mActionFileNew.png" ) );
|
||||
mActionOpenProject->setIcon( QgsApplication::getThemeIcon( "/mActionFileOpen.png" ) );
|
||||
mActionSaveProject->setIcon( QgsApplication::getThemeIcon( "/mActionFileSave.png" ) );
|
||||
mActionSaveProjectAs->setIcon( QgsApplication::getThemeIcon( "/mActionFileSaveAs.png" ) );
|
||||
mActionNewPrintComposer->setIcon( QgsApplication::getThemeIcon( "/mActionNewComposer.png" ) );
|
||||
mActionShowComposerManager->setIcon( QgsApplication::getThemeIcon( "/mActionComposerManager.png" ) );
|
||||
mActionSaveMapAsImage->setIcon( QgsApplication::getThemeIcon( "/mActionSaveMapAsImage.png" ) );
|
||||
mActionExit->setIcon( QgsApplication::getThemeIcon( "/mActionFileExit.png" ) );
|
||||
mActionAddOgrLayer->setIcon( QgsApplication::getThemeIcon( "/mActionAddOgrLayer.png" ) );
|
||||
mActionAddRasterLayer->setIcon( QgsApplication::getThemeIcon( "/mActionAddRasterLayer.png" ) );
|
||||
#ifdef HAVE_POSTGRESQL
|
||||
mActionAddPgLayer->setIcon( getThemeIcon( "/mActionAddLayer.png" ) );
|
||||
mActionAddPgLayer->setIcon( QgsApplication::getThemeIcon( "/mActionAddLayer.png" ) );
|
||||
#endif
|
||||
#ifdef HAVE_SPATIALITE
|
||||
mActionNewSpatialiteLayer->setIcon( getThemeIcon( "/mActionNewVectorLayer.png" ) );
|
||||
mActionAddSpatiaLiteLayer->setIcon( getThemeIcon( "/mActionAddSpatiaLiteLayer.png" ) );
|
||||
mActionNewSpatialiteLayer->setIcon( QgsApplication::getThemeIcon( "/mActionNewVectorLayer.png" ) );
|
||||
mActionAddSpatiaLiteLayer->setIcon( QgsApplication::getThemeIcon( "/mActionAddSpatiaLiteLayer.png" ) );
|
||||
#endif
|
||||
#ifdef HAVE_MSSQL
|
||||
mActionAddMssqlLayer->setIcon( getThemeIcon( "/mActionAddMssqlLayer.png" ) );
|
||||
mActionAddMssqlLayer->setIcon( QgsApplication::getThemeIcon( "/mActionAddMssqlLayer.png" ) );
|
||||
#endif
|
||||
mActionRemoveLayer->setIcon( getThemeIcon( "/mActionRemoveLayer.png" ) );
|
||||
mActionSetLayerCRS->setIcon( getThemeIcon( "/mActionSetLayerCRS.png" ) );
|
||||
mActionSetProjectCRSFromLayer->setIcon( getThemeIcon( "/mActionSetProjectCRSFromLayer.png" ) );
|
||||
mActionNewVectorLayer->setIcon( getThemeIcon( "/mActionNewVectorLayer.png" ) );
|
||||
mActionAddAllToOverview->setIcon( getThemeIcon( "/mActionAddAllToOverview.png" ) );
|
||||
mActionHideAllLayers->setIcon( getThemeIcon( "/mActionHideAllLayers.png" ) );
|
||||
mActionShowAllLayers->setIcon( getThemeIcon( "/mActionShowAllLayers.png" ) );
|
||||
mActionRemoveAllFromOverview->setIcon( getThemeIcon( "/mActionRemoveAllFromOverview.png" ) );
|
||||
mActionToggleFullScreen->setIcon( getThemeIcon( "/mActionToggleFullScreen.png" ) );
|
||||
mActionProjectProperties->setIcon( getThemeIcon( "/mActionProjectProperties.png" ) );
|
||||
mActionManagePlugins->setIcon( getThemeIcon( "/mActionShowPluginManager.png" ) );
|
||||
mActionCheckQgisVersion->setIcon( getThemeIcon( "/mActionCheckQgisVersion.png" ) );
|
||||
mActionOptions->setIcon( getThemeIcon( "/mActionOptions.png" ) );
|
||||
mActionConfigureShortcuts->setIcon( getThemeIcon( "/mActionOptions.png" ) );
|
||||
mActionCustomization->setIcon( getThemeIcon( "/mActionOptions.png" ) );
|
||||
mActionHelpContents->setIcon( getThemeIcon( "/mActionHelpContents.png" ) );
|
||||
mActionLocalHistogramStretch->setIcon( getThemeIcon( "/mActionLocalHistogramStretch.png" ) );
|
||||
mActionFullHistogramStretch->setIcon( getThemeIcon( "/mActionFullHistogramStretch.png" ) );
|
||||
mActionZoomActualSize->setIcon( getThemeIcon( "/mActionZoomNative.png" ) );
|
||||
mActionQgisHomePage->setIcon( getThemeIcon( "/mActionQgisHomePage.png" ) );
|
||||
mActionAbout->setIcon( getThemeIcon( "/mActionHelpAbout.png" ) );
|
||||
mActionSponsors->setIcon( getThemeIcon( "/mActionHelpSponsors.png" ) );
|
||||
mActionDraw->setIcon( getThemeIcon( "/mActionDraw.png" ) );
|
||||
mActionToggleEditing->setIcon( getThemeIcon( "/mActionToggleEditing.png" ) );
|
||||
mActionSaveEdits->setIcon( getThemeIcon( "/mActionSaveEdits.png" ) );
|
||||
mActionCutFeatures->setIcon( getThemeIcon( "/mActionEditCut.png" ) );
|
||||
mActionCopyFeatures->setIcon( getThemeIcon( "/mActionEditCopy.png" ) );
|
||||
mActionPasteFeatures->setIcon( getThemeIcon( "/mActionEditPaste.png" ) );
|
||||
mActionAddFeature->setIcon( getThemeIcon( "/mActionCapturePoint.png" ) );
|
||||
mActionMoveFeature->setIcon( getThemeIcon( "/mActionMoveFeature.png" ) );
|
||||
mActionReshapeFeatures->setIcon( getThemeIcon( "/mActionReshape.png" ) );
|
||||
mActionSplitFeatures->setIcon( getThemeIcon( "/mActionSplitFeatures.png" ) );
|
||||
mActionDeleteSelected->setIcon( getThemeIcon( "/mActionDeleteSelected.png" ) );
|
||||
mActionNodeTool->setIcon( getThemeIcon( "/mActionNodeTool.png" ) );
|
||||
mActionSimplifyFeature->setIcon( getThemeIcon( "/mActionSimplify.png" ) );
|
||||
mActionUndo->setIcon( getThemeIcon( "/mActionUndo.png" ) );
|
||||
mActionRedo->setIcon( getThemeIcon( "/mActionRedo.png" ) );
|
||||
mActionAddRing->setIcon( getThemeIcon( "/mActionAddRing.png" ) );
|
||||
mActionAddPart->setIcon( getThemeIcon( "/mActionAddPart.png" ) );
|
||||
mActionDeleteRing->setIcon( getThemeIcon( "/mActionDeleteRing.png" ) );
|
||||
mActionDeletePart->setIcon( getThemeIcon( "/mActionDeletePart.png" ) );
|
||||
mActionMergeFeatures->setIcon( getThemeIcon( "/mActionMergeFeatures.png" ) );
|
||||
mActionMergeFeatureAttributes->setIcon( getThemeIcon( "/mActionMergeFeatureAttributes.png" ) );
|
||||
mActionRotatePointSymbols->setIcon( getThemeIcon( "mActionRotatePointSymbols.png" ) );
|
||||
mActionZoomIn->setIcon( getThemeIcon( "/mActionZoomIn.png" ) );
|
||||
mActionZoomOut->setIcon( getThemeIcon( "/mActionZoomOut.png" ) );
|
||||
mActionZoomFullExtent->setIcon( getThemeIcon( "/mActionZoomFullExtent.png" ) );
|
||||
mActionZoomToSelected->setIcon( getThemeIcon( "/mActionZoomToSelected.png" ) );
|
||||
mActionShowRasterCalculator->setIcon( getThemeIcon( "/mActionShowRasterCalculator.png" ) );
|
||||
mActionRemoveLayer->setIcon( QgsApplication::getThemeIcon( "/mActionRemoveLayer.png" ) );
|
||||
mActionSetLayerCRS->setIcon( QgsApplication::getThemeIcon( "/mActionSetLayerCRS.png" ) );
|
||||
mActionSetProjectCRSFromLayer->setIcon( QgsApplication::getThemeIcon( "/mActionSetProjectCRSFromLayer.png" ) );
|
||||
mActionNewVectorLayer->setIcon( QgsApplication::getThemeIcon( "/mActionNewVectorLayer.png" ) );
|
||||
mActionAddAllToOverview->setIcon( QgsApplication::getThemeIcon( "/mActionAddAllToOverview.png" ) );
|
||||
mActionHideAllLayers->setIcon( QgsApplication::getThemeIcon( "/mActionHideAllLayers.png" ) );
|
||||
mActionShowAllLayers->setIcon( QgsApplication::getThemeIcon( "/mActionShowAllLayers.png" ) );
|
||||
mActionRemoveAllFromOverview->setIcon( QgsApplication::getThemeIcon( "/mActionRemoveAllFromOverview.png" ) );
|
||||
mActionToggleFullScreen->setIcon( QgsApplication::getThemeIcon( "/mActionToggleFullScreen.png" ) );
|
||||
mActionProjectProperties->setIcon( QgsApplication::getThemeIcon( "/mActionProjectProperties.png" ) );
|
||||
mActionManagePlugins->setIcon( QgsApplication::getThemeIcon( "/mActionShowPluginManager.png" ) );
|
||||
mActionCheckQgisVersion->setIcon( QgsApplication::getThemeIcon( "/mActionCheckQgisVersion.png" ) );
|
||||
mActionOptions->setIcon( QgsApplication::getThemeIcon( "/mActionOptions.png" ) );
|
||||
mActionConfigureShortcuts->setIcon( QgsApplication::getThemeIcon( "/mActionOptions.png" ) );
|
||||
mActionCustomization->setIcon( QgsApplication::getThemeIcon( "/mActionOptions.png" ) );
|
||||
mActionHelpContents->setIcon( QgsApplication::getThemeIcon( "/mActionHelpContents.png" ) );
|
||||
mActionLocalHistogramStretch->setIcon( QgsApplication::getThemeIcon( "/mActionLocalHistogramStretch.png" ) );
|
||||
mActionFullHistogramStretch->setIcon( QgsApplication::getThemeIcon( "/mActionFullHistogramStretch.png" ) );
|
||||
mActionZoomActualSize->setIcon( QgsApplication::getThemeIcon( "/mActionZoomNative.png" ) );
|
||||
mActionQgisHomePage->setIcon( QgsApplication::getThemeIcon( "/mActionQgisHomePage.png" ) );
|
||||
mActionAbout->setIcon( QgsApplication::getThemeIcon( "/mActionHelpAbout.png" ) );
|
||||
mActionSponsors->setIcon( QgsApplication::getThemeIcon( "/mActionHelpSponsors.png" ) );
|
||||
mActionDraw->setIcon( QgsApplication::getThemeIcon( "/mActionDraw.png" ) );
|
||||
mActionToggleEditing->setIcon( QgsApplication::getThemeIcon( "/mActionToggleEditing.png" ) );
|
||||
mActionSaveEdits->setIcon( QgsApplication::getThemeIcon( "/mActionSaveEdits.png" ) );
|
||||
mActionCutFeatures->setIcon( QgsApplication::getThemeIcon( "/mActionEditCut.png" ) );
|
||||
mActionCopyFeatures->setIcon( QgsApplication::getThemeIcon( "/mActionEditCopy.png" ) );
|
||||
mActionPasteFeatures->setIcon( QgsApplication::getThemeIcon( "/mActionEditPaste.png" ) );
|
||||
mActionAddFeature->setIcon( QgsApplication::getThemeIcon( "/mActionCapturePoint.png" ) );
|
||||
mActionMoveFeature->setIcon( QgsApplication::getThemeIcon( "/mActionMoveFeature.png" ) );
|
||||
mActionReshapeFeatures->setIcon( QgsApplication::getThemeIcon( "/mActionReshape.png" ) );
|
||||
mActionSplitFeatures->setIcon( QgsApplication::getThemeIcon( "/mActionSplitFeatures.png" ) );
|
||||
mActionDeleteSelected->setIcon( QgsApplication::getThemeIcon( "/mActionDeleteSelected.png" ) );
|
||||
mActionNodeTool->setIcon( QgsApplication::getThemeIcon( "/mActionNodeTool.png" ) );
|
||||
mActionSimplifyFeature->setIcon( QgsApplication::getThemeIcon( "/mActionSimplify.png" ) );
|
||||
mActionUndo->setIcon( QgsApplication::getThemeIcon( "/mActionUndo.png" ) );
|
||||
mActionRedo->setIcon( QgsApplication::getThemeIcon( "/mActionRedo.png" ) );
|
||||
mActionAddRing->setIcon( QgsApplication::getThemeIcon( "/mActionAddRing.png" ) );
|
||||
mActionAddPart->setIcon( QgsApplication::getThemeIcon( "/mActionAddPart.png" ) );
|
||||
mActionDeleteRing->setIcon( QgsApplication::getThemeIcon( "/mActionDeleteRing.png" ) );
|
||||
mActionDeletePart->setIcon( QgsApplication::getThemeIcon( "/mActionDeletePart.png" ) );
|
||||
mActionMergeFeatures->setIcon( QgsApplication::getThemeIcon( "/mActionMergeFeatures.png" ) );
|
||||
mActionMergeFeatureAttributes->setIcon( QgsApplication::getThemeIcon( "/mActionMergeFeatureAttributes.png" ) );
|
||||
mActionRotatePointSymbols->setIcon( QgsApplication::getThemeIcon( "mActionRotatePointSymbols.png" ) );
|
||||
mActionZoomIn->setIcon( QgsApplication::getThemeIcon( "/mActionZoomIn.png" ) );
|
||||
mActionZoomOut->setIcon( QgsApplication::getThemeIcon( "/mActionZoomOut.png" ) );
|
||||
mActionZoomFullExtent->setIcon( QgsApplication::getThemeIcon( "/mActionZoomFullExtent.png" ) );
|
||||
mActionZoomToSelected->setIcon( QgsApplication::getThemeIcon( "/mActionZoomToSelected.png" ) );
|
||||
mActionShowRasterCalculator->setIcon( QgsApplication::getThemeIcon( "/mActionShowRasterCalculator.png" ) );
|
||||
#ifdef HAVE_TOUCH
|
||||
mActionTouch->setIcon( getThemeIcon( "/mActionTouch.png" ) );
|
||||
mActionTouch->setIcon( QgsApplication::getThemeIcon( "/mActionTouch.png" ) );
|
||||
#endif
|
||||
mActionPan->setIcon( getThemeIcon( "/mActionPan.png" ) );
|
||||
mActionZoomLast->setIcon( getThemeIcon( "/mActionZoomLast.png" ) );
|
||||
mActionZoomNext->setIcon( getThemeIcon( "/mActionZoomNext.png" ) );
|
||||
mActionZoomToLayer->setIcon( getThemeIcon( "/mActionZoomToLayer.png" ) );
|
||||
mActionZoomActualSize->setIcon( getThemeIcon( "/mActionZoomActual.png" ) );
|
||||
mActionIdentify->setIcon( getThemeIcon( "/mActionIdentify.png" ) );
|
||||
mActionFeatureAction->setIcon( getThemeIcon( "/mAction.png" ) );
|
||||
mActionSelect->setIcon( getThemeIcon( "/mActionSelect.png" ) );
|
||||
mActionSelectRectangle->setIcon( getThemeIcon( "/mActionSelectRectangle.png" ) );
|
||||
mActionSelectPolygon->setIcon( getThemeIcon( "/mActionSelectPolygon.png" ) );
|
||||
mActionSelectFreehand->setIcon( getThemeIcon( "/mActionSelectFreehand.png" ) );
|
||||
mActionSelectRadius->setIcon( getThemeIcon( "/mActionSelectRadius.png" ) );
|
||||
mActionDeselectAll->setIcon( getThemeIcon( "/mActionDeselectAll.png" ) );
|
||||
mActionOpenTable->setIcon( getThemeIcon( "/mActionOpenTable.png" ) );
|
||||
mActionMeasure->setIcon( getThemeIcon( "/mActionMeasure.png" ) );
|
||||
mActionMeasureArea->setIcon( getThemeIcon( "/mActionMeasureArea.png" ) );
|
||||
mActionMeasureAngle->setIcon( getThemeIcon( "/mActionMeasureAngle.png" ) );
|
||||
mActionMapTips->setIcon( getThemeIcon( "/mActionMapTips.png" ) );
|
||||
mActionShowBookmarks->setIcon( getThemeIcon( "/mActionShowBookmarks.png" ) );
|
||||
mActionNewBookmark->setIcon( getThemeIcon( "/mActionNewBookmark.png" ) );
|
||||
mActionCustomProjection->setIcon( getThemeIcon( "/mActionCustomProjection.png" ) );
|
||||
mActionAddWmsLayer->setIcon( getThemeIcon( "/mActionAddWmsLayer.png" ) );
|
||||
mActionAddWcsLayer->setIcon( getThemeIcon( "/mActionAddWcsLayer.png" ) );
|
||||
mActionAddWfsLayer->setIcon( getThemeIcon( "/mActionAddWfsLayer.png" ) );
|
||||
mActionAddToOverview->setIcon( getThemeIcon( "/mActionInOverview.png" ) );
|
||||
mActionAnnotation->setIcon( getThemeIcon( "/mActionAnnotation.png" ) );
|
||||
mActionFormAnnotation->setIcon( getThemeIcon( "/mActionFormAnnotation.png" ) );
|
||||
mActionTextAnnotation->setIcon( getThemeIcon( "/mActionTextAnnotation.png" ) );
|
||||
mActionLabeling->setIcon( getThemeIcon( "/mActionLabeling.png" ) );
|
||||
mActionMoveLabel->setIcon( getThemeIcon( "/mActionMoveLabel.png" ) );
|
||||
mActionRotateLabel->setIcon( getThemeIcon( "/mActionRotateLabel.png" ) );
|
||||
mActionChangeLabelProperties->setIcon( getThemeIcon( "/mActionChangeLabelProperties.png" ) );
|
||||
mActionDecorationCopyright->setIcon( getThemeIcon( "/plugins/copyright_label.png" ) );
|
||||
mActionDecorationNorthArrow->setIcon( getThemeIcon( "/plugins/north_arrow.png" ) );
|
||||
mActionDecorationScaleBar->setIcon( getThemeIcon( "/plugins/scale_bar.png" ) );
|
||||
mActionDecorationGrid->setIcon( getThemeIcon( "/transformed.png" ) );
|
||||
mActionPan->setIcon( QgsApplication::getThemeIcon( "/mActionPan.png" ) );
|
||||
mActionZoomLast->setIcon( QgsApplication::getThemeIcon( "/mActionZoomLast.png" ) );
|
||||
mActionZoomNext->setIcon( QgsApplication::getThemeIcon( "/mActionZoomNext.png" ) );
|
||||
mActionZoomToLayer->setIcon( QgsApplication::getThemeIcon( "/mActionZoomToLayer.png" ) );
|
||||
mActionZoomActualSize->setIcon( QgsApplication::getThemeIcon( "/mActionZoomActual.png" ) );
|
||||
mActionIdentify->setIcon( QgsApplication::getThemeIcon( "/mActionIdentify.png" ) );
|
||||
mActionFeatureAction->setIcon( QgsApplication::getThemeIcon( "/mAction.png" ) );
|
||||
mActionSelect->setIcon( QgsApplication::getThemeIcon( "/mActionSelect.png" ) );
|
||||
mActionSelectRectangle->setIcon( QgsApplication::getThemeIcon( "/mActionSelectRectangle.png" ) );
|
||||
mActionSelectPolygon->setIcon( QgsApplication::getThemeIcon( "/mActionSelectPolygon.png" ) );
|
||||
mActionSelectFreehand->setIcon( QgsApplication::getThemeIcon( "/mActionSelectFreehand.png" ) );
|
||||
mActionSelectRadius->setIcon( QgsApplication::getThemeIcon( "/mActionSelectRadius.png" ) );
|
||||
mActionDeselectAll->setIcon( QgsApplication::getThemeIcon( "/mActionDeselectAll.png" ) );
|
||||
mActionOpenTable->setIcon( QgsApplication::getThemeIcon( "/mActionOpenTable.png" ) );
|
||||
mActionMeasure->setIcon( QgsApplication::getThemeIcon( "/mActionMeasure.png" ) );
|
||||
mActionMeasureArea->setIcon( QgsApplication::getThemeIcon( "/mActionMeasureArea.png" ) );
|
||||
mActionMeasureAngle->setIcon( QgsApplication::getThemeIcon( "/mActionMeasureAngle.png" ) );
|
||||
mActionMapTips->setIcon( QgsApplication::getThemeIcon( "/mActionMapTips.png" ) );
|
||||
mActionShowBookmarks->setIcon( QgsApplication::getThemeIcon( "/mActionShowBookmarks.png" ) );
|
||||
mActionNewBookmark->setIcon( QgsApplication::getThemeIcon( "/mActionNewBookmark.png" ) );
|
||||
mActionCustomProjection->setIcon( QgsApplication::getThemeIcon( "/mActionCustomProjection.png" ) );
|
||||
mActionAddWmsLayer->setIcon( QgsApplication::getThemeIcon( "/mActionAddWmsLayer.png" ) );
|
||||
mActionAddWcsLayer->setIcon( QgsApplication::getThemeIcon( "/mActionAddWcsLayer.png" ) );
|
||||
mActionAddWfsLayer->setIcon( QgsApplication::getThemeIcon( "/mActionAddWfsLayer.png" ) );
|
||||
mActionAddToOverview->setIcon( QgsApplication::getThemeIcon( "/mActionInOverview.png" ) );
|
||||
mActionAnnotation->setIcon( QgsApplication::getThemeIcon( "/mActionAnnotation.png" ) );
|
||||
mActionFormAnnotation->setIcon( QgsApplication::getThemeIcon( "/mActionFormAnnotation.png" ) );
|
||||
mActionTextAnnotation->setIcon( QgsApplication::getThemeIcon( "/mActionTextAnnotation.png" ) );
|
||||
mActionLabeling->setIcon( QgsApplication::getThemeIcon( "/mActionLabeling.png" ) );
|
||||
mActionMoveLabel->setIcon( QgsApplication::getThemeIcon( "/mActionMoveLabel.png" ) );
|
||||
mActionRotateLabel->setIcon( QgsApplication::getThemeIcon( "/mActionRotateLabel.png" ) );
|
||||
mActionChangeLabelProperties->setIcon( QgsApplication::getThemeIcon( "/mActionChangeLabelProperties.png" ) );
|
||||
mActionDecorationCopyright->setIcon( QgsApplication::getThemeIcon( "/plugins/copyright_label.png" ) );
|
||||
mActionDecorationNorthArrow->setIcon( QgsApplication::getThemeIcon( "/plugins/north_arrow.png" ) );
|
||||
mActionDecorationScaleBar->setIcon( QgsApplication::getThemeIcon( "/plugins/scale_bar.png" ) );
|
||||
mActionDecorationGrid->setIcon( QgsApplication::getThemeIcon( "/transformed.png" ) );
|
||||
|
||||
//change themes of all composers
|
||||
QSet<QgsComposer*>::iterator composerIt = mPrintComposers.begin();
|
||||
@ -6237,14 +6238,14 @@ void QgisApp::updateCRSStatusBar()
|
||||
mOnTheFlyProjectionStatusLabel->setEnabled( true );
|
||||
mOnTheFlyProjectionStatusLabel->setToolTip(
|
||||
tr( "Current CRS: %1 (OTFR enabled)" ).arg( mMapCanvas->mapRenderer()->destinationCrs().description() ) );
|
||||
mOnTheFlyProjectionStatusButton->setIcon( getThemeIcon( "mIconProjectionEnabled.png" ) );
|
||||
mOnTheFlyProjectionStatusButton->setIcon( QgsApplication::getThemeIcon( "mIconProjectionEnabled.png" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
mOnTheFlyProjectionStatusLabel->setEnabled( false );
|
||||
mOnTheFlyProjectionStatusLabel->setToolTip(
|
||||
tr( "Current CRS: %1 (OTFR disabled)" ).arg( mMapCanvas->mapRenderer()->destinationCrs().description() ) );
|
||||
mOnTheFlyProjectionStatusButton->setIcon( getThemeIcon( "mIconProjectionDisabled.png" ) );
|
||||
mOnTheFlyProjectionStatusButton->setIcon( QgsApplication::getThemeIcon( "mIconProjectionDisabled.png" ) );
|
||||
}
|
||||
}
|
||||
|
||||
@ -6295,7 +6296,7 @@ void QgisApp::extentsViewToggled( bool theFlag )
|
||||
if ( theFlag )
|
||||
{
|
||||
//extents view mode!
|
||||
mToggleExtentsViewButton->setIcon( getThemeIcon( "extents.png" ) );
|
||||
mToggleExtentsViewButton->setIcon( QgsApplication::getThemeIcon( "extents.png" ) );
|
||||
mCoordsEdit->setToolTip( tr( "Map coordinates for the current view extents" ) );
|
||||
mCoordsEdit->setReadOnly( true );
|
||||
showExtents();
|
||||
@ -6303,7 +6304,7 @@ void QgisApp::extentsViewToggled( bool theFlag )
|
||||
else
|
||||
{
|
||||
//mouse cursor pos view mode!
|
||||
mToggleExtentsViewButton->setIcon( getThemeIcon( "tracking.png" ) );
|
||||
mToggleExtentsViewButton->setIcon( QgsApplication::getThemeIcon( "tracking.png" ) );
|
||||
mCoordsEdit->setToolTip( tr( "Map coordinates at mouse cursor position" ) );
|
||||
mCoordsEdit->setReadOnly( false );
|
||||
mCoordsLabel->setText( tr( "Coordinate:" ) );
|
||||
@ -6724,7 +6725,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
|
||||
|
||||
if ( vlayer->geometryType() == QGis::Point )
|
||||
{
|
||||
mActionAddFeature->setIcon( getThemeIcon( "/mActionCapturePoint.png" ) );
|
||||
mActionAddFeature->setIcon( QgsApplication::getThemeIcon( "/mActionCapturePoint.png" ) );
|
||||
|
||||
mActionAddRing->setEnabled( false );
|
||||
mActionReshapeFeatures->setEnabled( false );
|
||||
@ -6744,7 +6745,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
|
||||
}
|
||||
else if ( vlayer->geometryType() == QGis::Line )
|
||||
{
|
||||
mActionAddFeature->setIcon( getThemeIcon( "/mActionCaptureLine.png" ) );
|
||||
mActionAddFeature->setIcon( QgsApplication::getThemeIcon( "/mActionCaptureLine.png" ) );
|
||||
|
||||
if ( vlayer->isEditable() && dprovider->capabilities() & QgsVectorDataProvider::AddFeatures )
|
||||
{
|
||||
@ -6765,7 +6766,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
|
||||
}
|
||||
else if ( vlayer->geometryType() == QGis::Polygon )
|
||||
{
|
||||
mActionAddFeature->setIcon( getThemeIcon( "/mActionCapturePolygon.png" ) );
|
||||
mActionAddFeature->setIcon( QgsApplication::getThemeIcon( "/mActionCapturePolygon.png" ) );
|
||||
|
||||
if ( vlayer->isEditable() && dprovider->capabilities() & QgsVectorDataProvider::AddFeatures )
|
||||
{
|
||||
@ -7318,42 +7319,6 @@ void QgisApp::oldProjectVersionWarning( QString oldVersion )
|
||||
return;
|
||||
}
|
||||
|
||||
QIcon QgisApp::getThemeIcon( const QString theName )
|
||||
{
|
||||
QString myPreferredPath = QgsApplication::activeThemePath() + QDir::separator() + theName;
|
||||
QString myDefaultPath = QgsApplication::defaultThemePath() + QDir::separator() + theName;
|
||||
if ( QFile::exists( myPreferredPath ) )
|
||||
{
|
||||
return QIcon( myPreferredPath );
|
||||
}
|
||||
else if ( QFile::exists( myDefaultPath ) )
|
||||
{
|
||||
//could still return an empty icon if it
|
||||
//doesnt exist in the default theme either!
|
||||
return QIcon( myDefaultPath );
|
||||
}
|
||||
else
|
||||
{
|
||||
return QIcon();
|
||||
}
|
||||
}
|
||||
|
||||
QPixmap QgisApp::getThemePixmap( const QString theName )
|
||||
{
|
||||
QString myPreferredPath = QgsApplication::activeThemePath() + QDir::separator() + theName;
|
||||
QString myDefaultPath = QgsApplication::defaultThemePath() + QDir::separator() + theName;
|
||||
if ( QFile::exists( myPreferredPath ) )
|
||||
{
|
||||
return QPixmap( myPreferredPath );
|
||||
}
|
||||
else
|
||||
{
|
||||
//could still return an empty icon if it
|
||||
//doesnt exist in the default theme either!
|
||||
return QPixmap( myDefaultPath );
|
||||
}
|
||||
}
|
||||
|
||||
void QgisApp::updateUndoActions()
|
||||
{
|
||||
bool canUndo = false, canRedo = false;
|
||||
|
@ -183,15 +183,6 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
|
||||
//! update proxy settings
|
||||
void namUpdate();
|
||||
|
||||
//! Helper to get a theme icon. It will fall back to the
|
||||
//default theme if the active theme does not have the required
|
||||
//icon.
|
||||
static QIcon getThemeIcon( const QString theName );
|
||||
//! Helper to get a theme icon as a pixmap. It will fall back to the
|
||||
//default theme if the active theme does not have the required
|
||||
//icon.
|
||||
static QPixmap getThemePixmap( const QString theName );
|
||||
|
||||
/** Add a dock widget to the main window. Overloaded from QMainWindow.
|
||||
* After adding the dock widget to the ui (by delegating to the QMainWindow
|
||||
* parent class, it will also add it to the View menu list of docks.*/
|
||||
|
@ -86,18 +86,18 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid
|
||||
|
||||
updateTitle();
|
||||
|
||||
mRemoveSelectionButton->setIcon( QgisApp::getThemeIcon( "/mActionUnselectAttributes.png" ) );
|
||||
mSelectedToTopButton->setIcon( QgisApp::getThemeIcon( "/mActionSelectedToTop.png" ) );
|
||||
mCopySelectedRowsButton->setIcon( QgisApp::getThemeIcon( "/mActionCopySelected.png" ) );
|
||||
mZoomMapToSelectedRowsButton->setIcon( QgisApp::getThemeIcon( "/mActionZoomToSelected.png" ) );
|
||||
mPanMapToSelectedRowsButton->setIcon( QgisApp::getThemeIcon( "/mActionPanToSelected.png" ) );
|
||||
mInvertSelectionButton->setIcon( QgisApp::getThemeIcon( "/mActionInvertSelection.png" ) );
|
||||
mToggleEditingButton->setIcon( QgisApp::getThemeIcon( "/mActionToggleEditing.png" ) );
|
||||
mSaveEditsButton->setIcon( QgisApp::getThemeIcon( "/mActionSaveEdits.png" ) );
|
||||
mDeleteSelectedButton->setIcon( QgisApp::getThemeIcon( "/mActionDeleteSelected.png" ) );
|
||||
mOpenFieldCalculator->setIcon( QgisApp::getThemeIcon( "/mActionCalculateField.png" ) );
|
||||
mAddAttribute->setIcon( QgisApp::getThemeIcon( "/mActionNewAttribute.png" ) );
|
||||
mRemoveAttribute->setIcon( QgisApp::getThemeIcon( "/mActionDeleteAttribute.png" ) );
|
||||
mRemoveSelectionButton->setIcon( QgsApplication::getThemeIcon( "/mActionUnselectAttributes.png" ) );
|
||||
mSelectedToTopButton->setIcon( QgsApplication::getThemeIcon( "/mActionSelectedToTop.png" ) );
|
||||
mCopySelectedRowsButton->setIcon( QgsApplication::getThemeIcon( "/mActionCopySelected.png" ) );
|
||||
mZoomMapToSelectedRowsButton->setIcon( QgsApplication::getThemeIcon( "/mActionZoomToSelected.png" ) );
|
||||
mPanMapToSelectedRowsButton->setIcon( QgsApplication::getThemeIcon( "/mActionPanToSelected.png" ) );
|
||||
mInvertSelectionButton->setIcon( QgsApplication::getThemeIcon( "/mActionInvertSelection.png" ) );
|
||||
mToggleEditingButton->setIcon( QgsApplication::getThemeIcon( "/mActionToggleEditing.png" ) );
|
||||
mSaveEditsButton->setIcon( QgsApplication::getThemeIcon( "/mActionSaveEdits.png" ) );
|
||||
mDeleteSelectedButton->setIcon( QgsApplication::getThemeIcon( "/mActionDeleteSelected.png" ) );
|
||||
mOpenFieldCalculator->setIcon( QgsApplication::getThemeIcon( "/mActionCalculateField.png" ) );
|
||||
mAddAttribute->setIcon( QgsApplication::getThemeIcon( "/mActionNewAttribute.png" ) );
|
||||
mRemoveAttribute->setIcon( QgsApplication::getThemeIcon( "/mActionDeleteAttribute.png" ) );
|
||||
|
||||
// toggle editing
|
||||
bool canChangeAttributes = mLayer->dataProvider()->capabilities() & QgsVectorDataProvider::ChangeAttributeValues;
|
||||
|
@ -88,7 +88,7 @@ QgsBrowserDockWidget::QgsBrowserDockWidget( QWidget * parent ) :
|
||||
mBrowserView = new QgsBrowserTreeView( this );
|
||||
|
||||
QToolButton* refreshButton = new QToolButton( this );
|
||||
refreshButton->setIcon( QgisApp::instance()->getThemeIcon( "mActionDraw.png" ) );
|
||||
refreshButton->setIcon( QgsApplication::getThemeIcon( "mActionDraw.png" ) );
|
||||
// remove this to save space
|
||||
refreshButton->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
|
||||
refreshButton->setText( tr( "Refresh" ) );
|
||||
@ -97,7 +97,7 @@ QgsBrowserDockWidget::QgsBrowserDockWidget( QWidget * parent ) :
|
||||
connect( refreshButton, SIGNAL( clicked() ), this, SLOT( refresh() ) );
|
||||
|
||||
QToolButton* addLayersButton = new QToolButton( this );
|
||||
addLayersButton->setIcon( QgisApp::instance()->getThemeIcon( "mActionAddLayer.png" ) );
|
||||
addLayersButton->setIcon( QgsApplication::getThemeIcon( "mActionAddLayer.png" ) );
|
||||
// remove this to save space
|
||||
addLayersButton->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
|
||||
addLayersButton->setText( tr( "Add Selection" ) );
|
||||
@ -106,7 +106,7 @@ QgsBrowserDockWidget::QgsBrowserDockWidget( QWidget * parent ) :
|
||||
connect( addLayersButton, SIGNAL( clicked() ), this, SLOT( addSelectedLayers() ) );
|
||||
|
||||
QToolButton* collapseButton = new QToolButton( this );
|
||||
collapseButton->setIcon( QgisApp::instance()->getThemeIcon( "mActionCollapseTree.png" ) );
|
||||
collapseButton->setIcon( QgsApplication::getThemeIcon( "mActionCollapseTree.png" ) );
|
||||
collapseButton->setToolTip( tr( "Collapse All" ) );
|
||||
collapseButton->setAutoRaise( true );
|
||||
connect( collapseButton, SIGNAL( clicked() ), mBrowserView, SLOT( collapseAll() ) );
|
||||
|
@ -49,13 +49,13 @@ QgsCustomProjectionDialog::QgsCustomProjectionDialog( QWidget *parent, Qt::WFlag
|
||||
QSettings settings;
|
||||
restoreGeometry( settings.value( "/Windows/CustomProjection/geometry" ).toByteArray() );
|
||||
|
||||
pbnFirst->setIcon( QgisApp::getThemeIcon( "mIconFirst.png" ) );
|
||||
pbnPrevious->setIcon( QgisApp::getThemeIcon( "mIconPrevious.png" ) );
|
||||
pbnNext->setIcon( QgisApp::getThemeIcon( "mIconNext.png" ) );
|
||||
pbnLast->setIcon( QgisApp::getThemeIcon( "mIconLast.png" ) );
|
||||
pbnNew->setIcon( QgisApp::getThemeIcon( "mIconNew.png" ) );
|
||||
pbnSave->setIcon( QgisApp::getThemeIcon( "mActionFileSave.png" ) );
|
||||
pbnDelete->setIcon( QgisApp::getThemeIcon( "mIconDelete.png" ) );
|
||||
pbnFirst->setIcon( QgsApplication::getThemeIcon( "mIconFirst.png" ) );
|
||||
pbnPrevious->setIcon( QgsApplication::getThemeIcon( "mIconPrevious.png" ) );
|
||||
pbnNext->setIcon( QgsApplication::getThemeIcon( "mIconNext.png" ) );
|
||||
pbnLast->setIcon( QgsApplication::getThemeIcon( "mIconLast.png" ) );
|
||||
pbnNew->setIcon( QgsApplication::getThemeIcon( "mIconNew.png" ) );
|
||||
pbnSave->setIcon( QgsApplication::getThemeIcon( "mActionFileSave.png" ) );
|
||||
pbnDelete->setIcon( QgsApplication::getThemeIcon( "mIconDelete.png" ) );
|
||||
// user database is created at QGIS startup in QgisApp::createDB
|
||||
// we just check whether there is our database [MD]
|
||||
QFileInfo myFileInfo;
|
||||
@ -594,7 +594,7 @@ void QgsCustomProjectionDialog::on_pbnNew_clicked()
|
||||
if ( pbnNew->text() == tr( "Abort" ) )
|
||||
{
|
||||
//if we get here, user has aborted add record
|
||||
pbnNew->setIcon( QgisApp::getThemeIcon( "mIconNew.png" ) );
|
||||
pbnNew->setIcon( QgsApplication::getThemeIcon( "mIconNew.png" ) );
|
||||
//next line needed for new/abort logic
|
||||
pbnNew->setText( tr( "New" ) );
|
||||
//get back to the last used record before insert was pressed
|
||||
@ -616,7 +616,7 @@ void QgsCustomProjectionDialog::on_pbnNew_clicked()
|
||||
pbnNext->setEnabled( false );
|
||||
pbnLast->setEnabled( false );
|
||||
pbnDelete->setEnabled( false );
|
||||
pbnNew->setIcon( QgisApp::getThemeIcon( "mIconNew.png" ) );
|
||||
pbnNew->setIcon( QgsApplication::getThemeIcon( "mIconNew.png" ) );
|
||||
//next line needed for new/abort logic
|
||||
pbnNew->setText( tr( "Abort" ) );
|
||||
//clear the controls
|
||||
|
@ -15,6 +15,8 @@
|
||||
#include "qgsembedlayerdialog.h"
|
||||
#include "qgsproject.h"
|
||||
#include "qgisapp.h"
|
||||
#include "qgsapplication.h"
|
||||
|
||||
#include <QDomDocument>
|
||||
#include <QFileDialog>
|
||||
#include <QFileInfo>
|
||||
@ -172,7 +174,7 @@ void QgsEmbedLayerDialog::addLegendGroupToTreeWidget( const QDomElement& groupEl
|
||||
{
|
||||
groupItem = new QTreeWidgetItem( parent );
|
||||
}
|
||||
groupItem->setIcon( 0, QgisApp::getThemeIcon( "mActionFolder.png" ) );
|
||||
groupItem->setIcon( 0, QgsApplication::getThemeIcon( "mActionFolder.png" ) );
|
||||
groupItem->setText( 0, groupElem.attribute( "name" ) );
|
||||
groupItem->setData( 0, Qt::UserRole, "group" );
|
||||
|
||||
|
@ -226,7 +226,7 @@ void QgsIdentifyResults::addFeature( QgsVectorLayer *vlayer,
|
||||
if ( vlayer->pendingFields().size() > 0 )
|
||||
{
|
||||
QTreeWidgetItem *editItem = new QTreeWidgetItem( QStringList() << "" << ( vlayer->isEditable() ? tr( "Edit feature form" ) : tr( "View feature form" ) ) );
|
||||
editItem->setIcon( 0, QgisApp::getThemeIcon( vlayer->isEditable() ? "/mIconEditable.png" : "/mIconEditable.png" ) );
|
||||
editItem->setIcon( 0, QgsApplication::getThemeIcon( vlayer->isEditable() ? "/mIconEditable.png" : "/mIconEditable.png" ) );
|
||||
editItem->setData( 0, Qt::UserRole, "edit" );
|
||||
actionItem->addChild( editItem );
|
||||
}
|
||||
@ -239,7 +239,7 @@ void QgsIdentifyResults::addFeature( QgsVectorLayer *vlayer,
|
||||
continue;
|
||||
|
||||
QTreeWidgetItem *twi = new QTreeWidgetItem( QStringList() << "" << action.name() );
|
||||
twi->setIcon( 0, QgisApp::getThemeIcon( "/mAction.png" ) );
|
||||
twi->setIcon( 0, QgsApplication::getThemeIcon( "/mAction.png" ) );
|
||||
twi->setData( 0, Qt::UserRole, "action" );
|
||||
twi->setData( 0, Qt::UserRole + 1, QVariant::fromValue( i ) );
|
||||
actionItem->addChild( twi );
|
||||
@ -329,7 +329,7 @@ void QgsIdentifyResults::editingToggled()
|
||||
continue;
|
||||
|
||||
QTreeWidgetItem *editItem = actions->child( j );
|
||||
editItem->setIcon( 0, QgisApp::getThemeIcon( vlayer->isEditable() ? "/mIconEditable.png" : "/mIconEditable.png" ) );
|
||||
editItem->setIcon( 0, QgsApplication::getThemeIcon( vlayer->isEditable() ? "/mIconEditable.png" : "/mIconEditable.png" ) );
|
||||
editItem->setText( 1, vlayer->isEditable() ? tr( "Edit feature form" ) : tr( "View feature form" ) );
|
||||
}
|
||||
}
|
||||
@ -434,7 +434,7 @@ void QgsIdentifyResults::contextMenuEvent( QContextMenuEvent* event )
|
||||
if ( featItem )
|
||||
{
|
||||
mActionPopup->addAction(
|
||||
QgisApp::getThemeIcon( vlayer->isEditable() ? "/mIconEditable.png" : "/mIconEditable.png" ),
|
||||
QgsApplication::getThemeIcon( vlayer->isEditable() ? "/mIconEditable.png" : "/mIconEditable.png" ),
|
||||
vlayer->isEditable() ? tr( "Edit feature form" ) : tr( "View feature form" ),
|
||||
this, SLOT( featureForm() ) );
|
||||
mActionPopup->addAction( tr( "Zoom to feature" ), this, SLOT( zoomToFeature() ) );
|
||||
@ -474,7 +474,7 @@ void QgsIdentifyResults::contextMenuEvent( QContextMenuEvent* event )
|
||||
continue;
|
||||
|
||||
QgsFeatureAction *a = new QgsFeatureAction( action.name(), mFeatures[ featIdx ], vlayer, i, idx, this );
|
||||
mActionPopup->addAction( QgisApp::getThemeIcon( "/mAction.png" ), action.name(), a, SLOT( execute() ) );
|
||||
mActionPopup->addAction( QgsApplication::getThemeIcon( "/mAction.png" ), action.name(), a, SLOT( execute() ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <QMouseEvent>
|
||||
|
||||
#include "qgisapp.h"
|
||||
#include "qgsapplication.h"
|
||||
|
||||
QgsMapToolRotateLabel::QgsMapToolRotateLabel( QgsMapCanvas* canvas ): QgsMapToolLabel( canvas ), mRotationItem( 0 ), mRotationPreviewBox( 0 )
|
||||
{
|
||||
@ -76,7 +77,7 @@ void QgsMapToolRotateLabel::canvasPressEvent( QMouseEvent *e )
|
||||
|
||||
mRotationItem = new QgsPointRotationItem( mCanvas );
|
||||
mRotationItem->setOrientation( QgsPointRotationItem::Counterclockwise );
|
||||
mRotationItem->setSymbol( QgisApp::instance()->getThemePixmap( "mActionRotatePointSymbols.png" ).toImage() );
|
||||
mRotationItem->setSymbol( QgsApplication::getThemePixmap( "mActionRotatePointSymbols.png" ).toImage() );
|
||||
mRotationItem->setPointLocation( mRotationPoint );
|
||||
mRotationItem->setSymbolRotation( mCurrentRotation );
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#include "qgsmergeattributesdialog.h"
|
||||
#include "qgisapp.h"
|
||||
#include "qgsapplication.h"
|
||||
#include "qgsfield.h"
|
||||
#include "qgsmapcanvas.h"
|
||||
#include "qgsrubberband.h"
|
||||
@ -46,8 +47,8 @@ QgsMergeAttributesDialog::QgsMergeAttributesDialog( const QgsFeatureList &featur
|
||||
mTableWidget->setSelectionBehavior( QAbstractItemView::SelectRows );
|
||||
mTableWidget->setSelectionMode( QAbstractItemView::SingleSelection );
|
||||
|
||||
mFromSelectedPushButton->setIcon( QgisApp::getThemeIcon( "mActionFromSelectedFeature.png" ) );
|
||||
mRemoveFeatureFromSelectionButton->setIcon( QgisApp::getThemeIcon( "mActionRemoveSelectedFeature.png" ) );
|
||||
mFromSelectedPushButton->setIcon( QgsApplication::getThemeIcon( "mActionFromSelectedFeature.png" ) );
|
||||
mRemoveFeatureFromSelectionButton->setIcon( QgsApplication::getThemeIcon( "mActionRemoveSelectedFeature.png" ) );
|
||||
|
||||
QSettings settings;
|
||||
restoreGeometry( settings.value( "/Windows/MergeAttributes/geometry" ).toByteArray() );
|
||||
|
@ -48,8 +48,8 @@ QgsNewSpatialiteLayerDialog::QgsNewSpatialiteLayerDialog( QWidget *parent, Qt::W
|
||||
QSettings settings;
|
||||
restoreGeometry( settings.value( "/Windows/NewSpatiaLiteLayer/geometry" ).toByteArray() );
|
||||
|
||||
mAddAttributeButton->setIcon( QgisApp::getThemeIcon( "/mActionNewAttribute.png" ) );
|
||||
mRemoveAttributeButton->setIcon( QgisApp::getThemeIcon( "/mActionDeleteAttribute.png" ) );
|
||||
mAddAttributeButton->setIcon( QgsApplication::getThemeIcon( "/mActionNewAttribute.png" ) );
|
||||
mRemoveAttributeButton->setIcon( QgsApplication::getThemeIcon( "/mActionDeleteAttribute.png" ) );
|
||||
mTypeBox->addItem( tr( "Text data" ), "text" );
|
||||
mTypeBox->addItem( tr( "Whole number" ), "integer" );
|
||||
mTypeBox->addItem( tr( "Decimal number" ), "real" );
|
||||
|
@ -31,19 +31,12 @@ class QgsRasterLayer;
|
||||
class QgsMapToolEmitPoint;
|
||||
class QgsRasterRenderer;
|
||||
class QgsRasterRendererWidget;
|
||||
class QwtPlotPicker;
|
||||
class QwtPlotMarker;
|
||||
class QwtPlotZoomer;
|
||||
class QgsRasterHistogramWidget;
|
||||
|
||||
/**Property sheet for a raster map layer
|
||||
*@author Tim Sutton
|
||||
*/
|
||||
|
||||
// fix for qwt5/qwt6 QwtDoublePoint vs. QPointF
|
||||
#if defined(QWT_VERSION) && QWT_VERSION>=0x060000
|
||||
typedef QPointF QwtDoublePoint;
|
||||
#endif
|
||||
|
||||
class QgsRasterLayerProperties : public QDialog, private Ui::QgsRasterLayerPropertiesBase
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -59,9 +52,6 @@ class QgsRasterLayerProperties : public QDialog, private Ui::QgsRasterLayerPrope
|
||||
/** synchronize state with associated raster layer */
|
||||
void sync();
|
||||
|
||||
/** Save the histogram as an image to disk */
|
||||
void histoSaveAsImage( const QString& theFilename );
|
||||
|
||||
public slots:
|
||||
//TODO: Verify that these all need to be public
|
||||
/** \brief Applies the settings made in the dialog without closing the box */
|
||||
@ -80,8 +70,6 @@ class QgsRasterLayerProperties : public QDialog, private Ui::QgsRasterLayerPrope
|
||||
void on_pbnExportTransparentPixelValues_clicked();
|
||||
/** \brief auto slot executed when the active page in the main widget stack is changed */
|
||||
void on_tabBar_currentChanged( int theTab );
|
||||
/** \brief slot executed when user wishes to refresh raster histogram */
|
||||
void refreshHistogram();
|
||||
/** \brief slow executed when user wishes to import transparency values */
|
||||
void on_pbnImportTransparentPixelValues_clicked();
|
||||
/** \brief slot executed when user presses "Remove Selected Row" button on the transparency page */
|
||||
@ -106,32 +94,9 @@ class QgsRasterLayerProperties : public QDialog, private Ui::QgsRasterLayerPrope
|
||||
void on_pbnSaveStyleAs_clicked();
|
||||
/** Help button */
|
||||
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
|
||||
/** This slot lets you save the histogram as an image to disk */
|
||||
void on_mSaveAsImageButton_clicked();
|
||||
/**Enable or disable Build pyramids button depending on selection in pyramids list*/
|
||||
void toggleBuildPyramidsButton();
|
||||
|
||||
// histogram
|
||||
|
||||
/** Used when the histogram band selector changes, or when tab is loaded. */
|
||||
void on_cboHistoBand_currentIndexChanged( int );
|
||||
/** Applies the selected min/max values to the renderer widget. */
|
||||
void applyHistoMin( );
|
||||
void applyHistoMax( );
|
||||
/** Button to activate picking of the min/max value on the graph. */
|
||||
void on_btnHistoMin_toggled();
|
||||
void on_btnHistoMax_toggled();
|
||||
/** Called when a selection has been made using the plot picker. */
|
||||
void histoPickerSelected( const QPointF & );
|
||||
/** Called when a selection has been made using the plot picker (for qwt5 only). */
|
||||
void histoPickerSelectedQwt5( const QwtDoublePoint & );
|
||||
/** Various actions that are stored in btnHistoActions. */
|
||||
void histoActionTriggered( QAction* );
|
||||
/** Draw the min/max markers on the histogram plot. */
|
||||
void updateHistoMarkers();
|
||||
/** Button to compute the histogram, appears when no cached histogram is available. */
|
||||
void on_btnHistoCompute_clicked();
|
||||
|
||||
signals:
|
||||
/** emitted when changes to layer were saved to update legend */
|
||||
void refreshLegend( QString layerID, bool expandItem );
|
||||
@ -187,28 +152,6 @@ class QgsRasterLayerProperties : public QDialog, private Ui::QgsRasterLayerPrope
|
||||
QgsMapCanvas* mMapCanvas;
|
||||
QgsMapToolEmitPoint* mPixelSelectorTool;
|
||||
|
||||
// histogram
|
||||
|
||||
QwtPlotPicker* mHistoPicker;
|
||||
QwtPlotZoomer* mHistoZoomer;
|
||||
QwtPlotMarker* mHistoMarkerMin;
|
||||
QwtPlotMarker* mHistoMarkerMax;
|
||||
double mHistoMin;
|
||||
double mHistoMax;
|
||||
QVector<QColor> mHistoColors;
|
||||
bool mHistoShowMarkers;
|
||||
bool mHistoLoadApplyAll;
|
||||
enum HistoShowBands
|
||||
{
|
||||
ShowAll = 0,
|
||||
ShowSelected = 1,
|
||||
ShowRGB = 2
|
||||
};
|
||||
HistoShowBands mHistoShowBands;
|
||||
|
||||
/** \brief Compute the histogram on demand. */
|
||||
bool computeHistogram( bool forceComputeFlag );
|
||||
/** \brief Returns a list of selected bands - or empty if there is no selection restriction. */
|
||||
QList< int > histoSelectedBands();
|
||||
QgsRasterHistogramWidget* mHistogramWidget;
|
||||
};
|
||||
#endif
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "qgslegend.h"
|
||||
|
||||
#include "qgisapp.h"
|
||||
#include "qgsapplication.h"
|
||||
|
||||
QgsUndoWidget::QgsUndoWidget( QWidget * parent, QgsMapCanvas * mapCanvas )
|
||||
: QDockWidget( parent )
|
||||
@ -148,13 +149,13 @@ void QgsUndoWidget::setupUi( QDockWidget *UndoWidget )
|
||||
|
||||
undoButton = new QPushButton( dockWidgetContents );
|
||||
undoButton->setObjectName( QString::fromUtf8( "undoButton" ) );
|
||||
undoButton->setIcon( QgisApp::instance()->getThemeIcon( "mActionUndo.png" ) );
|
||||
undoButton->setIcon( QgsApplication::getThemeIcon( "mActionUndo.png" ) );
|
||||
|
||||
gridLayout->addWidget( undoButton, 1, 0, 1, 1 );
|
||||
|
||||
redoButton = new QPushButton( dockWidgetContents );
|
||||
redoButton->setObjectName( QString::fromUtf8( "redoButton" ) );
|
||||
redoButton->setIcon( QgisApp::instance()->getThemeIcon( "mActionRedo.png" ) );
|
||||
redoButton->setIcon( QgsApplication::getThemeIcon( "mActionRedo.png" ) );
|
||||
|
||||
gridLayout->addWidget( redoButton, 1, 1, 1, 1 );
|
||||
|
||||
|
@ -95,10 +95,10 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
|
||||
connect( layer, SIGNAL( attributeAdded( int ) ), this, SLOT( attributeAdded( int ) ) );
|
||||
connect( layer, SIGNAL( attributeDeleted( int ) ), this, SLOT( attributeDeleted( int ) ) );
|
||||
|
||||
mAddAttributeButton->setIcon( QgisApp::getThemeIcon( "/mActionNewAttribute.png" ) );
|
||||
mDeleteAttributeButton->setIcon( QgisApp::getThemeIcon( "/mActionDeleteAttribute.png" ) );
|
||||
mToggleEditingButton->setIcon( QgisApp::getThemeIcon( "/mActionToggleEditing.png" ) );
|
||||
mCalculateFieldButton->setIcon( QgisApp::getThemeIcon( "/mActionCalculateField.png" ) );
|
||||
mAddAttributeButton->setIcon( QgsApplication::getThemeIcon( "/mActionNewAttribute.png" ) );
|
||||
mDeleteAttributeButton->setIcon( QgsApplication::getThemeIcon( "/mActionDeleteAttribute.png" ) );
|
||||
mToggleEditingButton->setIcon( QgsApplication::getThemeIcon( "/mActionToggleEditing.png" ) );
|
||||
mCalculateFieldButton->setIcon( QgsApplication::getThemeIcon( "/mActionCalculateField.png" ) );
|
||||
|
||||
connect( btnUseNewSymbology, SIGNAL( clicked() ), this, SLOT( useNewSymbology() ) );
|
||||
|
||||
@ -179,7 +179,7 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
|
||||
for ( ; it != overlayPluginList.constEnd(); ++it )
|
||||
{
|
||||
QgsApplyDialog* d = ( *it )->dialog( lyr );
|
||||
position = tabWidget->insertTab( tabWidget->count(), qobject_cast<QDialog*>( d ), QgisApp::getThemeIcon( "propertyicons/diagram.png" ), tr( "Overlay" ) );
|
||||
position = tabWidget->insertTab( tabWidget->count(), qobject_cast<QDialog*>( d ), QgsApplication::getThemeIcon( "propertyicons/diagram.png" ), tr( "Overlay" ) );
|
||||
tabWidget->setCurrentIndex( position ); //ugly, but otherwise the properties dialog is a mess
|
||||
mOverlayDialogs.push_back( d );
|
||||
}
|
||||
|
@ -26,6 +26,8 @@
|
||||
#include <QMessageBox>
|
||||
#include <QPalette>
|
||||
#include <QSettings>
|
||||
#include <QIcon>
|
||||
#include <QPixmap>
|
||||
|
||||
#ifndef Q_WS_WIN
|
||||
#include <netinet/in.h>
|
||||
@ -329,6 +331,43 @@ QString QgsApplication::iconPath( QString iconFile )
|
||||
return defaultThemePath() + iconFile;
|
||||
}
|
||||
|
||||
QIcon QgsApplication::getThemeIcon( const QString theName )
|
||||
{
|
||||
QString myPreferredPath = activeThemePath() + QDir::separator() + theName;
|
||||
QString myDefaultPath = defaultThemePath() + QDir::separator() + theName;
|
||||
if ( QFile::exists( myPreferredPath ) )
|
||||
{
|
||||
return QIcon( myPreferredPath );
|
||||
}
|
||||
else if ( QFile::exists( myDefaultPath ) )
|
||||
{
|
||||
//could still return an empty icon if it
|
||||
//doesnt exist in the default theme either!
|
||||
return QIcon( myDefaultPath );
|
||||
}
|
||||
else
|
||||
{
|
||||
return QIcon();
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: add some caching mechanism ?
|
||||
QPixmap QgsApplication::getThemePixmap( const QString theName )
|
||||
{
|
||||
QString myPreferredPath = activeThemePath() + QDir::separator() + theName;
|
||||
QString myDefaultPath = defaultThemePath() + QDir::separator() + theName;
|
||||
if ( QFile::exists( myPreferredPath ) )
|
||||
{
|
||||
return QPixmap( myPreferredPath );
|
||||
}
|
||||
else
|
||||
{
|
||||
//could still return an empty icon if it
|
||||
//doesnt exist in the default theme either!
|
||||
return QPixmap( myDefaultPath );
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
Set the theme path to the specified theme.
|
||||
*/
|
||||
|
@ -149,6 +149,16 @@ class CORE_EXPORT QgsApplication: public QApplication
|
||||
//! @note Added in 1.5
|
||||
static QString iconPath( QString iconFile );
|
||||
|
||||
//! Helper to get a theme icon. It will fall back to the
|
||||
//! default theme if the active theme does not have the required icon.
|
||||
//! @note Added in 2.0
|
||||
static QIcon getThemeIcon( const QString theName );
|
||||
|
||||
//! Helper to get a theme icon as a pixmap. It will fall back to the
|
||||
//! default theme if the active theme does not have the required icon.
|
||||
//! @note Added in 2.0
|
||||
static QPixmap getThemePixmap( const QString theName );
|
||||
|
||||
//! Returns the path to user's style. Added in QGIS 1.4
|
||||
static const QString userStyleV2Path();
|
||||
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include <QSettings>
|
||||
|
||||
#include "qgis.h"
|
||||
#include "qgsapplication.h"
|
||||
#include "qgsdataitem.h"
|
||||
|
||||
#include "qgsdataprovider.h"
|
||||
@ -46,7 +45,7 @@ const QIcon &QgsLayerItem::iconPoint()
|
||||
static QIcon icon;
|
||||
|
||||
if ( icon.isNull() )
|
||||
icon = QIcon( getThemePixmap( "/mIconPointLayer.png" ) );
|
||||
icon = QgsApplication::getThemeIcon( "/mIconPointLayer.png" );
|
||||
|
||||
return icon;
|
||||
}
|
||||
@ -56,7 +55,7 @@ const QIcon &QgsLayerItem::iconLine()
|
||||
static QIcon icon;
|
||||
|
||||
if ( icon.isNull() )
|
||||
icon = QIcon( getThemePixmap( "/mIconLineLayer.png" ) );
|
||||
icon = QgsApplication::getThemeIcon( "/mIconLineLayer.png" );
|
||||
|
||||
return icon;
|
||||
}
|
||||
@ -66,7 +65,7 @@ const QIcon &QgsLayerItem::iconPolygon()
|
||||
static QIcon icon;
|
||||
|
||||
if ( icon.isNull() )
|
||||
icon = QIcon( getThemePixmap( "/mIconPolygonLayer.png" ) );
|
||||
icon = QgsApplication::getThemeIcon( "/mIconPolygonLayer.png" );
|
||||
|
||||
return icon;
|
||||
}
|
||||
@ -76,7 +75,7 @@ const QIcon &QgsLayerItem::iconTable()
|
||||
static QIcon icon;
|
||||
|
||||
if ( icon.isNull() )
|
||||
icon = QIcon( getThemePixmap( "/mIconTableLayer.png" ) );
|
||||
icon = QgsApplication::getThemeIcon( "/mIconTableLayer.png" );
|
||||
|
||||
return icon;
|
||||
}
|
||||
@ -86,7 +85,7 @@ const QIcon &QgsLayerItem::iconRaster()
|
||||
static QIcon icon;
|
||||
|
||||
if ( icon.isNull() )
|
||||
icon = QIcon( getThemePixmap( "/mIconRaster.png" ) );
|
||||
icon = QgsApplication::getThemeIcon( "/mIconRaster.png" );
|
||||
|
||||
return icon;
|
||||
}
|
||||
@ -96,7 +95,7 @@ const QIcon &QgsLayerItem::iconDefault()
|
||||
static QIcon icon;
|
||||
|
||||
if ( icon.isNull() )
|
||||
icon = QIcon( getThemePixmap( "/mIconLayer.png" ) );
|
||||
icon = QgsApplication::getThemeIcon( "/mIconLayer.png" );
|
||||
|
||||
return icon;
|
||||
}
|
||||
@ -106,7 +105,7 @@ const QIcon &QgsDataCollectionItem::iconDataCollection()
|
||||
static QIcon icon;
|
||||
|
||||
if ( icon.isNull() )
|
||||
icon = QIcon( getThemePixmap( "/mIconDbSchema.png" ) );
|
||||
icon = QgsApplication::getThemeIcon( "/mIconDbSchema.png" );
|
||||
|
||||
return icon;
|
||||
}
|
||||
@ -132,7 +131,7 @@ const QIcon &QgsFavouritesItem::iconFavourites()
|
||||
static QIcon icon;
|
||||
|
||||
if ( icon.isNull() )
|
||||
icon = QIcon( getThemePixmap( "/mIconFavourites.png" ) );
|
||||
icon = QgsApplication::getThemeIcon( "/mIconFavourites.png" );
|
||||
|
||||
return icon;
|
||||
}
|
||||
@ -142,7 +141,7 @@ const QIcon &QgsZipItem::iconZip()
|
||||
static QIcon icon;
|
||||
|
||||
if ( icon.isNull() )
|
||||
icon = QIcon( getThemePixmap( "/mIconZip.png" ) );
|
||||
icon = QgsApplication::getThemeIcon( "/mIconZip.png" );
|
||||
// icon from http://www.softicons.com/free-icons/application-icons/mega-pack-icons-1-by-nikolay-verin/winzip-folder-icon
|
||||
|
||||
return icon;
|
||||
@ -160,28 +159,6 @@ QgsDataItem::~QgsDataItem()
|
||||
QgsDebugMsg( "mName = " + mName + " mPath = " + mPath );
|
||||
}
|
||||
|
||||
// TODO: This is copy from QgisApp, bad
|
||||
// TODO: add some caching mechanism ?
|
||||
QPixmap QgsDataItem::getThemePixmap( const QString theName )
|
||||
{
|
||||
QString myPreferredPath = QgsApplication::activeThemePath() + QDir::separator() + theName;
|
||||
QString myDefaultPath = QgsApplication::defaultThemePath() + QDir::separator() + theName;
|
||||
|
||||
// QgsDebugMsg( "theName = " + theName );
|
||||
// QgsDebugMsg( "myPreferredPath = " + myPreferredPath );
|
||||
// QgsDebugMsg( "myDefaultPath = " + myDefaultPath );
|
||||
if ( QFile::exists( myPreferredPath ) )
|
||||
{
|
||||
return QPixmap( myPreferredPath );
|
||||
}
|
||||
else
|
||||
{
|
||||
//could still return an empty icon if it
|
||||
//doesnt exist in the default theme either!
|
||||
return QPixmap( myDefaultPath );
|
||||
}
|
||||
}
|
||||
|
||||
void QgsDataItem::emitBeginInsertItems( QgsDataItem* parent, int first, int last )
|
||||
{
|
||||
emit beginInsertItems( parent, first, last );
|
||||
@ -698,7 +675,7 @@ void QgsDirectoryParamWidget::showHideColumn()
|
||||
QgsErrorItem::QgsErrorItem( QgsDataItem* parent, QString error, QString path )
|
||||
: QgsDataItem( QgsDataItem::Error, parent, error, path )
|
||||
{
|
||||
mIcon = QIcon( getThemePixmap( "/mIconDelete.png" ) );
|
||||
mIcon = QIcon( QgsApplication::getThemePixmap( "/mIconDelete.png" ) );
|
||||
|
||||
mPopulated = true; // no more children
|
||||
}
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <QVector>
|
||||
#include <QTreeWidget>
|
||||
|
||||
#include "qgsapplication.h"
|
||||
#include "qgsmaplayer.h"
|
||||
#include "qgscoordinatereferencesystem.h"
|
||||
|
||||
@ -107,8 +108,6 @@ class CORE_EXPORT QgsDataItem : public QObject
|
||||
|
||||
// static methods
|
||||
|
||||
static QPixmap getThemePixmap( const QString theName );
|
||||
|
||||
// Find child index in vector of items using '==' operator
|
||||
static int findItem( QVector<QgsDataItem*> items, QgsDataItem * item );
|
||||
|
||||
|
@ -6,6 +6,7 @@ raster/qgsmultibandcolorrendererwidget.cpp
|
||||
raster/qgspalettedrendererwidget.cpp
|
||||
raster/qgssinglebandgrayrendererwidget.cpp
|
||||
raster/qgssinglebandpseudocolorrendererwidget.cpp
|
||||
raster/qgsrasterhistogramwidget.cpp
|
||||
|
||||
symbology-ng/qgsbrushstylecombobox.cpp
|
||||
symbology-ng/qgscolorrampcombobox.cpp
|
||||
@ -100,6 +101,7 @@ raster/qgspalettedrendererwidget.h
|
||||
raster/qgsmultibandcolorrendererwidget.h
|
||||
raster/qgssinglebandgrayrendererwidget.h
|
||||
raster/qgssinglebandpseudocolorrendererwidget.h
|
||||
raster/qgsrasterhistogramwidget.h
|
||||
|
||||
symbology-ng/qgsdashspacedialog.h
|
||||
symbology-ng/qgssymbollayerv2widget.h
|
||||
@ -251,6 +253,7 @@ INCLUDE_DIRECTORIES(
|
||||
../core/symbology-ng
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../ui
|
||||
${QWT_INCLUDE_DIR}
|
||||
)
|
||||
IF (WITH_INTERNAL_SPATIALITE)
|
||||
INCLUDE_DIRECTORIES(../core/spatialite/headers)
|
||||
@ -316,6 +319,7 @@ ADD_DEPENDENCIES(qgis_gui ui)
|
||||
TARGET_LINK_LIBRARIES(qgis_gui
|
||||
qgis_core
|
||||
${QT_QTUITOOLS_LIBRARY}
|
||||
${QWT_LIBRARY}
|
||||
#${QT_QTTEST_LIBRARY} # for ModelTest
|
||||
)
|
||||
|
||||
@ -323,6 +327,10 @@ IF (NOT WITH_INTERNAL_SPATIALITE)
|
||||
TARGET_LINK_LIBRARIES(qgis_gui ${SQLITE3_LIBRARIES})
|
||||
ENDIF (NOT WITH_INTERNAL_SPATIALITE)
|
||||
|
||||
IF(WIN32)
|
||||
ADD_DEFINITIONS(-DQWT_DLL)
|
||||
ENDIF(WIN32)
|
||||
|
||||
IF (APPLE)
|
||||
SET_TARGET_PROPERTIES(qgis_gui PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)
|
||||
ENDIF (APPLE)
|
||||
|
992
src/gui/raster/qgsrasterhistogramwidget.cpp
Normal file
@ -0,0 +1,992 @@
|
||||
/***************************************************************************
|
||||
qgsrasterhistogramwidget.cpp
|
||||
---------------------------
|
||||
begin : July 2012
|
||||
copyright : (C) 2012 by Etienne Tourigny
|
||||
email : etourigny dot dev at gmail dot com
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include "qgsapplication.h"
|
||||
#include "qgisgui.h"
|
||||
#include "qgsrasterrendererregistry.h"
|
||||
#include "qgsrasterrendererwidget.h"
|
||||
#include "qgsrasterhistogramwidget.h"
|
||||
|
||||
#include <QMenu>
|
||||
#include <QFileInfo>
|
||||
#include <QDir>
|
||||
#include <QPainter>
|
||||
|
||||
// QWT Charting widget
|
||||
#include <qwt_global.h>
|
||||
#include <qwt_plot_canvas.h>
|
||||
#include <qwt_legend.h>
|
||||
#include <qwt_plot.h>
|
||||
#include <qwt_plot_curve.h>
|
||||
#include <qwt_plot_grid.h>
|
||||
#include <qwt_plot_marker.h>
|
||||
#include <qwt_plot_picker.h>
|
||||
#include <qwt_picker_machine.h>
|
||||
#include <qwt_plot_zoomer.h>
|
||||
#include <qwt_plot_layout.h>
|
||||
#if defined(QWT_VERSION) && QWT_VERSION>=0x060000
|
||||
#include <qwt_plot_renderer.h>
|
||||
#endif
|
||||
|
||||
QgsRasterHistogramWidget::QgsRasterHistogramWidget( QgsRasterLayer* lyr, QWidget *parent )
|
||||
: QWidget( parent ),
|
||||
mRasterLayer( lyr ), mRendererWidget( 0 )
|
||||
{
|
||||
setupUi( this );
|
||||
|
||||
mSaveAsImageButton->setIcon( QgsApplication::getThemeIcon( "/mActionFileSave.png" ) );
|
||||
|
||||
mRendererWidget = 0;
|
||||
mRendererName = "singlebandgray";
|
||||
|
||||
mHistoPicker = NULL;
|
||||
mHistoZoomer = NULL;
|
||||
mHistoMarkerMin = NULL;
|
||||
mHistoMarkerMax = NULL;
|
||||
mHistoShowMarkers = false;
|
||||
mHistoLoadApplyAll = false;
|
||||
mHistoShowBands = ShowAll;
|
||||
if ( true )
|
||||
{
|
||||
//band selector
|
||||
int myBandCountInt = mRasterLayer->bandCount();
|
||||
for ( int myIteratorInt = 1;
|
||||
myIteratorInt <= myBandCountInt;
|
||||
++myIteratorInt )
|
||||
{
|
||||
cboHistoBand->addItem( mRasterLayer->bandName( myIteratorInt ) );
|
||||
}
|
||||
|
||||
// histo min/max selectors
|
||||
leHistoMin->setValidator( new QDoubleValidator( this ) );
|
||||
leHistoMax->setValidator( new QDoubleValidator( this ) );
|
||||
// this might generate many refresh events! test..
|
||||
// connect( leHistoMin, SIGNAL( textChanged( const QString & ) ), this, SLOT( updateHistoMarkers() ) );
|
||||
// connect( leHistoMax, SIGNAL( textChanged( const QString & ) ), this, SLOT( updateHistoMarkers() ) );
|
||||
// connect( leHistoMin, SIGNAL( textChanged( const QString & ) ), this, SLOT( applyHistoMin() ) );
|
||||
// connect( leHistoMax, SIGNAL( textChanged( const QString & ) ), this, SLOT( applyHistoMax() ) );
|
||||
connect( leHistoMin, SIGNAL( editingFinished() ), this, SLOT( applyHistoMin() ) );
|
||||
connect( leHistoMax, SIGNAL( editingFinished() ), this, SLOT( applyHistoMax() ) );
|
||||
|
||||
// histo actions
|
||||
QMenu* menu = new QMenu( this );
|
||||
menu->setSeparatorsCollapsible( false );
|
||||
btnHistoActions->setMenu( menu );
|
||||
QActionGroup* group;
|
||||
QAction* action;
|
||||
|
||||
// various actions / prefs
|
||||
group = new QActionGroup( this );
|
||||
group->setExclusive( false );
|
||||
connect( group, SIGNAL( triggered( QAction* ) ), this, SLOT( histoActionTriggered( QAction* ) ) );
|
||||
action = new QAction( tr( "Visibility" ), group );
|
||||
action->setSeparator( true );
|
||||
menu->addAction( action );
|
||||
action = new QAction( tr( "Show min/max markers" ), group );
|
||||
action->setData( QVariant( "Show markers" ) );
|
||||
action->setCheckable( true );
|
||||
action->setChecked( mHistoShowMarkers );
|
||||
menu->addAction( action );
|
||||
group = new QActionGroup( this );
|
||||
group->setExclusive( true ); // these options are exclusive
|
||||
connect( group, SIGNAL( triggered( QAction* ) ), this, SLOT( histoActionTriggered( QAction* ) ) );
|
||||
action = new QAction( tr( "Show all bands" ), group );
|
||||
action->setData( QVariant( "Show all" ) );
|
||||
action->setCheckable( true );
|
||||
action->setChecked( mHistoShowBands == ShowAll );
|
||||
menu->addAction( action );
|
||||
action = new QAction( tr( "Show RGB/Gray band(s)" ), group );
|
||||
action->setData( QVariant( "Show RGB" ) );
|
||||
action->setCheckable( true );
|
||||
action->setChecked( mHistoShowBands == ShowRGB );
|
||||
menu->addAction( action );
|
||||
action = new QAction( tr( "Show selected band" ), group );
|
||||
action->setData( QVariant( "Show selected" ) );
|
||||
action->setCheckable( true );
|
||||
action->setChecked( mHistoShowBands == ShowSelected );
|
||||
menu->addAction( action );
|
||||
|
||||
// load actions
|
||||
group = new QActionGroup( this );
|
||||
group->setExclusive( false );
|
||||
connect( group, SIGNAL( triggered( QAction* ) ), this, SLOT( histoActionTriggered( QAction* ) ) );
|
||||
// action = new QAction( tr( "Load min/max from band" ), group );
|
||||
action = new QAction( tr( "Load min/max" ), group );
|
||||
action->setSeparator( true );
|
||||
menu->addAction( action );
|
||||
action = new QAction( tr( "Estimate (faster)" ), group );
|
||||
action->setData( QVariant( "Load estimate" ) );
|
||||
menu->addAction( action );
|
||||
action = new QAction( tr( "Actual (slower)" ), group );
|
||||
action->setData( QVariant( "Load actual" ) );
|
||||
menu->addAction( action );
|
||||
action = new QAction( tr( "Current extent" ), group );
|
||||
action->setData( QVariant( "Load extent" ) );
|
||||
menu->addAction( action );
|
||||
action = new QAction( tr( "Use stddev (1.0)" ), group );
|
||||
action->setData( QVariant( "Load 1 stddev" ) );
|
||||
menu->addAction( action );
|
||||
action = new QAction( tr( "Use stddev (custom)" ), group );
|
||||
action->setData( QVariant( "Load stddev" ) );
|
||||
menu->addAction( action );
|
||||
action = new QAction( tr( "Reset" ), group );
|
||||
action->setData( QVariant( "Load reset" ) );
|
||||
menu->addAction( action );
|
||||
action = new QAction( tr( "Load for each band" ), group );
|
||||
action->setData( QVariant( "Load apply all" ) );
|
||||
action->setCheckable( true );
|
||||
action->setChecked( mHistoLoadApplyAll );
|
||||
menu->addAction( action );
|
||||
|
||||
//others
|
||||
menu->addSeparator( );
|
||||
action = new QAction( tr( "Recompute Histogram" ), group );
|
||||
action->setData( QVariant( "Compute histogram" ) );
|
||||
menu->addAction( action );
|
||||
|
||||
}
|
||||
|
||||
} // QgsRasterHistogramWidget ctor
|
||||
|
||||
|
||||
QgsRasterHistogramWidget::~QgsRasterHistogramWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void QgsRasterHistogramWidget::setRendererWidget( const QString& name, QgsRasterRendererWidget* rendererWidget )
|
||||
{
|
||||
mRendererName = name;
|
||||
mRendererWidget = rendererWidget;
|
||||
refreshHistogram();
|
||||
on_cboHistoBand_currentIndexChanged( -1 );
|
||||
}
|
||||
|
||||
void QgsRasterHistogramWidget::setActive( bool theActiveFlag )
|
||||
{
|
||||
if ( theActiveFlag )
|
||||
{
|
||||
refreshHistogram();
|
||||
on_cboHistoBand_currentIndexChanged( -1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( QApplication::overrideCursor() )
|
||||
QApplication::restoreOverrideCursor();
|
||||
btnHistoMin->setChecked( false );
|
||||
btnHistoMax->setChecked( false );
|
||||
}
|
||||
}
|
||||
|
||||
void QgsRasterHistogramWidget::on_btnHistoCompute_clicked()
|
||||
{
|
||||
// Histogram computation can be called either by clicking the "Compute Histogram" button
|
||||
// which is only visible if there is no cached histogram or by calling the
|
||||
// "Compute Histogram" action. Due to limitations in the gdal api, it is not possible
|
||||
// to re-calculate the histogramif it has already been calculated
|
||||
computeHistogram( true );
|
||||
refreshHistogram();
|
||||
}
|
||||
|
||||
bool QgsRasterHistogramWidget::computeHistogram( bool forceComputeFlag )
|
||||
{
|
||||
const int BINCOUNT = RASTER_HISTOGRAM_BINS; // 256 - defined in qgsrasterdataprovider.h
|
||||
bool myIgnoreOutOfRangeFlag = true;
|
||||
bool myThoroughBandScanFlag = false;
|
||||
int myBandCountInt = mRasterLayer->bandCount();
|
||||
|
||||
// if forceComputeFlag = false make sure raster has cached histogram, else return false
|
||||
if ( ! forceComputeFlag )
|
||||
{
|
||||
for ( int myIteratorInt = 1;
|
||||
myIteratorInt <= myBandCountInt;
|
||||
++myIteratorInt )
|
||||
{
|
||||
if ( ! mRasterLayer->hasCachedHistogram( myIteratorInt, BINCOUNT ) )
|
||||
{
|
||||
QgsDebugMsg( QString( "band %1 does not have cached histo" ).arg( myIteratorInt ) );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// compute histogram
|
||||
stackedWidget2->setCurrentIndex( 1 );
|
||||
connect( mRasterLayer, SIGNAL( progressUpdate( int ) ), mHistogramProgress, SLOT( setValue( int ) ) );
|
||||
QApplication::setOverrideCursor( Qt::WaitCursor );
|
||||
|
||||
for ( int myIteratorInt = 1;
|
||||
myIteratorInt <= myBandCountInt;
|
||||
++myIteratorInt )
|
||||
{
|
||||
mRasterLayer->populateHistogram( myIteratorInt, BINCOUNT, myIgnoreOutOfRangeFlag, myThoroughBandScanFlag );
|
||||
}
|
||||
|
||||
disconnect( mRasterLayer, SIGNAL( progressUpdate( int ) ), mHistogramProgress, SLOT( setValue( int ) ) );
|
||||
// mHistogramProgress->hide();
|
||||
stackedWidget2->setCurrentIndex( 0 );
|
||||
QApplication::restoreOverrideCursor();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void QgsRasterHistogramWidget::refreshHistogram()
|
||||
{
|
||||
// Explanation:
|
||||
// We use the gdal histogram creation routine is called for each selected
|
||||
// layer. Currently the hist is hardcoded to create 256 bins. Each bin stores
|
||||
// the total number of cells that fit into the range defined by that bin.
|
||||
//
|
||||
// The graph routine below determines the greatest number of pixels in any given
|
||||
// bin in all selected layers, and the min. It then draws a scaled line between min
|
||||
// and max - scaled to image height. 1 line drawn per selected band
|
||||
//
|
||||
const int BINCOUNT = RASTER_HISTOGRAM_BINS; // 256 - defined in qgsrasterdataprovider.h
|
||||
int myBandCountInt = mRasterLayer->bandCount();
|
||||
|
||||
QgsDebugMsg( "entered." );
|
||||
|
||||
if ( ! computeHistogram( false ) )
|
||||
{
|
||||
QgsDebugMsg( QString( "raster does not have cached histogram" ) );
|
||||
stackedWidget2->setCurrentIndex( 2 );
|
||||
return;
|
||||
}
|
||||
|
||||
#if defined(QWT_VERSION) && QWT_VERSION>=0x060000
|
||||
mpPlot->detachItems();
|
||||
#else
|
||||
mpPlot->clear();
|
||||
#endif
|
||||
//ensure all children get removed
|
||||
mpPlot->setAutoDelete( true );
|
||||
mpPlot->setTitle( QObject::tr( "Raster Histogram" ) );
|
||||
mpPlot->insertLegend( new QwtLegend(), QwtPlot::BottomLegend );
|
||||
// Set axis titles
|
||||
mpPlot->setAxisTitle( QwtPlot::xBottom, QObject::tr( "Pixel Value" ) );
|
||||
mpPlot->setAxisTitle( QwtPlot::yLeft, QObject::tr( "Frequency" ) );
|
||||
mpPlot->setAxisAutoScale( QwtPlot::yLeft );
|
||||
|
||||
// x axis scale only set after computing global min/max across bands (see below)
|
||||
// add a grid
|
||||
QwtPlotGrid * myGrid = new QwtPlotGrid();
|
||||
myGrid->attach( mpPlot );
|
||||
|
||||
// make colors list
|
||||
mHistoColors.clear();
|
||||
mHistoColors << Qt::black; // first element, not used
|
||||
QVector<QColor> myColors;
|
||||
myColors << Qt::red << Qt::green << Qt::blue << Qt::magenta << Qt::darkYellow << Qt::cyan;
|
||||
srand( myBandCountInt * 100 ); // make sure colors are always the same for a given band count
|
||||
while ( myColors.size() <= myBandCountInt )
|
||||
{
|
||||
myColors <<
|
||||
QColor( 1 + ( int )( 255.0 * rand() / ( RAND_MAX + 1.0 ) ),
|
||||
1 + ( int )( 255.0 * rand() / ( RAND_MAX + 1.0 ) ),
|
||||
1 + ( int )( 255.0 * rand() / ( RAND_MAX + 1.0 ) ) );
|
||||
}
|
||||
|
||||
// assign colors to each band, depending on the current RGB/gray band selection
|
||||
// grayscale
|
||||
QList< int > mySelectedBands = rendererSelectedBands();
|
||||
if ( mRendererName == "singlebandgray" )
|
||||
{
|
||||
int myGrayBand = mySelectedBands[0];
|
||||
for ( int i = 1; i <= myBandCountInt; i++ )
|
||||
{
|
||||
if ( i == myGrayBand )
|
||||
{
|
||||
mHistoColors << Qt::darkGray;
|
||||
cboHistoBand->setItemData( i - 1, Qt::darkGray, Qt::ForegroundRole );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( ! myColors.isEmpty() )
|
||||
{
|
||||
mHistoColors << myColors.first();
|
||||
myColors.pop_front();
|
||||
}
|
||||
else
|
||||
{
|
||||
mHistoColors << Qt::black;
|
||||
}
|
||||
cboHistoBand->setItemData( i - 1, Qt::black, Qt::ForegroundRole );
|
||||
}
|
||||
}
|
||||
}
|
||||
// RGB
|
||||
else if ( mRendererName == "multibandcolor" )
|
||||
{
|
||||
int myRedBand = mySelectedBands[0];
|
||||
int myGreenBand = mySelectedBands[1];
|
||||
int myBlueBand = mySelectedBands[2];
|
||||
// remove RGB, which are reserved for the actual RGB bands
|
||||
// show name of RGB bands in appropriate color in bold
|
||||
myColors.remove( 0, 3 );
|
||||
for ( int i = 1; i <= myBandCountInt; i++ )
|
||||
{
|
||||
QColor myColor;
|
||||
if ( i == myRedBand )
|
||||
myColor = Qt::red;
|
||||
else if ( i == myGreenBand )
|
||||
myColor = Qt::green;
|
||||
else if ( i == myBlueBand )
|
||||
myColor = Qt::blue;
|
||||
else
|
||||
{
|
||||
if ( ! myColors.isEmpty() )
|
||||
{
|
||||
myColor = myColors.first();
|
||||
myColors.pop_front();
|
||||
}
|
||||
else
|
||||
{
|
||||
myColor = Qt::black;
|
||||
}
|
||||
cboHistoBand->setItemData( i - 1, Qt::black, Qt::ForegroundRole );
|
||||
}
|
||||
if ( i == myRedBand || i == myGreenBand || i == myBlueBand )
|
||||
{
|
||||
cboHistoBand->setItemData( i - 1, myColor, Qt::ForegroundRole );
|
||||
}
|
||||
mHistoColors << myColor;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mHistoColors << myColors;
|
||||
}
|
||||
|
||||
//
|
||||
//now draw actual graphs
|
||||
//
|
||||
|
||||
//somtimes there are more bins than needed
|
||||
//we find out the last one that actually has data in it
|
||||
//so we can discard the rest and set the x-axis scales correctly
|
||||
//
|
||||
// scan through to get counts from layers' histograms
|
||||
//
|
||||
mHistoMin = 0;
|
||||
mHistoMax = 0;
|
||||
bool myFirstIteration = true;
|
||||
/* get selected band list, if mHistoShowBands != ShowAll */
|
||||
mySelectedBands = histoSelectedBands();
|
||||
double myBinXStep = 1;
|
||||
double myBinX = 0;
|
||||
|
||||
for ( int myIteratorInt = 1;
|
||||
myIteratorInt <= myBandCountInt;
|
||||
++myIteratorInt )
|
||||
{
|
||||
/* skip this band if mHistoShowBands != ShowAll and this band is not selected */
|
||||
if ( mHistoShowBands != ShowAll )
|
||||
{
|
||||
if ( ! mySelectedBands.contains( myIteratorInt ) )
|
||||
continue;
|
||||
}
|
||||
QgsRasterBandStats myRasterBandStats = mRasterLayer->bandStatistics( myIteratorInt );
|
||||
// mRasterLayer->populateHistogram( myIteratorInt, BINCOUNT, myIgnoreOutOfRangeFlag, myThoroughBandScanFlag );
|
||||
QwtPlotCurve * mypCurve = new QwtPlotCurve( tr( "Band %1" ).arg( myIteratorInt ) );
|
||||
mypCurve->setCurveAttribute( QwtPlotCurve::Fitted );
|
||||
mypCurve->setRenderHint( QwtPlotItem::RenderAntialiased );
|
||||
mypCurve->setPen( QPen( mHistoColors.at( myIteratorInt ) ) );
|
||||
#if defined(QWT_VERSION) && QWT_VERSION>=0x060000
|
||||
QVector<QPointF> data;
|
||||
#else
|
||||
QVector<double> myX2Data;
|
||||
QVector<double> myY2Data;
|
||||
#endif
|
||||
// calculate first bin x value and bin step size if not Byte data
|
||||
if ( mRasterLayer->dataProvider()->srcDataType( myIteratorInt ) != QgsRasterDataProvider::Byte )
|
||||
{
|
||||
myBinXStep = myRasterBandStats.range / BINCOUNT;
|
||||
myBinX = myRasterBandStats.minimumValue + myBinXStep / 2.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
myBinXStep = 1;
|
||||
myBinX = 0;
|
||||
}
|
||||
|
||||
for ( int myBin = 0; myBin < BINCOUNT; myBin++ )
|
||||
{
|
||||
int myBinValue = myRasterBandStats.histogramVector->at( myBin );
|
||||
#if defined(QWT_VERSION) && QWT_VERSION>=0x060000
|
||||
data << QPointF( myBinX, myBinValue );
|
||||
#else
|
||||
myX2Data.append( double( myBinX ) );
|
||||
myY2Data.append( double( myBinValue ) );
|
||||
#endif
|
||||
myBinX += myBinXStep;
|
||||
}
|
||||
#if defined(QWT_VERSION) && QWT_VERSION>=0x060000
|
||||
mypCurve->setSamples( data );
|
||||
#else
|
||||
mypCurve->setData( myX2Data, myY2Data );
|
||||
#endif
|
||||
mypCurve->attach( mpPlot );
|
||||
if ( myFirstIteration || mHistoMin > myRasterBandStats.minimumValue )
|
||||
{
|
||||
mHistoMin = myRasterBandStats.minimumValue;
|
||||
}
|
||||
if ( myFirstIteration || mHistoMax < myRasterBandStats.maximumValue )
|
||||
{
|
||||
mHistoMax = myRasterBandStats.maximumValue;
|
||||
}
|
||||
QgsDebugMsg( QString( "computed histo min = %1 max = %2" ).arg( mHistoMin ).arg( mHistoMax ) );
|
||||
myFirstIteration = false;
|
||||
}
|
||||
// for x axis use band pixel values rather than gdal hist. bin values
|
||||
// subtract -0.5 to prevent rounding errors
|
||||
// see http://www.gdal.org/classGDALRasterBand.html#3f8889607d3b2294f7e0f11181c201c8
|
||||
// fix x range for non-Byte data
|
||||
mpPlot->setAxisScale( QwtPlot::xBottom,
|
||||
mHistoMin - myBinXStep / 2,
|
||||
mHistoMax + myBinXStep / 2 );
|
||||
|
||||
mpPlot->replot();
|
||||
|
||||
// histo plot markers
|
||||
// memory leak?
|
||||
mHistoMarkerMin = new QwtPlotMarker();
|
||||
mHistoMarkerMin->attach( mpPlot );
|
||||
mHistoMarkerMax = new QwtPlotMarker();
|
||||
mHistoMarkerMax->attach( mpPlot );
|
||||
updateHistoMarkers();
|
||||
|
||||
// histo picker
|
||||
if ( ! mHistoPicker )
|
||||
{
|
||||
mHistoPicker = new QwtPlotPicker( mpPlot->canvas() );
|
||||
// mHistoPicker->setTrackerMode( QwtPicker::ActiveOnly );
|
||||
mHistoPicker->setTrackerMode( QwtPicker::AlwaysOff );
|
||||
mHistoPicker->setRubberBand( QwtPicker::VLineRubberBand );
|
||||
mHistoPicker->setEnabled( false );
|
||||
#if defined(QWT_VERSION) && QWT_VERSION>=0x060000
|
||||
mHistoPicker->setStateMachine( new QwtPickerDragPointMachine );
|
||||
connect( mHistoPicker, SIGNAL( selected( const QPointF & ) ), this, SLOT( histoPickerSelected( const QPointF & ) ) );
|
||||
#else
|
||||
mHistoPicker->setSelectionFlags( QwtPicker::PointSelection | QwtPicker::DragSelection );
|
||||
connect( mHistoPicker, SIGNAL( selected( const QwtDoublePoint & ) ), this, SLOT( histoPickerSelectedQwt5( const QwtDoublePoint & ) ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
// plot zoomer
|
||||
if ( ! mHistoZoomer )
|
||||
{
|
||||
mHistoZoomer = new QwtPlotZoomer( mpPlot->canvas() );
|
||||
#if defined(QWT_VERSION) && QWT_VERSION>=0x060000
|
||||
mHistoZoomer->setStateMachine( new QwtPickerDragRectMachine );
|
||||
#else
|
||||
mHistoZoomer->setSelectionFlags( QwtPicker::RectSelection | QwtPicker::DragSelection );
|
||||
#endif
|
||||
mHistoZoomer->setTrackerMode( QwtPicker::AlwaysOff );
|
||||
mHistoZoomer->setEnabled( true );
|
||||
}
|
||||
|
||||
disconnect( mRasterLayer, SIGNAL( progressUpdate( int ) ), mHistogramProgress, SLOT( setValue( int ) ) );
|
||||
stackedWidget2->setCurrentIndex( 0 );
|
||||
// icon from http://findicons.com/icon/169577/14_zoom?id=171427
|
||||
mpPlot->canvas()->setCursor( QCursor( QgsApplication::getThemePixmap( "/mIconZoom.png" ) ) );
|
||||
// on_cboHistoBand_currentIndexChanged( -1 );
|
||||
QApplication::restoreOverrideCursor();
|
||||
}
|
||||
|
||||
void QgsRasterHistogramWidget::on_mSaveAsImageButton_clicked()
|
||||
{
|
||||
if ( mpPlot == 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QPair< QString, QString> myFileNameAndFilter = QgisGui::getSaveAsImageName( this, tr( "Choose a file name to save the map image as" ) );
|
||||
QFileInfo myInfo( myFileNameAndFilter.first );
|
||||
if ( QFileInfo( myFileNameAndFilter.first ).baseName() != "" )
|
||||
{
|
||||
histoSaveAsImage( myFileNameAndFilter.first );
|
||||
}
|
||||
}
|
||||
|
||||
bool QgsRasterHistogramWidget::histoSaveAsImage( const QString& theFilename,
|
||||
int width, int height, int quality )
|
||||
{
|
||||
// make sure dir. exists
|
||||
QFileInfo myInfo( theFilename );
|
||||
QDir myDir( myInfo.dir() );
|
||||
if ( ! myDir.exists() )
|
||||
{
|
||||
QgsDebugMsg( QString( "Error, directory %1 non-existent (theFilename = %2)" ).arg( myDir.absolutePath() ).arg( theFilename ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
// prepare the pixmap
|
||||
QPixmap myPixmap( width, height );
|
||||
QRect myQRect( 5, 5, width - 10, height - 10 ); // leave a 5px border on all sides
|
||||
myPixmap.fill( Qt::white ); // Qt::transparent ?
|
||||
|
||||
#if defined(QWT_VERSION) && QWT_VERSION>=0x060000
|
||||
QwtPlotRenderer myRenderer;
|
||||
myRenderer.setDiscardFlags( QwtPlotRenderer::DiscardBackground |
|
||||
QwtPlotRenderer::DiscardCanvasBackground );
|
||||
myRenderer.setLayoutFlags( QwtPlotRenderer::FrameWithScales );
|
||||
|
||||
QPainter myPainter;
|
||||
myPainter.begin( &myPixmap );
|
||||
myRenderer.render( mpPlot, &myPainter, myQRect );
|
||||
myPainter.end();
|
||||
#else
|
||||
QwtPlotPrintFilter myFilter;
|
||||
int myOptions = QwtPlotPrintFilter::PrintAll;
|
||||
myOptions &= ~QwtPlotPrintFilter::PrintBackground;
|
||||
myOptions |= QwtPlotPrintFilter::PrintFrameWithScales;
|
||||
myFilter.setOptions( myOptions );
|
||||
|
||||
QPainter myPainter;
|
||||
myPainter.begin( &myPixmap );
|
||||
mpPlot->print( &myPainter, myQRect, myFilter );
|
||||
myPainter.end();
|
||||
|
||||
// "fix" for bug in qwt5 - legend and plot shifts a bit
|
||||
// can't see how to avoid this without picking qwt5 apart...
|
||||
refreshHistogram();
|
||||
refreshHistogram();
|
||||
#endif
|
||||
|
||||
// save pixmap to file
|
||||
myPixmap.save( theFilename, 0, quality );
|
||||
|
||||
// should do more error checking
|
||||
return true;
|
||||
}
|
||||
|
||||
void QgsRasterHistogramWidget::setSelectedBand( int theBandNo )
|
||||
{
|
||||
cboHistoBand->setCurrentIndex( theBandNo - 1 );
|
||||
}
|
||||
|
||||
void QgsRasterHistogramWidget::on_cboHistoBand_currentIndexChanged( int index )
|
||||
{
|
||||
if ( mHistoShowBands == ShowSelected )
|
||||
refreshHistogram();
|
||||
|
||||
// get the current index value, index can be -1
|
||||
index = cboHistoBand->currentIndex();
|
||||
if ( mHistoPicker != NULL )
|
||||
{
|
||||
mHistoPicker->setEnabled( false );
|
||||
mHistoPicker->setRubberBandPen( QPen( mHistoColors.at( index + 1 ) ) );
|
||||
}
|
||||
if ( mHistoZoomer != NULL )
|
||||
mHistoZoomer->setEnabled( true );
|
||||
btnHistoMin->setEnabled( true );
|
||||
btnHistoMax->setEnabled( true );
|
||||
|
||||
int theBandNo = index + 1;
|
||||
// TODO - there are 2 definitions of raster data type that should be unified
|
||||
// QgsRasterDataProvider::DataType and QgsContrastEnhancement::QgsRasterDataType
|
||||
// TODO - fix gdal provider: changes data type when nodata value is not found
|
||||
// this prevents us from getting proper min and max values here
|
||||
// minStr = QString::number( QgsContrastEnhancement::minimumValuePossible( ( QgsContrastEnhancement::QgsRasterDataType )
|
||||
// mRasterLayer->dataProvider()->dataType( theBandNo ) ) );
|
||||
// maxStr = QString::number( QgsContrastEnhancement::maximumValuePossible( ( QgsContrastEnhancement::QgsRasterDataType )
|
||||
// mRasterLayer->dataProvider()->dataType( theBandNo ) ) );
|
||||
|
||||
QPair< QString, QString > myMinMax = rendererMinMax( theBandNo );
|
||||
leHistoMin->setText( myMinMax.first );
|
||||
leHistoMax->setText( myMinMax.second );
|
||||
applyHistoMin();
|
||||
applyHistoMax();
|
||||
}
|
||||
|
||||
void QgsRasterHistogramWidget::histoActionTriggered( QAction* action )
|
||||
{
|
||||
if ( ! action )
|
||||
return;
|
||||
histoAction( action->data().toString(), action->isChecked() );
|
||||
}
|
||||
|
||||
void QgsRasterHistogramWidget::histoAction( const QString actionName, bool actionFlag )
|
||||
{
|
||||
if ( actionName == "" )
|
||||
return;
|
||||
|
||||
// this approach is a bit of a hack, but this way we don't have to define slots for each action
|
||||
QgsDebugMsg( QString( "band = %1 action = %2" ).arg( cboHistoBand->currentIndex() + 1 ).arg( actionName ) );
|
||||
|
||||
// checkeable actions
|
||||
if ( actionName == "Show markers" )
|
||||
{
|
||||
mHistoShowMarkers = actionFlag;
|
||||
updateHistoMarkers();
|
||||
return;
|
||||
}
|
||||
else if ( actionName == "Show all" )
|
||||
{
|
||||
mHistoShowBands = ShowAll;
|
||||
refreshHistogram();
|
||||
return;
|
||||
}
|
||||
else if ( actionName == "Show selected" )
|
||||
{
|
||||
mHistoShowBands = ShowSelected;
|
||||
refreshHistogram();
|
||||
return;
|
||||
}
|
||||
else if ( actionName == "Show RGB" )
|
||||
{
|
||||
mHistoShowBands = ShowRGB;
|
||||
refreshHistogram();
|
||||
return;
|
||||
}
|
||||
else if ( actionName == "Load apply all" )
|
||||
{
|
||||
mHistoLoadApplyAll = actionFlag;
|
||||
return;
|
||||
}
|
||||
// Load actions
|
||||
// TODO - seperate calculations from rendererwidget so we can do them without
|
||||
else if ( actionName.left( 5 ) == "Load " && mRendererWidget )
|
||||
{
|
||||
QVector<int> myBands;
|
||||
double minMaxValues[2];
|
||||
bool ok = false;
|
||||
|
||||
// find which band(s) need updating (all or current)
|
||||
if ( mHistoLoadApplyAll )
|
||||
{
|
||||
int myBandCountInt = mRasterLayer->bandCount();
|
||||
for ( int i = 1; i <= myBandCountInt; i++ )
|
||||
{
|
||||
if ( i != cboHistoBand->currentIndex() + 1 )
|
||||
myBands << i;
|
||||
}
|
||||
}
|
||||
// add current band to the end
|
||||
myBands << cboHistoBand->currentIndex() + 1;
|
||||
|
||||
// get stddev value once if needed
|
||||
double myStdDev = 1.0;
|
||||
if ( actionName == "Load stddev" )
|
||||
{
|
||||
myStdDev = mRendererWidget->stdDev().toDouble();
|
||||
}
|
||||
|
||||
// don't update markers every time
|
||||
leHistoMin->blockSignals( true );
|
||||
leHistoMax->blockSignals( true );
|
||||
|
||||
// process each band
|
||||
foreach( int theBandNo, myBands )
|
||||
{
|
||||
ok = false;
|
||||
if ( actionName == "Load actual" )
|
||||
{
|
||||
ok = mRendererWidget->bandMinMax( QgsRasterRendererWidget::Actual,
|
||||
theBandNo, minMaxValues );
|
||||
}
|
||||
else if ( actionName == "Load estimate" )
|
||||
{
|
||||
ok = mRendererWidget->bandMinMax( QgsRasterRendererWidget::Estimate,
|
||||
theBandNo, minMaxValues );
|
||||
}
|
||||
else if ( actionName == "Load extent" )
|
||||
{
|
||||
ok = mRendererWidget->bandMinMax( QgsRasterRendererWidget::CurrentExtent,
|
||||
theBandNo, minMaxValues );
|
||||
}
|
||||
else if ( actionName == "Load 1 stddev" ||
|
||||
actionName == "Load stddev" )
|
||||
{
|
||||
ok = mRendererWidget->bandMinMaxFromStdDev( myStdDev, theBandNo, minMaxValues );
|
||||
}
|
||||
|
||||
// apply current item
|
||||
cboHistoBand->setCurrentIndex( theBandNo - 1 );
|
||||
if ( !ok || actionName == "Load reset" )
|
||||
{
|
||||
leHistoMin->clear();
|
||||
leHistoMax->clear();
|
||||
// TODO - fix gdal provider: changes data type when nodata value is not found
|
||||
// this prevents us from getting proper min and max values here
|
||||
// minMaxValues[0] = QgsContrastEnhancement::minimumValuePossible( ( QgsContrastEnhancement::QgsRasterDataType )
|
||||
// mRasterLayer->dataProvider()->dataType( theBandNo ) );
|
||||
// minMaxValues[1] = QgsContrastEnhancement::maximumValuePossible( ( QgsContrastEnhancement::QgsRasterDataType )
|
||||
// mRasterLayer->dataProvider()->dataType( theBandNo ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
leHistoMin->setText( QString::number( minMaxValues[0] ) );
|
||||
leHistoMax->setText( QString::number( minMaxValues[1] ) );
|
||||
}
|
||||
applyHistoMin( );
|
||||
applyHistoMax( );
|
||||
}
|
||||
// update markers
|
||||
leHistoMin->blockSignals( false );
|
||||
leHistoMax->blockSignals( false );
|
||||
updateHistoMarkers();
|
||||
}
|
||||
else if ( actionName == "Compute histogram" )
|
||||
{
|
||||
on_btnHistoCompute_clicked();
|
||||
}
|
||||
else
|
||||
{
|
||||
QgsDebugMsg( "Invalid action " + actionName );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void QgsRasterHistogramWidget::applyHistoMin( )
|
||||
{
|
||||
if ( ! mRendererWidget )
|
||||
return;
|
||||
|
||||
int theBandNo = cboHistoBand->currentIndex() + 1;
|
||||
QList< int > mySelectedBands = rendererSelectedBands();
|
||||
for ( int i = 0; i <= mySelectedBands.size(); i++ )
|
||||
{
|
||||
if ( theBandNo == mRendererWidget->selectedBand( i ) )
|
||||
mRendererWidget->setMin( leHistoMin->text(), i );
|
||||
}
|
||||
|
||||
updateHistoMarkers();
|
||||
}
|
||||
|
||||
void QgsRasterHistogramWidget::applyHistoMax( )
|
||||
{
|
||||
if ( ! mRendererWidget )
|
||||
return;
|
||||
|
||||
int theBandNo = cboHistoBand->currentIndex() + 1;
|
||||
QList< int > mySelectedBands = rendererSelectedBands();
|
||||
for ( int i = 0; i <= mySelectedBands.size(); i++ )
|
||||
{
|
||||
if ( theBandNo == mRendererWidget->selectedBand( i ) )
|
||||
mRendererWidget->setMax( leHistoMax->text(), i );
|
||||
}
|
||||
|
||||
updateHistoMarkers();
|
||||
}
|
||||
|
||||
void QgsRasterHistogramWidget::on_btnHistoMin_toggled()
|
||||
{
|
||||
if ( mpPlot != NULL && mHistoPicker != NULL )
|
||||
{
|
||||
if ( QApplication::overrideCursor() )
|
||||
QApplication::restoreOverrideCursor();
|
||||
if ( btnHistoMin->isChecked() )
|
||||
{
|
||||
btnHistoMax->setChecked( false );
|
||||
QApplication::setOverrideCursor( Qt::PointingHandCursor );
|
||||
}
|
||||
if ( mHistoZoomer != NULL )
|
||||
mHistoZoomer->setEnabled( ! btnHistoMax->isChecked() );
|
||||
mHistoPicker->setEnabled( btnHistoMin->isChecked() );
|
||||
}
|
||||
}
|
||||
|
||||
void QgsRasterHistogramWidget::on_btnHistoMax_toggled()
|
||||
{
|
||||
if ( mpPlot != NULL && mHistoPicker != NULL )
|
||||
{
|
||||
if ( QApplication::overrideCursor() )
|
||||
QApplication::restoreOverrideCursor();
|
||||
if ( btnHistoMax->isChecked() )
|
||||
{
|
||||
btnHistoMin->setChecked( false );
|
||||
QApplication::setOverrideCursor( Qt::PointingHandCursor );
|
||||
}
|
||||
if ( mHistoZoomer != NULL )
|
||||
mHistoZoomer->setEnabled( ! btnHistoMax->isChecked() );
|
||||
mHistoPicker->setEnabled( btnHistoMax->isChecked() );
|
||||
}
|
||||
}
|
||||
|
||||
// local function used by histoPickerSelected(), to get a rounded picked value
|
||||
// this is sensitive and may not always be correct, needs more testing
|
||||
QString findClosestTickVal( double target, QwtScaleDiv * scale, int div = 100 )
|
||||
{
|
||||
if ( scale == NULL ) return "";
|
||||
|
||||
QList< double > minorTicks = scale->ticks( QwtScaleDiv::MinorTick );
|
||||
QList< double > majorTicks = scale->ticks( QwtScaleDiv::MajorTick );
|
||||
double diff = ( minorTicks[1] - minorTicks[0] ) / div;
|
||||
double min = majorTicks[0] - diff;
|
||||
if ( min > target )
|
||||
min -= ( majorTicks[1] - majorTicks[0] );
|
||||
double max = scale->upperBound();
|
||||
double closest = target;
|
||||
double current = min;
|
||||
|
||||
while ( current < max )
|
||||
{
|
||||
current += diff;
|
||||
if ( current > target )
|
||||
{
|
||||
closest = ( abs( target - current + diff ) < abs( target - current ) ) ? current - diff : current;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// QgsDebugMsg( QString( "target=%1 div=%2 closest=%3" ).arg( target ).arg( div ).arg( closest ) );
|
||||
return QString::number( closest );
|
||||
}
|
||||
|
||||
void QgsRasterHistogramWidget::histoPickerSelected( const QPointF & pos )
|
||||
{
|
||||
if ( btnHistoMin->isChecked() )
|
||||
{
|
||||
leHistoMin->setText( findClosestTickVal( pos.x(), mpPlot->axisScaleDiv( QwtPlot::xBottom ) ) );
|
||||
applyHistoMin();
|
||||
btnHistoMin->setChecked( false );
|
||||
}
|
||||
else if ( btnHistoMax->isChecked() )
|
||||
{
|
||||
leHistoMax->setText( findClosestTickVal( pos.x(), mpPlot->axisScaleDiv( QwtPlot::xBottom ) ) );
|
||||
applyHistoMax();
|
||||
btnHistoMax->setChecked( false );
|
||||
}
|
||||
if ( QApplication::overrideCursor() )
|
||||
QApplication::restoreOverrideCursor();
|
||||
}
|
||||
|
||||
void QgsRasterHistogramWidget::histoPickerSelectedQwt5( const QwtDoublePoint & pos )
|
||||
{
|
||||
histoPickerSelected( QPointF( pos.x(), pos.y() ) );
|
||||
}
|
||||
|
||||
void QgsRasterHistogramWidget::updateHistoMarkers( )
|
||||
{
|
||||
// hack to not update markers
|
||||
if ( leHistoMin->signalsBlocked() )
|
||||
return;
|
||||
// todo error checking
|
||||
if ( mpPlot == NULL || mHistoMarkerMin == NULL || mHistoMarkerMax == NULL )
|
||||
return;
|
||||
|
||||
int theBandNo = cboHistoBand->currentIndex() + 1;
|
||||
QList< int > mySelectedBands = histoSelectedBands();
|
||||
|
||||
if ( ! mHistoShowMarkers ||
|
||||
( ! mySelectedBands.isEmpty() && ! mySelectedBands.contains( theBandNo ) ) )
|
||||
{
|
||||
mHistoMarkerMin->hide();
|
||||
mHistoMarkerMax->hide();
|
||||
mpPlot->replot();
|
||||
return;
|
||||
}
|
||||
|
||||
double minVal = mHistoMin;
|
||||
double maxVal = mHistoMax;
|
||||
QString minStr = leHistoMin->text();
|
||||
QString maxStr = leHistoMax->text();
|
||||
if ( minStr != "" )
|
||||
minVal = minStr.toDouble();
|
||||
if ( maxStr != "" )
|
||||
maxVal = maxStr.toDouble();
|
||||
|
||||
QPen linePen = QPen( mHistoColors.at( theBandNo ) );
|
||||
linePen.setStyle( Qt::DashLine );
|
||||
mHistoMarkerMin->setLineStyle( QwtPlotMarker::VLine );
|
||||
mHistoMarkerMin->setLinePen( linePen );
|
||||
mHistoMarkerMin->setXValue( minVal );
|
||||
mHistoMarkerMin->show();
|
||||
mHistoMarkerMax->setLineStyle( QwtPlotMarker::VLine );
|
||||
mHistoMarkerMax->setLinePen( linePen );
|
||||
mHistoMarkerMax->setXValue( maxVal );
|
||||
mHistoMarkerMax->show();
|
||||
|
||||
mpPlot->replot();
|
||||
}
|
||||
|
||||
|
||||
QList< int > QgsRasterHistogramWidget::histoSelectedBands()
|
||||
{
|
||||
QList< int > mySelectedBands;
|
||||
|
||||
if ( mHistoShowBands != ShowAll )
|
||||
{
|
||||
if ( mHistoShowBands == ShowSelected )
|
||||
{
|
||||
mySelectedBands << cboHistoBand->currentIndex() + 1;
|
||||
}
|
||||
else if ( mHistoShowBands == ShowRGB )
|
||||
{
|
||||
mySelectedBands = rendererSelectedBands();
|
||||
}
|
||||
}
|
||||
|
||||
return mySelectedBands;
|
||||
}
|
||||
|
||||
QList< int > QgsRasterHistogramWidget::rendererSelectedBands()
|
||||
{
|
||||
QList< int > mySelectedBands;
|
||||
|
||||
if ( ! mRendererWidget )
|
||||
{
|
||||
mySelectedBands << -1 << -1 << -1; // make sure we return 3 elements
|
||||
return mySelectedBands;
|
||||
}
|
||||
|
||||
if ( mRendererName == "singlebandgray" )
|
||||
{
|
||||
mySelectedBands << mRendererWidget->selectedBand( );
|
||||
}
|
||||
else if ( mRendererName == "multibandcolor" )
|
||||
{
|
||||
for ( int i = 0; i <= 2; i++ )
|
||||
{
|
||||
mySelectedBands << mRendererWidget->selectedBand( i );
|
||||
}
|
||||
}
|
||||
|
||||
return mySelectedBands;
|
||||
}
|
||||
|
||||
QPair< QString, QString > QgsRasterHistogramWidget::rendererMinMax( int theBandNo )
|
||||
{
|
||||
QPair< QString, QString > myMinMax;
|
||||
|
||||
if ( ! mRendererWidget )
|
||||
return myMinMax;
|
||||
|
||||
if ( mRendererName == "singlebandgray" )
|
||||
{
|
||||
if ( theBandNo == mRendererWidget->selectedBand( ) )
|
||||
{
|
||||
myMinMax.first = mRendererWidget->min();
|
||||
myMinMax.second = mRendererWidget->max();
|
||||
}
|
||||
}
|
||||
else if ( mRendererName == "multibandcolor" )
|
||||
{
|
||||
for ( int i = 0; i <= 2; i++ )
|
||||
{
|
||||
if ( theBandNo == mRendererWidget->selectedBand( i ) )
|
||||
{
|
||||
myMinMax.first = mRendererWidget->min( i );
|
||||
myMinMax.second = mRendererWidget->max( i );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return myMinMax;
|
||||
}
|
123
src/gui/raster/qgsrasterhistogramwidget.h
Normal file
@ -0,0 +1,123 @@
|
||||
/***************************************************************************
|
||||
qgsrasterrendererwidget.h
|
||||
---------------------------
|
||||
begin : July 2012
|
||||
copyright : (C) 2012 by Etienne Tourigny
|
||||
email : etourigny dot dev at gmail dot com
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
#ifndef QGSRASTERHISTOGRAMWIDGET_H
|
||||
#define QGSRASTERHISTOGRAMWIDGET_H
|
||||
|
||||
#include "ui_qgsrasterhistogramwidgetbase.h"
|
||||
|
||||
class QgsRasterLayer;
|
||||
class QgsRasterRendererWidget;
|
||||
class QwtPlotPicker;
|
||||
class QwtPlotMarker;
|
||||
class QwtPlotZoomer;
|
||||
|
||||
// fix for qwt5/qwt6 QwtDoublePoint vs. QPointF
|
||||
#if defined(QWT_VERSION) && QWT_VERSION>=0x060000
|
||||
typedef QPointF QwtDoublePoint;
|
||||
#endif
|
||||
|
||||
/** Histogram widget
|
||||
*@author Etienne Tourigny
|
||||
*/
|
||||
|
||||
class QgsRasterHistogramWidget : public QWidget, private Ui::QgsRasterHistogramWidgetBase
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QgsRasterHistogramWidget( QgsRasterLayer *lyr, QWidget *parent = 0 );
|
||||
~QgsRasterHistogramWidget();
|
||||
|
||||
/** Save the histogram as an image to disk */
|
||||
bool histoSaveAsImage( const QString& theFilename, int width = 600, int height = 600, int quality = -1 );
|
||||
|
||||
/** Set the renderer widget (or just its name if there is no widget) */
|
||||
void setRendererWidget( const QString& name, QgsRasterRendererWidget* rendererWidget = NULL );
|
||||
|
||||
/** Activate the histogram widget */
|
||||
void setActive( bool theActiveFlag );
|
||||
|
||||
/** \brief Compute the histogram on demand. */
|
||||
bool computeHistogram( bool forceComputeFlag );
|
||||
|
||||
/** Apply a histoActionTriggered() event. */
|
||||
void histoAction( const QString actionName, bool actionFlag = true );
|
||||
|
||||
/** Apply a histoActionTriggered() event. */
|
||||
void setSelectedBand( int index );
|
||||
|
||||
public slots:
|
||||
/** \brief slot executed when user wishes to refresh raster histogramwidget */
|
||||
void refreshHistogram();
|
||||
/** This slot lets you save the histogram as an image to disk */
|
||||
void on_mSaveAsImageButton_clicked();
|
||||
|
||||
private slots:
|
||||
/** Used when the histogram band selector changes, or when tab is loaded. */
|
||||
void on_cboHistoBand_currentIndexChanged( int );
|
||||
/** Applies the selected min/max values to the renderer widget. */
|
||||
void applyHistoMin( );
|
||||
void applyHistoMax( );
|
||||
/** Button to activate picking of the min/max value on the graph. */
|
||||
void on_btnHistoMin_toggled();
|
||||
void on_btnHistoMax_toggled();
|
||||
/** Called when a selection has been made using the plot picker. */
|
||||
void histoPickerSelected( const QPointF & );
|
||||
/** Called when a selection has been made using the plot picker (for qwt5 only). */
|
||||
void histoPickerSelectedQwt5( const QwtDoublePoint & );
|
||||
/** Various actions that are stored in btnHistoActions. */
|
||||
void histoActionTriggered( QAction* );
|
||||
/** Draw the min/max markers on the histogram plot. */
|
||||
void updateHistoMarkers();
|
||||
/** Button to compute the histogram, appears when no cached histogram is available. */
|
||||
void on_btnHistoCompute_clicked();
|
||||
|
||||
//signals:
|
||||
|
||||
private:
|
||||
|
||||
enum HistoShowBands
|
||||
{
|
||||
ShowAll = 0,
|
||||
ShowSelected = 1,
|
||||
ShowRGB = 2
|
||||
};
|
||||
|
||||
/** \brief Pointer to the raster layer that this property dilog changes the behaviour of. */
|
||||
QgsRasterLayer * mRasterLayer;
|
||||
/** \brief Pointer to the renderer widget, to get/set min/max. */
|
||||
QgsRasterRendererWidget* mRendererWidget;
|
||||
/** \brief Name of the renderer widget (see QgsRasterRendererRegistry). */
|
||||
QString mRendererName;
|
||||
|
||||
QwtPlotPicker* mHistoPicker;
|
||||
QwtPlotZoomer* mHistoZoomer;
|
||||
QwtPlotMarker* mHistoMarkerMin;
|
||||
QwtPlotMarker* mHistoMarkerMax;
|
||||
double mHistoMin;
|
||||
double mHistoMax;
|
||||
QVector<QColor> mHistoColors;
|
||||
bool mHistoShowMarkers;
|
||||
bool mHistoLoadApplyAll;
|
||||
HistoShowBands mHistoShowBands;
|
||||
/** \brief Returns a list of selected bands in the histogram widget- or empty if there is no selection restriction. */
|
||||
QList< int > histoSelectedBands();
|
||||
/** \brief Returns a list of selected bands in the renderer widget. */
|
||||
QList< int > rendererSelectedBands();
|
||||
QPair< QString, QString > rendererMinMax( int theBandNo );
|
||||
};
|
||||
#endif
|
@ -132,7 +132,7 @@ QString QgsGdalLayerItem::layerName() const
|
||||
QgsWCSConnectionItem::QgsWCSConnectionItem( QgsDataItem* parent, QString name, QString path )
|
||||
: QgsDataCollectionItem( parent, name, path )
|
||||
{
|
||||
mIcon = QIcon( getThemePixmap( "mIconWcs.png" ) );
|
||||
mIcon = QIcon( QgsApplication::getThemePixmap( "mIconWcs.png" ) );
|
||||
}
|
||||
|
||||
QgsWCSConnectionItem::~QgsWCSConnectionItem()
|
||||
@ -245,7 +245,7 @@ QgsWCSLayerItem::QgsWCSLayerItem( QgsDataItem* parent, QString name, QString pat
|
||||
if ( mChildren.size() == 0 )
|
||||
{
|
||||
//mIcon = iconRaster();
|
||||
mIcon = QIcon( getThemePixmap( "mIconWcs.png" ) );
|
||||
mIcon = QgsApplication::getThemeIcon( "mIconWcs.png" );
|
||||
}
|
||||
mPopulated = true;
|
||||
}
|
||||
@ -323,7 +323,7 @@ QString QgsWCSLayerItem::createUri()
|
||||
QgsWCSRootItem::QgsWCSRootItem( QgsDataItem* parent, QString name, QString path )
|
||||
: QgsDataCollectionItem( parent, name, path )
|
||||
{
|
||||
mIcon = QIcon( getThemePixmap( "mIconWcs.png" ) );
|
||||
mIcon = QgsApplication::getThemeIcon( "mIconWcs.png" );
|
||||
|
||||
populate();
|
||||
}
|
||||
@ -341,7 +341,7 @@ QVector<QgsDataItem*>QgsWCSRootItem::createChildren()
|
||||
QgsOWSConnection connection( "WCS", connName );
|
||||
QgsDataItem * conn = new QgsWCSConnectionItem( this, connName, connection.uri().encodedUri() );
|
||||
|
||||
conn->setIcon( QIcon( getThemePixmap( "mIconConnect.png" ) ) );
|
||||
conn->setIcon( QgsApplication::getThemeIcon( "mIconConnect.png" ) );
|
||||
connections.append( conn );
|
||||
}
|
||||
return connections;
|
||||
|
@ -1498,7 +1498,10 @@ void QgsGdalProvider::populateHistogram( int theBandNo, QgsRasterBandStats & the
|
||||
double dfHalfBucket = 0;
|
||||
eErr = GDALGetRasterStatistics( myGdalBand, TRUE, TRUE, &myMinVal, &myMaxVal, NULL, NULL );
|
||||
if ( eErr != CE_None )
|
||||
{
|
||||
delete [] myHistogramArray;
|
||||
return;
|
||||
}
|
||||
dfHalfBucket = ( myMaxVal - myMinVal ) / ( 2 * theBinCount );
|
||||
myMinVal -= dfHalfBucket;
|
||||
myMaxVal += dfHalfBucket;
|
||||
@ -1509,7 +1512,10 @@ void QgsGdalProvider::populateHistogram( int theBandNo, QgsRasterBandStats & the
|
||||
theIgnoreOutOfRangeFlag, theHistogramEstimatedFlag, progressCallback,
|
||||
&myProg ); //this is the arg for our custom gdal progress callback
|
||||
if ( myError != CE_None )
|
||||
{
|
||||
delete [] myHistogramArray;
|
||||
return;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1526,6 +1532,8 @@ void QgsGdalProvider::populateHistogram( int theBandNo, QgsRasterBandStats & the
|
||||
// QgsDebugMsg( "Added " + QString::number( myHistogramArray[myBin] ) + " to histogram vector" );
|
||||
}
|
||||
}
|
||||
delete [] myHistogramArray;
|
||||
|
||||
|
||||
}
|
||||
QgsDebugMsg( ">>>>> Histogram vector now contains " + QString::number( theBandStats.histogramVector->size() ) +
|
||||
|
@ -36,7 +36,7 @@
|
||||
QgsMssqlConnectionItem::QgsMssqlConnectionItem( QgsDataItem* parent, QString name, QString path )
|
||||
: QgsDataCollectionItem( parent, name, path )
|
||||
{
|
||||
mIcon = QIcon( getThemePixmap( "mIconConnect.png" ) );
|
||||
mIcon = QgsApplication::getThemeIcon( "mIconConnect.png" );
|
||||
QSettings settings;
|
||||
QString key = "/MSSQL/connections/" + mName;
|
||||
mService = settings.value( key + "/service" ).toString();
|
||||
@ -438,7 +438,7 @@ QString QgsMssqlLayerItem::createUri()
|
||||
QgsMssqlSchemaItem::QgsMssqlSchemaItem( QgsDataItem* parent, QString name, QString path )
|
||||
: QgsDataCollectionItem( parent, name, path )
|
||||
{
|
||||
mIcon = QIcon( getThemePixmap( "mIconDbSchema.png" ) );
|
||||
mIcon = QgsApplication::getThemeIcon( "mIconDbSchema.png" );
|
||||
}
|
||||
|
||||
QVector<QgsDataItem*> QgsMssqlSchemaItem::createChildren()
|
||||
@ -518,7 +518,7 @@ QgsMssqlLayerItem* QgsMssqlSchemaItem::addLayer( QgsMssqlLayerProperty layerProp
|
||||
QgsMssqlRootItem::QgsMssqlRootItem( QgsDataItem* parent, QString name, QString path )
|
||||
: QgsDataCollectionItem( parent, name, path )
|
||||
{
|
||||
mIcon = QIcon( getThemePixmap( "mIconMssql.png" ) );
|
||||
mIcon = QgsApplication::getThemeIcon( "mIconMssql.png" );
|
||||
populate();
|
||||
}
|
||||
|
||||
|
@ -296,23 +296,23 @@ QIcon QgsMssqlTableModel::iconForWkbType( QGis::WkbType type )
|
||||
case QGis::WKBPoint25D:
|
||||
case QGis::WKBMultiPoint:
|
||||
case QGis::WKBMultiPoint25D:
|
||||
return QIcon( QgsDataItem::getThemePixmap( "/mIconPointLayer.png" ) );
|
||||
return QgsApplication::getThemeIcon( "/mIconPointLayer.png" );
|
||||
case QGis::WKBLineString:
|
||||
case QGis::WKBLineString25D:
|
||||
case QGis::WKBMultiLineString:
|
||||
case QGis::WKBMultiLineString25D:
|
||||
return QIcon( QgsDataItem::getThemePixmap( "/mIconLineLayer.png" ) );
|
||||
return QgsApplication::getThemeIcon( "/mIconLineLayer.png" );
|
||||
case QGis::WKBPolygon:
|
||||
case QGis::WKBPolygon25D:
|
||||
case QGis::WKBMultiPolygon:
|
||||
case QGis::WKBMultiPolygon25D:
|
||||
return QIcon( QgsDataItem::getThemePixmap( "/mIconPolygonLayer.png" ) );
|
||||
return QgsApplication::getThemeIcon( "/mIconPolygonLayer.png" );
|
||||
case QGis::WKBNoGeometry:
|
||||
return QIcon( QgsDataItem::getThemePixmap( "/mIconTableLayer.png" ) );
|
||||
return QgsApplication::getThemeIcon( "/mIconTableLayer.png" );
|
||||
case QGis::WKBUnknown:
|
||||
break;
|
||||
}
|
||||
return QIcon( QgsDataItem::getThemePixmap( "/mIconLayer.png" ) );
|
||||
return QgsApplication::getThemeIcon( "/mIconLayer.png" );
|
||||
}
|
||||
|
||||
bool QgsMssqlTableModel::setData( const QModelIndex &idx, const QVariant &value, int role )
|
||||
|
@ -7,13 +7,15 @@
|
||||
#include "qgsowsconnection.h"
|
||||
#include "qgsnewhttpconnection.h"
|
||||
|
||||
#include "qgsapplication.h"
|
||||
|
||||
#include <QFileInfo>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
QgsOWSConnectionItem::QgsOWSConnectionItem( QgsDataItem* parent, QString name, QString path )
|
||||
: QgsDataCollectionItem( parent, name, path )
|
||||
{
|
||||
mIcon = QIcon( getThemePixmap( "mIconConnect.png" ) );
|
||||
mIcon = QgsApplication::getThemeIcon( "mIconConnect.png" );
|
||||
}
|
||||
|
||||
QgsOWSConnectionItem::~QgsOWSConnectionItem()
|
||||
@ -134,7 +136,7 @@ void QgsOWSConnectionItem::deleteConnection()
|
||||
QgsOWSRootItem::QgsOWSRootItem( QgsDataItem* parent, QString name, QString path )
|
||||
: QgsDataCollectionItem( parent, name, path )
|
||||
{
|
||||
mIcon = QIcon( getThemePixmap( "mIconOws.png" ) );
|
||||
mIcon = QgsApplication::getThemeIcon( "mIconOws.png" );
|
||||
|
||||
populate();
|
||||
}
|
||||
|
@ -285,23 +285,23 @@ QIcon QgsPgTableModel::iconForWkbType( QGis::WkbType type )
|
||||
case QGis::WKBPoint25D:
|
||||
case QGis::WKBMultiPoint:
|
||||
case QGis::WKBMultiPoint25D:
|
||||
return QIcon( QgsDataItem::getThemePixmap( "/mIconPointLayer.png" ) );
|
||||
return QgsApplication::getThemeIcon( "/mIconPointLayer.png" );
|
||||
case QGis::WKBLineString:
|
||||
case QGis::WKBLineString25D:
|
||||
case QGis::WKBMultiLineString:
|
||||
case QGis::WKBMultiLineString25D:
|
||||
return QIcon( QgsDataItem::getThemePixmap( "/mIconLineLayer.png" ) );
|
||||
return QgsApplication::getThemeIcon( "/mIconLineLayer.png" );
|
||||
case QGis::WKBPolygon:
|
||||
case QGis::WKBPolygon25D:
|
||||
case QGis::WKBMultiPolygon:
|
||||
case QGis::WKBMultiPolygon25D:
|
||||
return QIcon( QgsDataItem::getThemePixmap( "/mIconPolygonLayer.png" ) );
|
||||
return QgsApplication::getThemeIcon( "/mIconPolygonLayer.png" );
|
||||
case QGis::WKBNoGeometry:
|
||||
return QIcon( QgsDataItem::getThemePixmap( "/mIconTableLayer.png" ) );
|
||||
return QgsApplication::getThemeIcon( "/mIconTableLayer.png" );
|
||||
case QGis::WKBUnknown:
|
||||
break;
|
||||
}
|
||||
return QIcon( QgsDataItem::getThemePixmap( "/mIconLayer.png" ) );
|
||||
return QgsApplication::getThemeIcon( "/mIconLayer.png" );
|
||||
}
|
||||
|
||||
bool QgsPgTableModel::setData( const QModelIndex &idx, const QVariant &value, int role )
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "qgscolumntypethread.h"
|
||||
#include "qgslogger.h"
|
||||
#include "qgsdatasourceuri.h"
|
||||
#include "qgsapplication.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
@ -28,7 +29,7 @@ QGISEXTERN bool deleteLayer( const QString& uri, QString& errCause );
|
||||
QgsPGConnectionItem::QgsPGConnectionItem( QgsDataItem* parent, QString name, QString path )
|
||||
: QgsDataCollectionItem( parent, name, path )
|
||||
{
|
||||
mIcon = QIcon( getThemePixmap( "mIconConnect.png" ) );
|
||||
mIcon = QgsApplication::getThemeIcon( "mIconConnect.png" );
|
||||
}
|
||||
|
||||
QgsPGConnectionItem::~QgsPGConnectionItem()
|
||||
@ -304,7 +305,7 @@ QString QgsPGLayerItem::createUri()
|
||||
QgsPGSchemaItem::QgsPGSchemaItem( QgsDataItem* parent, QString name, QString path )
|
||||
: QgsDataCollectionItem( parent, name, path )
|
||||
{
|
||||
mIcon = QIcon( getThemePixmap( "mIconDbSchema.png" ) );
|
||||
mIcon = QgsApplication::getThemeIcon( "mIconDbSchema.png" );
|
||||
}
|
||||
|
||||
QVector<QgsDataItem*> QgsPGSchemaItem::createChildren()
|
||||
@ -364,7 +365,7 @@ void QgsPGSchemaItem::addLayer( QgsPostgresLayerProperty layerProperty )
|
||||
QgsPGRootItem::QgsPGRootItem( QgsDataItem* parent, QString name, QString path )
|
||||
: QgsDataCollectionItem( parent, name, path )
|
||||
{
|
||||
mIcon = QIcon( getThemePixmap( "mIconPostgis.png" ) );
|
||||
mIcon = QgsApplication::getThemeIcon( "mIconPostgis.png" );
|
||||
populate();
|
||||
}
|
||||
|
||||
|
@ -244,7 +244,7 @@ bool QgsSLConnectionItem::handleDrop( const QMimeData * data, Qt::DropAction )
|
||||
QgsSLRootItem::QgsSLRootItem( QgsDataItem* parent, QString name, QString path )
|
||||
: QgsDataCollectionItem( parent, name, path )
|
||||
{
|
||||
mIcon = QIcon( getThemePixmap( "mIconSpatialite.png" ) );
|
||||
mIcon = QgsApplication::getThemeIcon( "mIconSpatialite.png" );
|
||||
populate();
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ QgsWFSLayerItem::QgsWFSLayerItem( QgsDataItem* parent, QString name, QgsDataSour
|
||||
mUri = QgsWFSCapabilities( uri.encodedUri() ).uriGetFeature( featureType );
|
||||
mPopulated = true;
|
||||
//mIcon = QIcon( getThemePixmap( "mIconVectorLayer.png" ) );
|
||||
mIcon = QIcon( getThemePixmap( "mIconWfs.png" ) );
|
||||
mIcon = QgsApplication::getThemeIcon( "mIconWfs.png" );
|
||||
}
|
||||
|
||||
QgsWFSLayerItem::~QgsWFSLayerItem()
|
||||
@ -42,7 +42,7 @@ QgsWFSLayerItem::~QgsWFSLayerItem()
|
||||
QgsWFSConnectionItem::QgsWFSConnectionItem( QgsDataItem* parent, QString name, QString path )
|
||||
: QgsDataCollectionItem( parent, name, path ), mName( name ), mCapabilities( NULL )
|
||||
{
|
||||
mIcon = QIcon( getThemePixmap( "mIconWfs.png" ) );
|
||||
mIcon = QgsApplication::getThemeIcon( "mIconWfs.png" );
|
||||
}
|
||||
|
||||
QgsWFSConnectionItem::~QgsWFSConnectionItem()
|
||||
@ -138,7 +138,7 @@ void QgsWFSConnectionItem::deleteConnection()
|
||||
QgsWFSRootItem::QgsWFSRootItem( QgsDataItem* parent, QString name, QString path )
|
||||
: QgsDataCollectionItem( parent, name, path )
|
||||
{
|
||||
mIcon = QIcon( getThemePixmap( "mIconWfs.png" ) );
|
||||
mIcon = QgsApplication::getThemeIcon( "mIconWfs.png" );
|
||||
|
||||
populate();
|
||||
}
|
||||
@ -155,7 +155,7 @@ QVector<QgsDataItem*> QgsWFSRootItem::createChildren()
|
||||
{
|
||||
QgsOWSConnection connection( "WF", connName );
|
||||
QgsDataItem * conn = new QgsWFSConnectionItem( this, connName, connection.uri().encodedUri() );
|
||||
conn->setIcon( QIcon( getThemePixmap( "mIconConnect.png" ) ) );
|
||||
conn->setIcon( QgsApplication::getThemeIcon( "mIconConnect.png" ) );
|
||||
connections.append( conn );
|
||||
}
|
||||
return connections;
|
||||
|
@ -24,11 +24,13 @@
|
||||
|
||||
#include "qgstilescalewidget.h"
|
||||
|
||||
#include "qgsapplication.h"
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
QgsWMSConnectionItem::QgsWMSConnectionItem( QgsDataItem* parent, QString name, QString path )
|
||||
: QgsDataCollectionItem( parent, name, path )
|
||||
{
|
||||
mIcon = QIcon( getThemePixmap( "mIconWms.png" ) );
|
||||
mIcon = QgsApplication::getThemeIcon( "mIconWms.png" );
|
||||
}
|
||||
|
||||
QgsWMSConnectionItem::~QgsWMSConnectionItem()
|
||||
@ -163,7 +165,7 @@ QgsWMSLayerItem::QgsWMSLayerItem( QgsDataItem* parent, QString name, QString pat
|
||||
if ( mChildren.size() == 0 )
|
||||
{
|
||||
//mIcon = iconRaster();
|
||||
mIcon = QIcon( getThemePixmap( "mIconWms.png" ) );
|
||||
mIcon = QgsApplication::getThemeIcon( "mIconWms.png" );
|
||||
}
|
||||
mPopulated = true;
|
||||
}
|
||||
@ -221,7 +223,7 @@ QString QgsWMSLayerItem::createUri()
|
||||
QgsWMSRootItem::QgsWMSRootItem( QgsDataItem* parent, QString name, QString path )
|
||||
: QgsDataCollectionItem( parent, name, path )
|
||||
{
|
||||
mIcon = QIcon( getThemePixmap( "mIconWms.png" ) );
|
||||
mIcon = QgsApplication::getThemeIcon( "mIconWms.png" );
|
||||
|
||||
populate();
|
||||
}
|
||||
@ -240,7 +242,7 @@ QVector<QgsDataItem*>QgsWMSRootItem::createChildren()
|
||||
QgsWMSConnection connection( connName );
|
||||
QgsDataItem * conn = new QgsWMSConnectionItem( this, connName, connection.uri().encodedUri() );
|
||||
|
||||
conn->setIcon( QIcon( getThemePixmap( "mIconConnect.png" ) ) );
|
||||
conn->setIcon( QgsApplication::getThemeIcon( "mIconConnect.png" ) );
|
||||
connections.append( conn );
|
||||
}
|
||||
return connections;
|
||||
|
441
src/ui/qgsrasterhistogramwidgetbase.ui
Normal file
@ -0,0 +1,441 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>QgsRasterHistogramWidgetBase</class>
|
||||
<widget class="QWidget" name="QgsRasterHistogramWidgetBase">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>694</width>
|
||||
<height>311</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QwtPlot" name="mpPlot"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>673</width>
|
||||
<height>7</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QStackedWidget" name="stackedWidget2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="page1_2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_2">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_9">
|
||||
<property name="spacing">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_13">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>5</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Band</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="cboHistoBand">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_7">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>10</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_10">
|
||||
<property name="spacing">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Min</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="leHistoMin">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnHistoMin">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Pick Min value on graph</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/mActionTouch2.png</normaloff>:/images/themes/default/mActionTouch2.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_15">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>5</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_11">
|
||||
<property name="spacing">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Max</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="leHistoMax">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnHistoMax">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Pick Max value on graph</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/mActionTouch2.png</normaloff>:/images/themes/default/mActionTouch2.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_6">
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_10">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>5</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnHistoActions">
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Prefs/Actions</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/mAction.png</normaloff>:/images/themes/default/mAction.png</iconset>
|
||||
</property>
|
||||
<property name="popupMode">
|
||||
<enum>QToolButton::InstantPopup</enum>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_16">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>1</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_17">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>5</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="mSaveAsImageButton">
|
||||
<property name="toolTip">
|
||||
<string>Save plot</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save as image...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/mActionFileSave.png</normaloff>:/images/themes/default/mActionFileSave.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="page2_2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_12">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QProgressBar" name="mHistogramProgress">
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="page">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_20">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnHistoCompute">
|
||||
<property name="text">
|
||||
<string>Compute Histogram</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_19">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>QwtPlot</class>
|
||||
<extends>QFrame</extends>
|
||||
<header>qwt_plot.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../../images/images.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
@ -300,6 +300,9 @@
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
<property name="showGrid">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="rowCount">
|
||||
<number>0</number>
|
||||
</property>
|
||||
@ -826,50 +829,30 @@ p, li { white-space: pre-wrap; }
|
||||
<table border="0" style="-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;">
|
||||
<tr>
|
||||
<td style="border: none;">
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:9pt;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:9pt;"><br /></span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:9pt;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:9pt;"><br /></span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:9pt;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:9pt;"><br /></span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:9pt;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:9pt;"><br /></span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:9pt;"></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:9pt;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:9pt;"><br /></span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:9pt;"><br /></span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:9pt;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:9pt;"><br /></span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:9pt;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:9pt;"><br /></span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:10pt;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:10pt;"><br /></span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:10pt;"><br /></span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu';"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu';"><br /></span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:10pt;"><br /></span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:10pt;"><br /></span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:10pt;"><br /></span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:10pt;"><br /></span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:10pt;"><br /></span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:10pt;"><br /></span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:10pt;"><br /></span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:10pt;"><br /></span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:10pt;"><br /></span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;"><br /></span></p></td></tr></table></body></html></string>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif';"><br /></p></td></tr></table></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -948,415 +931,8 @@ p, li { white-space: pre-wrap; }
|
||||
<string>Histogram</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QwtPlot" name="mpPlot"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QStackedWidget" name="stackedWidget2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="page1_2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_2">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_9">
|
||||
<property name="spacing">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_13">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>5</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Band</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="cboHistoBand">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_7">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>10</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_10">
|
||||
<property name="spacing">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Min</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="leHistoMin">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnHistoMin">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Pick Min value on graph</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/mActionTouch2.png</normaloff>:/images/themes/default/mActionTouch2.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_15">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>5</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_11">
|
||||
<property name="spacing">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Max</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="leHistoMax">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnHistoMax">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Pick Max value on graph</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/mActionTouch2.png</normaloff>:/images/themes/default/mActionTouch2.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_6">
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_10">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>5</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnHistoActions">
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Prefs/Actions</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/mAction.png</normaloff>:/images/themes/default/mAction.png</iconset>
|
||||
</property>
|
||||
<property name="popupMode">
|
||||
<enum>QToolButton::InstantPopup</enum>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_16">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>1</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_17">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>5</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="mSaveAsImageButton">
|
||||
<property name="toolTip">
|
||||
<string>Save plot</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save as image...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/mActionFileSave.png</normaloff>:/images/themes/default/mActionFileSave.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="page2_2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_12">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QProgressBar" name="mHistogramProgress">
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="page">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_20">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnHistoCompute">
|
||||
<property name="text">
|
||||
<string>Compute Histogram</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_19">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>10</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
<item row="1" column="1">
|
||||
<widget class="QStackedWidget" name="mHistogramStackedWidget"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
@ -1403,14 +979,6 @@ p, li { white-space: pre-wrap; }
|
||||
</layout>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>QwtPlot</class>
|
||||
<extends>QFrame</extends>
|
||||
<header>qwt_plot.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>tabBar</tabstop>
|
||||
<tabstop>buttonBox</tabstop>
|
||||
|
@ -15,7 +15,6 @@
|
||||
|
||||
#include "qgsrenderchecker.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QColor>
|
||||
#include <QPainter>
|
||||
#include <QImage>
|
||||
@ -33,7 +32,8 @@ QgsRenderChecker::QgsRenderChecker( ) :
|
||||
mMatchTarget( 0 ),
|
||||
mElapsedTime( 0 ),
|
||||
mElapsedTimeTarget( 0 ),
|
||||
mpMapRenderer( NULL )
|
||||
mpMapRenderer( NULL ),
|
||||
mControlPathPrefix( "" )
|
||||
{
|
||||
|
||||
}
|
||||
@ -41,8 +41,8 @@ QgsRenderChecker::QgsRenderChecker( ) :
|
||||
QString QgsRenderChecker::controlImagePath() const
|
||||
{
|
||||
QString myDataDir( TEST_DATA_DIR ); //defined in CmakeLists.txt
|
||||
QString myControlImageDir = myDataDir + QDir::separator() + "control_images"
|
||||
+ QDir::separator() ;
|
||||
QString myControlImageDir = myDataDir + QDir::separator() + "control_images" +
|
||||
QDir::separator() + mControlPathPrefix;
|
||||
return myControlImageDir;
|
||||
}
|
||||
|
||||
@ -167,7 +167,8 @@ bool QgsRenderChecker::runTest( QString theTestName,
|
||||
|
||||
|
||||
bool QgsRenderChecker::compareImages( QString theTestName,
|
||||
unsigned int theMismatchCount )
|
||||
unsigned int theMismatchCount,
|
||||
QString theRenderedImageFile )
|
||||
{
|
||||
if ( mExpectedImageFile.isEmpty() )
|
||||
{
|
||||
@ -178,6 +179,10 @@ bool QgsRenderChecker::compareImages( QString theTestName,
|
||||
"Image File not set.</td></tr></table>\n";
|
||||
return false;
|
||||
}
|
||||
if ( ! theRenderedImageFile.isEmpty() )
|
||||
{
|
||||
mRenderedImageFile = theRenderedImageFile;
|
||||
}
|
||||
if ( mRenderedImageFile.isEmpty() )
|
||||
{
|
||||
qDebug( "QgsRenderChecker::runTest failed - Rendered Image File not set." );
|
||||
@ -327,7 +332,7 @@ bool QgsRenderChecker::compareImages( QString theTestName,
|
||||
"\" type=\"text/text\">" + myMessage +
|
||||
" If you feel the difference image should be considered an anomaly "
|
||||
"you can do something like this\n"
|
||||
"cp " + myDiffImageFile + "../tests/testdata/control_images/" + theTestName +
|
||||
"cp " + myDiffImageFile + " ../tests/testdata/control_images/" + theTestName +
|
||||
"/<imagename>.png"
|
||||
"</DartMeasurement>";
|
||||
qDebug() << myMeasureMessage;
|
||||
|
@ -16,6 +16,7 @@
|
||||
#ifndef QGSRENDERCHECKER_H
|
||||
#define QGSRENDERCHECKER_H
|
||||
|
||||
#include <QDir>
|
||||
#include <QString>
|
||||
#include <qgsmaprenderer.h>
|
||||
class QImage;
|
||||
@ -52,6 +53,10 @@ class QgsRenderChecker
|
||||
* controlImagePath + '/' + mControlName + '/' + mControlName + '.png'
|
||||
*/
|
||||
void setControlName( const QString theName );
|
||||
/** Prefix where the control images are kept.
|
||||
* This will be appended to controlImagePath
|
||||
*/
|
||||
void setControlPathPrefix( const QString theName ) { mControlPathPrefix = theName + QDir::separator(); }
|
||||
/** Get an md5 hash that uniquely identifies an image */
|
||||
QString imageToHash( QString theImageFile );
|
||||
|
||||
@ -79,7 +84,7 @@ class QgsRenderChecker
|
||||
* for that by providing a tolerance.
|
||||
* @note: make sure to call setExpectedImage and setRenderedImage first.
|
||||
*/
|
||||
bool compareImages( QString theTestName, unsigned int theMismatchCount = 0 );
|
||||
bool compareImages( QString theTestName, unsigned int theMismatchCount = 0, QString theRenderedImageFile = "" );
|
||||
/** Get a list of all teh anomalies. An anomaly is a rendered difference
|
||||
* file where there is some red pixel content (indicating a render check
|
||||
* mismatch), but where the output was still acceptible. If the render
|
||||
@ -100,6 +105,7 @@ class QgsRenderChecker
|
||||
int mElapsedTime;
|
||||
int mElapsedTimeTarget;
|
||||
QgsMapRenderer * mpMapRenderer;
|
||||
QString mControlPathPrefix;
|
||||
|
||||
}; // class QgsRenderChecker
|
||||
|
||||
|
@ -11,6 +11,7 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../core #for render checker class
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/gui
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/gui/symbology-ng
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/gui/raster
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/core
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/core/raster
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/core/symbology-ng
|
||||
@ -18,6 +19,7 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${GDAL_INCLUDE_DIR}
|
||||
${PROJ_INCLUDE_DIR}
|
||||
${GEOS_INCLUDE_DIR}
|
||||
${QWT_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
#############################################################
|
||||
@ -37,6 +39,10 @@ IF (WIN32)
|
||||
SET(PLATFORM_LIBRARIES wsock32)
|
||||
ENDIF (WIN32)
|
||||
|
||||
IF(WIN32)
|
||||
ADD_DEFINITIONS(-DQWT_DLL)
|
||||
ENDIF(WIN32)
|
||||
|
||||
# Since the tests are not actually installed, but rather
|
||||
# run directly from the build/src/tests dir we need to
|
||||
# ensure the omg libs can be found.
|
||||
@ -93,6 +99,7 @@ MACRO (ADD_QGIS_TEST testname testsrc)
|
||||
${PROJ_LIBRARY}
|
||||
${GEOS_LIBRARY}
|
||||
${GDAL_LIBRARY}
|
||||
${QWT_LIBRARY}
|
||||
qgis_core
|
||||
qgis_gui)
|
||||
ADD_TEST(qgis_${testname} ${CMAKE_CURRENT_BINARY_DIR}/../../../output/bin/qgis_${testname})
|
||||
@ -110,4 +117,5 @@ ADD_QGIS_TEST(zoomtest testqgsmaptoolzoom.cpp)
|
||||
#QT4_WRAP_CPP(rendererv2gui_MOC_SRCS ${rendererv2gui_HDRS})
|
||||
#ADD_EXECUTABLE(qgis_rendererv2gui ${rendererv2gui_SRCS} ${rendererv2gui_MOC_SRCS})
|
||||
|
||||
ADD_QGIS_TEST(histogramtest testqgsrasterhistogram.cpp)
|
||||
|
||||
|
295
tests/src/gui/testqgsrasterhistogram.cpp
Normal file
@ -0,0 +1,295 @@
|
||||
/***************************************************************************
|
||||
testziplayer.cpp
|
||||
--------------------------------------
|
||||
Date : Mon Jul 16 15:50:29 BRT 2012
|
||||
Copyright : (C) 2012 Etienne Tourigny
|
||||
Email : etourigny.dev@gmail.com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
#include <QtTest>
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QObject>
|
||||
#include <QApplication>
|
||||
#include <QFileInfo>
|
||||
|
||||
#include <qwt_global.h>
|
||||
|
||||
//qgis includes...
|
||||
#include <qgsapplication.h>
|
||||
#include <qgsproviderregistry.h>
|
||||
#include <qgsrasterlayer.h>
|
||||
#include <qgsconfig.h>
|
||||
#include "qgssinglebandgrayrendererwidget.h"
|
||||
#include "qgsmultibandcolorrendererwidget.h"
|
||||
#include "qgssinglebandpseudocolorrendererwidget.h"
|
||||
#include "qgsrasterhistogramwidget.h"
|
||||
|
||||
//qgis unit test includes
|
||||
#include <qgsrenderchecker.h>
|
||||
|
||||
|
||||
/** \ingroup UnitTests
|
||||
* This is a unit test to verify that raster histogram works
|
||||
*/
|
||||
class TestRasterHistogram: public QObject
|
||||
{
|
||||
Q_OBJECT;
|
||||
|
||||
private:
|
||||
|
||||
QString mDataDir;
|
||||
QString mTestPrefix;
|
||||
int mWidth, mHeight, mImageQuality;
|
||||
QgsRasterLayer* mRasterLayer;
|
||||
QgsSingleBandGrayRendererWidget* mGrayRendererWidget;
|
||||
QgsMultiBandColorRendererWidget* mRGBRendererWidget;
|
||||
QgsSingleBandPseudoColorRendererWidget* mPseudoRendererWidget;
|
||||
QgsRasterHistogramWidget* mHistogramWidget;
|
||||
QString mReport;
|
||||
|
||||
bool openLayer( const QString& fileName );
|
||||
void closeLayer( );
|
||||
bool saveImage( const QString& fileName );
|
||||
bool testFile( QString testName,
|
||||
QString rendererName,
|
||||
QgsRasterRendererWidget* rendererWidget,
|
||||
QStringList actionsList = QStringList(),
|
||||
int selectedBand = -1 );
|
||||
|
||||
private slots:
|
||||
|
||||
// init / cleanup
|
||||
void initTestCase();// will be called before the first testfunction is executed.
|
||||
void cleanupTestCase();// will be called after the last testfunction was executed.
|
||||
void init() {};// will be called before each testfunction is executed.
|
||||
void cleanup() {};// will be called after every testfunction.
|
||||
|
||||
// tests
|
||||
void testGray1();
|
||||
void testGray2();
|
||||
void testRGB1();
|
||||
void testRGB2();
|
||||
void testRGB3();
|
||||
void testRGB4();
|
||||
void testPseudo1();
|
||||
};
|
||||
|
||||
|
||||
// slots
|
||||
|
||||
void TestRasterHistogram::initTestCase()
|
||||
{
|
||||
QgsApplication::init();
|
||||
QgsApplication::initQgis();
|
||||
QString mySettings = QgsApplication::showSettings();
|
||||
mySettings = mySettings.replace( "\n", "<br />" );
|
||||
|
||||
// output test environment
|
||||
QgsApplication::showSettings();
|
||||
qDebug() << "QWT version: " << QWT_VERSION_STR;
|
||||
#if defined(QWT_VERSION) && QWT_VERSION>=0x060000
|
||||
mTestPrefix = "histogram_qwt6";
|
||||
#else
|
||||
mTestPrefix = "histogram_qwt5";
|
||||
#endif
|
||||
|
||||
// save data dir
|
||||
mDataDir = QString( TEST_DATA_DIR ) + QDir::separator();
|
||||
mWidth = mHeight = 400;
|
||||
mImageQuality = -1;
|
||||
// Set up the QSettings environment
|
||||
QCoreApplication::setOrganizationName( "QuantumGIS" );
|
||||
QCoreApplication::setOrganizationDomain( "qgis.org" );
|
||||
QCoreApplication::setApplicationName( "QGIS-TEST" );
|
||||
|
||||
// setup objects
|
||||
mRasterLayer = 0;
|
||||
mGrayRendererWidget = 0;
|
||||
mRGBRendererWidget = 0;
|
||||
mPseudoRendererWidget = 0;
|
||||
mHistogramWidget = 0;
|
||||
|
||||
mReport += "<h1>Raster Histogram Tests</h1>\n";
|
||||
mReport += "<p>" + mySettings + "</p>";
|
||||
|
||||
// remove .aux.xml file to make sure histogram computation is fresh
|
||||
QFile::remove( mDataDir + QDir::separator() + "landsat.tif.aux.xml" );
|
||||
QVERIFY( openLayer( "landsat.tif" ) );
|
||||
}
|
||||
|
||||
void TestRasterHistogram::cleanupTestCase()
|
||||
{
|
||||
closeLayer();
|
||||
// remove .aux.xml file to make sure histogram computation is fresh
|
||||
QFile::remove( mDataDir + QDir::separator() + "landsat.tif.aux.xml" );
|
||||
QString myReportFile = QDir::tempPath() + QDir::separator() + "qgishistotest.html";
|
||||
QFile myFile( myReportFile );
|
||||
if ( myFile.open( QIODevice::WriteOnly | QIODevice::Append ) )
|
||||
{
|
||||
QTextStream myQTextStream( &myFile );
|
||||
myQTextStream << mReport;
|
||||
myFile.close();
|
||||
//QDesktopServices::openUrl( "file:///" + myReportFile );
|
||||
}
|
||||
}
|
||||
|
||||
// grayscale, all bands
|
||||
void TestRasterHistogram::testGray1( )
|
||||
{
|
||||
QStringList actionsList;
|
||||
QVERIFY( testFile( "gray1", "singlebandgray", mGrayRendererWidget, actionsList )
|
||||
== true );
|
||||
}
|
||||
|
||||
// grayscale, gray band
|
||||
void TestRasterHistogram::testGray2( )
|
||||
{
|
||||
QStringList actionsList( "Show RGB" );
|
||||
QVERIFY( testFile( "gray2", "singlebandgray", mGrayRendererWidget, actionsList )
|
||||
== true );
|
||||
}
|
||||
|
||||
// RGB, all bands
|
||||
void TestRasterHistogram::testRGB1( )
|
||||
{
|
||||
QStringList actionsList;
|
||||
QVERIFY( testFile( "rgb1", "multibandcolor", mRGBRendererWidget, actionsList )
|
||||
== true );
|
||||
}
|
||||
|
||||
// RGB, RGB bands
|
||||
void TestRasterHistogram::testRGB2( )
|
||||
{
|
||||
QStringList actionsList( "Show RGB" );
|
||||
QVERIFY( testFile( "rgb2", "multibandcolor", mRGBRendererWidget, actionsList )
|
||||
== true );
|
||||
}
|
||||
|
||||
// RGB, band 5
|
||||
void TestRasterHistogram::testRGB3( )
|
||||
{
|
||||
QStringList actionsList( "Show selected" );
|
||||
QVERIFY( testFile( "rgb3", "multibandcolor", mRGBRendererWidget, actionsList, 5 )
|
||||
== true );
|
||||
}
|
||||
|
||||
// RGB, all bands + markers, load 1 stddev
|
||||
void TestRasterHistogram::testRGB4( )
|
||||
{
|
||||
QStringList actionsList;
|
||||
actionsList << "Show selected" << "Show markers" << "Load 1 stddev";
|
||||
QVERIFY( testFile( "rgb4", "multibandcolor", mRGBRendererWidget, actionsList )
|
||||
== true );
|
||||
}
|
||||
|
||||
// pseudocolor, all bands
|
||||
void TestRasterHistogram::testPseudo1( )
|
||||
{
|
||||
QStringList actionsList;
|
||||
QVERIFY( testFile( "pseudo1", "singlebandpseudocolor", mPseudoRendererWidget, actionsList )
|
||||
== true );
|
||||
}
|
||||
|
||||
// helper methods
|
||||
|
||||
bool TestRasterHistogram::openLayer( const QString& fileName )
|
||||
{
|
||||
mRasterLayer = new QgsRasterLayer( mDataDir + QDir::separator() + fileName, fileName );
|
||||
if ( ! mRasterLayer )
|
||||
return false;
|
||||
mGrayRendererWidget = new QgsSingleBandGrayRendererWidget( mRasterLayer );
|
||||
mRGBRendererWidget = new QgsMultiBandColorRendererWidget( mRasterLayer );
|
||||
mPseudoRendererWidget = new QgsSingleBandPseudoColorRendererWidget( mRasterLayer );
|
||||
mHistogramWidget = new QgsRasterHistogramWidget( mRasterLayer, 0 );
|
||||
mHistogramWidget->computeHistogram( true );
|
||||
return true;
|
||||
}
|
||||
|
||||
void TestRasterHistogram::closeLayer( )
|
||||
{
|
||||
if ( mHistogramWidget )
|
||||
{
|
||||
delete mHistogramWidget;
|
||||
mHistogramWidget = 0;
|
||||
}
|
||||
if ( mGrayRendererWidget )
|
||||
{
|
||||
delete mGrayRendererWidget;
|
||||
mGrayRendererWidget = 0;
|
||||
}
|
||||
if ( mRGBRendererWidget )
|
||||
{
|
||||
delete mRGBRendererWidget;
|
||||
mRGBRendererWidget = 0;
|
||||
}
|
||||
if ( mPseudoRendererWidget )
|
||||
{
|
||||
delete mPseudoRendererWidget;
|
||||
mPseudoRendererWidget = 0;
|
||||
}
|
||||
if ( mRasterLayer )
|
||||
{
|
||||
delete mRasterLayer;
|
||||
mRasterLayer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool TestRasterHistogram::saveImage( const QString& fileName )
|
||||
{
|
||||
return mHistogramWidget->histoSaveAsImage( fileName, mWidth, mHeight, mImageQuality );
|
||||
}
|
||||
|
||||
// test resulting image file based on md5sum - perhaps a direct file comparison might be better
|
||||
bool TestRasterHistogram::testFile( QString theTestType,
|
||||
QString rendererName, QgsRasterRendererWidget* rendererWidget,
|
||||
QStringList actionsList, int selectedBand )
|
||||
{
|
||||
if ( mRasterLayer == 0 )
|
||||
{
|
||||
QWARN( QString( "Invalid raster layer" ).toLocal8Bit().data() );
|
||||
return false;
|
||||
}
|
||||
|
||||
// reset histogram widget to clear previous state
|
||||
if ( mHistogramWidget )
|
||||
delete mHistogramWidget;
|
||||
mHistogramWidget = new QgsRasterHistogramWidget( mRasterLayer, 0 );
|
||||
|
||||
// setup histogram widget
|
||||
mHistogramWidget->setRendererWidget( rendererName, rendererWidget );
|
||||
foreach( QString actionName, actionsList )
|
||||
{
|
||||
mHistogramWidget->histoAction( actionName );
|
||||
}
|
||||
if ( selectedBand != -1 )
|
||||
{
|
||||
mHistogramWidget->setSelectedBand( selectedBand );
|
||||
}
|
||||
QString fileName = QDir::tempPath() + QDir::separator() +
|
||||
theTestType + "_result.png";
|
||||
if ( ! saveImage( fileName ) )
|
||||
{
|
||||
QWARN( QString( "Did not save image file " + fileName ).toLocal8Bit().data() );
|
||||
return false;
|
||||
}
|
||||
mReport += "<h2>" + theTestType + "</h2>\n";
|
||||
QgsRenderChecker myChecker;
|
||||
myChecker.setControlPathPrefix( mTestPrefix );
|
||||
myChecker.setControlName( "expected_histo_" + theTestType );
|
||||
// myChecker.setMapRenderer( mpMapRenderer );
|
||||
bool myResultFlag = myChecker.compareImages( theTestType, 0, fileName );
|
||||
mReport += "\n\n\n" + myChecker.report();
|
||||
return myResultFlag;
|
||||
|
||||
}
|
||||
|
||||
|
||||
QTEST_MAIN( TestRasterHistogram )
|
||||
#include "moc_testqgsrasterhistogram.cxx"
|
BIN
tests/testdata/control_images/histogram_qwt5/expected_histo_gray1/expected_histo_gray1.png
vendored
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
tests/testdata/control_images/histogram_qwt5/expected_histo_gray2/expected_histo_gray2.png
vendored
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
tests/testdata/control_images/histogram_qwt5/expected_histo_gray2/expected_histo_rgb2.png
vendored
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
tests/testdata/control_images/histogram_qwt5/expected_histo_pseudo1/expected_histo_pseudo1.png
vendored
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
tests/testdata/control_images/histogram_qwt5/expected_histo_rgb1/expected_histo_rgb1.png
vendored
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
tests/testdata/control_images/histogram_qwt5/expected_histo_rgb2/expected_histo_rgb2.png
vendored
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
tests/testdata/control_images/histogram_qwt5/expected_histo_rgb3/expected_histo_rgb3.png
vendored
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
tests/testdata/control_images/histogram_qwt5/expected_histo_rgb4/expected_histo_rgb4.png
vendored
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
tests/testdata/control_images/histogram_qwt6/expected_histo_gray1/expected_histo_gray1.png
vendored
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
tests/testdata/control_images/histogram_qwt6/expected_histo_gray2/expected_histo_gray2.png
vendored
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
tests/testdata/control_images/histogram_qwt6/expected_histo_pseudo1/expected_histo_pseudo1.png
vendored
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
tests/testdata/control_images/histogram_qwt6/expected_histo_rgb1/expected_histo_rgb1.png
vendored
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
tests/testdata/control_images/histogram_qwt6/expected_histo_rgb2/expected_histo_rgb2.png
vendored
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
tests/testdata/control_images/histogram_qwt6/expected_histo_rgb3/expected_histo_rgb3.png
vendored
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
tests/testdata/control_images/histogram_qwt6/expected_histo_rgb4/expected_histo_rgb4.png
vendored
Normal file
After Width: | Height: | Size: 21 KiB |