File tree Expand file tree Collapse file tree 1 file changed +10
-15
lines changed Expand file tree Collapse file tree 1 file changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -4786,27 +4786,22 @@ void QgsRasterLayer::identify(QgsRect * r)
4786
4786
if ( !mIdentifyResults )
4787
4787
{
4788
4788
4789
- // TODO: Doesn't work in Qt4 (list is now just a QWidgetList, not a pointer to one)
4790
- #if QT_VERSION < 0x040000
4791
- // TODO it is necessary to pass topLevelWidget()as parent, but there is no QWidget availabl
4792
- QWidgetList *list = QApplication::topLevelWidgets ();
4793
- QWidgetListIt it ( *list );
4794
- QWidget *w;
4789
+ // Win32 doesn't like this approach to creating the window and seems
4790
+ // to work fine without it [gsherman]
4795
4791
QWidget *top = 0 ;
4796
- while ( (w=it.current ()) != 0 )
4792
+ #ifndef WIN32
4793
+ foreach (QWidget *w, QApplication::topLevelWidgets ())
4797
4794
{
4798
- ++it;
4799
- if ( typeid (*w) == typeid (QgisApp) )
4800
- {
4801
- top = w;
4802
- break ;
4803
- }
4795
+ if ( typeid (*w) == typeid (QgisApp) )
4796
+ {
4797
+ top = w;
4798
+ break ;
4799
+ }
4804
4800
}
4805
- delete list;
4801
+ # endif
4806
4802
QgsAttributeAction aa;
4807
4803
mIdentifyResults = new QgsIdentifyResults (aa, top);
4808
4804
mIdentifyResults ->restorePosition ();
4809
- #endif
4810
4805
}
4811
4806
else
4812
4807
{
You can’t perform that action at this time.
0 commit comments