QtDesigner tutorial for Complete Beginners - Overview of PyQt5 QtDesigner + 3 Ways to Load UI Files

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ต.ค. 2024

ความคิดเห็น • 43

  • @josys363
    @josys363 2 ปีที่แล้ว +8

    As someone who has worked with PyQt for a while now, the load UI method is NOT the way to go. The best way to do this is to convert the UI file to a PY file, and then import that into another python file. the load UI method has overhead which when working with a larger application can be noticed, and also you have to have your UI files bundled in your application in order for it to even function. If you just import the generated py file created from the ui file you can put the ui files anywhere you want. This also has some cross platform implications. Also most IDEs are able to parse python files on the fly. If you import the generated py file then your IDE will have access to all the objects you have added to your interface. Autocomplete of text in your IDE should work just like any other variable or object. Again, loading the UI is not the best way to go and i don't even know why they have that ability built in. I'm sure there is a reason, but again I don't recommend it.

    • @cjhoffmn
      @cjhoffmn ปีที่แล้ว

      I’ve been wondering about this exact issue. I find it really useful during my development to use the loadUi so if I have Ui changes I can integrate them using the editor as I find that more intuitive than writing code for Ui changes. However, I worried about the exact issue you point out here. For me I’m likely to use it for dev purposes with loadUI then convert to .py when production ready. Of course I may just get tired of refactoring for the different way of getting the imports etc and may ultimately just code the changes directly. Seems to me they should create an import function from .py so you can use the editor again if you’ve made changes to the .py….

    • @josys363
      @josys363 ปีที่แล้ว +2

      @@cjhoffmn It literally takes two seconds to convert a ui file to a python file using UIC from a command line. Also you can integrate the commands into the ide you are using. Just do this from the beginning and in no way change the generated python file. There is never a good reason to do so.

    • @cjhoffmn
      @cjhoffmn ปีที่แล้ว

      @@josys363 ahh - so you’re saying - change the UI as needed - re-save it and convert the new one and done. That makes sense of course. It feels more connected to not have to take that extra step - but makes sense that it’s a one line step anyway.

    • @cjhoffmn
      @cjhoffmn ปีที่แล้ว

      @@josys363 thx for the comment and the follow up!

    • @josys363
      @josys363 ปีที่แล้ว

      @@cjhoffmn That’s exactly what I’m saying.

  • @عابثالأخير-ز9ي
    @عابثالأخير-ز9ي ปีที่แล้ว +2

    Many thanks for this tutorial, it was pretty helpful. 👏🏻
    Please add more tutorials 🌹

  • @AdamGerald-s7s
    @AdamGerald-s7s 11 วันที่ผ่านมา

    Lewis Amy Jones Betty Thomas Michael

  • @cristianoltfs
    @cristianoltfs 28 วันที่ผ่านมา

    Amazing... Thank you so much!

  • @JoshBetty-e8c
    @JoshBetty-e8c 18 วันที่ผ่านมา

    Lee Larry Perez Helen Rodriguez Brian

  • @midohany9
    @midohany9 หลายเดือนก่อน

    Perfect!
    I've been looking for a video like that for a while that brings all the ways together. I was confused from multiple separate tutorials but this one shows the difference clear between them & also your explanation is very simple & clear. Thanks
    (one more thing; the point that we can refer to widgets classes directly from py file without using findChild() for each one is really helpful!)

  • @avcom11
    @avcom11 10 หลายเดือนก่อน

    I receive this error when I try to convert the .ui file to .py file (first method): pyuic5 : The term 'pyuic5' is not recognized as the name of a cmdlet, function, script
    file, or operable program. Check the spelling of the name, or if a path was included, v
    erify that the path is correct and try again.

  • @wallypizza323
    @wallypizza323 หลายเดือนก่อน

    You are brilliant and I can't thank you enough for making these videos!

  • @EunjonGloksrati
    @EunjonGloksrati 5 หลายเดือนก่อน

    your explanation is simple and clear. now I understand why most of tutorial using method #2. thanks!

  • @againstthegrain5914
    @againstthegrain5914 2 ปีที่แล้ว

    Hi thanks for the video! It helped me! I like method #2! lol Im alittle stuck with the resources file. when coding ' loadUi('main.ui', self) ' It works for me np. But when I try following the instructions in the documentation page, where it says ' loadUi('main.ui', resource_suffix='resource.qrc', self) ' I get a SyntaxError: positional argument follows keyword argument. VSCode doesnt like me using 'self' at the end like that. But If I remove it, with the resource_suffix added, my UI doesnt show up like its suppose too. When I remove it and just keep 'self' and the main.ui string, everything works.. Any suggestions or ideas how to solve that? Thanks again!!

  • @Omar_Ibra
    @Omar_Ibra 2 ปีที่แล้ว

    Great qtdesigner content ,If you can speak arabic , arabic content will be great.

  • @hibachabane3147
    @hibachabane3147 ปีที่แล้ว

    J’ai un Error :DLL load failed :le module spécifié est introuvable
    Aide moi 😢

  • @wesleygfx5540
    @wesleygfx5540 9 หลายเดือนก่อน

    First Tutorial came across explaining in Detail, Thankyou!

  • @ezadeenalqubati3815
    @ezadeenalqubati3815 ปีที่แล้ว

    Thanks alot
    my problem is solve😊

  • @jerryscde1
    @jerryscde1 ปีที่แล้ว

    Thanks very much I have learned a lot from your tutorials

  • @يامنالاسطوره-غ9خ
    @يامنالاسطوره-غ9خ 2 ปีที่แล้ว

    If i changed the name of the button from PushButton to another name in the design file, why not take the new name for it in the Python file

    • @medregio
      @medregio 2 ปีที่แล้ว

      Because in your *.py file you used the original variable PushButton name of the *.ui file rather than the new name you gave in the design file afer having generating the *.ui file. Having this in mind, you should keep your names in design (i.e. wich will be variables for your *.py file) after you have coded them in python. The best way is to change the default names given by Qt designer BEFORE you generate the *.ui file that will be loaded in *.py file. Hope I was clear.

  • @ГерхардШрёдер-э9н
    @ГерхардШрёдер-э9н ปีที่แล้ว

    Даже без знания английского языка в этом видео я нашел ответ, который не мог найти в русском сегменте интернета. Все интуитивно понятно. Лайк и комментарий в поддержку канала!👍

  • @dipanjanjana9518
    @dipanjanjana9518 ปีที่แล้ว

    This is what I was looking for. Thanks.

  • @digitalmachine0101
    @digitalmachine0101 4 หลายเดือนก่อน

    good information

  • @majdsaadeh6480
    @majdsaadeh6480 2 ปีที่แล้ว

    Helped a lot. Thanks.

  • @arthurdeka
    @arthurdeka 2 ปีที่แล้ว

    you saved me! thank you

    • @codefirstwithhala
      @codefirstwithhala  2 ปีที่แล้ว +1

      Thanks for the comment! You're absolutely welcome :)

  • @kokebdese4787
    @kokebdese4787 2 ปีที่แล้ว

    Helpful, Thanks Hala

  • @its_code
    @its_code 2 ปีที่แล้ว

    I love 💕 this tool. Very helpful 😍

    • @codefirstwithhala
      @codefirstwithhala  2 ปีที่แล้ว +1

      true, it's such a great tool 😊

    • @its_code
      @its_code 2 ปีที่แล้ว

      @@codefirstwithhala is there any tool for kivy library like this... Plizzz make a full tutorial on kivy android development...😃

    • @codefirstwithhala
      @codefirstwithhala  2 ปีที่แล้ว +1

      Unfortunately there isn't something similar for Kivy :( However, don't worry, expect some Kivy stuff around mid-June ;)

    • @its_code
      @its_code 2 ปีที่แล้ว

      @@codefirstwithhala thanks 👍💕