Master PyQt5 part 5: Moving data between windows

  Рет қаралды 20,805

Alan D Moore Codes

Alan D Moore Codes

Күн бұрын

Пікірлер: 38
@TillSeyfarth
@TillSeyfarth Жыл бұрын
"So there's a few ways we can do that". Love that approach! This series is such a gem.
3 жыл бұрын
Thank you so much!!! I am very grateful not only for your videos but your books have helped me a lot in this long path of programming in Python and PyQt.
@alandmoorecodes3585
@alandmoorecodes3585 3 жыл бұрын
Thanks!
@tungbrian4108
@tungbrian4108 2 жыл бұрын
What if passing value from sub module to main module
@hanzofuma
@hanzofuma 5 жыл бұрын
omg, thx so much you are a saver I struggled on how to move the data with QtCore.Signal or with Getters or with the constructor 2 hours and i m changing the code until i found your video
@alandmoorecodes3585
@alandmoorecodes3585 5 жыл бұрын
Awesome, glad it helped!
@chrisw5509
@chrisw5509 3 жыл бұрын
Fantastic video!! I used what you presented to create a button that pops up the Calendar Widget. My next steps which are to set the input field (widget) to sync with the calendar. Based on what you have provided in the video I should be able to accomplish that. I'm working my way through your videos. If you publish a book on PyQt6. I plan to buy it. I know you have a book on PyQt5 but want to wait for PyQt6 version.
@alandmoorecodes3585
@alandmoorecodes3585 3 жыл бұрын
Thanks! I looked at doing a PyQt6 version of the book earlier this year, but PyQt6 was still incomplete and the timing was just wrong. Been busy with another book project in the meantime, so it won't be forthcoming anytime too soon.
@kevinclary5167
@kevinclary5167 4 жыл бұрын
This was the exact tutorial I needed - thank you!
@alandmoorecodes3585
@alandmoorecodes3585 4 жыл бұрын
Awesome!
@Linuxovert
@Linuxovert 4 жыл бұрын
thanks Alan I will try to reuse this code in finishing my "Request Form for events" that i'm working on for the last couple of months.
@himanshupoddar1395
@himanshupoddar1395 3 жыл бұрын
9:33 Why using submitted signal? why not use submit button on click
@rimshayawar2290
@rimshayawar2290 3 жыл бұрын
If there are three classes A, B, and C, and if I want to pass data from A to C using the PushButton of B window to open the C window. How I can accomplish this task?
@michaelbowen8864
@michaelbowen8864 4 жыл бұрын
This was immensely helpful, thank you so much
@OficinadoArdito
@OficinadoArdito 2 жыл бұрын
man... not all heroes wear capes... thanks a LOT!
@alu9645
@alu9645 4 жыл бұрын
I would love to see your emacs tutorial and setting for python. That would be really great!
@alandmoorecodes3585
@alandmoorecodes3585 4 жыл бұрын
Thanks! My emacs config is a bit of a mess at the moment, but maybe I can clean it up a bit and share.
@catseye2500
@catseye2500 3 жыл бұрын
Mr. Moore, I am new to python programming and PYQt5. I watched your video and it was very good. I am having an issue though, where when I get user name from one class, when it is suppose to pass the name to the other class it displays nt instead of the name. I am at a loss on how to fix the issue.
@wandersonfelipe5588
@wandersonfelipe5588 3 жыл бұрын
Hey Alan, thanks so much for the content. I got to do what you did, and it works, but with a little error: I've got to send the information from the dialog window to the previous one, but when closing the dialog, I receive the message "TypeError: native Qt signal is not callable", then the program ends. What could I do to fix that?
@alandmoorecodes3585
@alandmoorecodes3585 3 жыл бұрын
Sounds like you've got some parentheses in the wrong place. Would need to see your code to be sure.
@wandersonfelipe5588
@wandersonfelipe5588 3 жыл бұрын
@@alandmoorecodes3585 how can I send you the entire code?
@wandersonfelipe5588
@wandersonfelipe5588 3 жыл бұрын
@@alandmoorecodes3585 I SOLVED IT. On the dialog box (the secundary window), I was using a QtWidgets.QDialog (which was making the program end when closed), then I replaced it by a QtWidgets.QWidget, and now it is working very well.
@adamkrysztopa6778
@adamkrysztopa6778 4 жыл бұрын
I like the way you explained that. I have a question: I was always creating 'sub window' as a child class of Main. After that I was referring to the Main window as e.g. in that case: self.parent().set_messages(...). I wondering if it is anyway non-optimal or non-elegant.
@alandmoorecodes3585
@alandmoorecodes3585 4 жыл бұрын
I think you can get away with stuff like this to a degree if you're consistent, but it does leave your classes tightly coupled. Your class has to assume that "parent" will always be an object with set_message(), for example. If for some reason that arrangement needs to change (for example, a form needs to become a child of a different widget, or become its own window), you're stuck. One aspect of elegant code is code that it solves the same problem in a consistent way. If you're communicating between child windows and the main window using direct calls, you can't use the same method to communicate between two windows or two sibling widgets. By sticking with signals and slots, you can communicate consistently between any objects in your app. To me that seems more elegant than mixing methods.
@mohamedyahya4014
@mohamedyahya4014 5 жыл бұрын
greate tutorial big thanks....... I got a question which is I have tow classes, emitting a signal from A to B when trying to print the signal object it gives me " " could you help me with why is that happening and how to read the object as a valid python data type so I can use it the required point, please?
@alandmoorecodes3585
@alandmoorecodes3585 5 жыл бұрын
That's what I would expect a signal object to show if I printed it. Not sure what you were expecting.
@someoneontheinternetuvenev6268
@someoneontheinternetuvenev6268 3 жыл бұрын
It would be great if you made a tutorial about QStackedWidget, sadly there really isn't any good tutorials for this and the ones that exist only show how to create multiple screens but don't show how to properly pass data between screens. (their method is basically just adding more and more widgets to the stack and none of them mention how to prevent the crazy memory leak that happens when you do that)
@alandmoorecodes3585
@alandmoorecodes3585 3 жыл бұрын
I'll see what I can do.
@DanArizona
@DanArizona 3 жыл бұрын
Hi Alan, great stuff. You put your signal/slot methods code into your dialog class. If Dialog was created using designer, would you recommend another file to contain the signal/slot methods? So two files for the two window GUIs (Main and Dialog), and two files to manage those GUIs.
@alandmoorecodes3585
@alandmoorecodes3585 3 жыл бұрын
Yes, remember that what comes out of designer is *not* your actual dialog widget, but an object which will build the GUI you designed on a widget class that you provide. See my video on "QtDesigner and PyQt5" for more detail on that. You'll need to create your own QWidget or QMainWindow subclass on which this builder class will build the UI, and in which you can define callbacks, signals, etc.
@barretoingridy
@barretoingridy 3 жыл бұрын
You're awesome!!!! Thank you =D
@GerardoBelot
@GerardoBelot 4 жыл бұрын
8:55 pass a signal from other win to main, just to remind me!!
@cinquecento1985
@cinquecento1985 2 жыл бұрын
thank you. little confusing, but I got it working.
@Factory400
@Factory400 4 жыл бұрын
Ordering the book now......I need to be swept off my feet :-)
@quleman
@quleman 4 жыл бұрын
Thank you
@richiericher9084
@richiericher9084 3 жыл бұрын
apperently PyQt5 doesn't have a lot of users. Otherwise your tutorials would have much more views since they are just excellent.
@alandmoorecodes3585
@alandmoorecodes3585 3 жыл бұрын
Thanks! This channel's growing fast, though, I can't really believe it.
Master PyQt5 part 6:  QMainWindow for easy apps
27:05
Alan D Moore Codes
Рет қаралды 12 М.
Master PyQt5 part 10: Make responsive GUIs with Threads
33:35
Alan D Moore Codes
Рет қаралды 19 М.
Почему Катар богатый? #shorts
0:45
Послезавтра
Рет қаралды 2 МЛН
🎈🎈🎈😲 #tiktok #shorts
0:28
Byungari 병아리언니
Рет қаралды 4,5 МЛН
Tkinter vs. PyQt:  Which Python GUI framework is right for you?
38:11
Alan D Moore Codes
Рет қаралды 65 М.
Master PyQt5 part 9: Style with Qt StyleSheets
14:59
Alan D Moore Codes
Рет қаралды 16 М.
Master PyQt5 part 11:  Application Infrastructure and Communication
33:51
Alan D Moore Codes
Рет қаралды 4,6 М.
Python Classes pt3:  5 signs that you need a class
31:33
Alan D Moore Codes
Рет қаралды 2,3 М.
Tkinter Basics 1: Setup, Widgets, and Geometry managers
26:00
Alan D Moore Codes
Рет қаралды 10 М.
Python Classes pt1:  5 Myths about Python Classes
18:39
Alan D Moore Codes
Рет қаралды 3,1 М.
Python Basics:  Handling Exceptions to keep your foot bullet-free
21:38
Alan D Moore Codes
Рет қаралды 985
Tkinter Basics 3: Control Variables
20:47
Alan D Moore Codes
Рет қаралды 3,9 М.
Tkinter Basics 10: Binding Events
23:35
Alan D Moore Codes
Рет қаралды 3,5 М.
Почему Катар богатый? #shorts
0:45
Послезавтра
Рет қаралды 2 МЛН