Skip to content

Commit 2bc9016

Browse files
author
g_j_m
committedJan 11, 2006
Scroll the tree view of srs to ensure that search results are visible
Sort the results from the sqlite srs query to make best use of the caching when populating the tree widget git-svn-id: http://svn.osgeo.org/qgis/trunk@4645 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 6774759 commit 2bc9016

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed
 

‎src/widgets/projectionselector/qgsprojectionselector.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ void QgsProjectionSelector::setSelectedSRSName(QString theSRSNAme)
6161
QList<QTreeWidgetItem*> nodes = lstCoordinateSystems->findItems(theSRSNAme, Qt::MatchExactly|Qt::MatchRecursive, 0);
6262

6363
if (nodes.count() == 1)
64+
{
6465
lstCoordinateSystems->setCurrentItem(nodes.first());
66+
lstCoordinateSystems->scrollToItem(nodes.first());
67+
}
6568
else // unselect the selected item to avoid confusing the user
6669
{
6770
if (lstCoordinateSystems->currentItem() != NULL)
@@ -77,7 +80,10 @@ void QgsProjectionSelector::setSelectedSRSID(long theSRSID)
7780
QList<QTreeWidgetItem*> nodes = lstCoordinateSystems->findItems(mySRSIDString, Qt::MatchExactly|Qt::MatchRecursive, 1);
7881

7982
if (nodes.count() == 1)
83+
{
8084
lstCoordinateSystems->setCurrentItem(nodes.first());
85+
lstCoordinateSystems->scrollToItem(nodes.first());
86+
}
8187
else // unselect the selected item to avoid confusing the user
8288
{
8389
if (lstCoordinateSystems->currentItem() != NULL)
@@ -407,7 +413,7 @@ void QgsProjectionSelector::getProjList()
407413
// Set up the query to retreive the projection information needed to populate the list
408414
//note I am giving the full field names for clarity here and in case someown
409415
//changes the underlying view TS
410-
sql = "select description,srs_id,is_geo, name,parameters from vw_srs";
416+
sql = "select description,srs_id,is_geo, name,parameters from vw_srs order by name, description";
411417
#ifdef QGISDEBUG
412418
std::cout << "SQL for projection list:\n" << sql.toLocal8Bit().data() << std::endl;
413419
#endif
@@ -565,6 +571,8 @@ void QgsProjectionSelector::coordinateSystemSelected( QTreeWidgetItem * theItem)
565571
myDescription+=(myProjString);
566572
}
567573
teProjection->setText(myDescription);
574+
// This call seems not to work????
575+
lstCoordinateSystems->scrollToItem(theItem);
568576
}
569577
else
570578
teProjection->setText("");

0 commit comments

Comments
 (0)
Please sign in to comment.