Results 1 to 9 of 9

Thread: QNetworkAccesManager (Connect not emiting signal)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2013
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QNetworkAccesManager (Connect not emiting signal)

    Hi Guys,

    I have been trying to use QObject::connect , but the signal is not being sent.


    [code]

    QNetworkAccessManager *manager = new QNetworkAccessManager(this);
    QNetworkReply* reply = manager->get(QNetworkRequest(url));
    QObject::connect(reply,SIGNAL(finished(QNetworkRep ly*)),this,SLOT(replyFinish(QNetworkReply*)));

    [\code]

    [code]

    void USGSDialog::replyFinish(QNetworkReply* reply)
    {

    if(reply->isOpen()){
    QXmlInputSource input;
    input.setData(reply->readAll());

    QDomDocument doc;
    doc.setContent(input.data());

    // Get the root element
    QDomElement root = doc.firstChildElement();

    // Get Data
    getData(root);
    if(reply->isFinished())
    reply->close();
    }


    [\code]

    My class file looks like this
    [code]

    class USGSDialog : public QDialog
    {
    Q_OBJECT

    public:
    explicit USGSDialog(QWidget *parent = 0);
    ~USGSDialog();


    signals:

    public slots:
    void replyFinish(QNetworkReply* reply);


    [\code]

    Can anybody help me out why the control doesn't go into the slot ? Why is the signal not being emitted ?
    Thanks in Advance
    Last edited by Sricharan; 7th July 2013 at 06:46.

Similar Threads

  1. problem with emiting a signal
    By msmihai in forum Newbie
    Replies: 2
    Last Post: 3rd January 2009, 14:32
  2. QDateEdit emiting signal problem
    By anafor2004 in forum Newbie
    Replies: 1
    Last Post: 17th June 2008, 07:59
  3. not emiting signal
    By bisz in forum Newbie
    Replies: 4
    Last Post: 3rd October 2007, 07:49
  4. Problem emiting signal in QTreeWidgetItem's subclass
    By Shawn in forum Qt Programming
    Replies: 12
    Last Post: 4th September 2007, 12:08
  5. Emiting signal, which NOT connected to any slots
    By krivenok in forum Qt Programming
    Replies: 7
    Last Post: 27th February 2006, 16:32

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.