diff options
author | Stefan Wildemann <gta04@metalstrolche.de> | 2021-09-01 22:36:54 +0200 |
---|---|---|
committer | Stefan Wildemann <gta04@metalstrolche.de> | 2021-09-01 22:36:54 +0200 |
commit | 1730a7152135990ef384ba1e9f712877b38e8ccc (patch) | |
tree | a888fc13b105bbe7f4f5db39a0876fbb16f97afd | |
parent | f6fefddcb166f2135ecc297d4994accf8668a8cf (diff) | |
download | navit-1730a7152135990ef384ba1e9f712877b38e8ccc.tar.gz |
Fix:graphics:qt5 Clear pixmap on resize
To remove ugly artefacts after resizing the widget until navit completes
to redraw the screen the widgets pixmap is cleared.
-rw-r--r-- | navit/graphics/qt5/QNavitQuick.cpp | 7 | ||||
-rw-r--r-- | navit/graphics/qt5/QNavitWidget.cpp | 7 |
2 files changed, 2 insertions, 12 deletions
diff --git a/navit/graphics/qt5/QNavitQuick.cpp b/navit/graphics/qt5/QNavitQuick.cpp index dcd0d2aa5..966072852 100644 --- a/navit/graphics/qt5/QNavitQuick.cpp +++ b/navit/graphics/qt5/QNavitQuick.cpp @@ -181,12 +181,7 @@ void QNavitQuick::geometryChanged(const QRectF& newGeometry, const QRectF& oldGe if (graphics_priv->pixmap == NULL) { graphics_priv->pixmap = new QPixmap(width(), height()); } - painter = new QPainter(graphics_priv->pixmap); - if (painter != NULL) { - QBrush brush; - painter->fillRect(0, 0, width(), height(), brush); - delete painter; - } + graphics_priv->pixmap->fill(Qt::transparent); dbg(lvl_debug, "size %fx%f", width(), height()); dbg(lvl_debug, "pixmap %p %dx%d", graphics_priv->pixmap, graphics_priv->pixmap->width(), graphics_priv->pixmap->height()); diff --git a/navit/graphics/qt5/QNavitWidget.cpp b/navit/graphics/qt5/QNavitWidget.cpp index 869d5f2ec..43c04d87f 100644 --- a/navit/graphics/qt5/QNavitWidget.cpp +++ b/navit/graphics/qt5/QNavitWidget.cpp @@ -105,12 +105,7 @@ void QNavitWidget::resizeEvent(QResizeEvent* event) { if (graphics_priv->pixmap == NULL) { graphics_priv->pixmap = new QPixmap(size()); } - painter = new QPainter(graphics_priv->pixmap); - if (painter != NULL) { - QBrush brush; - painter->fillRect(0, 0, width(), height(), brush); - delete painter; - } + graphics_priv->pixmap->fill(Qt::transparent); dbg(lvl_debug, "size %dx%d", width(), height()); dbg(lvl_debug, "pixmap %p %dx%d", graphics_priv->pixmap, graphics_priv->pixmap->width(), graphics_priv->pixmap->height()); |