Home · All Classes ·
  • QextSerialPort Manual
  • QextSerialPort Manual

    Overview

    QextSerialPort provides an interface to old fashioned serial ports for Qt-based applications. It currently supports Mac OS X, Windows, Linux, FreeBSD.

    From QextSerialPort 1.2-beta on, license of the project has been changed to MIT.

    Classes

    Getting Started

    Usage(1): Source Code Only

    The package contains a qextserialport.pri file that allows you to integrate the component into programs that use qmake for the build step.

    Download the source code. Put the source code in any directory you like. For example, 3rdparty:

        |-- project.pro
        |-- ....
        |-- 3rdparty\
        |     |-- qextserialport\
        |     |

    Add following line to your qmake project file:

        include(pathToPri/qextserialport.pri)

    Then, using QextSerialPort in your code

        #include "qextserialport.h"
        ...
        MyClass::MyClass()
        {
            port = new QextSerialPort("COM1");
            connect(port, SIGNAL(readyRead()), this, SLOT(onDataAvailable()));
            port->open();
        }
    
        void MyClass::onDataAvailable()
        {
            QByteArray data = port->readAll();
            processNewData(usbdata);
        }

    Usage(2): shared library

    Although QextSerialPort can be directly compiled into your application, You may prefer to use QextSerailPort as an library, which is very easy too.

    1. Download the source code, and put it in any location you like.

    2. Goto the top level directory ,run following command to generate library.

            qmake
            sudo make install (or nmake install)

    3. Add following line to your project's file

            CONFIG += extserialport

    4. Using QextSerialPort in your code. Enjoy it!

            #include "qextserialport.h"
            ....
            QextSerialPort * port = new QextSerialPort();
            ....

    Usage(3): Static library

    Someone prefer to use QextSerailPort as static library.

    Open the project file: qextserialport.pro, add uncomment follow line

             # CONFIG += qesp_static

    Then follow the same steps as shared library

             qmake
             sudo make install

    The static library, the header files, and the feature file will be installed to your system.

    Add following line to your qmake's project file:

            CONFIG += extserialport

    Platform Special

    For MacX: Build as framework

    Open the project file: *qextserialport.pro*, and uncomment follow line

             # CONFIG += qesp_mac_framework

    Then follow the same steps as shared library, Goto the top level directory , and run

             qmake
             sudo make install

    The framework which includes libraries and the header files, and the feature file will be installed to your system.

    Add following line to your qmake's project file:

             CONFIG += extserialport

    For Linux: Enable udev

    Open the project file: *qextserialport.pro*, uncomment follow line

             #linux*:CONFIG += qesp_linux_udev

    Note, If you are using the usage(1), Add following line before include the qextserialport.pri file.

             CONFIG += qesp_linux_udev

    Build documents

          make docs

    Examples

    Resources

    Nokia(Trolltech)

    MSDN

    TLDP

    Other


    Copyright © 2000-2012 QextSerialPort Project
    QextSerialPort Manual