Results 1 to 12 of 12

Thread: An Implemented QHttp Object

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2006
    Posts
    25
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default An Implemented QHttp Object

    My problem is when I connect one of my login dialog's slots, which is to
    be executed when my Conn object has completed it's http request, however
    all it does is; making my dialog return Accepted().

    I have an object like this:
    Qt Code:
    1. class Conn : public QHttp {};
    To copy to clipboard, switch view to plain text mode 

    and a dialog like this:
    Qt Code:
    1. class Login : public QDialog, private Ui::login
    2. {
    3. Conn conn;
    4. ...
    5. private slot:
    6. void HttpDone(bool err);
    7. };
    To copy to clipboard, switch view to plain text mode 

    and in the Login's constructor I call this connect:
    Qt Code:
    1. if(c==0) {
    2. conn = new Conn;
    3. } else {
    4. conn = c;
    5. }
    6.  
    7. connect(conn,SIGNAL(done(bool)),this,SLOT(HttpDone(bool)));
    To copy to clipboard, switch view to plain text mode 

    Login::HttpDone looks like this:
    Qt Code:
    1. void
    2. Login::HttpDone(bool err)
    3. {
    4. if(err) { return; }
    5. XmlHnd *hnd = new XmlHnd();
    6. xml.setContentHandler(hnd);
    7. if(conn->Data()->size() < 2)
    8. {
    9. file = conn->Data();
    10. QXmlInputSource XFile(file);
    11. if(xml.parse(XFile))
    12. {
    13. if(hnd->srvErr())
    14. {
    15. QMessageBox *mb = new QMessageBox("Helhed",
    16. hnd->getValue("error"),QMessageBox::Critical,
    17. QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton);
    18. mb->exec();
    19. delete hnd;
    20. return;
    21. } else {
    22. conn->setcid(hnd->getValue("cid"));
    23. delete hnd;
    24. accept();
    25. }
    26. }
    27. }
    28. }
    To copy to clipboard, switch view to plain text mode 

    To me it seems like the slot is called at the time it is being connected to the
    http's done signal. Is this true, if so how can I make it behave different?
    Last edited by bhs-ittech; 18th August 2006 at 13:41. Reason: Updates Login::HttpDone()

Similar Threads

  1. QHttp internal error
    By LubosD in forum Qt Programming
    Replies: 1
    Last Post: 16th August 2006, 09:57
  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. Passing Object to dll
    By ankurjain in forum Qt Programming
    Replies: 2
    Last Post: 1st April 2006, 09:50
  4. Signal-Slot, object instances
    By ct in forum Qt Programming
    Replies: 3
    Last Post: 16th February 2006, 19:08
  5. Using QSA: A very basic question
    By yogeshm02 in forum Newbie
    Replies: 3
    Last Post: 26th January 2006, 07:34

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.