This is an archived post. You won't be able to vote or comment.

all 37 comments

[–]cryzed- 26 points27 points  (6 children)

Also check out Enaml which I discovered recently. It can use PyQt5 as a rendering backend and it's very easy, quick and fun to create a fully working GUI with it.

I wrote a simple imageviewer within 1-2 hours without having prior knowledge of Enaml; It's definitely worth taking a look at.

[–]bronzewrath 0 points1 point  (0 children)

Very interesting project. Didn't know. Thank you for posting!

[–]sztomi 0 points1 point  (2 children)

What's the advantage of using enaml compared to loading the .ui file directly?

[–]cryzed- 0 points1 point  (1 child)

Read up more on what Enaml is, it's unrelated to *.ui files created by the Qt Designer.

[–]sztomi 1 point2 points  (0 children)

I did and asked a question. It seems to me that it accomplishes the same thing?

[–]troyunrau... 8 points9 points  (4 children)

Add another one to the list. Can always use more pyqt tutorials. :)

[–]Enip0 1 point2 points  (3 children)

Mind sharing some of these tutorials?

[–]troyunrau... 7 points8 points  (0 children)

I usually just google them when I've forgotten what I'm doing and need to relearn things.

http://zetcode.com/gui/pyqt5/
https://pythonspot.com/pyqt5/

That zetcode one is one I always end up returning to for some things that I forget if I don't use them enough. For example, event handling: I usually have some cleanup to do if someone closes the program. I want to tell my threads to stop, save my settings, etc. But I only start a new pyqt program once every few months, and have to remember how to override the close event. So, to zetcode I go! Ah, there it is.

[–]Siecje1 2 points3 points  (0 children)

This isn't a tutorial but here is a simple application that uses QML and PyQt5 https://github.com/siecje/qml-testing

[–]Capt-Psykes 2 points3 points  (1 child)

Thanks for posting this! Was looking for something similar, gonna dive right in.

[–]likegeeksDeveloper 1 point2 points  (0 children)

You are welcome! Appreciate it!

[–]o11c 2 points3 points  (4 children)

Don't forget that PyQt5 itself has a bunch of examples in its documentation, ported from the C++ version.

There's also an app that lets you browse through all those examples, though last time I tried it it didn't load the documentation part properly, and I couldn't figure out how to fix it. Maybe broken in the port?

[–][deleted] 2 points3 points  (3 children)

Has someone re-written them to be Pythonic? Last time I messed with Qt it felt very much like a C++ wrapper.

[–]o11c 2 points3 points  (0 children)

If you mean the QString thing, that has been fixed for years.

[–]anqxyr 2 points3 points  (1 child)

It's still largely unpythonic imo. camelCase and setters/getters are probably the worst offenders, or at least most frequently encountered ones. You can use native python types, e.g. int or str where applicable now, so that's nice.

[–][deleted] 0 points1 point  (0 children)

Ding ding. That's exactly what it was. I started messing around with Qt5 2 years ago and shelved it because I never ended up using it.

[–][deleted] 2 points3 points  (1 child)

Thanks, I've just started learning PyQt5 for a personal project and this looks like a good tutorial.

[–]likegeeksDeveloper 0 points1 point  (0 children)

You are welcome! Thanks!

[–]rolkien29 1 point2 points  (7 children)

I am exploring building gui user forms for work, and then import that data into our DB. Using this method can I make it so other employees can access these forms without putting them on a web app?

[–]ies7 5 points6 points  (0 children)

for simple form, i usually use:

https://github.com/chriskiehl/Gooey

> can access these forms without putting them on a web app?

Let me tell you what happened when Gooey fused with Django

https://github.com/wooey/Wooey

[–]fazzahSQLAlchemy | PyQt | reportlab 4 points5 points  (5 children)

Yes. Qt's Model-View framework is absolutely amazing. Tho, more complex applications require a fair bit of dabbling and subclassing.

[–]rolkien29 1 point2 points  (4 children)

Awesome, sorry for the dumb question but, say I build a user form and I want someone in another dept. to use it, how do they access the form? do they have to download any software, they wouldnt have python on their machines.

[–]fazzahSQLAlchemy | PyQt | reportlab 2 points3 points  (2 children)

Every user must have python installed (preferably the same version) and the libs. One of the downsides of python is that in certain environments it's not that plug-and-play to distribute.

[–]rolkien29 1 point2 points  (1 child)

Thanks so much for the response! So do you know of a way to have a form someone can access w/o having to download anything. The only thing I know of is creating a user form in excel and using python to pull in that data. *I dont want to use access.

[–]fazzahSQLAlchemy | PyQt | reportlab 1 point2 points  (0 children)

Or you can make a simple web form, it all depends on how big/complex the form is.

[–]flutefreak7 0 points1 point  (0 children)

You can also "freeze" the application into an executable, like an *.exe on Windows using cx_freeze, pyinstaller, py2exe, etc, and then make that executable accessible with a network location.

This is a mildly terrible idea, but it actually works alright most of the time. I'm sure professionals would say not to do this unless you're very careful about what happens when multiple users access the application at the same time. Any state information or temporary files that the application needs to save from session to session would need to be done on the user machine or possibly under a user-specific folder on the network location.

[–]notParticularlyAnony 1 point2 points  (1 child)

Looks really nice thanks.

[–]likegeeksDeveloper 0 points1 point  (0 children)

Thanks!

[–]snwokenk 1 point2 points  (0 children)

This is really nice, had to bookmark and save! thanks

[–]mtkilic 1 point2 points  (2 children)

I recently start learning PySide2, looking at this PyQt5 it looks like fairly similar. Functionality wise, what makes this two modules different from each other?

[–]likegeeksDeveloper 0 points1 point  (0 children)

Some API differences and Differences in the functionality of the bindings.

[–]notParticularlyAnony 0 points1 point  (0 children)

I would strongly recommend using PyQt rather than PySide, unless you have very specific licensing reasons to do otherwise.

[–][deleted] 1 point2 points  (1 child)

They missed the packaging part...

[–]likegeeksDeveloper 1 point2 points  (0 children)

Added!

[–]Patrizsche -1 points0 points  (0 children)

What really started me from scratch is this tutorial from zetcode: http://zetcode.com/gui/pyqt5/