forked from qt-creator/qt-creator
MiniProjectTargetSelector: Ensure selected item is visible on show event
Is useful when project contains large amount of targets and you have to switch between them more or less often. Change also applies to other tree views in selector but they are less likely to contain large row counts. Change-Id: Ic2cd920335adeef618d85202b3347a4cd042871c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -389,6 +389,12 @@ private:
|
|||||||
TreeView::mouseReleaseEvent(event);
|
TreeView::mouseReleaseEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void showEvent(QShowEvent* event) override
|
||||||
|
{
|
||||||
|
scrollTo(currentIndex());
|
||||||
|
TreeView::showEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
QObject *objectAt(const QModelIndex &index) const
|
QObject *objectAt(const QModelIndex &index) const
|
||||||
{
|
{
|
||||||
return theModel()->itemForIndex(index)->object();
|
return theModel()->itemForIndex(index)->object();
|
||||||
|
Reference in New Issue
Block a user