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>
This commit is contained in:
Gerald Combs 2016-07-21 10:27:45 -07:00
parent ad6fc87d64
commit 97d194cd3c
1 changed files with 4 additions and 1 deletions

View File

@ -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);
}