Results 1 to 2 of 2

Thread: model/view: how do i get the data from a Qtableview model?

  1. #1
    Join Date
    Nov 2010
    Posts
    142
    Thanks
    24
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default model/view: how do i get the data from a Qtableview model?

    Consider that I have a simple qtableview model/view.

    two columns: one for name and one for surname
    several rows, for instance 4.

    Ok, the program runs and the user writes in some data of names and surnames.
    Now I want for instance to have an external Qlineedit that will print out a simple message for row No1, like:

    Qt Code:
    1. Name: John ----- Surname: Smith
    To copy to clipboard, switch view to plain text mode 
    Is there a built in signal to connect the model data to the slot of the Qlineedit setText(QString).

    I am trying to build a simple program to understand the model/view architecture in Qt.
    I have read several times the corresponding tutorials, but without building my own simple example I cannot understand it!

    Thanks in advance for your time and any small code example is more than welcome!
    Last edited by fatecasino; 24th February 2011 at 02:21.

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: model/view: how do i get the data from a Qtableview model?


Similar Threads

  1. Replies: 3
    Last Post: 23rd February 2011, 10:27
  2. Replies: 0
    Last Post: 21st April 2010, 13:23
  3. Replies: 1
    Last Post: 1st February 2010, 19:42
  4. Table view->model->set data
    By tulsi in forum Qt Programming
    Replies: 3
    Last Post: 21st April 2009, 09:36
  5. Model/View framework: streaming data in a QTableView
    By yannickt in forum Qt Programming
    Replies: 6
    Last Post: 24th October 2008, 01:06

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.