PyQt5 Tutorial - QMessageBox and Popup Windows

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

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

  • @mindcreativestudios4709
    @mindcreativestudios4709 4 ปีที่แล้ว +7

    I know that I am late the " | " is called a "pipe" --- thanks for the videos. New to Python and Qt -- learning a lot here. Thank you.

  • @mattwest5695
    @mattwest5695 4 ปีที่แล้ว +37

    In case this is useful to anyone else: I was having a hard time getting the Qmessagebox to center on the main window (rather than the screen.) I fixed this by inheriting from MainWindow when defining msg like so:
    msg = QMessageBox(MainWindow)

    • @joshua6765
      @joshua6765 3 ปีที่แล้ว +1

      wow good thank you.

    • @mirimomekiku7141
      @mirimomekiku7141 3 ปีที่แล้ว +1

      Thankyou so much for this, this is what I needed lmao.

  • @fv4202x
    @fv4202x 5 ปีที่แล้ว +8

    8:50 you can close all with one click. click right to window icon bottom and select close all.

  • @migueldomingos4570
    @migueldomingos4570 4 ปีที่แล้ว +8

    Very good tutorial on PyQt5.This playlist is helping me a lot.

  • @barunbasnet
    @barunbasnet 5 ปีที่แล้ว +11

    Man, why did I find this channel so late.

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

    this is the best tutorial yet I have ever seen. So thanks
    TIA

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

    This series is straight to the point thank you man

  • @shukurullomakhammadjanov1972
    @shukurullomakhammadjanov1972 4 ปีที่แล้ว

    Man you are the coolest guy I have ever seen Thanks a lot. It is much easier to comprehend python with your videos.

  • @AaronEstebanSEO
    @AaronEstebanSEO 3 ปีที่แล้ว +17

    You're really NOT supposed to edit the main .UI file that's generated by QT Designer. From my simple research, it's best to just import the .UI file into a new .py file instead of converting the .ui file into a .py file because you will need to continue editing the ui file or making changes to it and you don't want to keep exporting and overwriting it each time that you convert it. So the real way is to continue on by importing it instead. Then you'll be able to keep editing the main .ui file without making any changes to the main py file that you're using to import the .ui file.

  • @odurolewis
    @odurolewis 3 ปีที่แล้ว

    Wonderful video. your tutorials are just what I need to understand how PyQt5 works. kudos

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

    Thank you for the very gud Tutorial! and the show_popup function you don't need a variable there only "msg.exec_()"

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

    Thanks for your efforts Tim.. please keep it up

  • @satyaprasad317
    @satyaprasad317 4 ปีที่แล้ว

    Man ! You Nailed Every details

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

    Super helpful, many thks

  • @mohammedk.h.f3016
    @mohammedk.h.f3016 ปีที่แล้ว

    Thanks. I wish you add LCD and how to display values on it.

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

    Thank you brother

  • @user-cj3yu9nv1u
    @user-cj3yu9nv1u 5 ปีที่แล้ว +7

    If we change the ui file and overwrite the python file again, won't all of your changes and methods disappear?
    Edit: How do we fix this issue? Can we inherit the class Ui_MainWindow in another py file? That is what I used to do in PyQt4
    Thanks in advance.

  • @billelguechi5831
    @billelguechi5831 4 ปีที่แล้ว

    Awesome Bro wish you success

  • @pagongturtle2217
    @pagongturtle2217 5 ปีที่แล้ว

    Great job Tim!
    You earned a new subscriber and I will share your channel to my friends for more subscriptions.
    Looking forward for more videos.
    Thanks

  • @benjaminlebari7694
    @benjaminlebari7694 3 ปีที่แล้ว

    thank you for this. it's very detailed and informative.

  • @sonnyornido1643
    @sonnyornido1643 4 ปีที่แล้ว +1

    I hope that this tutorial to have some continuation...
    so sad that it's just 8 episodes

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

    The return value from msg.exec_() would be the state of the button right (OK button in this case)? How else would you know if the user clicked ok or closed the window

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

    8:10 how come when you are calling the function self.popup_button you don't need to use a lambda function in order to pass an extra parameter (the button itself) like you showed in a previous video?

  • @anilkumarbhagat2206
    @anilkumarbhagat2206 4 ปีที่แล้ว

    Awesome tutorials Tim! Keep it up :):)

  • @geraldgeraffe2209
    @geraldgeraffe2209 4 ปีที่แล้ว +1

    I find this tutorial very inforamtive.

  • @AliTwaij
    @AliTwaij 3 ปีที่แล้ว

    Brilliant Thankyou

  • @rowerziwx9920
    @rowerziwx9920 4 ปีที่แล้ว

    You are awesome, solved my problem! thank you!

  • @barikam2m891
    @barikam2m891 3 ปีที่แล้ว

    Thanks : merci beaucoups pour les bonnes leçons.

  • @Sergey_Latyshev
    @Sergey_Latyshev 5 ปีที่แล้ว +1

    Why don't button match their position from msg.setStandardButtons? You typed "Cancel Retry Ignore", but in the window there are "Retry Ignore Cancel" (and "Ignore Cancel Retry" on my computer). Your "Show Details" button appears as the 3rd, mine does as the 1st.
    Also, my Cancel button has its letter C underlined and can be pressed with C key, and the program prints "&Cancel" in the terminal when I press it.

  • @arsenkhachaturov8282
    @arsenkhachaturov8282 8 หลายเดือนก่อน +1

    How do I close a message box without the whole application crushing? Pyqt5

  • @louishammer2296
    @louishammer2296 5 ปีที่แล้ว

    Thank You great video

  • @blackhairedgoon8218
    @blackhairedgoon8218 4 ปีที่แล้ว +1

    How do you get each button to do different things?

  • @pycomvision3089
    @pycomvision3089 4 ปีที่แล้ว

    Thank you Sir

  • @TimothyLopez-p4l
    @TimothyLopez-p4l หลายเดือนก่อน

    1763 Feest Bridge

  • @marsellinus559
    @marsellinus559 3 ปีที่แล้ว

    thanks to help me :)

  • @weidylan5356
    @weidylan5356 4 ปีที่แล้ว +1

    After I translate the ui file into python, and I write code in it, but how can I transform back to an ui file where I can still edit it with all my code saved?

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

    Which one is better? this or kivy?

    • @adityask277
      @adityask277 3 ปีที่แล้ว

      I have used kivy and prefer this way over that

  • @creationduwal
    @creationduwal 4 ปีที่แล้ว +1

    he is creating each video of the tutorial series in a totally new place. I wonder how rich he is.

  • @strikerguimaraes
    @strikerguimaraes 5 ปีที่แล้ว

    I wanna thank you for the videos They are very useful for community I was wondering if you are going to make video about tts and stt..

  • @anshusood2522
    @anshusood2522 4 ปีที่แล้ว

    Very nice 👌👌

  • @farhanfaisal6620
    @farhanfaisal6620 5 ปีที่แล้ว

    Hi Tim I Love Your Videos I Just Wanted To Say Please Make Roulette Game In Python In A Live Stream

  • @averageengineeer
    @averageengineeer 5 ปีที่แล้ว

    Damn i was too late to subscribe to your channel. I hope it gathers steam in the coming days. Keep the videos coming and all the best

  • @joshua6765
    @joshua6765 3 ปีที่แล้ว

    I use VScode. and 3:42 when i type 'cri...' a context menu? appears. And it recommends 'critical' not 'Critical' but when i compileed? the program. it didn't work. When 'Critical' then worked

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

    How can i create an Output code in pyqt5 ? I need to see the output codes in interface after pack to .exe

  • @sankethb.k642
    @sankethb.k642 5 ปีที่แล้ว

    Thank you

  • @filiplaszczak7844
    @filiplaszczak7844 4 ปีที่แล้ว

    Can i use tkinter messagebox instead pyqt5? In tkinter we can 100x easier show a warning or error box.

  • @Lucasbc
    @Lucasbc 3 ปีที่แล้ว

    Can we make like a bigger popup? Like a menu or smth?

  • @javiporras3396
    @javiporras3396 4 ปีที่แล้ว +1

    Hi Tim,
    I am trying to do a small software for ecommerce in which will have inventory, picking, packing, despatch, users...would you recommend PyQt5 for this or have any other suggestions?
    Great content, keep it up (Y) !

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

      pls tell me which path you would recommend now after 2 years as you may have experience now

  • @diversaoaocubo
    @diversaoaocubo 3 ปีที่แล้ว

    I have this problem: "module 'PyQt5.QtGui' has no attribute 'QMessageBox'"! Can someone help me?

  •  2 ปีที่แล้ว

    How can i add line edit on message box?

  • @vaibhavkrkm
    @vaibhavkrkm 4 ปีที่แล้ว +1

    Nice tutorial, I think, we can leave x variable also right, if exec_() shows the pop-up, cuz I don't think we need to store any data in x🤔

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

      actually the _exec() method returns an int code that shows which button was pressed .. so for each button type there is an unique code. so the x variable is there to save the returned code.

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

      @@deiaabdullah2008 yes, but I don't think we need to use that data...

  • @hakunamatata1681
    @hakunamatata1681 3 ปีที่แล้ว

    I'm having a problem where my window closes every time i click the button what should i do

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

    is PyQt5 easier that kivy ? and if i want to get values and run operators on it with is easier to use ?

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

    "|" -> pipe symbol

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

    Why when I create a simple message box, run the program, box shows up and then I pressing OK and... whole program crashing. Code is similar that yours...

  • @sainco3036
    @sainco3036 5 ปีที่แล้ว

    thanks.

  • @mauve2643
    @mauve2643 4 ปีที่แล้ว

    I'm wondering how to use the exit button to exit the message box
    any answers please???

  • @suganthiganesh6101
    @suganthiganesh6101 4 ปีที่แล้ว

    Hi,
    Is it possible to add the rows and column dynamically ? Can you Please make a video about QTableView. especially for matrix operation like multiplication

  • @muthkhodsitadevi7852
    @muthkhodsitadevi7852 4 ปีที่แล้ว

    How do I change the position of buttons inside message pop-up box? I tried searching for it online but to no avail. Can anyone help?

  • @sreejasitcvellanad
    @sreejasitcvellanad 4 ปีที่แล้ว

    I did this and have small problem, when I click cancel in the popup window, the python shell prints "&Cancel", in the other buttons no problems. Thanks in advance. I have subscribed your channel

    • @MiskoKatua
      @MiskoKatua 4 ปีที่แล้ว

      The ampersand (&) serves as the shortcut symbol; so in the UI the first C of Cancel should be underlined.

  • @santiagotorres6929
    @santiagotorres6929 4 ปีที่แล้ว +1

    Hi, i ran into the following issue when i tried to import the lib: "No name 'QMessageBox' in module 'PyQt5.QtWidgets' "
    Does anyone know how to fix it?

    • @BoDuke73
      @BoDuke73 4 ปีที่แล้ว

      I got the same thing but then noticed a syntax error in my typing. You get that error when you paste in this line?
      from PyQt5.QtWidgets import QMessageBox

    • @santiagotorres6929
      @santiagotorres6929 4 ปีที่แล้ว

      @@BoDuke73 i still get the same error, i don't know if it involves something with the version...

  • @ЮзефЗаборовский
    @ЮзефЗаборовский 2 ปีที่แล้ว

    Can sb explain how popup_button function "understands" where to take data for parametr clicked_button?
    because we don't put any parametrs when connecting this function
    msg.buttonClicked.connect(self.popup_button)
    I understand that we can't use brackets and if we like to pass parameters we should use lambda instead.
    But here we just do nothing and parametr is passed inside popup_button function...
    Confused...

    • @ЮзефЗаборовский
      @ЮзефЗаборовский 2 ปีที่แล้ว

      if this i is passed "by default" as extra parameter when you click the button, then where can I read about this in documentation?

    • @ЮзефЗаборовский
      @ЮзефЗаборовский 2 ปีที่แล้ว

      And also btw popup_button(self, i) doesn't work properly with detailed text button - no reaction on click :(

  • @ashrafalzoubi6470
    @ashrafalzoubi6470 4 ปีที่แล้ว

    i copy the same text you out in this tutorial but an error message pop up says " line 10 in from PyQt5.QWidgets import QMessageBox "
    moduleNotFoundError: No module named 'PyQtf.QWidgets'

  • @ljq7299
    @ljq7299 4 ปีที่แล้ว

    Hi Tim, I was doing a login system and I want to pop up this Qmessage if the email is not matched. The function does work, but for how many times (let's say 4) i click login button with wrong email, the function seems to remember it and once i successfully logged in, the message box will show that many times (in this case 4).
    Is there any way to solve this issue?
    Thanks

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

      You should store how many times the user failed in a variable(or in a file if you want the value to be kept when you run the program any time)

  • @Roy-wk5gy
    @Roy-wk5gy 4 ปีที่แล้ว

    Is there a site where I can view all the commands that Tim is explaining to us? I googled it but I couldn't find anything

    • @muthkhodsitadevi7852
      @muthkhodsitadevi7852 4 ปีที่แล้ว

      This could be of some help: doc.qt.io/qt-5/qmessagebox.html

  • @tankosama3845
    @tankosama3845 5 ปีที่แล้ว

    Hi Tim can i build professional android app with out java just on python

    • @MrEloska
      @MrEloska 5 ปีที่แล้ว

      Try kivy, but python is not the best language for android apps

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

    I like how he completely ignores the warning message to not edit the file :D
    He is going to cause a lot of people shoot themselves in the foot when they accidentally overwrite their work.

  • @r2verse2025
    @r2verse2025 5 ปีที่แล้ว

    ERROR: Could not find a version that satisfies the requirement pyqt5-tools (from versions: none)
    ERROR: No matching distribution found for pyqt5-tools
    this is the error i am getting, when i tried to install this.
    I am using Ubuntu 18.04, python 3.7.3, and pip 19.1.1
    i also tried to search about this problem, i came to know that, this pyqt5-tools only supports windows not for linux.
    Can u suggest me some other. what should i do? i am not going to windows for this. any help will be useful.

    • @celtix2244
      @celtix2244 5 ปีที่แล้ว

      It's a bit different for Ubuntu:
      gist.github.com/ujjwal96/1dcd57542bdaf3c9d1b0dd526ccd44ff

  • @kosta518
    @kosta518 4 ปีที่แล้ว

    anyone having error with self.button.clicked.connect(show_popup), stating show_popup not defined? I have the method verbatim to this tutorial, but receiving error.

    • @kosta518
      @kosta518 4 ปีที่แล้ว

      got it to work with self.button.clicked.connect(self.show_popup). couldn't just pass show_popup as argument to connect.

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

    Thanks for this video. However, it does not seem practical for this reason, especially for Questions. Wherever an issue arises (e.g. "file not found"), need to resolve that issue in a unique way Where the issue arises, not in Dialog code. Issues found elsewhere (e.g. "name is missing") have other reactions. I've seen in other languages something like "If reply == 'yes' do A, else do B". The reply is returned from Dialog box code. The reactions A and B may be different with each issue. We shouldn't need separate Dialog boxes for each issue. Does PyQt5 not have the return value or does your video not include this for some reason?

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

      Here is sample code to use at point of issue: reply = QMessageBox.question(self, 'title', 'issue question? ',QMessageBox.Yes, QMessageBox.Cancel,)
      then on next line: if reply == Qtw.QMessageBox.Yes: do A. EDIT: This does not use the show_popup function in your video.

  • @OtherRath
    @OtherRath 4 ปีที่แล้ว +1

    PyQt5 is much better than tkinter, man.

  • @matthiasurankar6354
    @matthiasurankar6354 4 ปีที่แล้ว

    give ya a 2 thumber.
    Do you have / or know how to load images from url? I cant seem to find a straight forward way to do so in PyQt5. I can do it with tkinter but I want to user PyQt5 to build my interface. I really want to stick with pyqt if at all possible.

  • @안토니오-u7j
    @안토니오-u7j 3 หลายเดือนก่อน

    sorry..자막이 없습니다.ㅠㅠ

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

    python has stopped working ._.

  • @KajokaTanzania
    @KajokaTanzania 5 ปีที่แล้ว

    or even your email

  • @ps_davi
    @ps_davi 4 ปีที่แล้ว +1

    not is a meme seriously

  • @РоманНейман-щ2ц
    @РоманНейман-щ2ц 4 ปีที่แล้ว

    Говорил бы, ты по русски - цены бы тебе не было👍🏻