Results 1 to 3 of 3

Thread: Question about using the QextSerialPort~

  1. #1
    Join Date
    Feb 2007
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Question about using the QextSerialPort~

    hi, all~
    I have a question about using QextSerialPort.
    When I searched articles about this library, I found that in order to check whether a new data comes or not, we should poll the serial port by using QTimer.
    However, when I saw the header file which describes the definition of the QextSerialPort class, I got to know that it is inherited by QIODevice class. Moreover, QIODevice emits signals like readyRead(), or bytesWritten(). Then, by writing slot function about those signals, is it possible to get data from a serial port from the slot function? not by polling repeatedly by using QTimer??

    any hints or help will be appreciated~

  2. #2
    Join Date
    Jan 2006
    Location
    Alingsås, Sweden
    Posts
    437
    Thanks
    3
    Thanked 39 Times in 39 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Question about using the QextSerialPort~

    What I have understood from previous questions about this class is that you must poll it. Of course you could write a polling thread class that is wrapped in an asyncronous device class - hence making it look good to the rest of the application - but you still have to poll it internally.

  3. #3
    Join Date
    Feb 2007
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Question about using the QextSerialPort~

    Quote Originally Posted by e8johan View Post
    What I have understood from previous questions about this class is that you must poll it. Of course you could write a polling thread class that is wrapped in an asyncronous device class - hence making it look good to the rest of the application - but you still have to poll it internally.
    Thanks your reply~ but it doesn't still clear for me that if it is impossible to response to serial data by event driven way which is supported by QIODevice class. I just guess if some data come to a serial port, then, since QExtSerialPort is inherited from QIODevice, the corresponding signal will be emitted. In that way, without having to make some thread for polling the serial, I think I just only to write some codes at the corresponding slot function. If it's possible, I guess it's more simpler way to listen to a serial port~

Similar Threads

  1. Question regarding how to paint after zoom.
    By JonathanForQT4 in forum Qt Programming
    Replies: 2
    Last Post: 26th January 2007, 15:34
  2. QThread exit()/quit() question
    By TheKedge in forum Qt Programming
    Replies: 1
    Last Post: 28th August 2006, 14:38
  3. simple thread layout question
    By mhoover in forum Qt Programming
    Replies: 1
    Last Post: 12th August 2006, 11:02
  4. simple question on Class-Members
    By mickey in forum General Programming
    Replies: 7
    Last Post: 4th February 2006, 22:37
  5. xml with binary question
    By TheKedge in forum Qt Programming
    Replies: 7
    Last Post: 12th January 2006, 23:21

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.