Results 1 to 2 of 2

Thread: QTableWidget or QTableView - noneditable field

  1. #1
    Join Date
    Jun 2009
    Posts
    10
    Platforms
    MacOS X

    Default QTableWidget or QTableView - noneditable field

    I am wondering if anyone could assist me in providing a way, such that the zeros can be not be editable when displayed in the table. QT 3.3 provided QTableItem::Never, so is there something similar for QTableWidget or QTableView

    table_widget1->setItem(r, c, new QTableWidgetItem(QString::number(0)));

  2. #2
    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: QTableWidget or QTableView - noneditable field

    QTableWidgetItem::setFlags() with unset Qt::ItemIsEditable. (see bit operators) or you use a view with a custom delegate where you don't set an editor when the value is null.

Similar Threads

  1. qtablewidget and qtableview
    By dreamer in forum Qt Programming
    Replies: 1
    Last Post: 17th May 2008, 16:01
  2. Drag and Drop QTableWidget and QTableView
    By scorpion11 in forum Qt Programming
    Replies: 5
    Last Post: 8th April 2008, 09:33
  3. Some very weird compilation warnings
    By MarkoSan in forum Qt Programming
    Replies: 21
    Last Post: 23rd January 2008, 16:48
  4. How to know when field is edited within QTableView
    By dkite in forum Qt Programming
    Replies: 3
    Last Post: 1st January 2007, 18:51
  5. QTableView versus QTableWidget
    By jcr in forum Qt Programming
    Replies: 2
    Last Post: 24th May 2006, 19:51

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.