How To Load PYQT5 Designer UI File - PyQt5 GUI Thursdays #27

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

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

  • @Codemycom
    @Codemycom  3 года назад +1

    ▶️ Watch Entire PyQt5 GUI Thursdays Playlist ✅ Subscribe To My RUclips Channel:
    bit.ly/3sHT8dc bit.ly/2IGzvOR
    ▶️ See More At: ✅ Join My Facebook Group:
    Codemy.com bit.ly/2GFmOBz
    ▶️ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt!
    Take $30 off with coupon code: youtube1 bit.ly/2VC9WUN
    ▶️ Get The Code:
    bit.ly/394NQ3R

  • @rancidbeef582
    @rancidbeef582 2 года назад +4

    THIS is the info I've needed and never found an any other Qt Designer videos I've watched (which all seem to stop after "Hello World"). I kept wondering how you could ever go back and edit a UI (without doing it manually in the code), but not lose all your application code. Thanks!

    • @Codemycom
      @Codemycom  2 года назад +2

      Glad it was helpful!

  • @edgoodson3174
    @edgoodson3174 Год назад +13

    You can completely skip defining all those widgets. Those widgets are defined and NAMED inside of designer.
    You call them by their EXACT custom name inside of the python file.
    Such as
    self.MY_CUSTOM_NAME_Label.setText("Some Text or variable")

    • @andrewcameron2135
      @andrewcameron2135 Год назад

      Thank you! I thought I was loosing my mind as I could access the labels defined by their object name in Qt Designer

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

    Great Python PyQt5 tutorial! Thanks for these!
    Feed the algorithm! its free and it helps our favorite creators.

  • @saralagab4036
    @saralagab4036 Год назад

    I always struggled to covert and reconvert every time .....thanks for the video it was a significant help.

  • @danilodelucio
    @danilodelucio Год назад

    Maaaan this is really insane, I didn't know that was possible to work without converting to python file.
    You are amazing, thank you so much!!! 🙏

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

    Thanks a lot, I searched a ton of videos literally , Thanks a lot again, Liked & Subscribed 🙂

  • @ЕвгенийБалакин-я5р
    @ЕвгенийБалакин-я5р 2 года назад

    Suppose it have to the first tutorial in pyqt and only then other functions, since load ui is a fundamental of pyqt idea.
    Great tutorial, thanks a lot

  • @fjt020795
    @fjt020795 5 месяцев назад

    Sweet. Worked like a charm. How do I add my image that goes with QmainWindow Qpixmap?

  • @sia9664
    @sia9664 3 года назад

    Yohoooo a new video...!!! Pleaseee speed uploading the videos up ,, I really need this course ,pleasee !!

    • @Codemycom
      @Codemycom  3 года назад +1

      I upload videos every single weekday, I'm not going to go any faster. Pyqt5 videos are every Thursday...

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

    dude you saved my project, you're the best

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

      Glad you found what you needed!

  • @molode4ik-i5e
    @molode4ik-i5e 2 года назад +1

    Лысый, ваще красавчик респект таким как ты!

  • @樹倒了沒
    @樹倒了沒 2 года назад

    Thx a lot! This video really inspires me about how to start my homework!

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

      Glad you enjoyed it!

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

    I wish to learn this method before dev lots of pyqt apps.
    more clean for managing.

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

    Thanks for making these great videos. They are very helpful and instructive.

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

    Man....... you saved my life!

  • @07poojam1cse4
    @07poojam1cse4 Год назад

    I have plot a graph from excel using python code and i have created a gui using qt designer, how can i plot this graph inside qt graphics view of gui .Please suggest

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

    Love From India ❤️

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

    Do you have a video showing how to open a second window (a different .ui file) from your main py code you are showing in this video?

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

    That's precisely what I'm looking for.
    Thank you very much 😄

  • @aamano7439
    @aamano7439 8 месяцев назад

    Very helpful, thanks a ton!

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

    Hi,why i'm gettiing just a empty frame while i'm running that code?

  • @Angry_Cat00
    @Angry_Cat00 Год назад

    that , What I'm looking for ,thank you very much , but is there any way to convert python script to GUI ?

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

    Why are you using the self.findChild method? I can access the objects directly after uic.loadUi with "self.textEdit", "self.pushButton" and so on. No need for creating new variables and setting them with findChild. Maybe I am using a newer version?

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

    Hello. Trying to understand the connection between the UI file and the PY file. Is it correct that the UI is an XML that gets processed by the Qt package and Qt has a graphic render engine which consumes the XML and creates one form per UI?
    If yes, is there a manual of the XML commands?
    Thanks. Love this format.

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

    awesome vid! Thanks for breaking this down! made me love Python again! :-)

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

    hey so when i try to make the button clicked thing I get the error "argument 1 has unexpected type 'QPushButton'" but I imported all right so yeah idk what is the problem

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

    sir these tutorials are very nice !!!

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

      Thanks! Glad you like them!

  • @robodev6033
    @robodev6033 3 года назад

    Very helpful thank you so much I'm now following your every video.

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

    For some reason none of the images are showing in my application.

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

    Good video! If I want to change the GUI in Qt designer, should I upload the new version of file with ui extension, or everything will be updated automatically since we linked file "loadui" with Python code? So, if I am updating the GUI via Qt designer I merely need to click "save" button to make changes? Then I can run my app with these changes and all previously coded functionality will be working

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

      I mean, it depends on the changes you make in the designer whether or not the code will still work.

  • @vyacheslavboyko6114
    @vyacheslavboyko6114 Год назад

    nice! thats what I was looking for

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

    Awesome! Thanks!

  • @christressler3857
    @christressler3857 Год назад

    Thanks for the info! When I first did this (and couple times afterward actually, respecting folder structure) it worked. Not too bad.
    However, whenever I move the files to a different folder, it can't find the .ui file.
    Even in same folder.
    Instead of looking at relative folders like imports do, it instead relies on the folder that vscode is in (terminal at bottom) (haven't tried it with other ide's studios etc)
    Is there a cleaner way to tell the py file where to find the ui file?

    • @christressler3857
      @christressler3857 Год назад

      This can work:
      import os
      This is supposed to be,
      underscore underscore file underscore underscore
      But reads it as italicize, sorry it gets around it second time but not this first:
      __file__ will refer to the py file's actual directory path (AND name)
      But when using the following,
      path1 = os.path.dirname(__file__)
      this will just refer ONLY to the directory, and not include the file's filename.
      As long as both files are kept together in the same subfolder (or ui is in sub-subfolder from your py file), you can refer to the ui file using the above, as a string + ui file's name (or + sub-subfolder/uifile.ui etc)
      ie,
      fullpath1 = path1 + 'loadui.ui'
      This looks like an absolute path technique - it is an absolute path - but is initially relative using the py file's location stored as a variable, which THEN becomes absolute path.
      This might also be flexible enough to add portability for your programs (I'm not 100% sure it will work but I'm pretty sure:) ).

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

    Hello, John...
    Thank you so much about all your wonderfull gifts: These videoes...
    I have a problem running your program:
    TypeError: ('Wrong base class of toplevel widget', (, 'QDialog'))
    -----
    (I did exactly what you did)...

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

      Where that 'QDialog' coming from...?

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

    i got error
    TypeError: ('Wrong base class of toplevel widget', (, 'QDialog'))
    what can i do

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

    Hi sir, it really helps me out in our project, Thank you so much. Just 1 question Sir how can I convert the final code to .exe file?

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

      I use a module called auto-py-to-exe, it’s very easy to use

  • @laurentreynaud4404
    @laurentreynaud4404 3 года назад

    It's really easier! Thank you so much!!!

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

    For some reason it does not recognise the .clicked attribute. Any idea?

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

      You typed something wrong somewhere

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

    Amazing video! Thank you very much!

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

    Great video, thanks! What if your GUI contains multiple windows, where each window represented by its own ui file? How would you import to the .py file those multiple ui files?

    • @danilodelucio
      @danilodelucio Год назад

      I guess you have to do the same process for each ui file, and manipulate them with different python files as well (for exemple, if you have a menu.ui, creates a menu.py, if you have register.ui, creates register.py and so on), like the video. So probably you will have to create a "master" python file to call them (like a "main.py"), and makes the transition of each one.
      This is what I guess because Im learning too.

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

    Hi John,
    Thanks heaps for you video.
    I have a loadUi question relating to a Homepage.py and 2 other windows that load ui files:
    Like this:
    * HomePage.py (this has a button labelled Goto_Window1.py that loads Window1.ui, and another button Goto_Window2 that loads Window2.ui.
    * When clicking on the Goto_Windows1.py it opens the Window1 window (and hides itself ie: HomePage.py) OR when when clicking on the Goto_Windows2.py it opens the Window2 (and hides itself ie: HomePage.py)
    * Both Goto_WIndows1.py and Goto_WIndows2.py have a "HOME" button which takes you back to the Homepage.py
    Can you please help me get a rough template for such an app.

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

    Hi John, thank you for the great tutorial, I have one question, what i don't understand is if you have both py and ui files in qt creator why do you compleating coding in another editor, is there any problem completing both ui and py file in qt creator ??

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

      We don't have our py file in qt creator...

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

      @@Codemycom sir i i cant import uic module it says module not found im using pycharm and python 3.9.7 how do i can fix this?

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

      @@rahmadbisma Stop using pycharm

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

    I get 3 errors in PyCharm when i run my main.py file. They are 1. "Cannot find reference 'uic' in '__init__py'
    2. 'Unresolved reference loadUi'
    3. FileNotFoundError: [Errno 2] No such file or directory: '[file_name].ui, self
    Any idea how i can fix these errors?

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

      Why I would never use PyCharm

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

    Thank you so much.

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

    Is anyone else getting the error where the app crashes on startup with no error? What should I do?

  • @umuts5
    @umuts5 Год назад

    This comment may seem like an ordinary “thank you” but it really really means more than a “thank you” 😅🙏

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

    I did everything you explained using pycharm. But when I got to the part that we pass MainWindow to the second window. I got an error saying:
    Ui_SecondWindow.setupUi() missing 1 required positional argument: ‘MainWindow’
    But I actually did everything right

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

      You're using pycharm...no clue what pycharm is doing. I would never use that.

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

    Is there anywhere else that I can go research about this subject? This video works, but is alittle outdated. I used the QtDesigner, all blown out widgets and all, but trying to add them all inside those widgets I made is VERY challenging. Is there a place I can go? Does anyone know?

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

      Yes, further along in this playlist you'll see a solution.

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

      Id like a more ellaborate video with multiple different uses. Such as labels, inputs, notifications etc

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

      @@againstthegrain5914 Yes, of course I do all of that on the playlist.

  • @HugoCervantes-HARO
    @HugoCervantes-HARO 3 года назад

    Hey John, whenever I try "from PyQt5 import uic" I get an error: uic is underlined in red, so when I try to do the uic.loadUi("load.ui", self), I get several errors. As I have been investigating, this seems to be a pretty common issue for lots of people. I have checked my Python and PyQT5 installation/configuration and they seem to be fine. In fact, I can run the line "from PyQt5 import uic" from the Python console with no problem. It is only from within the scrip in PyCharm that I am getting this problem. YOUR HELP WILL BE HIGHLY APPRECIATED!

    • @Codemycom
      @Codemycom  3 года назад +3

      Don't use pycharm, it sucks.

    • @bardub1
      @bardub1 3 года назад +1

      Make sure the interpreter you configured in PyCharm is the same one which you installed all PyQT5 stuff

    • @Scanito
      @Scanito 3 года назад

      @@bardub1 Thanks! Yes, I have it working now...

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

    Thanks!

  • @thanushkarthik_tk
    @thanushkarthik_tk 3 года назад

    i have a resource.qrc file how do i import that

    • @Codemycom
      @Codemycom  3 года назад

      I don't have any videos on that

  • @kirpi2019
    @kirpi2019 3 года назад

    How to open a second window with this way?

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

    How to connect two different programs two ui files in two different py program

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

      This is one I am really struggling to figure out. The biggest struggle I am finding with PyQt is using popups or dialogs .

  • @jenilchudgar
    @jenilchudgar 3 года назад

    Upload Daily!

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

    Done thanks

  •  2 года назад

    Heisenberg ?

  • @XChat1
    @XChat1 3 месяца назад

    Teacher how open a live web server ?

    • @Codemycom
      @Codemycom  2 месяца назад

      I don't know what you mean by opening a live web server

  • @joimarbritogoncalvesfilho8336
    @joimarbritogoncalvesfilho8336 11 месяцев назад

    For some reson the window doesn't even show up here

    • @Codemycom
      @Codemycom  11 месяцев назад

      what did you do differently from the video?

  • @codeKeshav
    @codeKeshav 3 года назад

    John Elder, please make a video how can we control the second window from 1st using *LOAD UI* method.
    Please show how can we create responsive gui using PYQT5

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

    He will pin my comment.
    Will he?

  • @adrianhochla3664
    @adrianhochla3664 3 года назад

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

    thx

  • @miguelfigueiredo8031
    @miguelfigueiredo8031 Год назад

    Great Python PyQt5 tutorial! Thanks for these!
    Feed the algorithm! its free and it helps our favorite creators.