From ea5e88b99d553b1637dfd16839376dc483dccdd1 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 12 Feb 2018 18:46:11 +0000 Subject: [PATCH] Use current item instead of last selected item in onclick handler --- qrenderdoc/Windows/Dialogs/EnvironmentEditor.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/qrenderdoc/Windows/Dialogs/EnvironmentEditor.cpp b/qrenderdoc/Windows/Dialogs/EnvironmentEditor.cpp index f352ff346..9d433ce3b 100644 --- a/qrenderdoc/Windows/Dialogs/EnvironmentEditor.cpp +++ b/qrenderdoc/Windows/Dialogs/EnvironmentEditor.cpp @@ -122,12 +122,10 @@ void EnvironmentEditor::on_variables_keyPress(QKeyEvent *event) void EnvironmentEditor::on_variables_currentItemChanged(RDTreeWidgetItem *current, RDTreeWidgetItem *previous) { - RDTreeWidgetItem *sel = ui->variables->selectedItem(); - - if(!sel) + if(!current) return; - EnvironmentModification mod = sel->tag().value(); + EnvironmentModification mod = current->tag().value(); if(!mod.value.empty()) {