Results 1 to 3 of 3

Thread: change a lot of data that are seen with model view QStandardItemModel

  1. #1
    Join Date
    Mar 2013
    Posts
    2

    Default change a lot of data that are seen with model view QStandardItemModel

    Hello people i'm brazilian, so not notice in my English.
    I'm newbie in QT, but a little experienced in programming with c/c++
    I'm modeling streets with graphs, and each street have a value(cost).
    I'm working with basedata to store data's street and displayed the graph(street map) with openGL.
    The user can change the cost, but righ now only one at a time. I want that the User can select more than one street (which will have the same cost) and change the value, and the value change in all selected streets. I dont know how to do it.
    Please help me.

  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: change a lot of data that are seen with model view QStandardItemModel

    Set the selection mode in your view to multi select and provide an action that opens a dialog where the user can enter the new value. Then iterate over all selected entries and use QAbstractItemModel::setData() or QStandardItem::setData() to update each of the entries.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Mar 2013
    Posts
    2

    Default Re: change a lot of data that are seen with model view QStandardItemModel

    ThankYou wysota, I'll try. I dont know very much the qt model/view but i'll try it.

Similar Threads

  1. How copy data from one model view to another
    By breakthecode in forum Newbie
    Replies: 14
    Last Post: 8th December 2011, 06:39
  2. Replies: 1
    Last Post: 24th February 2011, 05:54
  3. How to identify data from the model in the view?
    By csmithmaui in forum Qt Programming
    Replies: 8
    Last Post: 17th April 2010, 08:52
  4. Change the Model via the View
    By thw in forum Qt Programming
    Replies: 1
    Last Post: 25th September 2006, 14:13
  5. data, model and tree view
    By larry104 in forum Qt Programming
    Replies: 17
    Last Post: 3rd July 2006, 14:43

Tags for this Thread

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.