示例#1
0
void MarbleWidget::setHighlightEnabled(bool enabled)
{
    if ( enabled ) {
        connect( this, SIGNAL(highlightedPlacemarksChanged(qreal,qreal,GeoDataCoordinates::Unit)),
                 d->map(), SIGNAL(highlightedPlacemarksChanged(qreal,qreal,GeoDataCoordinates::Unit)),
                 Qt::UniqueConnection );
    }
    else {
        disconnect( this, SIGNAL(highlightedPlacemarksChanged(qreal,qreal,GeoDataCoordinates::Unit)),
                 d->map(), SIGNAL(highlightedPlacemarksChanged(qreal,qreal,GeoDataCoordinates::Unit)) );
    }
}
示例#2
0
CountryByShape::CountryByShape( MarbleWidget *marbleWidget )
    : QObject(),
      d( new CountryByShapePrivate(marbleWidget) )
{
    d->m_parent = this;
    connect( this, SIGNAL(announceHighlight(qreal,qreal,GeoDataCoordinates::Unit)),
             d->m_marbleWidget, SIGNAL(highlightedPlacemarksChanged(qreal,qreal,GeoDataCoordinates::Unit)) );
}
示例#3
0
    }
}

void MainWindow::disableGames()
{
    disconnect( this, SIGNAL(postQuestion(QObject*)),
                d->m_countryByShape, SLOT(postQuestion(QObject*)) );

    disconnect( this, SIGNAL(postQuestion(QObject*)),
                d->m_countryByFlag, SLOT(postQuestion(QObject*)) );

    disconnect( this, SIGNAL(postQuestion(QObject*)),
                d->m_clickOnThat, SLOT(postQuestion(QObject*)) );
    disconnect( d->m_clickOnThat, SIGNAL(updateResult(bool)),
                this, SLOT(displayResult(bool)) );
    disconnect( d->m_marbleWidget, SIGNAL(highlightedPlacemarksChanged(qreal,qreal,GeoDataCoordinates::Unit)),
                d->m_clickOnThat, SLOT(determineResult(qreal,qreal,GeoDataCoordinates::Unit)) );
    d->m_clickOnThat->disablePinDocument();

    // Reset the map view
    d->m_marbleWidget->centerOn( 23.0, 42.0 );
    d->m_marbleWidget->setDistance( 7500 );
}

void MainWindow::enableCountryShapeGame()
{
    connect( this, SIGNAL(postQuestion(QObject*)),
             d->m_countryByShape, SLOT(postQuestion(QObject*)) );

    d->m_countryByShape->initiateGame();
}