mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
Update file selection whenever an item is selected, not just clicked.
* This catches when you use typing to find an item, or select with the arrow keys.
This commit is contained in:
@@ -593,6 +593,9 @@ VirtualFileDialog::VirtualFileDialog(ICaptureContext &ctx, QWidget *parent)
|
||||
// switch to home folder and expand it
|
||||
changeCurrentDir(m_Model->homeFolder());
|
||||
ui->dirList->expand(m_DirProxy->mapFromSource(currentDir()));
|
||||
|
||||
QObject::connect(ui->fileList->selectionModel(), &QItemSelectionModel::selectionChanged, this,
|
||||
&VirtualFileDialog::fileList_selectionChanged);
|
||||
}
|
||||
|
||||
VirtualFileDialog::~VirtualFileDialog()
|
||||
@@ -721,6 +724,14 @@ void VirtualFileDialog::on_fileList_clicked(const QModelIndex &index)
|
||||
ui->filename->setText(m_FileProxy->data(index, RemoteFileModel::FileNameRole).toString());
|
||||
}
|
||||
|
||||
void VirtualFileDialog::fileList_selectionChanged(const QItemSelection &selected,
|
||||
const QItemSelection &deselected)
|
||||
{
|
||||
QModelIndexList indices = selected.indexes();
|
||||
if(indices.count() >= 1)
|
||||
on_fileList_clicked(indices[0]);
|
||||
}
|
||||
|
||||
void VirtualFileDialog::on_fileList_keyPress(QKeyEvent *e)
|
||||
{
|
||||
// only process when enter is pressed
|
||||
|
||||
@@ -61,6 +61,9 @@ private slots:
|
||||
void on_forward_clicked();
|
||||
void on_upFolder_clicked();
|
||||
|
||||
// manual slots
|
||||
void fileList_selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
|
||||
|
||||
private:
|
||||
Ui::VirtualFileDialog *ui;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user