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

main.cpp Example File
obex/simpleobexdemo/main.cpp

    /****************************************************************************
    **
    ** This file is part of the Qt Extended Opensource Package.
    **
    ** Copyright (C) 2009 Trolltech ASA.
    **
    ** $QT_EXTENDED_DUAL_LICENSE$
    **
    ****************************************************************************/

    #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.
    */

    QSXE_APP_KEY
    int main( int argc, char **argv )
    {
        QSXE_SET_APP_KEY(argv[0])
        QtopiaApplication app( argc, argv );

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

        return app.exec();
    }


Copyright © 2009 Trolltech Trademarks
Qt Extended 4.4.3