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. [Delete] Model/View QAbstractListModel and Forms

[Delete] Model/View QAbstractListModel and Forms

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

    Just started working the Model/View classes and have run into a problem. I created my model using QAbstractListModel and showing the data in a QListView, No problem so far. Now I would like to display the items in a series of QLineEdit widgets. For test purposes I only have 4 items in the list, all QStrings. I created a QDataWidgetMapper, set my model and then used the following:

    mapper->addMapping(chan1,0);
    mapper->addMapping(chan2,1);
    mapper->addMapping(chan3,2);
    mapper->addMapping(chan4,3);

    Needless to say my four list items are not showing up in the QLineEdit widgets. I played around with the orientation put didn't seem to help. I did notice that when I changed the data in the first QLineEdit it did change in my QListView. Changes in the other QLineEdits didn't do anything until I changed the first QLineEdit again.

    So I figure my problem must be in how things are getting mapped but I have run out of ideas.

    Thanks,
    Joel

    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