PDA

View Full Version : clicked signal on qtableview does not exist?



jessn
23rd July 2010, 07:43
I am trying to connect to the signal clicked (and pressed), but it cannot find any of them. I have been looking in the doc and it states that both signals exist. Does anyone know why it says that the signals do not exist when I try?

Thanks in advance
Jess


QTableView *tableViewAvailStops;
connect(tableViewAvailStops, SIGNAL(pressed(QModelIndex())), this, SLOT(clickedAvailableStop()));
Object::connect: No such signal QTableView::pressed(QModelIndex())
Object::connect: (sender name: 'tableViewAvailStops')
...

QTableView *tableViewAvailStops;
connect(tableViewAvailStops, SIGNAL(clicked(QModelIndex())), this, SLOT(clickedAvailableStop()));
Object::connect: No such signal QTableView::clicked(QModelIndex())
Object::connect: (sender name: 'tableViewAvailStops')
...

jessn
23rd July 2010, 09:44
I have solved this on my own...


connect(tableViewAvailStops, SIGNAL(clicked(QModelIndex)), this, SLOT(clickedAvailableStop()));

agathiyaa
23rd July 2010, 11:34
Note that your function signatures are different

clicked(QModelIndex); 1 arg
clickedAvailableStop(); No Arg

The above code might not work sometimes.