can create a user-defined signals static?Or Changing the value of a variable to make sure that the function?
-
wrote on 9 Sept 2015, 07:37 last edited by ForestPoem 9 Sept 2015, 07:56This post is deleted!
-
I don't really get what you want to do. Do you want to connect a signal to a slot in the same class (this is possible)?
What do you mean by "keep a thread"?
Signals cannot be static. -
One more comment: you do not define a signal, you only declare it in your class (the body of the signal is created by the moc meta compiler). So, this is wrong:
void Widget::tick()
{
QMetaObject::activate(this, &staticMetaObject, 0, 0);
} -
One more comment: you do not define a signal, you only declare it in your class (the body of the signal is created by the moc meta compiler). So, this is wrong:
void Widget::tick()
{
QMetaObject::activate(this, &staticMetaObject, 0, 0);
}wrote on 9 Sept 2015, 08:23 last edited byWant to send a signal to the other classes.
-
Want to send a signal to the other classes.
@ForestPoem Then declare the signal in the class which is going to emit this signal. Create an instance of this class and connect the signals to the slots of all the other instances of other classes.
Is there a special reason why you wanted a static signal? -
@ForestPoem Then declare the signal in the class which is going to emit this signal. Create an instance of this class and connect the signals to the slots of all the other instances of other classes.
Is there a special reason why you wanted a static signal?wrote on 9 Sept 2015, 08:57 last edited by@jsulm
thanks you,
To use a static function. Coding in the B class A class when you try to use the function. -
Well, you can call the static method in a non static slot :-)
-
wrote on 10 Sept 2015, 05:16 last edited by
@jsulm Then change the value property to determine the signal or event that occurs?
-
@jsulm Then change the value property to determine the signal or event that occurs?
@ForestPoem In the slot you know which signal was emitted (the one you connected it to), you can even get the pointer to the object which emitted the signal using sender()
6/9