Results 1 to 5 of 5

Thread: loading pictures from a server

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2007
    Posts
    628
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    3
    Thanked 89 Times in 87 Posts

    Default Re: loading pictures from a server

    It seems like this fetch is a blocking function.
    Please check the return value of loadFromData().
    And check the length of image data after fetch to make sure that fetcher is fetching right.

  2. #2
    Join Date
    Jul 2009
    Posts
    139
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    13
    Thanked 59 Times in 52 Posts

    Default Re: loading pictures from a server

    sizeof(data) will always return the size of a pointer. You need to use the return value of http_fetch:
    Qt Code:
    1. int len = http_fetch(urlpath,&data)
    2. pixmap.loadFromData((const uchar *)data, len);
    To copy to clipboard, switch view to plain text mode 
    On another note, using a blocking function in your GUI thread is probably not a good idea.

  3. The following user says thank you to numbat for this useful post:

    anafor2004 (25th August 2009)

Similar Threads

  1. Replies: 3
    Last Post: 29th November 2009, 20:24
  2. How to download any file through ftp server
    By thomasjoy in forum Qt Programming
    Replies: 1
    Last Post: 24th July 2007, 01:23
  3. How to ping a server ?
    By Nyphel in forum Newbie
    Replies: 2
    Last Post: 23rd April 2007, 11:27
  4. How a server can write "Hello" to a browser ?
    By probine in forum Qt Programming
    Replies: 2
    Last Post: 1st December 2006, 14:43
  5. synching client readings to server output
    By OnionRingOfDoom in forum Qt Programming
    Replies: 14
    Last Post: 28th January 2006, 18:15

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
  •  
Qt is a trademark of The Qt Company.