aboutsummaryrefslogtreecommitdiff
path: root/examples/GuiClient/mainDialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/GuiClient/mainDialog.cpp')
-rw-r--r--examples/GuiClient/mainDialog.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/examples/GuiClient/mainDialog.cpp b/examples/GuiClient/mainDialog.cpp
index e9adfce2..e8c53f73 100644
--- a/examples/GuiClient/mainDialog.cpp
+++ b/examples/GuiClient/mainDialog.cpp
@@ -304,7 +304,13 @@ void mainDialog::avatarChanged(const QImage& image)
{
QXmppVCardIq vcard;
vcard.setType(QXmppIq::Set);
- vcard.setPhoto(image);
+
+ QByteArray ba;
+ QBuffer buffer(&ba);
+ buffer.open(QIODevice::WriteOnly);
+ image.save(&buffer, "PNG");
+ vcard.setPhoto(ba);
+
m_xmppClient.sendPacket(vcard);
m_statusWidget.setAvatar(image);
}