@@ -300,6 +300,9 @@ QgsIdentifyResultsDialog::QgsIdentifyResultsDialog( QgsMapCanvas *canvas, QWidge
300
300
cmbIdentifyMode->setCurrentIndex ( cmbIdentifyMode->findData ( identifyMode ) );
301
301
cbxAutoFeatureForm->setChecked ( mySettings.value ( " /Map/identifyAutoFeatureForm" , false ).toBool () );
302
302
303
+ tabWidget->removeTab ( 1 );
304
+ tabWidget->removeTab ( 1 );
305
+
303
306
// graph
304
307
mPlot ->setVisible ( false );
305
308
mPlot ->setAutoFillBackground ( false );
@@ -652,6 +655,12 @@ void QgsIdentifyResultsDialog::addFeature( QgsRasterLayer *layer,
652
655
653
656
QgsRaster::IdentifyFormat currentFormat = QgsRasterDataProvider::identifyFormatFromName ( layer->customProperty ( " identify/format" ).toString () );
654
657
658
+ if ( tabWidget->indexOf ( tableTab ) < 0 )
659
+ {
660
+ tabWidget->addTab ( tableTab, tr ( " Table" ) );
661
+ tabWidget->addTab ( plotTab, tr ( " Graph" ) );
662
+ }
663
+
655
664
if ( layItem == 0 )
656
665
{
657
666
layItem = new QTreeWidgetItem ( QStringList () << QString::number ( lstResults->topLevelItemCount () ) << layer->name () );
@@ -885,7 +894,7 @@ void QgsIdentifyResultsDialog::contextMenuEvent( QContextMenuEvent* event )
885
894
QgsDebugMsg ( " Entered" );
886
895
887
896
// only handle context menu event if showing tree widget
888
- if ( tabWidget->currentIndex () != 0 )
897
+ if ( tabWidget->currentWidget () != treeTab )
889
898
return ;
890
899
891
900
QTreeWidgetItem *item = lstResults->itemAt ( lstResults->viewport ()->mapFrom ( this , event->pos () ) );
@@ -1030,16 +1039,6 @@ void QgsIdentifyResultsDialog::expandColumnsToFit()
1030
1039
lstResults->resizeColumnToContents ( 1 );
1031
1040
}
1032
1041
1033
- void QgsIdentifyResultsDialog::clearHighlights ()
1034
- {
1035
- foreach ( QgsHighlight *h, mHighlights )
1036
- {
1037
- delete h;
1038
- }
1039
-
1040
- mHighlights .clear ();
1041
- }
1042
-
1043
1042
void QgsIdentifyResultsDialog::clear ()
1044
1043
{
1045
1044
for ( int i = 0 ; i < lstResults->topLevelItemCount (); i++ )
@@ -1053,6 +1052,9 @@ void QgsIdentifyResultsDialog::clear()
1053
1052
tblResults->clearContents ();
1054
1053
tblResults->setRowCount ( 0 );
1055
1054
1055
+ tabWidget->removeTab ( 1 );
1056
+ tabWidget->removeTab ( 1 );
1057
+
1056
1058
mPlot ->setVisible ( false );
1057
1059
foreach ( QgsIdentifyPlotCurve *curve, mPlotCurves )
1058
1060
delete curve;
@@ -1063,14 +1065,22 @@ void QgsIdentifyResultsDialog::clear()
1063
1065
mPrintToolButton ->setDisabled ( true );
1064
1066
}
1065
1067
1068
+ void QgsIdentifyResultsDialog::clearHighlights ()
1069
+ {
1070
+ foreach ( QgsHighlight *h, mHighlights )
1071
+ {
1072
+ delete h;
1073
+ }
1074
+
1075
+ mHighlights .clear ();
1076
+ }
1077
+
1066
1078
void QgsIdentifyResultsDialog::activate ()
1067
1079
{
1068
- #if 0
1069
- foreach ( QgsRubberBand *rb, mRubberBands )
1080
+ foreach ( QgsHighlight *h, mHighlights )
1070
1081
{
1071
- rb ->show();
1082
+ h ->show ();
1072
1083
}
1073
- #endif
1074
1084
1075
1085
if ( lstResults->topLevelItemCount () > 0 )
1076
1086
{
@@ -1081,12 +1091,10 @@ void QgsIdentifyResultsDialog::activate()
1081
1091
1082
1092
void QgsIdentifyResultsDialog::deactivate ()
1083
1093
{
1084
- #if 0
1085
- foreach ( QgsRubberBand *rb, mRubberBands )
1094
+ foreach ( QgsHighlight *h, mHighlights )
1086
1095
{
1087
- rb ->hide();
1096
+ h ->hide ();
1088
1097
}
1089
- #endif
1090
1098
}
1091
1099
1092
1100
void QgsIdentifyResultsDialog::doAction ( QTreeWidgetItem *item, int action )
0 commit comments