syntax signal/slots QT - question
-
I have some questions about signal and slots. First thing the syntax look like this:
connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
If i am not wrong:
- const QObject *sender-> is the button that start the signal?
- const char *signal, -> the signal
- const char *method->element receive the signal
- Qt::ConnectionType type-> slot
Other question i have, i can call the signal using emit or other way without buttons? thx again!
-
Hi,
A signal should be emitted from within the class that declares it. What do you have in mind ?
Also, you should move to Qt 5's new syntax. It does compile time check rather than run time.
-
If you don't have a sender then you can't emit a signal.
What is exactly your use case ?
-
How is exactly your application supposed to work ?
-
@SGaist my program will be console so i can't use buttons like with mainwindow. So i dont know other way to activate sender or emit signal.
How is exactly your application supposed to work ?
Activate some sender to activate signal i was trying include in this code something to activate sender without using buttons.
Signal/slot connection:
connect(this, SIGNAL(finished(QNetworkReply*)),this, SLOT(replyFinished(QNetworkReply*)));
I need some sender to activate this signal.
If i am doing one console program i can activate sender??? -
That I understood, my question is: what is your application supposed to do ? i.e How should it be used ? Why do you need that signal ?
-
That I understood, my question is: what is your application supposed to do ? i.e How should it be used ? Why do you need that signal ?
-
That I understood, my question is: what is your application supposed to do ? i.e How should it be used ? Why do you need that signal ?