diff options
| -rw-r--r-- | qt/ScintillaEditBase/PlatQt.cpp | 7 | 
1 files changed, 7 insertions, 0 deletions
diff --git a/qt/ScintillaEditBase/PlatQt.cpp b/qt/ScintillaEditBase/PlatQt.cpp index 243c9476c..836df1f9b 100644 --- a/qt/ScintillaEditBase/PlatQt.cpp +++ b/qt/ScintillaEditBase/PlatQt.cpp @@ -915,6 +915,13 @@ int ListBoxImpl::Length()  void ListBoxImpl::Select(int n)  {  	ListWidget *list = static_cast<ListWidget *>(wid); +	QModelIndex index = list->model()->index(n, 0); +	if (index.isValid()) { +		QRect row_rect = list->visualRect(index); +		if (!list->viewport()->rect().contains(row_rect)) { +			list->scrollTo(index, QAbstractItemView::PositionAtTop); +		} +	}  	list->setCurrentRow(n);  }  | 
