accessing prtected member of QTableView
I have a tableview in a form which i have subclassed. The form contains a qtableview and i am trying to access one the view's protected member functions
(QModelIndexList selectedIndexes () const) from a slot in the derived class using
Code:
void derived_class::derived_class_slot()
{
index = view->selectedIndexes().first();
......
}
but i'm getting the following error:
error C2248: 'QTableView::selectedIndexes' : cannot access protected member declared in class 'QTableView'
how can i access this function?
thanks for your attention.
Re: accessing prtected member of QTableView
Quote:
Originally Posted by
locus
how can i access this function?
You can't access it from outside. Protected methods and fields are only accessible to derived classes. Better try QAbstractItemView::selectionModel().