Commit 1302b8bb authored by Eike Ziller's avatar Eike Ziller
Browse files

Fix that there could be many "fading indicators" painted over each other



Simply hide the current indicator, if there is any.

Task-number: QTCREATORBUG-14805
Change-Id: Ic25ba1b671e6ba2490803ba73b8a5757ccbff24b
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent 7130ea7d
......@@ -37,6 +37,7 @@
#include <QLabel>
#include <QPainter>
#include <QPixmap>
#include <QPointer>
#include <QPropertyAnimation>
#include <QTimer>
......@@ -130,14 +131,20 @@ namespace FadingIndicator {
void showText(QWidget *parent, const QString &text, TextSize size)
{
auto indicator = new Internal::FadingIndicatorPrivate(parent, size);
static QPointer<Internal::FadingIndicatorPrivate> indicator;
if (indicator)
delete indicator;
indicator = new Internal::FadingIndicatorPrivate(parent, size);
indicator->setText(text);
indicator->run(2500); // deletes itself
}
void showPixmap(QWidget *parent, const QString &pixmap)
{
auto indicator = new Internal::FadingIndicatorPrivate(parent, LargeText);
static QPointer<Internal::FadingIndicatorPrivate> indicator;
if (indicator)
delete indicator;
indicator = new Internal::FadingIndicatorPrivate(parent, LargeText);
indicator->setPixmap(pixmap);
indicator->run(300); // deletes itself
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment