I need to get all selected items in QTableWidget and getting this error

Qt Code:
  1. QList<QTableWidgetItem *> items = this->selectedItems();
To copy to clipboard, switch view to plain text mode 

error: '((QTableWidget*)this)->QTableWidget::selectedItems' cannot be used as a function

when I try

Qt Code:
  1. QList<QTableWidgetItem *> items = this->selectedItems;
To copy to clipboard, switch view to plain text mode 

it crashes on items.size(); or items.at(0)

It works only if I use this->selectedIndexes(), but why can't use selectedItems() and what about selectedRanges() ??