Results 1 to 5 of 5

Thread: How to Set TableWidget to readonly/non-editable

  1. #1
    Join Date
    Jun 2006
    Location
    San Diego, USA
    Posts
    95
    Thanks
    9
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default How to Set TableWidget to readonly/non-editable

    How a TableWidget /TableWidgetItem can be made to readonly / non-editable?

    Thanks & Regards,
    Arun

  2. #2
    Join Date
    Aug 2007
    Location
    Gorakhpur, India
    Posts
    254
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: How to Set TableWidget to readonly/non-editable

    Quote Originally Posted by arunvv View Post
    How a TableWidget /TableWidgetItem can be made to readonly / non-editable?

    Thanks & Regards,
    Arun
    See the link http://www.qtcentre.org/forum/f-qt-p...item-9762.html
    hope its help.
    Anurag Shukla
    A man who never makes mistake is the man who never does anything! Theodre Rosvelt!

  3. The following user says thank you to ashukla for this useful post:

    arunvv (5th February 2008)

  4. #3
    Join Date
    Jun 2006
    Location
    San Diego, USA
    Posts
    95
    Thanks
    9
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: How to Set TableWidget to readonly/non-editable

    I have one more query ?
    How to set particular TableWidget cell for given row, column to read only, instead of whole table.
    I want to set some of the cells to read only, and other cells open to read/write.

    Thanks & Regards,
    Arun.

  5. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How to Set TableWidget to readonly/non-editable

    Just like it is advised in that thread; use QTableWidgetItem::setFlags().
    J-P Nurmi

  6. #5
    Join Date
    Apr 2006
    Location
    Denmark / Norway
    Posts
    67
    Thanks
    3
    Thanked 12 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: How to Set TableWidget to readonly/non-editable

    You might also want to look at the model/view approach if you are viewing data differnt than it is stored.

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.