Results 1 to 4 of 4

Thread: QPixmap cannot load data on Windows Mobile 6.1

  1. #1
    Join Date
    Mar 2010
    Location
    Capelle aan den IJssel, Netherlands
    Posts
    24
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Question QPixmap cannot load data on Windows Mobile 6.1

    Hello all!

    I have this weird situation, and I can't seem to find the solution myself. Maybe someone has had this problem before or can point me in the right direction.

    I have made an application in Qt creator. It loads a JPG from an internet source, and puts it in a QPixmap, which is then displayed by a label. No problem here, it works.

    Now, the problem arises, when I compile the same application for Windows Mobile. I have compiled the Qt libraries with Qt everywhere, according to the documentation, all seemed to work. I can also get the app on the phone im using to test and debug the app.

    Now, the same code, gives me a problem when I try to load the data into the QPixmap. It is the same JPG and even the data the app gathered looks the same as with the desktop app.

    Does anyone have a clue, why this fails on Windows Mobile 6.1?


    Here is some code that is called when I have received all the JPG data.
    m_imgData is q QByteArray, which does have the same size as in the desktop app, so I guess, this should be ok.
    Qt Code:
    1. QPixmap img;
    2. img.loadFromData(m_imgData, "JPG"); // returns false on Windows Mobile, not on desktop!! why??
    3. ui.lblImage->setText(m_imgData);
    4.  
    5. m_imgData.clear();
    6. Reply->deleteLater();
    To copy to clipboard, switch view to plain text mode 

    Any ideas?


    Grtz,

    Stefan

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QPixmap cannot load data on Windows Mobile 6.1

    It all sounds like you have not build the jpeg plugin for your mobile or you have it "installed" on a place where your application can't find it.

  3. #3
    Join Date
    Mar 2010
    Location
    Capelle aan den IJssel, Netherlands
    Posts
    24
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: QPixmap cannot load data on Windows Mobile 6.1

    Thanks for the hint!

    It indeed does look like it. When I fetch the supported image types, it does not give me jpg, so that should be enough of a hint.

    However, the jpg pluging did build, I have all the DLL, .so and .a files in there. I tried linking in the jpegd4.lib file and deploy the jpegd4.dll, but it still does not recognize it.

    Do I have to build Qt all over again, or how can I tell the solution that I want to make use of the plugin? Haven't ever used this before =/

    Thanks so far!

  4. #4
    Join Date
    Mar 2010
    Location
    Capelle aan den IJssel, Netherlands
    Posts
    24
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: QPixmap cannot load data on Windows Mobile 6.1

    Never mind, I figured it out! It works like a charm now.

    Just in case anyone was wondering, you need to create a folder where you want to put your plugins in. The name of this folder is irrelevant, but I conveniently named it plugins, just like qt does.

    In there, copy the plugins you want to use. So I needed the imageformats plugins:
    In my plugins folder, I created the imageformats folder (this time, the name DOES matter, else Qt cannot find them) and I copied all the JPG named files.

    Then in your code, after you create your QApplication / QCoreApplication, add the line QApplication::addLibraryPath ("./plugins"); (or QCoreApplication::....).
    I have placed the folder plugins in the root of my app.

    And now it all works

    Thanks again!

Similar Threads

  1. QPixmap/QImage load a big picture fail in Symbian. Help!
    By l241002209l in forum Qt Programming
    Replies: 5
    Last Post: 17th May 2011, 08:16
  2. Load QPixmap
    By jano_alex_es in forum Qt for Embedded and Mobile
    Replies: 3
    Last Post: 10th June 2010, 08:44
  3. Replies: 0
    Last Post: 12th March 2010, 22:01
  4. QPixmap/QImage fail to load jpg files in vista
    By schan117 in forum Qt Programming
    Replies: 2
    Last Post: 7th September 2009, 15:48
  5. QPixmap xx.scaledToWidth dont Scale but load...
    By patrik08 in forum Qt Programming
    Replies: 4
    Last Post: 25th June 2006, 23:21

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.