"current" and "selected" is not the same. You are not checking the selection here.
"current" and "selected" is not the same. You are not checking the selection here.
If I select a item on qtablewidget, the currentRow() function returns the number of row selected, or of the current row? Or not?
I just want to know if some row or item is selected on table. The solution in my code is crasshing on execution. The code is in a custom slot function connected with a pushbutton. When I click the button, if no item or row of the table is selected, crashes, if there selection, works ok.
"Current" item is the one which has the keyboard focus (thus there is always a "current row" if the widget has focus). "Selected" item is an item, which is highlighted by a changed background in most widget styles. There can be many selected items but only one current item.Originally Posted by marcelrc
Use QTableWidget::selectedItems() to retrieve a list of selected items. If the list is empty, no items are selected.I just want to know if some row or item is selected on table. The solution in my code is crasshing on execution. The code is in a custom slot function connected with a pushbutton. When I click the button, if no item or row of the table is selected, crashes, if there selection, works ok.
marcelrc (27th May 2006)
![]()
Thak you very much wysota! It's solved my problem!
You are fast to response.
I think you was hired by somebody only to response this forum. Is this your job?
No, I do it in my free time (although I don't have much time free now).Originally Posted by marcelrc
Bookmarks