${SanitizedNameLower}_dialog.py 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. SPDX-License-Identifier: Apache-2.0 OR MIT
  5. """
  6. # -------------------------------------------------------------------------
  7. """${SanitizedCppName}\\editor\\scripts\\${SanitizedNameLower}_dialog.py
  8. Generated from O3DE PythonToolGem Template"""
  9. from PySide2.QtCore import Qt
  10. from PySide2.QtWidgets import QDialog, QLabel, QVBoxLayout
  11. class ${SanitizedCppName}Dialog(QDialog):
  12. def __init__(self, parent=None):
  13. super(${SanitizedCppName}Dialog, self).__init__(parent)
  14. self.mainLayout = QVBoxLayout(self)
  15. self.introLabel = QLabel("Put your cool stuff here!")
  16. self.mainLayout.addWidget(self.introLabel, 0, Qt.AlignCenter)
  17. self.helpText = str("For help getting started,"
  18. "visit the <a href=\"https://o3de.org/docs/tools-ui/\">UI Development</a> documentation<br/>"
  19. "or come ask a question in the <a href=\"https://discord.gg/R77Wss3kHe\">sig-ui-ux channel</a> on Discord")
  20. self.helpLabel = QLabel()
  21. self.helpLabel.setTextFormat(Qt.RichText)
  22. self.helpLabel.setText(self.helpText)
  23. self.helpLabel.setOpenExternalLinks(True)
  24. self.mainLayout.addWidget(self.helpLabel, 0, Qt.AlignCenter)
  25. self.setLayout(self.mainLayout)
  26. if __name__ == "__main__":
  27. # Create a new instance of the tool if launched from the Python Scripts window,
  28. # which allows for quick iteration without having to close/re-launch the Editor
  29. test_dialog = ${SanitizedCppName}Dialog()
  30. test_dialog.setWindowTitle("${SanitizedCppName}")
  31. test_dialog.show()
  32. test_dialog.adjustSize()