Sunday, July 6th 2008, 2:55pm UTC+1

You are not logged in.

  • Login
  • Register

bat

Beginner

1

Saturday, May 3rd 2008, 10:58pm

QTableWidget whole row selected SIGNAL

Hi all,
I'm using QTableWidget to create a table of 2 columns that looks as follow:

__ Col1 Col2
1 | aaa | bbb |
2 | bbb | ddd |
...

where the number 1,2, 3, etc are inserted automatically by QTableWidget (not my columns). When I click on one of these numbers, it will select/highlight the whole row. I tried to capture this event/signal with connect( this, SIGNAL( itemClicked/clicked/activated/etc()), this, SLOT( myFunc() ) and overload the SLOT selectRow(), but can't capture it.

Do you know a way to capture this signal when clicking on the numbers?

Thanks.
  • Go to the top of the page

2

Monday, May 5th 2008, 1:16pm

RE: QTableWidget whole row selected SIGNAL

I think you capture that signal by using the QHeaderView signal.

connect ( tableWidget->horizontalHeader(), SIGNAL(sectionClicked(int)), this, SLOT(slotSectionClicked(int)));

i think this will work..

Regards,
Anusha
  • Go to the top of the page

bat

Beginner

3

Wednesday, May 7th 2008, 1:39am

RE: QTableWidget whole row selected SIGNAL

Cool... Thx. That gives me the hint to do it. The right one is :

connect( (QObject*) this->verticalHeader(), SIGNAL( sectionClicked(int) ), this, SLOT( rowSelection( int ) ) );
  • Go to the top of the page

Rate this thread