aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2016-03-31 13:25:44 -0700
committerGerald Combs <gerald@wireshark.org>2016-04-02 00:03:23 +0000
commite6a65afd3ee567f743e6b2f4f8596f27445ed390 (patch)
tree040022b8a219bc9bf62577219a9cf5963ed16c77 /ui
parent3db7b1ed04e0f627c97a0c2d961bfea79429a24d (diff)
Qt: Try to speed up SplashOverlay
Limit the amount of event processing SplashOverlay does. Let QWidget take care of painting. Change-Id: I9176baeba2cc9203e50c02029d85689f8908daba Reviewed-on: https://code.wireshark.org/review/14771 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui')
-rw-r--r--ui/qt/main_welcome.cpp2
-rw-r--r--ui/qt/splash_overlay.cpp20
-rw-r--r--ui/qt/splash_overlay.h3
3 files changed, 9 insertions, 16 deletions
diff --git a/ui/qt/main_welcome.cpp b/ui/qt/main_welcome.cpp
index 696f681204..691a457b6b 100644
--- a/ui/qt/main_welcome.cpp
+++ b/ui/qt/main_welcome.cpp
@@ -188,7 +188,7 @@ MainWelcome::MainWelcome(QWidget *parent) :
#if !defined(Q_OS_MAC) || QT_VERSION > QT_VERSION_CHECK(5, 0, 0)
// This crashes with Qt 4.8.3 on OS X.
QGraphicsBlurEffect *blur = new QGraphicsBlurEffect(welcome_ui_->childContainer);
- blur->setBlurRadius(1.3);
+ blur->setBlurRadius(2);
welcome_ui_->childContainer->setGraphicsEffect(blur);
#endif
diff --git a/ui/qt/splash_overlay.cpp b/ui/qt/splash_overlay.cpp
index a38fc1296f..fec318607a 100644
--- a/ui/qt/splash_overlay.cpp
+++ b/ui/qt/splash_overlay.cpp
@@ -62,7 +62,13 @@ SplashOverlay::SplashOverlay(QWidget *parent) :
so_ui_->progressBar->setMaximum((int)register_count() + register_add);
elapsed_timer_.start();
- setPalette(Qt::transparent);
+ QColor bg = QColor(tango_aluminium_6);
+ bg.setAlphaF(0.4);
+ QPalette pal;
+ pal.setColor(QPalette::Background, bg);
+ setPalette(pal);
+ setAutoFillBackground(true);
+
setStyleSheet(QString(
"QLabel {"
" color: white;"
@@ -172,20 +178,10 @@ void SplashOverlay::splashUpdate(register_action_e action, const char *message)
so_ui_->progressBar->setValue(register_cur_);
- wsApp->processEvents();
+ wsApp->processEvents(QEventLoop::ExcludeUserInputEvents | QEventLoop::ExcludeSocketNotifiers, 1);
elapsed_timer_.restart();
}
-void SplashOverlay::paintEvent(QPaintEvent *)
-{
- QPainter painter(this);
-
- painter.setRenderHint(QPainter::Antialiasing);
- painter.setBrush(QColor(tango_aluminium_6));
- painter.setOpacity(0.4);
- painter.drawRect(rect());
-}
-
/*
* Editor modelines
*
diff --git a/ui/qt/splash_overlay.h b/ui/qt/splash_overlay.h
index 2cae0c1694..3aae85ff5a 100644
--- a/ui/qt/splash_overlay.h
+++ b/ui/qt/splash_overlay.h
@@ -45,9 +45,6 @@ public:
explicit SplashOverlay(QWidget *parent = 0);
~SplashOverlay();
-protected:
- void paintEvent(QPaintEvent *event);
-
private:
Ui::SplashOverlay *so_ui_;
bool blurred_;