Results 1 to 6 of 6

Thread: Send QImage over network

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2008
    Posts
    29
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Send QImage over network

    Quote Originally Posted by wysota View Post
    Have you checked that the appropriate amount of data is ready to be read on the receiving end? The fact that you are notified there is something to be read doesn't mean there is everything to be read, maybe that's the problem?
    Thank you for your help. I'm still quite new to network programming in QT. Right now I'm using QIODevice::readyRead() signal to notify my socket when to begin reading. Is that incorrect? How should I determine when the reading should begin?

    I tried sending the size of the file first, but I find that readyRead() is emitted several times for each transfer.

  2. #2
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Send QImage over network

    it is ok to begin reading. the point is when to stop.
    because unless you send the package size (before the image data) you will never know if the image is complete.

    see network-fortuneclient for an example to wait for a complete package of network data

    hth

Similar Threads

  1. Replies: 12
    Last Post: 7th September 2011, 16:37
  2. Replies: 12
    Last Post: 22nd March 2009, 11:22
  3. Streaming QImage (QByteArray, QDataStream, QBuffer)
    By knarz in forum Qt Programming
    Replies: 5
    Last Post: 17th January 2009, 22:05
  4. Multiple QPainters on QImage
    By fire in forum Qt Programming
    Replies: 3
    Last Post: 14th August 2008, 13:10
  5. Send QEvents over network?
    By Winni in forum Qt Programming
    Replies: 2
    Last Post: 2nd October 2007, 20:58

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.