×

Discussion Board

Results 1 to 1 of 1
  1. #1
    Registered User
    Join Date
    Aug 2009
    Posts
    22

    QNetworkSession->open() do not open nothing

    Hi experts,
    Still fighting with IAP,
    I can find an IAP (the one I use daily at home), pass it to QNetworkSession, but when I try to open de conexion it the device says it is open BUT IT IS NOT. Even when the modem is tunr off it says the session is open.
    Any clue????

    My code:

    #include <qmobilityglobal.h>
    #include <qnetworksession.h>
    #include <QNetworkConfigurationManager>
    #include <QNetworkConfiguration>

    QTM_USE_NAMESPACE //(2)

    QNetworkSession* session;

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    MainWindow w;

    QNetworkConfigurationManager manager;
    const bool selectIap = (manager.capabilities()& QNetworkConfigurationManager::CanStartAndStopInterfaces);
    QNetworkConfiguration defaultIap = manager.defaultConfiguration();
    if(!defaultIap.isValid() && (!selectIap && defaultIap.state() != QNetworkConfiguration::Active))
    {
    // let the user know that there is no access point available
    qDebug("no IAP");
    }
    else{ qDebug(defaultIap.name().toAscii());
    qDebug(defaultIap.bearerName().toAscii());
    }
    session = new QNetworkSession(defaultIap,&a);
    QObject::connect(session,SIGNAL(opened()),&w,SLOT(conectado()));
    QObject::connect(session,SIGNAL(error(QNetworkSession::SessionError)),&w,SLOT(conectado()));
    session->open();
    session->waitForOpened();
    if (session->isOpen())qDebug("open");

    AND the .pro:
    -----------------------------------

    QT += core gui network

    TARGET = untitled5
    TEMPLATE = app


    SOURCES += main.cpp\
    mainwindow.cpp

    HEADERS += mainwindow.h

    FORMS += mainwindow.ui

    CONFIG += mobility
    MOBILITY = bearer

    symbian {
    TARGET.UID3 = 0xe0b3a492
    TARGET.CAPABILITY += NetworkServices ReadUserData
    TARGET.EPOCSTACKSIZE = 0x14000
    TARGET.EPOCHEAPSIZE = 0x020000 0x800000
    }
    THANKS
    Last edited by tadu; 2010-06-03 at 21:13. Reason: not finished

Similar Threads

  1. How to open Webpages autometically one by one?
    By SymbianTH in forum Symbian
    Replies: 2
    Last Post: 2010-02-05, 10:57
  2. Phones should be open...
    By gbraad in forum General Development Questions
    Replies: 1
    Last Post: 2009-10-28, 17:42
  3. Replies: 8
    Last Post: 2008-09-22, 06:34
  4. Automatic code signing for open source J2ME Apps?
    By gagravarr in forum Series 40 & S60 Platform Feedback Archive
    Replies: 3
    Last Post: 2008-05-12, 06:09
  5. Replies: 3
    Last Post: 2005-10-12, 05:26

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×