QDataWidgetMapper and setModelData confusion



  • 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.)



  • 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.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.