mirror of
https://github.com/LongSoft/UEFITool.git
synced 2024-11-25 17:38:22 +08:00
Changed scrollTo() to center the view on selected item
This commit is contained in:
parent
fa280c0f36
commit
1b40fa32d7
@ -17,7 +17,7 @@
|
|||||||
UEFITool::UEFITool(QWidget *parent) :
|
UEFITool::UEFITool(QWidget *parent) :
|
||||||
QMainWindow(parent),
|
QMainWindow(parent),
|
||||||
ui(new Ui::UEFITool),
|
ui(new Ui::UEFITool),
|
||||||
version(tr("0.19.1"))
|
version(tr("0.19.1.1"))
|
||||||
{
|
{
|
||||||
clipboard = QApplication::clipboard();
|
clipboard = QApplication::clipboard();
|
||||||
|
|
||||||
@ -631,7 +631,7 @@ void UEFITool::scrollTreeView(QListWidgetItem* item)
|
|||||||
MessageListItem* messageItem = static_cast<MessageListItem*>(item);
|
MessageListItem* messageItem = static_cast<MessageListItem*>(item);
|
||||||
QModelIndex index = messageItem->index();
|
QModelIndex index = messageItem->index();
|
||||||
if (index.isValid()) {
|
if (index.isValid()) {
|
||||||
ui->structureTreeView->scrollTo(index);
|
ui->structureTreeView->scrollTo(index, QAbstractItemView::PositionAtCenter);
|
||||||
ui->structureTreeView->selectionModel()->clearSelection();
|
ui->structureTreeView->selectionModel()->clearSelection();
|
||||||
ui->structureTreeView->selectionModel()->select(index, QItemSelectionModel::Select);
|
ui->structureTreeView->selectionModel()->select(index, QItemSelectionModel::Select);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user