QT Project crashes when attempting signal slot connect()
-
Hi,
Im struggling to find why my signal causes my program to completely crash.
I am sending from a dialog to my main wondow (class->class)
reciever header file:

Receiver (slot) function + function that creates the child dialog:

sender header file:

sender cpp file (including connect() func):

Would greatly apreciate if anyone can figure this out.
-
Hi,
Im struggling to find why my signal causes my program to completely crash.
I am sending from a dialog to my main wondow (class->class)
reciever header file:

Receiver (slot) function + function that creates the child dialog:

sender header file:

sender cpp file (including connect() func):

Would greatly apreciate if anyone can figure this out.
@SOrton
It's a lot easier for people to reply if you paste your code as text not as screenshots.In
AddDataDialog:MainWindow *test = new MainWindow; connect(..., test, ...);You are creating a brand new
MainWindowhere, in your dialog. This is conceptually wrong.If this were to work at all you would need the instance of
MainWindowto pass as parameter. But don't try to do the connection from the dialog anyway. Do it fromMainWindow. Either export a getter returningui->btn_Exitor emit a new signal fromAddDataDialogfor the button being clicked/exiting and connect that. Either wayconnect()back inMainWindow. You wouldn't need a signal if you show the dialog modally, but maybe that's not your case. -
Hi,
Im struggling to find why my signal causes my program to completely crash.
I am sending from a dialog to my main wondow (class->class)
reciever header file:

Receiver (slot) function + function that creates the child dialog:

sender header file:

sender cpp file (including connect() func):

Would greatly apreciate if anyone can figure this out.
-
Hi,
Im struggling to find why my signal causes my program to completely crash.
I am sending from a dialog to my main wondow (class->class)
reciever header file:

Receiver (slot) function + function that creates the child dialog:

sender header file:

sender cpp file (including connect() func):

Would greatly apreciate if anyone can figure this out.
@SOrton
It's a lot easier for people to reply if you paste your code as text not as screenshots.In
AddDataDialog:MainWindow *test = new MainWindow; connect(..., test, ...);You are creating a brand new
MainWindowhere, in your dialog. This is conceptually wrong.If this were to work at all you would need the instance of
MainWindowto pass as parameter. But don't try to do the connection from the dialog anyway. Do it fromMainWindow. Either export a getter returningui->btn_Exitor emit a new signal fromAddDataDialogfor the button being clicked/exiting and connect that. Either wayconnect()back inMainWindow. You wouldn't need a signal if you show the dialog modally, but maybe that's not your case.