void QDeclarativeGraphicsGeoMap::populateMap() { if (!mapData_ || !componentCompleted_) return; QObjectList kids = children(); for (int i = 0; i < kids.size(); ++i) { // dispatch items appropriately QDeclarativeGeoMapObjectView* mapView = qobject_cast<QDeclarativeGeoMapObjectView*>(kids.at(i)); if (mapView) { mapViews_.append(mapView); setupMapView(mapView); continue; } QDeclarativeGeoMapObject *mapObject = qobject_cast<QDeclarativeGeoMapObject*>(kids.at(i)); if (mapObject) { mapObjects_.append(mapObject); objectMap_.insert(mapObject->mapObject(), mapObject); mapData_->addMapObject(mapObject->mapObject()); mapObject->setMap(this); continue; } QDeclarativeGeoMapMouseArea *mouseArea = qobject_cast<QDeclarativeGeoMapMouseArea*>(kids.at(i)); if (mouseArea) { mouseArea->setMap(this); mouseAreas_.append(mouseArea); } } }
void EnMapView::initialize() { // set up the map view setupMapView(); // register for getting periodic updates yaf3d::EntityManager::get()->registerUpdate( this, true ); // register us to get notifications on changed player lists vrc::gameutils::PlayerUtils::get()->registerCallbackPlayerListChanged( this, true ); }
/*! \internal */ void QDeclarativeGeoMap::populateMap() { QObjectList kids = children(); for (int i = 0; i < kids.size(); ++i) { // dispatch items appropriately QDeclarativeGeoMapItemView *mapView = qobject_cast<QDeclarativeGeoMapItemView *>(kids.at(i)); if (mapView) { mapViews_.append(mapView); setupMapView(mapView); continue; } QDeclarativeGeoMapItemBase *mapItem = qobject_cast<QDeclarativeGeoMapItemBase *>(kids.at(i)); if (mapItem) { addMapItem(mapItem); } } }
void EnMapView::handleNotification( const yaf3d::EntityNotification& notification ) { // handle notifications switch( notification.getId() ) { case YAF3D_NOTIFY_ENTITY_ATTRIBUTE_CHANGED: // recreate the map view destroyMapView(); setupMapView(); break; case YAF3D_NOTIFY_MENU_ENTER: break; case YAF3D_NOTIFY_MENU_LEAVE: break; case YAF3D_NOTIFY_SHUTDOWN: break; default: ; } }