Oh sorry, mistake you want a source code with an example of the api.
So look the "qextserial":http://qextserialport.sourceforge.net/ project, it is a project to use serial port with qt.
This project have documentation in doxygen and if you download the source you see the doxygen comment in the source.
This is an example
@
/*!
\class QextSerialBase
\version 1.0.0
\author Stefan Sander
A common base class for Win_QextSerialBase, Posix_QextSerialBase and QextSerialPort.
/
#ifdef QT_THREAD_SUPPORT
QMutex QextSerialBase::mutex=NULL;
unsigned long QextSerialBase::refCount=0;
#endif
/*!
\fn QextSerialBase::QextSerialBase()
Default constructor.
*/
QextSerialBase::QextSerialBase()
: QIODevice()
{
#ifdef TTY_WIN
setPortName("COM1");
#elif defined(TTY_IRIX)
setPortName("/dev/ttyf1");
#elif defined(TTY_HPUX)
setPortName("/dev/tty1p0");
#elif defined(TTY_SUN)
setPortName("/dev/ttya");
#elif defined(TTY_DIGITAL)
setPortName("/dev/tty01");
#elif defined(TTY_FREEBSD)
setPortName("/dev/ttyd1");
#else
setPortName("/dev/ttyS0");
#endif
construct();
}
/*!
\fn QextSerialBase::QextSerialBase(const QString & name)
Construct a port and assign it to the device specified by the name parameter.
*/
QextSerialBase::QextSerialBase(const QString & name)
: QIODevice()
{
setPortName(name);
construct();
}
/*!
\fn QextSerialBase::~QextSerialBase()
Standard destructor.
*/
QextSerialBase::~QextSerialBase()
{
#ifdef QT_THREAD_SUPPORT
refCount--;
if (mutex && refCount==0) {
delete mutex;
mutex=NULL;
}
#endif
}
/*!
\fn void QextSerialBase::construct()
Common constructor function for setting up default port settings.
(115200 Baud, 8N1, Hardware flow control where supported, otherwise no flow control, and 500 ms timeout).
*/
void QextSerialBase::construct()
{
Settings.BaudRate=BAUD115200;
Settings.DataBits=DATA_8;
Settings.Parity=PAR_NONE;
Settings.StopBits=STOP_1;
Settings.FlowControl=FLOW_HARDWARE;
Settings.Timeout_Sec=0;
Settings.Timeout_Millisec=500;
#ifdef QT_THREAD_SUPPORT
if (!mutex) {
mutex=new QMutex( QMutex::Recursive );
}
refCount++;
#endif
setOpenMode(QIODevice::NotOpen);
}
/*!
\fn void QextSerialBase::setPortName(const QString & name)
Sets the name of the device associated with the object, e.g. "COM1", or "/dev/ttyS0".
*/
void QextSerialBase::setPortName(const QString & name)
{
port = name;
}
@
[quote author="Wolf P." date="1292253770"]Thanks, but this seems to be API docs...[/quote]