PyQt Images and qrc files

Поделиться
HTML-код
  • Опубликовано: 7 фев 2025

Комментарии • 8

  • @michealkinney6205
    @michealkinney6205 2 года назад +3

    I never knew you could just type CMD in the navigation dialog and it would resolve the path within CMD. That was a nonchalant way of learning something amazing. Thanks

  • @lohitsgameplaykalpx
    @lohitsgameplaykalpx Год назад +1

    thanks bruh!

  • @wasa01234567899
    @wasa01234567899 10 месяцев назад

    ty man i really have a big laugh at 9:02 with that trick hahaha

  • @yolosingh-nt4hv
    @yolosingh-nt4hv Год назад +1

    Thanks for sharing:)

  • @topografoenggeografoangola174
    @topografoenggeografoangola174 2 года назад +1

    Thanks u very much 👏

  • @euripedesfilho259
    @euripedesfilho259 2 года назад

    hi man thanks for all but i've a question in
    class
    class PySide6Ui():
    what you writing next?
    from PySide6.QtWidgets import QApplication, QWidget
    import subprocess
    import xml.etree.ElementTree as xml
    class PySide6Ui():???????????
    app QApplication([])
    from_class, base_class = PySide6Ui('controle.py').load()
    win = base_class()
    form = from_class()
    form.setupUi(win)
    win.show()
    app.show()

    • @MadPonyInteractive
      @MadPonyInteractive  2 года назад

      class PySide6Ui:
      """
      class to load .ui files to memory or
      convert them to .py files
      based on:
      stackoverflow.com/a/14195313/3781327
      usage:
      PySide6Ui('myUi.ui').toPy('myUi.py')
      PySide6Ui('myUi.ui').toPy()
      PySide6Ui('myUi.ui').load()
      """
      def __init__(self, ui_file):
      self.__ui_file = ui_file
      def __getUi(self):
      return subprocess.check_output(['pyside6-uic', self.__ui_file])
      def toPy(self, py_file=None):
      py_file = py_file or self.__ui_file.replace('.ui','.py')
      uipy = self.__getUi()
      try:
      # Write the file
      with open(py_file, 'w') as f:
      f.write(uipy.decode("utf-8"))
      return True
      except:
      return False
      def load(self):
      uipy = self.__getUi()
      parsed = xml.parse(self.__ui_file)
      widget_class = parsed.find('widget').get('class')
      form_class = parsed.find('class').text
      pyc = compile(uipy, '', 'exec')
      frame = {}
      exec(pyc, frame)
      form_class = frame['Ui_%s'%form_class]# Ui_MainWindow or Ui_Form
      base_class = eval('%s'%widget_class)# QMainWindow or QWidget
      return form_class, base_class