You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.2 KiB
C++
42 lines
1.2 KiB
C++
/*
|
|
* Copyright (c) Contributors to the Open 3D Engine Project.
|
|
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
|
*
|
|
*/
|
|
|
|
#include <FormBrowseEditWidget.h>
|
|
|
|
#include <QPushButton>
|
|
#include <QHBoxLayout>
|
|
#include <QKeyEvent>
|
|
|
|
namespace O3DE::ProjectManager
|
|
{
|
|
FormBrowseEditWidget::FormBrowseEditWidget(const QString& labelText, const QString& valueText, QWidget* parent)
|
|
: FormLineEditWidget(labelText, valueText, parent)
|
|
{
|
|
setObjectName("formBrowseEditWidget");
|
|
|
|
QPushButton* browseButton = new QPushButton(this);
|
|
connect(browseButton, &QPushButton::pressed, this, &FormBrowseEditWidget::HandleBrowseButton);
|
|
m_frameLayout->addWidget(browseButton);
|
|
}
|
|
|
|
FormBrowseEditWidget::FormBrowseEditWidget(const QString& labelText, QWidget* parent)
|
|
: FormBrowseEditWidget(labelText, "", parent)
|
|
{
|
|
}
|
|
|
|
void FormBrowseEditWidget::keyPressEvent(QKeyEvent* event)
|
|
{
|
|
int key = event->key();
|
|
if (key == Qt::Key_Return || key == Qt::Key_Enter)
|
|
{
|
|
HandleBrowseButton();
|
|
}
|
|
}
|
|
|
|
} // namespace O3DE::ProjectManager
|