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. QComboBox signal "aboutToShow" or get prev index on "activated"?
Forum Updated to NodeBB v4.3 + New Features

QComboBox signal "aboutToShow" or get prev index on "activated"?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 361 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.
  • D Offline
    D Offline
    davecotter
    wrote on last edited by
    #1

    my end goal is i want to call a function only when the user CHANGES the value, i do NOT want this function called when the value hasn't changed, and also not when changed programmatically.

    so, in a dialog, when my QComboBox is changed by the user (NOT when programmatically), i need to know what the previous index was during the "activated" signal. but by then, it has already been changed.
    i could stash the current value away if there was an "aboutToShow" signal, but there isn't.

    what's the EASIEST way to implement this?

    this really should be a one-liner, like an "aboutToShow" signal or have "activated" also send in the previous value, but it's not. i don't want to have a parallel structure hanging around JUST to track previous values, and i don't want complicated event filtering (maybe it's easy / simple to do?)

    any ideas?

    1 Reply Last reply
    0
    • nageshN Offline
      nageshN Offline
      nagesh
      wrote on last edited by
      #2

      @davecotter
      option 1)use the dynamic property feature
      Set lastselection property and keep track as previous selected value
      option 2)subclass qcombobox add the previous selection code and promote the widget

      1 Reply Last reply
      2
      • D Offline
        D Offline
        davecotter
        wrote on last edited by
        #3

        oooOOoo! both very interesting ideas!

        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