Results 1 to 5 of 5

Thread: How to get signal when checkbox in table cell changed?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to get signal when checkbox in table cell changed?

    Since you know row and column when creating the checkbox, I would just store these values as dynamic properties on the object and connect to the checkbox' toggled signal

    Qt Code:
    1. cb1->setProperty("row", ctr);
    2. cb1->setProperty("column", 6);
    3. connect(cb1, SIGNAL(toggled(bool)), this, SLOT(checkBoxToggled(bool)));
    To copy to clipboard, switch view to plain text mode 
    Qt Code:
    1. void MyClass::checkBoxBoxToggled(bool on)
    2. {
    3. QObject *cb = sender();
    4. const int row = cb->property("row");
    5. const int column = cb->property("column");
    6. }
    To copy to clipboard, switch view to plain text mode 

    Cheers,
    _

  2. The following user says thank you to anda_skoa for this useful post:

    d_stranz (11th August 2016)

Similar Threads

  1. Detect when the content of a cell of QTableView is changed
    By qt_developer in forum Qt Programming
    Replies: 5
    Last Post: 21st August 2021, 16:00
  2. How to detect when item is changed in the table view?
    By schmimona in forum Qt Programming
    Replies: 1
    Last Post: 15th August 2011, 09:06
  3. Replies: 1
    Last Post: 8th June 2011, 14:13
  4. Replies: 1
    Last Post: 19th May 2010, 15:10
  5. QTreeView: How to center a checkbox in a cell
    By chezifresh in forum Qt Programming
    Replies: 3
    Last Post: 19th December 2008, 12:11

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
  •  
Qt is a trademark of The Qt Company.