[Interest] Access forms from an called class?
André Somers
andre at familiesomers.nl
Mon Mar 4 15:17:07 CET 2013
Op 4-3-2013 14:20, Robert Wood schreef:
> I have my main window which accesses its form. I have another (non-GUI)
> class I have written that takes BTLE messages in and decodes them. This
> blte_commands class is called from MainWindow and works out what the
> message is and what to do with it.
>
> I would then like to change values back on the mainwindow ui form
> depending on what blte_commands decodes.
>
> I was thinking I could maybe pass a pointer from mainwindow to
> blte_commands and access the form directly from blte_commands, but
> failed with that.
>
> Is what I am trying to do good practice? Is there a way to do this and
> if so, how should I do it please?
>
I think you should read up on the signal-slot paradigm used all over Qt.
It seems like a great candidate for your BTLEDecoder class to provide
some signals that anyone, incluing your main window, can connect to.
André
More information about the Interest
mailing list