Results 1 to 9 of 9

Thread: QExtSerialPort does weired things!

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2013
    Posts
    36
    Qt products
    Qt5
    Thanks
    14
    Thanked 8 Times in 8 Posts

    Question QExtSerialPort does weired things!

    I am reading a String from the Arduino, which comes like this:

    Qt Code:
    1. string_outData = 'a' + string_1 + '&' + string_2 + '&' + string_3 + 'E';
    2. char char_buf[40];
    3. string_outData.toCharArray(char_buf, 50);
    4. Serial.write(char_buf);
    To copy to clipboard, switch view to plain text mode 

    In QT, I want to receive the chars and build a string:
    Qt Code:
    1. QString incoming_string = QString::fromLatin1(port->readLine());
    2. ui->recv_text->moveCursor(QTextCursor::End);
    3. ui->recv_text->append(incoming_string);
    To copy to clipboard, switch view to plain text mode 
    This works fine so far - but this is a QTextEdit and not a string. In the QTextEdit I do not get 1 Line with the whole string, but this:
    XXX // 3 chars
    XXXX // 4 chars. ... why?
    XXXX
    XXXX
    XX

    instead of:
    XXXXXXXXXXXXXXXXXXXXXXXX

    What I want to get is the whole content of what is char_buf at the Arduino in incoming_string in the QT5 GUI. But I am failing miserably so far. I want to seperate the incoming_string later so I am able to work with the three strings. Please, I am very much in need of input How can I get a perfectly fine string ?
    Last edited by xtlc; 7th August 2013 at 13:07.

Similar Threads

  1. Things to inlcude in an LGPL distribution
    By The physicist in forum Installation and Deployment
    Replies: 23
    Last Post: 10th January 2011, 15:25
  2. hellogl_es example with weired behavior
    By fleez in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 27th July 2010, 14:10
  3. Replies: 4
    Last Post: 13th June 2010, 12:31
  4. Replies: 4
    Last Post: 10th March 2007, 04:28
  5. Replies: 2
    Last Post: 14th February 2006, 15:28

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.