diff options
author | Gerald Combs <gerald@wireshark.org> | 2016-07-21 10:27:45 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2016-07-21 19:47:21 +0000 |
commit | 97d194cd3cb7fa3806a7bb83f83f06ee2eda418b (patch) | |
tree | 1615c7fb1577265fba096900ca18762b762ce121 /ui/qt/label_stack.cpp | |
parent | ad6fc87d64de30cdcdca18168a117d2ec24591da (diff) | |
download | wireshark-97d194cd3cb7fa3806a7bb83f83f06ee2eda418b.tar.gz |
Qt: Set the LabelStack CSS only when it changes.
We call fillLabel repeatedly while loading a capture. Try to avoid
applying a style sheet when we do since it can affect performance.
Change-Id: I9ee188cb79f7cad340ba35b12011b82004ed8262
Reviewed-on: https://code.wireshark.org/review/16571
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/qt/label_stack.cpp')
-rw-r--r-- | ui/qt/label_stack.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ui/qt/label_stack.cpp b/ui/qt/label_stack.cpp index 1f0507f396..731a6f2ff5 100644 --- a/ui/qt/label_stack.cpp +++ b/ui/qt/label_stack.cpp @@ -77,7 +77,10 @@ void LabelStack::fillLabel() { } style_sheet += "}"; - setStyleSheet(style_sheet); + if (styleSheet().size() != style_sheet.size()) { + // Can be computationally expensive. + setStyleSheet(style_sheet); + } setText(si.text); } |