Results 1 to 4 of 4

Thread: how to make a row read-only row in QTableView

  1. #1
    Join Date
    Oct 2010
    Posts
    18
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default how to make a row read-only row in QTableView

    hi

    I need to make few rows as read-only in the list of rows added to QTableView

    please help me.


    Regards
    Nagesh

  2. #2
    Join Date
    Dec 2008
    Location
    Poland
    Posts
    383
    Thanks
    52
    Thanked 42 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: how to make a row read-only row in QTableView

    Set
    Qt Code:
    1. setEditable( false );
    To copy to clipboard, switch view to plain text mode 
    for items in the model.
    In the near future - corporate networks reach out to the stars. Electrons and light flow throughout the universe.
    The advance of computerization however, has not yet wiped out nations and ethnic groups.

  3. #3
    Join Date
    Oct 2010
    Posts
    6
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60 Maemo/MeeGo

    Default Re: how to make a row read-only row in QTableView

    same as Talei said

    use
    setEditable(false);

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: how to make a row read-only row in QTableView

    Quote Originally Posted by anamr View Post
    same as Talei said

    use
    setEditable(false);
    ?!?

    You can also subclass your model und reimp the flags() method and alter the item flags for spezific indexes.

Similar Threads

  1. Replies: 2
    Last Post: 18th October 2010, 14:33
  2. Make a column read-only in a QSqlTableModel/QTableView
    By graciano in forum Qt Programming
    Replies: 0
    Last Post: 15th November 2009, 18:18
  3. How to read and write data into the QTableView
    By grsandeep85 in forum Qt Programming
    Replies: 2
    Last Post: 20th October 2009, 12:31
  4. qtableview QStandardItemModel read only
    By JeanC in forum Qt Programming
    Replies: 2
    Last Post: 9th February 2008, 16:42
  5. Replies: 8
    Last Post: 28th May 2007, 20:32

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.