Results 1 to 2 of 2

Thread: QTableWidget does not recieve events from cell

  1. #1
    Join Date
    Apr 2008
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QTableWidget does not recieve events from cell

    Hi you all,
    I'm adding ComboBox widgets and checkbox widgets to QTableWidget using setCellWidget. the problem is that the CellChanged signal is not emited when the user changes the status or the values in the comboboxes. I'm working with QT4.1.4. can anyone enlighten me?
    Yuval

  2. #2
    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: QTableWidget does not recieve events from cell

    QTableWidget::setCellWidget() is not really meant for that but for a static content. The model-view framework supports checkable items out of the box. For checkable items you use:
    Qt Code:
    1. item->setFlags(item->flags() | Qt::ItemIsUserCheckable); // make the item checkable
    2. item->setCheckState(Qt::Unchecked); // initialize the checkstate
    To copy to clipboard, switch view to plain text mode 
    and to get combo box as editor you reimplement QItemDelegate::createEditor().
    J-P Nurmi

Similar Threads

  1. Replies: 5
    Last Post: 26th October 2014, 12:56
  2. Center a widget in a cell on a QTableWidget
    By roleroz in forum Qt Programming
    Replies: 16
    Last Post: 5th March 2009, 14:47
  3. Replies: 2
    Last Post: 2nd April 2008, 14:19
  4. Word wrapping in a QTableWidget cell
    By jcooperddtd in forum Qt Programming
    Replies: 3
    Last Post: 1st May 2007, 03:57
  5. Selection of cell with QWidget in QTableWidget
    By Tamara in forum Qt Programming
    Replies: 7
    Last Post: 17th February 2007, 14:11

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.