mirror of
				https://github.com/YACReader/yacreader
				synced 2025-10-31 08:14:29 -04:00 
			
		
		
		
	fixed bug grid view when the current index is requested, if there are no comics then a invalid QModelIndex should be returned
This commit is contained in:
		| @ -219,13 +219,21 @@ void GridComicsView::setCurrentIndex(const QModelIndex &index) | ||||
|  | ||||
| QModelIndex GridComicsView::currentIndex() | ||||
| { | ||||
|         QLOG_INFO() << "currentIndex"; | ||||
|     QLOG_INFO() << "currentIndex"; | ||||
|  | ||||
|     if(!_selectionModel) | ||||
|         return QModelIndex(); | ||||
|  | ||||
|     QModelIndexList indexes = _selectionModel->selectedRows(); | ||||
|     if(indexes.length()>0) | ||||
|         return indexes[0]; | ||||
|  | ||||
|     this->selectIndex(0); | ||||
|     return _selectionModel->selectedRows()[0]; | ||||
|     indexes = _selectionModel->selectedRows(); | ||||
|     if(indexes.length()>0) | ||||
|         return indexes[0]; | ||||
|     else | ||||
|         return QModelIndex(); | ||||
| } | ||||
|  | ||||
| QItemSelectionModel *GridComicsView::selectionModel() | ||||
|  | ||||
		Reference in New Issue
	
	Block a user