problem using dialog to control a glwidget in a main window
I've got an application that has a main window with a glWidget and sliders (as in helloGL), and a second window alongside it that has the controls to manipulate the GL widget's content.
That is, I have the interface built. Where I'm stuck is that I can't work out how to share variables between the two windows so I can communicate changes to the glWidget context from the controls window.
This is likely an issue with my not yet grasping how QT works. I'm sure there must be a way to communicate between windows, but I can't see it.
Any help/pointers would be much apreciated.
Re: problem using dialog to control a glwidget in a main window
Re: problem using dialog to control a glwidget in a main window
I looked at that, but I didn't know how to make the dialog class aware of the glWidget. I may need to study signals/slots a bit more. by 'I may' I of course mean 'absolutelly must...'
Think I solved it for the moment, I passed a pointer to the glWidget as a parameter to the control dialogs constructor. That's probably a cheap hack that misses a major point of QT, but it works.
I'll change it to use signals and slots as soon as I can figure them out. Thanks for the help, and the link.
Re: problem using dialog to control a glwidget in a main window
You can code signals and slots to the main window widget (first window), so that you expose whatever functionality you want to call from the dialog (or second window)
Re: problem using dialog to control a glwidget in a main window
Quote:
Originally Posted by
Zlatomir
You can code signals and slots to the main window widget (first window), so that you expose whatever functionality you want to call from the dialog (or second window)
That would seem to make the most sense. Frantically reading the signals/slots link right now. Quite how I managed to get this far into QT without learning about them is beyond me. Mind you, I mainly do CLI.
Re: problem using dialog to control a glwidget in a main window
Oh dear. Now I've got to grips with signals and slots I have a severe case of 'buggrit I'm an idiot' going on....