[Qt-interest] Basic non modal dialog question
Phil
phillor at telstra.com
Fri Feb 19 02:41:03 CET 2010
On Thu, 18 Feb 2010 12:49:17 pm Scott Aron Bloom wrote:
> On Feb 17, 2010, at 5:43 PM, Phil wrote:
> >> ??!! Of course signals and slots work across classes.
> >
> > Take this code for instance:
> >
> > connect(action_OpenMyDialog, SIGNAL(triggered()), this,
> > SLOT(showDialog()));
> >
> > This works if showDialog() is a member of the class that sends the
> > signal
> > but how do I write code where the showDialog() slot is a member of a
> > different class?
>
> easy...
>
> connect( action_OpenMyDialog, SIGNAL( triggered() ), obj,
> SLOT( show() ) );
>
> where obj is a pointer to the other objedct.
>
Thanks Scott. I tried that quite some time ago and failed. Anyway, it works
now.
--
Regards,
Phil
More information about the Qt-interest-old
mailing list