[Qgis-developer] keeping layer settings tab between layers and
qgis sessions can cause problems when histogram tab is the last viewed
Etienne Tourigny
etourigny.dev at gmail.com
Wed May 9 17:49:10 PDT 2012
I agree that this should not happen, should the default be always open
the first tab, or only when the histogram tab was previously selected?
Unfortunately there is no function in the provider API to know if
there is a cached histogram, so it would be better to never allow the
properties window to start on the histogram tab.
I have implemented this in a branch of mine to improve the histogram
tab, here is a snippet:
- tabBar->setCurrentIndex( settings.value(
"/Windows/RasterLayerProperties/row" ).toInt() );
+ int currentTabIndex = settings.value(
"/Windows/RasterLayerProperties/row" ).toInt();
+ // if current tab is disabled, use first tab
+ if ( ! tabBar->widget( currentTabIndex )->isEnabled() )
+ currentTabIndex = 0;
+ // if current tab is histogram, use first tab (to avoid long
histogram queries)
+ // there is currently no way to know if there ia a cached histogram
int myHistogramTab = 6;
- if ( tabBar->currentIndex() == myHistogramTab )
- {
- refreshHistogram();
- }
+ if ( currentTabIndex == myHistogramTab )
+ currentTabIndex = 0;
+ tabBar->setCurrentIndex( currentTabIndex );
Etienne
On Mon, May 7, 2012 at 10:15 AM, G. Allegri <giohappy at gmail.com> wrote:
> A complex object to say something simple :(
> When a user opens a layer settings window and hits a tab, the same tab index
> is kept when opening another layer settings, or in a new qgis sessions.
> I had a small raster layer, and I opened the histogram tab.
> The today I've opened a big raster layer, and opening the layer settings
> caused my pc running and running, till a complete qgis crash.
> I supposed it was something with the settings, so I opened the smalle
> raster, changed the tab to Style, then I was able to open the large raster
> settings
> It's corner case probably, and qgis shouldn't crash with huge raster
> histograms. Anyway, opening the layer settings to the frist tab would avoid
> heartbreaks :)
>
> giovanni
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
More information about the Qgis-developer
mailing list