diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-12-28 11:26:59 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-12-28 11:26:59 +0900 |
commit | a3b9fe1ddd2d3b0a0cbb07ffc42317b30a1a3899 (patch) | |
tree | 206628e68b5f19db48b6bcc03cbaa00ae151fc29 /user.cpp | |
parent | 1dce783c4ac9ca37343648114885d332bdfe7fa1 (diff) | |
download | libquotient-a3b9fe1ddd2d3b0a0cbb07ffc42317b30a1a3899.tar.gz libquotient-a3b9fe1ddd2d3b0a0cbb07ffc42317b30a1a3899.zip |
Switch from QPixmap to QImage; add convenience avatar() overloads to Room and User
The switch is necessary because MediaThumbnailJob is supposed to return something that can be worked on in non-GUI threads (as is the case of QML image providers), and QPixmap is not supposed for usage out of the main thread.
Diffstat (limited to 'user.cpp')
-rw-r--r-- | user.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -95,7 +95,12 @@ Avatar& User::avatarObject() return d->avatar; } -QPixmap User::avatar(int width, int height) +QImage User::avatar(int dimension) +{ + return avatar(dimension, dimension); +} + +QImage User::avatar(int width, int height) { return d->avatar.get(width, height, [=] { emit avatarChanged(this); }); } |