Results 1 to 10 of 10

Thread: QFile::atEnd() problem?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QFile::atEnd() problem?

    Quote Originally Posted by lvi View Post
    If I understand correctly, I should only use the approach I use now if I properly use mutexes, or pass the object by reference in a signal-slot setup?
    Not really. You can't call directly methods from QObjects across threads unless they are explicitely mentioned as thread-safe. So yes, you can connect to them using signals and slots to transfer data across threads, but you can't pass QObjects themselves as arguments to signals or call the sending object's methods from within the slot living in another thread than the object.

    To come back to the original problem: I have found that the problem may be caused my socket reading (where the data in the file comes from). Not yet sure how to fix it, but apparently, there's some \r and \n mess going on there, i.e.: \r\n from the network protocol, \n from writing to file, something like that.
    Dump the data directly to a file without modifying anything and inspect it manually.

  2. The following user says thank you to wysota for this useful post:

    lvi (6th August 2008)

Similar Threads

  1. Steps in solving a programming problem?
    By triperzonak in forum General Programming
    Replies: 8
    Last Post: 5th August 2008, 08:47
  2. problem with paint and erase in frame
    By M.A.M in forum Qt Programming
    Replies: 9
    Last Post: 4th May 2008, 20:17
  3. Tricky problem with ARGB widget / UpdateLayeredWindow
    By nooky59 in forum Qt Programming
    Replies: 3
    Last Post: 21st February 2008, 10:35
  4. [QMYSQL] connection problem
    By chaos_theory in forum Installation and Deployment
    Replies: 5
    Last Post: 2nd July 2007, 09:52
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.