FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Signals - segmentation fault

 
Post new topic   Reply to topic     Forum Index -> QtD
View previous topic :: View next topic  
Author Message
Mitu



Joined: 22 Sep 2009
Posts: 59
Location: Poland

PostPosted: Thu Apr 01, 2010 6:34 am    Post subject: Signals - segmentation fault Reply with quote

I want to connect a signal from QHttp to an object declared in another module. Unfortunately, I can't get rid of the segmentation fault.


Function:
Code:

void getServerAddress(uint uid, QObject object, string slot)
{
   buffer = new QBuffer();
   
   QHttp http = new QHttp();
   object.connect(http, "requestFinished(int,bool)", object, slot); //this line causes segfault
   
   http.setHost("aHost.aDomain.com", 80);
   http.get(format("/sth.asp"), buffer);
}


And invoking:
Code:

class Main : QMainWindow
{
   this()
   {
      setWindowTitle("Some window");
      
      // sth else

      getServerAddress(0, this, "serverDataReceived(int,bool)");
      show();
   }
   void slot_serverDataReceived(int, bool)
   {
      // sth here
   }
}


Would you help me?
Back to top
View user's profile Send private message
Mitu



Joined: 22 Sep 2009
Posts: 59
Location: Poland

PostPosted: Mon Apr 05, 2010 2:27 am    Post subject: Reply with quote

I've solved it. I forgot "mixin Q_OBJECT;".
Back to top
View user's profile Send private message
maxter



Joined: 17 May 2006
Posts: 34

PostPosted: Wed Apr 07, 2010 7:37 am    Post subject: Reply with quote

It definitely should not segfault but issue a sensible error message. Would you care to post a ticket with the test case?
Back to top
View user's profile Send private message
Mitu



Joined: 22 Sep 2009
Posts: 59
Location: Poland

PostPosted: Wed Apr 07, 2010 8:56 am    Post subject: Reply with quote

Done, ticket posted.
Back to top
View user's profile Send private message
maxter



Joined: 17 May 2006
Posts: 34

PostPosted: Fri Apr 09, 2010 5:53 am    Post subject: Reply with quote

Thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> QtD All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group