samples.py 1.6 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. #
  5. # SPDX-License-Identifier: Apache-2.0 OR MIT
  6. #
  7. #
  8. # -------------------------------------------------------------------------
  9. """! Thos module contains some lightweight PySide2 sample ui code.
  10. :file: < DCCsi >\\azpy\\shared\\ui\\samples.py
  11. :Status: Prototype
  12. :Version: 0.0.1
  13. """
  14. # -------------------------------------------------------------------------
  15. # standard imports
  16. from pathlib import Path
  17. import logging as _logging
  18. #PySide2 imports
  19. from PySide2 import QtWidgets
  20. # -------------------------------------------------------------------------
  21. # global scope
  22. _MODULENAME = 'azpy.shared.ui.samples'
  23. _LOGGER = _logging.getLogger(_MODULENAME)
  24. _LOGGER.debug('Initializing: {0}.'.format({_MODULENAME}))
  25. _MODULE_PATH = Path(__file__)
  26. _LOGGER.debug(f'_MODULE_PATH: {_MODULE_PATH.as_posix()}')
  27. # -------------------------------------------------------------------------
  28. # -------------------------------------------------------------------------
  29. class SampleUI(QtWidgets.QDialog):
  30. """Lightweight UI Test Class created a button"""
  31. def __init__(self, parent, title='Not Set'):
  32. super(SampleUI, self).__init__(parent)
  33. self.setWindowTitle(title)
  34. self.initUI()
  35. def initUI(self):
  36. mainLayout = QtWidgets.QHBoxLayout()
  37. testBtn = QtWidgets.QPushButton("I am just a Button man!")
  38. mainLayout.addWidget(testBtn)
  39. self.setLayout(mainLayout)
  40. # -------------------------------------------------------------------------