Qt World Summit: Register Today!

Rerender Widget depending on QComboBox current index

  • Hi,

    I am working on an application that must do kind of different rendering on the GLWidget depending on the value of the QComboBox current index.
    On the widget I have 2 axis rendered. On the MainWIndow I have 2 comboboxes, for selecting lables for the axis. Depending on the current indexes of comboboxes, i want to render different labels for axis.
    How to do that?

    Thanks in advance.

  • Moderators

    Hi, welcome to devnet.

    Connect currentIndexChanged(int) signals of your comboboxes to the updateGL() slot of your gl widget. This will call paintGL() whenever you change your selection. Inside the paintGL you check current indices of the combos with currentIndex() and draw based on that.

  • Thank you for quick answer. It helped.


Log in to reply