Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Rerender Widget depending on QComboBox current index
Forum Updated to NodeBB v4.3 + New Features

Rerender Widget depending on QComboBox current index

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mike_newbye
    wrote on last edited by
    #1

    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.

    Kind regards,
    Mikael

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Mike_newbye
        wrote on last edited by
        #3

        Thank you for quick answer. It helped.

        Mikael

        Kind regards,
        Mikael

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved