Results 1 to 2 of 2

Thread: QDataWidgetMapper issue

  1. #1
    Join Date
    Jan 2006
    Location
    Moscow, Russia
    Posts
    20
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default QDataWidgetMapper issue

    Hi

    I have a QSqlTableModel with OnFieldChange edit strategy. To view the model contents I have a QTableView and several editing (QLineEdit) controls which display some cells of QTableView's current row. These editing controls are connected with the model by the QMapper. I have the connection of QTableView->selectionModel()->currentRowChanged() to the QDataWidgetMapper's slot setCurrentModelIndex(). So when the current row is changed the mapper automatically updates the edit controls.

    I make some changes in first edit control. Then I move focus to the next edit control by pressing tab and try to change its value. The value which was changed in the second control would not be saved into the model. The reason when I move focus to the next edit control the QTableView resets its selection state. So the current row becomes invalid in the table. QDataWidgetMapper has an invalid current model row.

    Do you have any ideas or an experience how to solve this issue?

    Thank you in advance,
    Vitaly
    Last edited by vitaly; 2nd June 2007 at 21:06.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QDataWidgetMapper issue

    You could try submitting the data first before setting a new index in the mapper.

Similar Threads

  1. .app file Issue in MAC
    By vishal.chauhan in forum General Discussion
    Replies: 2
    Last Post: 30th March 2007, 18:41
  2. QMainWindow Maximization Issue
    By vishal.chauhan in forum Qt Programming
    Replies: 6
    Last Post: 15th March 2007, 13:30
  3. qt3 to qt4 - uic issue
    By hvengel in forum Qt Programming
    Replies: 10
    Last Post: 4th March 2007, 02:59
  4. Dialog and code design issue
    By Gopala Krishna in forum Qt Programming
    Replies: 1
    Last Post: 24th September 2006, 17:54
  5. Replies: 5
    Last Post: 22nd September 2006, 08:04

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.