Merge branch 'development' of https://github.com/o3de/o3de into daimini/ReadOnly/TransformResetFix

This commit is contained in:
Danilo Aimini
2021-12-10 14:35:25 -08:00
2 changed files with 28 additions and 0 deletions
+25
View File
@@ -112,6 +112,31 @@ void EditorPreferencesDialog::showEvent(QShowEvent* event)
QDialog::showEvent(event);
}
void WidgetHandleKeyPressEvent(QWidget* widget, QKeyEvent* event)
{
// If the enter key is pressed during any text input, the dialog box will close
// making it inconvenient to do multiple edits. This routine captures the
// Key_Enter or Key_Return and clears the focus to give a visible cue that
// editing of that field has finished and then doesn't propogate it.
if (event->key() != Qt::Key::Key_Enter && event->key() != Qt::Key::Key_Return)
{
QApplication::sendEvent(widget, event);
}
else
{
if (QWidget* editWidget = QApplication::focusWidget())
{
editWidget->clearFocus();
}
}
}
void EditorPreferencesDialog::keyPressEvent(QKeyEvent* event)
{
WidgetHandleKeyPressEvent(this, event);
}
void EditorPreferencesDialog::OnTreeCurrentItemChanged()
{
QTreeWidgetItem* currentItem = ui->pageTree->currentItem();
+3
View File
@@ -19,6 +19,8 @@ namespace Ui
class EditorPreferencesTreeWidgetItem;
void WidgetHandleKeyPressEvent(QWidget* widget, QKeyEvent* event);
class EditorPreferencesDialog
: public QDialog
, public AzToolsFramework::IPropertyEditorNotify
@@ -36,6 +38,7 @@ public:
protected:
void showEvent(QShowEvent* event) override;
void keyPressEvent(QKeyEvent* event) override;
private:
void CreateImages();