Results 1 to 1 of 1

Thread: Problem displaying JPEG when running deployed exe file that loads from MSSQL

  1. #1
    Join Date
    Nov 2010
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem displaying JPEG when running deployed exe file that loads from MSSQL

    Hi all,

    I used Qlabel to display a image that query MSSQL. The database is currently located in the same computer(1) as the one I used to program the GUI in Qt. Everything works fine and image displays properly.

    However when I tested the deployed exe file in another computer(2) that doesn't have Qt installed. I can access all data from the database but not the JPG images that is suppose to show. Could it be that there are Qt plugins that are needed by computer(2)?

    Here is my code for displaying image from MSSQL to QLabel:
    QSqlQuery query;
    query.exec("SELECT photo FROM dbo.report_img WHERE _Time = '"+ui->img_list->currentItem()->text()+"'");
    query.next();
    QByteArray image = query.value(0).toByteArray() ;
    QPixmap pixmap;
    pixmap.loadFromData(image);
    ui->image_detail->setPixmap(pixmap);

    Thanks for your help

    Jeff


    Added after 5 minutes:


    Fixed. turns out I needed plugins from the imageformat folder on computer(2)!
    Last edited by bbgunner; 30th November 2010 at 08:51.

Similar Threads

  1. Replies: 6
    Last Post: 25th November 2010, 21:02
  2. N97 mini resets when running deployed version QSolitaire 1.2.
    By skeletor in forum Installation and Deployment
    Replies: 1
    Last Post: 8th September 2010, 20:19
  3. Problem with displaying jpeg and gif images, in QT4
    By node_ex in forum Installation and Deployment
    Replies: 1
    Last Post: 23rd September 2008, 15:29
  4. Can't Write Image as Jpeg file
    By noufalk in forum Qt Programming
    Replies: 4
    Last Post: 25th July 2007, 14:53
  5. Can't display .jpg,.jpeg file in my QT app
    By Shalabh in forum Qt Programming
    Replies: 3
    Last Post: 23rd April 2007, 14:52

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.