Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. QDataWidgetMapper and QPushButton
Qt 6.11 is out! See what's new in the release blog

QDataWidgetMapper and QPushButton

Scheduled Pinned Locked Moved Unsolved Qt for Python
6 Posts 3 Posters 982 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.
  • R Offline
    R Offline
    Robbie
    wrote on last edited by
    #1

    I would like to store the state of a "checkable" QPushButton in the QDataWidgetMapper model. I tried adding code as follows but it doesn't do anything.

    mapper.addMapping(checkBtn, 0, b'checked')
    

    On checking or unchecking the button, data in the model remains unchanged.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      I can't test right now but are you sure you should not be using a str rather than a bytes variable ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      R 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        I can't test right now but are you sure you should not be using a str rather than a bytes variable ?

        R Offline
        R Offline
        Robbie
        wrote on last edited by
        #3

        @SGaist I have tried str and byte for push button. For combobox i use bytes and don't have a problem. Works fine. Also used bytes as Pyside Documentation specified using PySide.QtCore.QByteArray

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Can you provide a minimal example that shows that behaviour ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          R 1 Reply Last reply
          0
          • SGaistS SGaist

            Can you provide a minimal example that shows that behaviour ?

            R Offline
            R Offline
            Robbie
            wrote on last edited by
            #5

            @SGaist Actually it works. I'm resolving this issue. I had made some errors in mapping to the right section.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Great !

              Then since you have it working now, please mark the thread as solved so other forum users may know a solution has been found :-)

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              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