Changing GUI structure on the fly

Hello

I have a question: I have to program one application, that will switch
between about 20 modulations.
With 20 modulations, program will have a lot of parameters to change, so
GUI needs to change during runtime.

Is it possible to do somethink like that ??
Are there any design patterns for problem like this ?

Many thanks
Przemek L.

Hi Przemek,

this might leave the kind of things that you can “easily” do with the
GUI tools in the GNU Radio companion. If you want to keep things in the
GRC, I’d recommend using different taps for the different groups of
widgets.
Basically, if you use the QT GUI stuff, you should be able to integrate
the GUI tools into an Qt application that you might design with Qt
Creator etc. I must admit that I haven’t tried to build complex GUI
applications with GR myself, so I can only point you to what I guess
needs to be done, based on what I did a while back myself with something
not-GR related:

  • build your flow graph with QtGUI visualizations; generate the python
    file. Open that file.
  • comment out all the GUI building stuff, ie. all after
    self.setWindowTitle(…) and before self.settings=…
  • build your GUI with QtCreator (Qt4, not 5!)[1]; add one of the Layouts
    (e.g. QHBoxLayout, by dragging “Horizontal Layout” onto your form) for
    your visualizations. Save.
  • Use pyuic4 to convert the .ui file to a python module. You’ll get a
    class with a setupUi method
  • import that module in your python file. Instantiate the class, e.g.
    myForm = Ui_Form()
  • set up the GUI by doing myForm.setupUi(self) where you formerly
    commented out the GUI building stuff
  • find the places where “addWidget” was generated by GRC. Replace the
    things to which your QtWidgets are added by the appropriate
    Layout/Container instances from your Qt Form (e.g. the name of your
    QHBoxLayout above)
  • hope for the best :slight_smile:

Maybe someone who actually did more work with PyQT can comment on this.

Best regards,
Marcus

[1] creating the form should look something like:
Form creation dialog