[Marble-commits] KDE/kdeedu/marble/src
Bernhard Beschow
bbeschow at cs.tu-berlin.de
Fri Oct 15 00:09:48 CEST 2010
SVN commit 1186008 by beschow:
reintroduce MarbleWidget::updateChangedMap() and MarbleMap::setNeedsUpdate()
* fixes repainting issues
M +1 -1 QtMainWindow.cpp
M +14 -14 lib/MarbleMap.cpp
M +5 -6 lib/MarbleMap.h
M +0 -5 lib/MarbleMap_p.h
M +9 -0 lib/MarbleWidget.cpp
M +5 -0 lib/MarbleWidget.h
M +1 -1 marble_part.cpp
--- trunk/KDE/kdeedu/marble/src/QtMainWindow.cpp #1186007:1186008
@@ -1101,7 +1101,7 @@
m_controlView->marbleWidget()->setProxy( m_configDialog->proxyUrl(), m_configDialog->proxyPort(), m_configDialog->user(), m_configDialog->password() );
*/
- m_controlView->marbleWidget()->update();
+ m_controlView->marbleWidget()->updateChangedMap();
}
void MainWindow::showDownloadRegionDialog()
--- trunk/KDE/kdeedu/marble/src/lib/MarbleMap.cpp #1186007:1186008
@@ -270,7 +270,7 @@
{
d->m_viewParams.setMapQuality( quality );
// Update texture map during the repaint that follows:
- d->setNeedsUpdate();
+ setNeedsUpdate();
}
MapQuality MarbleMap::mapQuality() const
@@ -327,7 +327,7 @@
{
d->m_viewParams.setRadius( radius );
- d->setNeedsUpdate();
+ setNeedsUpdate();
d->m_logzoom = qRound( d->zoom( radius ) );
emit zoomChanged( d->m_logzoom );
@@ -342,9 +342,9 @@
|| !( m_viewParams.planetAxis() == m_viewParams.planetAxisUpdated() ) );
}
-void MarbleMapPrivate::setNeedsUpdate()
+void MarbleMap::setNeedsUpdate()
{
- m_justModified = true;
+ d->m_justModified = true;
}
@@ -613,7 +613,7 @@
d->m_viewParams.setRadius( d->radius( newZoom ) );
- d->setNeedsUpdate();
+ setNeedsUpdate();
d->m_logzoom = newZoom;
emit zoomChanged( d->m_logzoom );
@@ -702,7 +702,7 @@
d->m_model->setupTextureMapper( projection );
// Update texture map during the repaint that follows:
- d->setNeedsUpdate();
+ setNeedsUpdate();
emit visibleLatLonAltBoxChanged( d->m_viewParams.viewport()->viewLatLonAltBox() );
}
@@ -771,14 +771,14 @@
}
// Update texture map during the repaint that follows:
- d->setNeedsUpdate();
+ setNeedsUpdate();
}
void MarbleMap::setPropertyValue( const QString& name, bool value )
{
mDebug() << "In MarbleMap the property " << name << "was set to " << value;
d->m_viewParams.setPropertyValue( name, value );
- d->setNeedsUpdate();
+ setNeedsUpdate();
}
void MarbleMap::setShowOverviewMap( bool visible )
@@ -823,7 +823,7 @@
void MarbleMap::setShowClouds( bool visible )
{
d->m_viewParams.setShowClouds( visible );
- d->setNeedsUpdate();
+ setNeedsUpdate();
}
void MarbleMap::setShowTileId( bool visible )
@@ -860,21 +860,21 @@
{
setPropertyValue( "relief", visible );
// Update texture map during the repaint that follows:
- d->setNeedsUpdate();
+ setNeedsUpdate();
}
void MarbleMap::setShowElevationModel( bool visible )
{
d->m_viewParams.setShowElevationModel( visible );
// Update texture map during the repaint that follows:
- d->setNeedsUpdate();
+ setNeedsUpdate();
}
void MarbleMap::setShowIceLayer( bool visible )
{
setPropertyValue( "ice", visible );
// Update texture map during the repaint that follows:
- d->setNeedsUpdate();
+ setNeedsUpdate();
}
void MarbleMap::setShowBorders( bool visible )
@@ -891,7 +891,7 @@
{
setPropertyValue( "lakes", visible );
// Update texture map during the repaint that follows:
- d->setNeedsUpdate();
+ setNeedsUpdate();
}
void MarbleMap::setShowFrameRate( bool visible )
@@ -1008,7 +1008,7 @@
mDebug() << "MarbleMap: Updating the sun shading map...";
d->m_model->update();
- d->setNeedsUpdate();
+ setNeedsUpdate();
//mDebug() << "Finished updating the sun shading map";
}
--- trunk/KDE/kdeedu/marble/src/lib/MarbleMap.h #1186007:1186008
@@ -434,6 +434,11 @@
void centerSun();
/**
+ * @brief Mark the map as needing an update.
+ */
+ void setNeedsUpdate();
+
+ /**
* @brief Paint the map using a give painter.
* @param painter The painter to use.
* @param dirtyRect the rectangle that actually needs repainting.
@@ -758,12 +763,6 @@
virtual void customPaint( GeoPainter *painter );
private:
- /**
- * @brief Request a full repaint of the map during next update.
- */
- Q_PRIVATE_SLOT( d, void setNeedsUpdate() )
-
- private:
Q_DISABLE_COPY( MarbleMap )
MarbleMapPrivate * const d;
};
--- trunk/KDE/kdeedu/marble/src/lib/MarbleMap_p.h #1186007:1186008
@@ -53,11 +53,6 @@
*/
bool needsUpdate() const;
- /**
- * @brief Mark the map as needing an update.
- */
- void setNeedsUpdate();
-
MarbleMap *m_parent;
// The model we are showing.
--- trunk/KDE/kdeedu/marble/src/lib/MarbleWidget.cpp #1186007:1186008
@@ -188,6 +188,8 @@
// show this in the view, i.e. here.
m_widget->connect( m_model, SIGNAL( themeChanged( QString ) ),
m_widget, SIGNAL( themeChanged( QString ) ) );
+ m_widget->connect( m_model, SIGNAL( modelChanged() ),
+ m_widget, SLOT( updateChangedMap() ) );
// Repaint scheduling
m_widget->connect( m_map, SIGNAL( repaintNeeded( QRegion ) ),
@@ -1045,6 +1047,13 @@
dlg.exec();
}
+void MarbleWidget::updateChangedMap()
+{
+ d->m_map->setNeedsUpdate();
+
+ update();
+}
+
void MarbleWidget::scheduleRepaint( const QRegion& dirtyRegion )
{
Q_UNUSED( dirtyRegion );
--- trunk/KDE/kdeedu/marble/src/lib/MarbleWidget.h #1186007:1186008
@@ -899,6 +899,11 @@
void creatingTilesStart( TileCreator *creator, const QString& name, const QString& description );
/**
+ * @brief Invalidate the map and update the widget.
+ */
+ void updateChangedMap();
+
+ /**
* Schedule repaint
*/
void scheduleRepaint( const QRegion& dirtyRegion );
--- trunk/KDE/kdeedu/marble/src/marble_part.cpp #1186007:1186008
@@ -1395,7 +1395,7 @@
QNetworkProxy::setApplicationProxy(proxy);
- m_controlView->marbleWidget()->update();
+ m_controlView->marbleWidget()->updateChangedMap();
// Show message box
if ( m_initialGraphicsSystem != graphicsSystem
More information about the Marble-commits
mailing list