FormImageBrowseEditWidget.cpp 944 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <FormImageBrowseEditWidget.h>
  9. #include <AzQtComponents/Components/StyledLineEdit.h>
  10. #include <QFileDialog>
  11. #include <QLineEdit>
  12. namespace O3DE::ProjectManager
  13. {
  14. FormImageBrowseEditWidget::FormImageBrowseEditWidget(const QString& labelText, const QString& valueText, QWidget* parent)
  15. : FormBrowseEditWidget(labelText, valueText, parent)
  16. {
  17. }
  18. void FormImageBrowseEditWidget::HandleBrowseButton()
  19. {
  20. QString file = QDir::toNativeSeparators(QFileDialog::getOpenFileName(
  21. this, tr("Select Image"), m_lineEdit->text(), tr("PNG (*.png)")));
  22. if (!file.isEmpty())
  23. {
  24. m_lineEdit->setText(file);
  25. }
  26. }
  27. } // namespace O3DE::ProjectManager