Call method in "parent" window from child window.
-
You do know that you are only supposed to give a declaration of a signal, right? No implementation allowed!
So, only do:
@
//MyChildWindow.h
class MyChildWindow: public QDialog
{
Q_OBJECT
/...
signals:
void valueChanged(int);
@Moc will provide an implementation for you.
-
Thank you!
2 things:
- I did make an empty implementation. Deleted it.
- I forgot to declare it a signal in my header file. ("signals:")
I now seems to be working. The variable is not updated properly, but I guess that's due to an error somewhere else.
Thank you so much for your time!
-
[quote author="maxmotor" date="1316523853"]I'm not sure if I'm doing this correct?
@Setup_selectMachine *selectMachine = new Setup_selectMachine();
QObject::connect(selectMachine, SIGNAL(valueChanged()), this, SLOT(updateValue()));
selectMachine->show();@[/quote]You forgot to specify the signal and slot parameters types (int).
@ @Setup_selectMachine *selectMachine = new Setup_selectMachine();
QObject::connect(selectMachine, SIGNAL(valueChanged(int)), this, SLOT(updateValue(int)));
selectMachine->show(); @ -
No I did not - to quote myself:
[quote author="maxmotor" date="1316523853"]I am not sending any values directly via the connection, but instead I'm using a resource class which holds all values.![/quote]
So I don't have to send any parameters with the signal.