Results 1 to 5 of 5

Thread: possible open/write two files same time with QFile

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Re: possible open/write two files same time with QFile

    Here's the debug() function that gets called in readADC. I don't know why it would matter since it worked fine when just clicking a button manually.

    Qt Code:
    1. void arm_rev0::debug(QString buffer)
    2. {
    3. /*Write to window
    4.   msg.append(buffer);
    5.   msg.append("\n");
    6.   ui->t_debug->setText(msg);
    7.   */
    8.  
    9. /*Write to log file*/
    10.  
    11. log << buffer << '\n';
    12. log.flush();
    13.  
    14.  
    15.  
    16. }
    To copy to clipboard, switch view to plain text mode 

  2. #2

    Default Re: possible open/write two files same time with QFile

    I've narrowed the problem down to this section of code.

    Qt Code:
    1. void arm_rev0::debug(QString buffer)
    2. {
    3. /*Write to window
    4.   msg.append(buffer);
    5.   msg.append("\n");
    6.   ui->t_debug->setText(msg);
    7.   */
    8.  
    9. /*Write to log file*/
    10.  
    11. log << buffer << '\n';
    12. log.flush();
    13.  
    14.  
    15.  
    16. }
    To copy to clipboard, switch view to plain text mode 

    If I have
    Qt Code:
    1. /*Write to window
    2.   msg.append(buffer);
    3.   msg.append("\n");
    4.   ui->t_debug->setText(msg);
    5.   */
    To copy to clipboard, switch view to plain text mode 

    uncommented, it works. otherwise, it doesn't work. Thoughts?

Similar Threads

  1. QFile resized files gets truncated after writing
    By MaximA in forum Qt Programming
    Replies: 1
    Last Post: 24th May 2008, 17:23
  2. changing files lastmodified time
    By ramazangirgin in forum Qt Programming
    Replies: 2
    Last Post: 27th March 2008, 10:04
  3. How to set the file's date and time.
    By santosh.kumar in forum General Programming
    Replies: 3
    Last Post: 12th October 2007, 11:13
  4. modification time on files
    By soul_rebel in forum Qt Programming
    Replies: 3
    Last Post: 9th August 2007, 20:51
  5. QFile and Creating Files
    By Jingoism in forum Newbie
    Replies: 2
    Last Post: 28th July 2007, 17:11

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.