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. QDataWidgetMapper manual submit

QDataWidgetMapper manual submit

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

    I have a huge problem with trying QDataWidgetMapper to work in manual submit mode. In the set method of my abstract model I always end up getting the old value of each mapped widget.

    Changing the submit policy to auto solves the issue when I manually call .submit() slot on the QDataWidgetMapper.
    Of course I have my own 'apply' button which I need to do it instead. SO not sure why I am getting old values only when manual submit policy in place.

    One thing I observed is that the data (get method) of my abstract model is called before call to set(). That is weird and might explain why I am getting old values because the get fetched from the model rather than from the widgets mapped via QDataWidgetMapper ?

    this is extremely confusing and frustrating, someone please?

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

      Hi,

      Can you provide a minimal sample application that reproduce this behavior ?

      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
      • P Offline
        P Offline
        pip010
        wrote on last edited by
        #3

        DISREGARD!

        Indeed there was something fishy with the abstract model. It seems if I invaldiate the model during one of the many calls to setData I end up getting the wrong value in the QVariant of setData. No idea why that might be the case, require some more qt internals knowledge. Somehow strange and unexpected but I got along it by simply rearranging the mapper fields, now order does matter for this particular case.

        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