Results 1 to 3 of 3

Thread: problem with QTableView

  1. #1
    Join Date
    Jul 2012
    Posts
    27
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Question problem with QTableView

    hello

    I have the following code:

    Qt Code:
    1. model = new QStandardItemModel();
    2. channel = new QTableView(this);
    3. channel->setModel(model);
    4.  
    5. model->setData(model->index(d,0,QModelIndex()), 0 );
    6. model->setData(model->index(d,1,QModelIndex()),Channel);
    7. model->setData(model->index(d,2,QModelIndex()),Unit);
    8. model->setData(model->index(d,3,QModelIndex()),dimension);
    9. model->setData(model->index(d,4,QModelIndex()),code);
    10. model->setData(model->index(d,5,QModelIndex()),description);
    To copy to clipboard, switch view to plain text mode 

    I want you to just click on a box, return the row number where the selected field.
    Last edited by jackajack01; 9th August 2012 at 20:39.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: problem with QTableView

    What is the question?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: problem with QTableView

    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

Similar Threads

  1. QTableView - CSS Problem
    By Sir Rogers in forum Qt Programming
    Replies: 0
    Last Post: 14th February 2011, 19:10
  2. Qtableview problem
    By kira411 in forum Qt Programming
    Replies: 0
    Last Post: 30th July 2010, 10:34
  3. Problem with QTableView
    By habeas_corpse in forum Qt Programming
    Replies: 2
    Last Post: 11th November 2008, 22:17
  4. Problem with QTableView
    By BoneCollector in forum Qt Programming
    Replies: 5
    Last Post: 12th March 2008, 12:30
  5. Problem about QTableView.
    By fengtian.we in forum Qt Programming
    Replies: 1
    Last Post: 31st October 2007, 23:13

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.