Results 1 to 3 of 3

Thread: QTableWidget and signals cellClicked, cellDoubleClicked, cell....

  1. #1
    Join Date
    Feb 2009
    Posts
    13
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QTableWidget and signals cellClicked, cellDoubleClicked, cell....

    I tried to get a signal from the example spreadsheet table that comes along with the qt 4.6 packages but nothing happens.

    I added to the Spreadsheet class the function

    void SpreadSheet::detectDoubleClick(int row, int column)
    { formulaInput->setText("a cell doubleclicked");

    and connected it

    connect(table, SIGNAL( cellDoubleClicked( int row, int column )),
    this, SLOT(detectRowSelection(int row, int column)) );
    }

    The formulaInput QLineEdit field remains intact no matter how fiercely you click on the table of the spreadsheet class.

    How could i pick up the clicks on the cells? Or more generally, how to detect clicks on QTableWidget cells?

    teele

  2. #2
    Join Date
    Feb 2008
    Posts
    491
    Thanks
    12
    Thanked 142 Times in 135 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: QTableWidget and signals cellClicked, cellDoubleClicked, cell....

    Don't click fiercely enough to break your mouse.

    Didnt you get some warnings on the console? Something like "Object::connect: No such slot ..."

    First,the slot name in your connect statement doesn't match the definition name. Second, read this. Note the sentence beginning with "Note that" in the second paragraph.

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

    teele (1st August 2010)

  4. #3
    Join Date
    Feb 2009
    Posts
    13
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QTableWidget and signals cellClicked, cellDoubleClicked, cell....

    Thank you, the parnames in the connect field are not allowed, your advise solved the problem

    teele

Similar Threads

  1. repaint a cell or row in QTableWidget
    By alphaqt in forum Newbie
    Replies: 6
    Last Post: 26th June 2012, 11:21
  2. Many cell widget in QTableWidget
    By Benarez in forum Qt Programming
    Replies: 3
    Last Post: 21st January 2010, 07:02
  3. Replies: 1
    Last Post: 7th December 2009, 18:56
  4. Close a QtableWidget cell
    By SailinShoes in forum Qt Programming
    Replies: 2
    Last Post: 7th March 2008, 14:03
  5. A QListWidget in a QTableWidget cell ?
    By Nyphel in forum Newbie
    Replies: 4
    Last Post: 11th April 2007, 10:46

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.