diff options
author | Sami Merila <sami.merila@nokia.com> | 2010-11-09 10:50:09 (GMT) |
---|---|---|
committer | Sami Merila <sami.merila@nokia.com> | 2010-11-09 10:50:09 (GMT) |
commit | d50fb14395e8ea35d09bdfc8bb420f051b6c140a (patch) | |
tree | 0ed8896e73a4e83e4ea4aeaad8b64d55ae6572fd /src/gui/itemviews | |
parent | 9c0b958cac97db37433e0bec33974eb8c964531f (diff) | |
download | Qt-d50fb14395e8ea35d09bdfc8bb420f051b6c140a.zip Qt-d50fb14395e8ea35d09bdfc8bb420f051b6c140a.tar.gz Qt-d50fb14395e8ea35d09bdfc8bb420f051b6c140a.tar.bz2 |
QS60Style: Color calculation should be optimized
Currently, QS60Style calculates some palette colors (tooltip base and
button). Since native side does not have a color for these, but a
nine-part theme graphic, the style tries to estimate the color of the
bitmap by taking a small sample of the QPixmap and calculate the
RGB colors of 32*32 pixels. This is rather slow, it takes around
110 msecs for each QApplication, when the application is started.
Note that color is cached to member variable of style, but it is very
rarely asked again (as the color is polished to all widgets/apps)
and the cache is not shared across processes.
As a fix, style now calculates the button color (tooltip color
is no longer calculated, as no other QStyle does that, and
tooltips do not anyway work in the Qt/Symbian) and stores the
calculated value to Global QSettings together with active theme
ID. Now, when a second Qt application is launched, the stored
theme ID value is matched with currently active theme. If it
matches, then the stored Button color is used. Otherwise, color
is again calculated and stored. If theme is unchanged, the
application launch is ~95msecs faster.
Task-number: QTBUG-14860
Reviewed-by: Jani Hautakangas
Diffstat (limited to 'src/gui/itemviews')
0 files changed, 0 insertions, 0 deletions