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. Is there a way of reading the previous value of a QSpinbox?
Forum Updated to NodeBB v4.3 + New Features

Is there a way of reading the previous value of a QSpinbox?

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 314 Views 2 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.
  • Dummie1138D Offline
    Dummie1138D Offline
    Dummie1138
    wrote on last edited by
    #1

    As the title suggests. I'm making a function that would greatly benefit from the ability to read the previous value of a QSpinbox, and I'm wondering whether this function exists without making an int that manually reads and saves the data before the value changes. Please let me know if more info is required.

    Pl45m4P 1 Reply Last reply
    0
    • Dummie1138D Dummie1138

      As the title suggests. I'm making a function that would greatly benefit from the ability to read the previous value of a QSpinbox, and I'm wondering whether this function exists without making an int that manually reads and saves the data before the value changes. Please let me know if more info is required.

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by Pl45m4
      #2

      @Dummie1138 said in Is there a way of reading the previous value of a QSpinbox?:

      I'm wondering whether this function exists

      If you are talking about something like aboutToChange(int oldVal), unfortunately not (for QSpinBox at least).
      ContextMenus have an aboutToShow signal before they are shown, but QSpinBox doesn't . As soon as you get your valueChanged signal, the widget itself forgets about the old value, if you haven't saved it.


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      1

      • Login

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