hashb
16th September 2010, 08:25
Hi, All
is it possible to set priority for the slots which connected to an object?
for example:
myaction = new QAction(this);
connect(myaction,SIGNAL(triggered()),this,SLOT(do_ thing1()));
connect(myaction,SIGNAL(triggered()),view_,SLOT(do _thing2)));
I hope when the action is active , do_thing1 will be called first ,then call view_::do_thing2
but the problem is that I found view_::do_thing2 will be called first sometimes
this can solved by write another slot ,such as do_things:
void do_things()
{
do_thing1();
view_->do_thing2();
}
but I am still want to know if there is a way to control the calling sequence of the slots that connect to an object.
Thanks in advance,
Best regards,
hb
is it possible to set priority for the slots which connected to an object?
for example:
myaction = new QAction(this);
connect(myaction,SIGNAL(triggered()),this,SLOT(do_ thing1()));
connect(myaction,SIGNAL(triggered()),view_,SLOT(do _thing2)));
I hope when the action is active , do_thing1 will be called first ,then call view_::do_thing2
but the problem is that I found view_::do_thing2 will be called first sometimes
this can solved by write another slot ,such as do_things:
void do_things()
{
do_thing1();
view_->do_thing2();
}
but I am still want to know if there is a way to control the calling sequence of the slots that connect to an object.
Thanks in advance,
Best regards,
hb