@@ -1692,7 +1692,8 @@ void QgisApp::addLayer()
1692
1692
bool QgisApp::addLayer (QFileInfo const & vectorFile)
1693
1693
{
1694
1694
// let the user know we're going to possibly be taking a while
1695
- QApplication::setOverrideCursor (Qt::WaitCursor);
1695
+ // Let render() do its own cursor management
1696
+ // QApplication::setOverrideCursor(Qt::WaitCursor);
1696
1697
1697
1698
mMapCanvas ->freeze (); // XXX why do we do this?
1698
1699
@@ -1732,7 +1733,8 @@ bool QgisApp::addLayer(QFileInfo const & vectorFile)
1732
1733
if ( ! renderer )
1733
1734
{
1734
1735
mMapCanvas ->freeze (false );
1735
- QApplication::restoreOverrideCursor ();
1736
+ // Let render() do its own cursor management
1737
+ // QApplication::restoreOverrideCursor();
1736
1738
1737
1739
// XXX should we also delete the layer?
1738
1740
@@ -1784,7 +1786,9 @@ bool QgisApp::addLayer(QFileInfo const & vectorFile)
1784
1786
delete layer;
1785
1787
1786
1788
mMapCanvas ->freeze (false );
1787
- QApplication::restoreOverrideCursor ();
1789
+
1790
+ // Let render() do its own cursor management
1791
+ // QApplication::restoreOverrideCursor();
1788
1792
1789
1793
return false ;
1790
1794
}
@@ -1800,7 +1804,8 @@ bool QgisApp::addLayer(QFileInfo const & vectorFile)
1800
1804
// the layer is intially added
1801
1805
mMapCanvas ->update ();
1802
1806
1803
- QApplication::restoreOverrideCursor ();
1807
+ // Let render() do its own cursor management
1808
+ // QApplication::restoreOverrideCursor();
1804
1809
1805
1810
statusBar ()->message (mMapCanvas ->extent ().stringRep (2 ));
1806
1811
@@ -1822,8 +1827,8 @@ bool QgisApp::addLayer(QStringList const &theLayerQStringList, const QString& en
1822
1827
{
1823
1828
mMapCanvas ->freeze ();
1824
1829
1825
- QApplication::setOverrideCursor (Qt::WaitCursor);
1826
-
1830
+ // Let render() do its own cursor management
1831
+ // QApplication::setOverrideCursor(Qt::WaitCursor);
1827
1832
1828
1833
for ( QStringList::ConstIterator it = theLayerQStringList.begin ();
1829
1834
it != theLayerQStringList.end ();
@@ -1846,7 +1851,9 @@ bool QgisApp::addLayer(QStringList const &theLayerQStringList, const QString& en
1846
1851
if ( ! layer )
1847
1852
{
1848
1853
mMapCanvas ->freeze (false );
1849
- QApplication::restoreOverrideCursor ();
1854
+
1855
+ // Let render() do its own cursor management
1856
+ // QApplication::restoreOverrideCursor();
1850
1857
1851
1858
// XXX insert meaningful whine to the user here
1852
1859
return false ;
@@ -1868,7 +1875,9 @@ bool QgisApp::addLayer(QStringList const &theLayerQStringList, const QString& en
1868
1875
if ( ! renderer )
1869
1876
{
1870
1877
mMapCanvas ->freeze (false );
1871
- QApplication::restoreOverrideCursor ();
1878
+
1879
+ // Let render() do its own cursor management
1880
+ // QApplication::restoreOverrideCursor();
1872
1881
1873
1882
// XXX insert meaningful whine to the user here
1874
1883
return false ;
@@ -1937,7 +1946,10 @@ bool QgisApp::addLayer(QStringList const &theLayerQStringList, const QString& en
1937
1946
// [gsherman]
1938
1947
mMapCanvas ->render ();
1939
1948
mMapCanvas ->update ();
1940
- QApplication::restoreOverrideCursor ();
1949
+
1950
+ // Let render() do its own cursor management
1951
+ // QApplication::restoreOverrideCursor();
1952
+
1941
1953
statusBar ()->message (mMapCanvas ->extent ().stringRep (2 ));
1942
1954
1943
1955
@@ -1975,7 +1987,8 @@ void QgisApp::addDatabaseLayer()
1975
1987
1976
1988
if (dbs->exec ())
1977
1989
{
1978
- QApplication::setOverrideCursor (Qt::WaitCursor);
1990
+ // Let render() do its own cursor management
1991
+ // QApplication::setOverrideCursor(Qt::WaitCursor);
1979
1992
1980
1993
1981
1994
// repaint the canvas if it was covered by the dialog
@@ -2056,7 +2069,10 @@ void QgisApp::addDatabaseLayer()
2056
2069
// [gsherman]
2057
2070
mMapCanvas ->render ();
2058
2071
mMapCanvas ->update ();
2059
- QApplication::restoreOverrideCursor ();
2072
+
2073
+ // Let render() do its own cursor management
2074
+ // QApplication::restoreOverrideCursor();
2075
+
2060
2076
} // QgisApp::addDatabaseLayer()
2061
2077
#endif
2062
2078
@@ -4719,7 +4735,10 @@ QString QgisApp::activeLayerSource()
4719
4735
void QgisApp::addVectorLayer (QString vectorLayerPath, QString baseName, QString providerKey)
4720
4736
{
4721
4737
mMapCanvas ->freeze ();
4722
- QApplication::setOverrideCursor (Qt::WaitCursor);
4738
+
4739
+ // Let render() do its own cursor management
4740
+ // QApplication::setOverrideCursor(Qt::WaitCursor);
4741
+
4723
4742
// create the layer
4724
4743
QgsVectorLayer *layer;
4725
4744
/* Eliminate the need to instantiate the layer based on provider type.
@@ -4796,7 +4815,9 @@ void QgisApp::addVectorLayer(QString vectorLayerPath, QString baseName, QString
4796
4815
// [gsherman]
4797
4816
mMapCanvas ->render ();
4798
4817
mMapCanvas ->update ();
4799
- QApplication::restoreOverrideCursor ();
4818
+
4819
+ // Let render() do its own cursor management
4820
+ // QApplication::restoreOverrideCursor();
4800
4821
4801
4822
} // QgisApp::addVectorLayer
4802
4823
@@ -4805,7 +4826,10 @@ void QgisApp::addVectorLayer(QString vectorLayerPath, QString baseName, QString
4805
4826
void QgisApp::addMapLayer (QgsMapLayer *theMapLayer)
4806
4827
{
4807
4828
mMapCanvas ->freeze ();
4808
- QApplication::setOverrideCursor (Qt::WaitCursor);
4829
+
4830
+ // Let render() do its own cursor management
4831
+ // QApplication::setOverrideCursor(Qt::WaitCursor);
4832
+
4809
4833
if (theMapLayer->isValid ())
4810
4834
{
4811
4835
// Register this layer with the layers registry
@@ -4838,7 +4862,9 @@ void QgisApp::addMapLayer(QgsMapLayer *theMapLayer)
4838
4862
// [gsherman]
4839
4863
mMapCanvas ->render ();
4840
4864
mMapCanvas ->update ();
4841
- QApplication::restoreOverrideCursor ();
4865
+
4866
+ // Let render() do its own cursor management
4867
+ // QApplication::restoreOverrideCursor();
4842
4868
4843
4869
}
4844
4870
@@ -5476,7 +5502,10 @@ bool QgisApp::addRasterLayer(QFileInfo const & rasterFile, bool guiWarning)
5476
5502
if (!addRasterLayer (layer))
5477
5503
{
5478
5504
mMapCanvas ->freeze (false );
5479
- QApplication::restoreOverrideCursor ();
5505
+
5506
+ // Let render() do its own cursor management
5507
+ // QApplication::restoreOverrideCursor();
5508
+
5480
5509
if (guiWarning)
5481
5510
{
5482
5511
// don't show the gui warning (probably because we are loading from command line)
@@ -5491,7 +5520,10 @@ bool QgisApp::addRasterLayer(QFileInfo const & rasterFile, bool guiWarning)
5491
5520
statusBar ()->message (mMapCanvas ->extent ().stringRep (2 ));
5492
5521
mMapCanvas ->freeze (false );
5493
5522
mOverviewCanvas ->freeze (false );
5494
- QApplication::restoreOverrideCursor ();
5523
+
5524
+ // Let render() do its own cursor management
5525
+ // QApplication::restoreOverrideCursor();
5526
+
5495
5527
return true ;
5496
5528
}
5497
5529
@@ -5522,7 +5554,10 @@ void QgisApp::addRasterLayer(QString const & rasterLayerPath,
5522
5554
#endif
5523
5555
5524
5556
mMapCanvas ->freeze ();
5525
- QApplication::setOverrideCursor (Qt::WaitCursor);
5557
+
5558
+ // Let render() do its own cursor management
5559
+ // QApplication::setOverrideCursor(Qt::WaitCursor);
5560
+
5526
5561
// create the layer
5527
5562
QgsRasterLayer *layer;
5528
5563
/* Eliminate the need to instantiate the layer based on provider type.
@@ -5605,7 +5640,9 @@ void QgisApp::addRasterLayer(QString const & rasterLayerPath,
5605
5640
// [gsherman]
5606
5641
mMapCanvas ->render ();
5607
5642
mMapCanvas ->update ();
5608
- QApplication::restoreOverrideCursor ();
5643
+
5644
+ // Let render() do its own cursor management
5645
+ // QApplication::restoreOverrideCursor();
5609
5646
5610
5647
} // QgisApp::addRasterLayer
5611
5648
@@ -5627,7 +5664,9 @@ bool QgisApp::addRasterLayer(QStringList const &theFileNameQStringList, bool gui
5627
5664
mMapCanvas ->freeze (true );
5628
5665
mOverviewCanvas ->freeze (true );
5629
5666
5630
- QApplication::setOverrideCursor (Qt::WaitCursor);
5667
+ // Let render() do its own cursor management
5668
+ // QApplication::setOverrideCursor(Qt::WaitCursor);
5669
+
5631
5670
// this is messy since some files in the list may be rasters and others may
5632
5671
// be ogr layers. We'll set returnValue to false if one or more layers fail
5633
5672
// to load.
@@ -5682,7 +5721,9 @@ bool QgisApp::addRasterLayer(QStringList const &theFileNameQStringList, bool gui
5682
5721
statusBar ()->message (mMapCanvas ->extent ().stringRep (2 ));
5683
5722
mMapCanvas ->freeze (false );
5684
5723
mOverviewCanvas ->freeze (false );
5685
- QApplication::restoreOverrideCursor ();
5724
+
5725
+ // Let render() do its own cursor management
5726
+ // QApplication::restoreOverrideCursor();
5686
5727
5687
5728
return returnValue;
5688
5729
0 commit comments