Results 1 to 4 of 4

Thread: QNetworkAccessManager property question

  1. #1
    Join Date
    May 2009
    Location
    USA
    Posts
    300
    Thanks
    82
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default QNetworkAccessManager property question

    How does one access this property to find out if the network is available?

    networkAccessible : NetworkAccessibility

    This property holds whether the network is currently accessible via this network access manager.

  2. #2
    Join Date
    Aug 2009
    Location
    coimbatore,India
    Posts
    314
    Thanks
    37
    Thanked 47 Times in 43 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QNetworkAccessManager property question

    hi,
    did u check the doc,
    enum QNetworkAccessManager::NetworkAccessibility
    Indicates whether the network is accessible via this network access manager.
    Constant Value Description
    QNetworkAccessManager::UnknownAccessibility -1 The network accessibility cannot be determined.
    QNetworkAccessManager::NotAccessible 0 The network is not currently accessible, either because there is currently no network coverage or network access has been explicitly disabled by a call to setNetworkAccessible().
    QNetworkAccessManager::Accessible 1 The network is accessible.
    hope it helps
    Bala

  3. #3
    Join Date
    May 2009
    Location
    USA
    Posts
    300
    Thanks
    82
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QNetworkAccessManager property question

    Thanks Bala, yes, I checked the doc. My question was what syntax to use to get the value of the property.

  4. #4
    Join Date
    Aug 2009
    Location
    coimbatore,India
    Posts
    314
    Thanks
    37
    Thanked 47 Times in 43 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QNetworkAccessManager property question

    hi,
    im not sure this will help or not , but pls look this file,
    qnetworkaccessmanager.cpp line no : 1337
    Qt Code:
    1. if (networkAccessible == QNetworkAccessManager::NotAccessible)
    2. emit q->networkAccessibleChanged(QNetworkAccessManager::NotAccessible);
    3. else
    4. emit q->networkAccessibleChanged(QNetworkAccessManager::UnknownAccessibility);
    5. return;
    To copy to clipboard, switch view to plain text mode 

    hope it helps
    Bala

Similar Threads

  1. QNetworkAccessManager and phonon - can it be done?
    By serenti in forum Qt Programming
    Replies: 16
    Last Post: 2nd December 2011, 18:32
  2. QNetworkAccessManager and redirections
    By alexandernst in forum Qt Programming
    Replies: 33
    Last Post: 22nd September 2010, 19:05
  3. Replies: 2
    Last Post: 18th June 2010, 11:04
  4. sending soap request using QNetworkAccessManager question
    By babymonsta in forum Qt Programming
    Replies: 10
    Last Post: 21st April 2010, 07:55
  5. QNetworkAccessManager question
    By _Stefan in forum Qt Programming
    Replies: 1
    Last Post: 5th March 2010, 12:21

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.