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 and setModelData confusion
Forum Updated to NodeBB v4.3 + New Features

QDataWidgetMapper and setModelData confusion

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

    Hi,

    I'm using Qt 4.6 on linux 64bit...this is the first time I've used the QDataWidgetMapper.

    I have a QTableView with a model attached that is derived from QAbstractTableModel.

    Right now I have the table displayed and one QLineEdit (let's call it myDetailEdit ) attached via QDataWidgetMapper. My datamapper submit policy is set to ManualSubmit.

    I figured out that myDetailEdit is pulling its display data from the Qt::EditRole on the model. If I enter new data in myDetailEdit everything works fine. I enter the new text, call QDataWidgetMapper::submit and the QTableView displays the new value.

    However, if I double click on the appropriate cell in the QTableView the line edit is not updated after setData is called.

    The QTableview has a QItemDelete attached. This delegate creates a QLineEdit within the cell, and uses the setEditorData to load that QLineEdit then the setModelData method makes changes to the model via setData. However, after the setData method is called myDetaileEdit doesn't show the change.

    I feel like I'm missing something simple. Can anyone help? Thanks

    (I'm happy to provide any additional information I've missed.)

    1 Reply Last reply
    0
    • J Offline
      J Offline
      JoelTW
      wrote on last edited by
      #2

      I currently am working on a similiar problem and wonder if you have had any success yet. In my case I also have a problem with getting the lineEdit to get data from the model.

      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