Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

main.cpp Example File

    ** This file is part of the Qt Extended Commercial Package.
    ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).

    #include "obexclientwindow.h"
    #include "obexquoteserver.h"
    #include <qtopiaapplication.h>

        This demonstrates the basics of using OBEX support in Qtopia to set up
        an OBEX server and then connect OBEX clients to that server.

        For this example, the OBEX sessions are run over TCP using QTcpSocket,
        but they could have used any transport provided by a subclass of
        QIODevice. For example, the QBluetoothRfcommSocket class could have
        been used to run the OBEX sessions over Bluetooth instead.

        More example code is provided in the QObexClientSession and
        QObexServerSession class documentation.

    int main( int argc, char **argv )
        QtopiaApplication app( argc, argv );

        ObexQuoteServer server;
        if (server.run()) {
            ObexClientWindow win(server.serverAddress(), server.serverPort());
        } else {
            qWarning("Unable to run OBEX example server");

        return app.exec();

Copyright © 2009 Nokia Trademarks
Qt Extended 4.4.3