Results 1 to 2 of 2

Thread: QHttp signals not connecting...

  1. #1

    Default QHttp signals not connecting...

    Please help, my signals won't connect.... using Visual C++ with QT add-on.

    my method ReqEnded never fires... but the Http does the Get. The connect returns false.

    .h file..
    Qt Code:
    1. class Sign : public QMainWindow
    2. {
    3. Q_OBJECT
    4.  
    5. public:
    6.  
    7. void ReceiveData(int Size, unsigned char * Data);
    8. static Sign * getInstance();
    9. ~Sign();
    10.  
    11. protected:
    12. Sign(QWidget *parent = 0, Qt::WFlags flags = 0);
    13. private:
    14. Ui::SignClass ui;
    15. static Sign * instance;
    16. QHttp * http;
    17.  
    18.  
    19. private slots:
    20. void on_processDataButton_clicked();
    21. void on_pushButton_2_clicked();
    22. void on_GoButton_clicked();
    23. void on_pushButton_clicked();
    24. void on_sendButton_clicked();
    25. void on_connectButton_clicked();
    26.  
    27. void ReqStarted(int x, bool error);
    28. void ReqEnded(int x, bool error);
    29. };
    To copy to clipboard, switch view to plain text mode 

    .c file..
    Qt Code:
    1. void Sign::on_GoButton_clicked()
    2. {
    3. int Ret;
    4. http = new QHttp(this);
    5. Ret = connect(http, SIGNAL(requestFinished(int, bool)), this, SLOT(reqEnded(int, bool)));
    6.  
    7. ui.lineEdit->setText("Go");
    8. QUrl url(ui.urlLineEdit->text(), QUrl::TolerantMode);
    9. http->setHost(url.host(), 80);
    10. int httpGetId = http->get(url.path());
    11. }
    12.  
    13. void Sign::ReqEnded(int x, bool error)
    14. {
    15. char Data[10000];
    16. http->read(Data, 10000);
    17. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by jacek; 27th February 2007 at 02:46. Reason: missing [code] tags

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QHttp signals not connecting...

    Quote Originally Posted by trobbins0000 View Post
    private slots:
    ...
    void ReqStarted(int x, bool error);
    void ReqEnded(int x, bool error);
    };
    ...
    Ret = connect(http, SIGNAL(requestFinished(int, bool)), this, SLOT(reqEnded(int, bool)));
    There is no reqEnded() slot, only ReqEnded().

Similar Threads

  1. QHttp signals don't work !!
    By probine in forum Qt Programming
    Replies: 11
    Last Post: 11th January 2007, 15:02
  2. how to use QHttp inside QThread in Qt3
    By alusuel in forum Qt Programming
    Replies: 3
    Last Post: 14th July 2006, 11:19
  3. QHttp and readyRead signals emit sequence
    By balitong in forum Qt Programming
    Replies: 4
    Last Post: 19th June 2006, 05:22
  4. Connecting signals & slots across different threads
    By jyoti kumar in forum Qt Programming
    Replies: 4
    Last Post: 16th May 2006, 12:40
  5. KDE Signals
    By chombium in forum KDE Forum
    Replies: 1
    Last Post: 25th January 2006, 18:45

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.