mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Convert to Qt4 iterator. (This should fix Identify Tool crashes.
git-svn-id: http://svn.osgeo.org/qgis/trunk@4291 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
2468c09298
commit
a10ec90f30
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user