Problem with pictures in qt4-gui

9 views
Skip to first unread message

Erik Johansson

unread,
Feb 7, 2013, 3:46:19 PM2/7/13
to licq...@googlegroups.com
Hi,

I'm trying to add picture support to the jabber plugin and it works
fine, except that it isn't visible in the qt4-gui. I have added the
patch below to the gui to make it support more image formats, but it
seems that is not enough.

I've tested the qt program
http://doc.qt.digia.com/qt/widgets-imageviewer.html and it also fails
to load the picture saved by the jabber plugin, unless I rename it to
remove the extension .pic.

Does anyone see any problem with dropping the .pic suffix and
modifying the 1.8 upgrade function to drop the .pic suffix when moving
existing pictures (except for people running master)?

// Erik

diff --git a/qt4-gui/src/userdlg/info.cpp b/qt4-gui/src/userdlg/info.cpp
index dd5957d..cc23af6 100644
--- a/qt4-gui/src/userdlg/info.cpp
+++ b/qt4-gui/src/userdlg/info.cpp
@@ -32,6 +32,7 @@
#include <QHeaderView>
#include <QLabel>
#include <QMovie>
+#include <QPicture>
#include <QPixmap>
#include <QPushButton>
#include <QTreeWidget>
@@ -1282,7 +1283,13 @@ void UserPages::Info::loadPagePicture(const
Licq::User* u)
myPictureClearButton->setEnabled(!m_sFilename.isNull());

if (m == NULL)
- lblPicture->setText(s);
+ {
+ QPicture picture;
+ if (!m_sFilename.isNull() && picture.load(m_sFilename))
+ lblPicture->setPicture(picture);
+ else
+ lblPicture->setText(s);
+ }
else
{
lblPicture->setMovie(m);

--
Erik Johansson
Home Page: http://ejohansson.se/
PGP Key: http://ejohansson.se/erik.asc

Erik Johansson

unread,
Feb 7, 2013, 3:51:16 PM2/7/13
to licq...@googlegroups.com
When dropping the .pic suffix we don't need the qt4-gui patch either.

And after some more though, perhaps .picture is better than nothing.

// Erik

Anders Olofsson

unread,
Feb 9, 2013, 7:58:34 AM2/9/13
to licq...@googlegroups.com
I think there should still be some suffix and .picture is good, so do
the switch.
And it should be enough to only change the 1.8 upgrade function. Anyone
using master will have to live with doing manual upgrades some times.
And loosing the pictures isn't a big deal anyway, they should just be
downloaded again.

/Anders
>> + if (!m_sFilename.isNull()&& picture.load(m_sFilename))
Reply all
Reply to author
Forward
0 new messages