Skip to content

Commit

Permalink
Convert to Qt4 iterator. (This should fix Identify Tool crashes.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@4291 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
telwertowski committed Dec 5, 2005
1 parent 2468c09 commit a10ec90
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/qgsvectorlayer.cpp
Expand Up @@ -975,30 +975,22 @@ void QgsVectorLayer::identify(QgsRect * r)
// display features falling within the search radius
if( !ir )
{
// TODO: Qt4 doesn't have QWidgetList, need to work out an alternative.
#if QT_VERSION < 0x040000
// It is necessary to pass topLevelWidget()as parent, but there is no QWidget available.
//
// Win32 doesn't like this approach to creating the window and seems
// to work fine without it [gsherman]
QWidget *top = 0;
#ifndef WIN32

QWidgetList *list = QApplication::topLevelWidgets ();
QWidgetListIt it( *list );
QWidget *w;

while ( (w=it.current()) != 0 ) {
++it;
if ( typeid(*w) == typeid(QgisApp) ) {
foreach (QWidget *w, QApplication::topLevelWidgets())
{
if ( typeid(*w) == typeid(QgisApp) )
{
top = w;
break;
}
}
delete list;
#endif
ir = new QgsIdentifyResults(mActions, top);
#endif

// restore the identify window position and show it
ir->restorePosition();
Expand Down

0 comments on commit a10ec90

Please sign in to comment.