PyQt5 Tutorial - QMessageBox and Popup Windows

Поделиться
HTML-код
  • Опубликовано: 6 ноя 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.

  • @migueldomingos4570
    @migueldomingos4570 4 года назад +8

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

  • @fv4202x
    @fv4202x 5 лет назад +8

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

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

    This series is straight to the point thank you man

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

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

  • @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.

  • @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.

  • @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.

  • @barunbasnet
    @barunbasnet 5 лет назад +11

    Man, why did I find this channel so late.

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

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

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

    Thanks for your efforts Tim.. please keep it up

  • @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_()"

  • @satyaprasad317
    @satyaprasad317 4 года назад

    Man ! You Nailed Every details

  • @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

  • @qwerasdfhjkio
    @qwerasdfhjkio 5 лет назад +2

    Which one is better? this or kivy?

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

      I have used kivy and prefer this way over that

  • @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?

  • @blackhairedgoon8218
    @blackhairedgoon8218 4 года назад +1

    How do you get each button to do different things?

  • @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.

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

    Super helpful, many thks

  • @billelguechi5831
    @billelguechi5831 4 года назад

    Awesome Bro wish you success

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

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

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

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

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

    Thank you brother

  • @filiplaszczak7844
    @filiplaszczak7844 4 года назад

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

  • @mohammedk.h.f3016
    @mohammedk.h.f3016 Год назад

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

  • @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

  • @arsenkhachaturov8282
    @arsenkhachaturov8282 8 месяцев назад +1

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

  • @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 ?

  • @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?

  • @geraldgeraffe2209
    @geraldgeraffe2209 4 года назад +1

    I find this tutorial very inforamtive.

  • @anilkumarbhagat2206
    @anilkumarbhagat2206 4 года назад

    Awesome tutorials Tim! Keep it up :):)

  • @rowerziwx9920
    @rowerziwx9920 4 года назад

    You are awesome, solved my problem! thank you!

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

    Thanks : merci beaucoups pour les bonnes leçons.

  •  2 года назад

    How can i add line edit on message box?

  • @sonnyornido1643
    @sonnyornido1643 4 года назад +1

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

  • @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

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

    Brilliant Thankyou

  • @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

  • @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..

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

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

  • @pycomvision3089
    @pycomvision3089 4 года назад

    Thank you Sir

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

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

  • @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...

  • @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.

  • @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.

  • @louishammer2296
    @louishammer2296 5 лет назад

    Thank You great video

  • @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

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

    thanks to help me :)

  • @TimothyLopez-p4l
    @TimothyLopez-p4l Месяц назад

    1763 Feest Bridge

  • @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...

  • @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)

  • @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

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

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

  • @ЮзефЗаборовский
    @ЮзефЗаборовский 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 :(

  • @sankethb.k642
    @sankethb.k642 5 лет назад

    Thank you

  • @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?

  • @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

  • @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

  • @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...

  • @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'

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

    "|" -> pipe symbol

  • @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

  • @sainco3036
    @sainco3036 5 лет назад

    thanks.

  • @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.

  • @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

  • @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.

  • @OtherRath
    @OtherRath 4 года назад +1

    PyQt5 is much better than tkinter, man.

  • @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.

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

    python has stopped working ._.

  • @creationduwal
    @creationduwal 4 года назад +1

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

  • @KajokaTanzania
    @KajokaTanzania 5 лет назад

    or even your email

  • @안토니오-u7j
    @안토니오-u7j 3 месяца назад

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

  • @ps_davi
    @ps_davi 4 года назад +1

    not is a meme seriously

  • @РоманНейман-щ2ц
    @РоманНейман-щ2ц 4 года назад

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