Source

Target

Commits (3)
Showing with 28 additions and 10 deletions
......@@ -381,6 +381,10 @@ QQuickGeoMapGestureArea *QDeclarativeGeoMap::gesture()
void QDeclarativeGeoMap::populateMap()
{
QObjectList kids = children();
QList<QQuickItem *> quickKids = childItems();
for (int i=0; i < quickKids.count(); ++i)
kids.append(quickKids.at(i));
for (int i = 0; i < kids.size(); ++i) {
// dispatch items appropriately
QDeclarativeGeoMapItemView *mapView = qobject_cast<QDeclarativeGeoMapItemView *>(kids.at(i));
......@@ -432,7 +436,6 @@ QSGNode *QDeclarativeGeoMap::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeDa
return root;
}
/*!
\qmlproperty Plugin QtLocation::Map::plugin
......
......@@ -133,6 +133,8 @@ void QDeclarativeGeoMapItemBase::setMap(QDeclarativeGeoMap *quickMap, QGeoMap *m
if (map_ && quickMap_) {
connect(map_, SIGNAL(cameraDataChanged(QGeoCameraData)),
this, SLOT(baseCameraDataChanged(QGeoCameraData)));
connect(quickMap, SIGNAL(heightChanged()), this, SLOT(polishAndUpdate()));
connect(quickMap, SIGNAL(widthChanged()), this, SLOT(polishAndUpdate()));
lastSize_ = QSizeF(quickMap_->width(), quickMap_->height());
lastCameraData_ = map_->cameraData();
}
......@@ -199,7 +201,6 @@ bool QDeclarativeGeoMapItemBase::childMouseEventFilter(QQuickItem *item, QEvent
switch (event->type()) {
case QEvent::MouseButtonPress:
case QEvent::MouseButtonRelease:
case QEvent::MouseMove:
if (contains(static_cast<QMouseEvent*>(event)->pos())) {
return false;
} else {
......
......@@ -157,8 +157,6 @@ void QDeclarativeGeoMapQuickItem::setMap(QDeclarativeGeoMap *quickMap, QGeoMap *
{
QDeclarativeGeoMapItemBase::setMap(quickMap,map);
if (map && quickMap) {
connect(quickMap, SIGNAL(heightChanged()), this, SLOT(polishAndUpdate()));
connect(quickMap, SIGNAL(widthChanged()), this, SLOT(polishAndUpdate()));
connect(map, SIGNAL(cameraDataChanged(QGeoCameraData)),
this, SLOT(polishAndUpdate()));
polishAndUpdate();
......
......@@ -283,7 +283,7 @@ Item {
Text {id: progressText}
TestCase {
name: "MapItemDeatils"
name: "MapItemDetails"
when: windowShown
/*
......@@ -464,19 +464,22 @@ Item {
verify(extMapCircleDateline.center.longitude === 180)
map.center = datelineCoordinate
point = map.fromCoordinate(extMapCircleDateline.center)
verify(point.x == map.width / 2.0)
extMapCircleDateline.center.longitude = datelineCoordinateRight.longitude
verify(point.x == map.width / 2.0) // center of the screen
visualInspectionPoint()
extMapCircleDateline.center.longitude = datelineCoordinateRight.longitude // -170, moving the circle to the right
point = map.fromCoordinate(extMapCircleDateline.center)
verify(point.x > map.width / 2.0)
verify(LocationTestHelper.waitForPolished(map))
verify(point.x > map.width / 2.0)
visualInspectionPoint()
mousePress(map, point.x, point.y)
for (i=0; i < 40; i += 4) {
for (i=0; i < 50; i += 4) {
wait(1)
mouseMove(map, point.x - i, point.y)
}
mouseRelease(map, point.x - i, point.y)
verify(LocationTestHelper.waitForPolished(map))
point = map.fromCoordinate(extMapCircleDateline.center)
visualInspectionPoint()
verify(point.x < map.width / 2.0)
map.removeMapItem(extMapCircleDateline)
......@@ -486,18 +489,21 @@ Item {
verify(extMapQuickItemDateline.coordinate.longitude === 175)
point = map.fromCoordinate(extMapQuickItemDateline.coordinate)
verify(point.x < map.width / 2.0)
visualInspectionPoint()
extMapQuickItemDateline.coordinate.longitude = datelineCoordinateRight.longitude
point = map.fromCoordinate(extMapQuickItemDateline.coordinate)
verify(point.x > map.width / 2.0)
verify(LocationTestHelper.waitForPolished(map))
visualInspectionPoint()
mousePress(map, point.x + 5, point.y + 5)
for (i=0; i < 50; i += 5) {
for (i=0; i < 64; i += 5) {
wait(1)
mouseMove(map, point.x + 5 - i, point.y + 5 )
}
mouseRelease(map, point.x + 5 - i, point.y + 5)
verify(LocationTestHelper.waitForPolished(map))
point = map.fromCoordinate(extMapQuickItemDateline.coordinate)
visualInspectionPoint()
verify(point.x < map.width / 2.0)
map.removeMapItem(extMapQuickItemDateline)
......@@ -741,5 +747,15 @@ Item {
console.log('map fuzzy cmp returns false for value, ref, tolerance: ' + val + ', ' + ref + ', ' + tolerance)
return false;
}
// call to visualInspectionPoint testcase (for dev time visual inspection)
function visualInspectionPoint(time) {
var waitTime = 0 // 300
if (time !== undefined)
waitTime = time
if (waitTime > 0) {
console.log('halting for ' + waitTime + ' milliseconds')
wait (waitTime)
}
}
}
}