Skip to content

Commit

Permalink
Add cursor status
Browse files Browse the repository at this point in the history
  • Loading branch information
KangLin committed Nov 16, 2016
1 parent 8492152 commit a3fb26f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ MainWindow::MainWindow(QWidget *parent) :
osgViewer::Viewer* viewer = (osgViewer::Viewer*)m_MapViewer.getViewer();
viewer->setSceneData(m_Root);
this->setCentralWidget(&m_MapViewer);
m_MapViewer.setCursor(Qt::OpenHandCursor);
LoadMap(CGlobalDir::Instance()->GetApplicationEarthFile());
}

Expand All @@ -62,6 +63,7 @@ int MainWindow::LoadMap(QString szFile)
{
int nRet = 0;
this->statusBar()->showMessage(tr("Loading map ...... "));
m_MapViewer.setCursor(Qt::BusyCursor);
do {
osg::Node* mapNode = osgDB::readNodeFile(
szFile.toStdString());
Expand Down Expand Up @@ -130,6 +132,7 @@ int MainWindow::LoadMap(QString szFile)
m_Root->addChild(m_MapNode);
} while(0);
this->statusBar()->showMessage(tr("Ready"));
m_MapViewer.setCursor(Qt::OpenHandCursor);
return 0;
}

Expand All @@ -156,6 +159,7 @@ void MainWindow::on_actionOpen_track_T_triggered()
if(szFile.isEmpty())
break;

m_MapViewer.setCursor(Qt::BusyCursor);
GPX_model gpx("RabbitGIS");
if(GPX_model::GPXM_OK != gpx.load(szFile.toStdString()))
{
Expand Down Expand Up @@ -256,6 +260,7 @@ void MainWindow::on_actionOpen_track_T_triggered()
range + geoSRS->getEllipsoid()->getRadiusEquator() * 0.2), 3);
}while(0);
this->statusBar()->showMessage(tr("Ready"));
m_MapViewer.setCursor(Qt::OpenHandCursor);
}

void MainWindow::changeEvent(QEvent *e)
Expand Down Expand Up @@ -413,9 +418,11 @@ void MainWindow::on_actionMeasure_the_distance_M_triggered()
QRect rect = this->centralWidget()->geometry();
m_pMeasureTool->move(rect.left(), rect.top());
m_pMeasureTool->show();
m_MapViewer.setCursor(Qt::CrossCursor);
}
else
{
m_MapViewer.setCursor(Qt::OpenHandCursor);
m_pMeasureTool->close();
delete m_pMeasureTool;
m_pMeasureTool = NULL;
Expand Down

0 comments on commit a3fb26f

Please sign in to comment.