Solved QTableView
-
You can listen on QAbstractItemView::currentChanged()
-
Some concrete example that you could provide, I say if it is possible.
-
Just connect the signal with a slot in PrincipalFrm and do what you're doing in on_tableView_clicked()
-
Hi, you know I did what you said, but when I want to connect the currentChanged signal, it just does not appear, which is what I'm doing wrong.
QObject::connect(ui->tableView, &QTableView:: ,this,[&](){ QMessageBox::information(this,qApp->applicationName(),"Mensaje"); });
-
Hi,
Do you mean there's no auto-completion ? If so, that shouldn't stop you, write the name of the signal. If you make any mistake in it, the compilation will fail.
-
the problem is not the auto completed, the problem is that the currentChanged () signal does not appear, when putting the four points, only one eslot appears and a function with the same name of the signal.
-
Well, that sounds like the auto-complete feature malfunctioning. But again, that's just a helper. Write the signal name and go on with your application.
-
Well, what I can say is that I have not achieved anything yet, and the truth is that I'm tired of searching and not getting an answer, thanks anyway.
-
@lincoln Did you try to write
QObject::connect(ui->tableView, &QTableView::currentChanged, this,[&](){ QMessageBox::information(this,qApp->applicationName(),"Mensaje"); });
?
There is nothing to search, you just need to write what was already suggested... -
@jsulm said in QTableView:
QMessageBox::information(this,qApp->applicationName(),"Mensaje");
I already did that and when I do I get this error.
semmantic issue
55:49: error 'currentChanged' is a protected member of 'QTableView'
qtableview.h: 176: 10: note: declared protedted herenote:
I attached an image with the screenshot of the error that I get, thanks.![alt text]( image url)
-
@Christian-Ehrlicher said in QTableView:
QAbstractItemView::currentChanged()
Ah, you have to go through the selectionModel, sorry
connect(ui->tableView->selectionModel, &QItemSelectionModel::currentChanged, ...)
-
deluxe brother, thank you already solved my problem, greetings.