15

I’m developing a fairly sophisticated desktop app in Python with PyQt5 as the widget set. Because my partner insists that all the kids these days love Python.

Piss on Python. And that goes double for PyQt5.

I’m on the absolute hardest section of the app. It’s a fairly complex import of data from PDF reports. There are so many different parts that I decided to go with a wizard.

So, I built a QWizard in Qt Designer. It generates a C++ .ui file, but you just truck it over to the command line and run this pyuic5 command, and it converts to a handy dandy Python class. Woo. You can subclass it and consume it from your Python script.

Sounded SO MUCH EASIER than writing the wizard from scratch. But OH NO. I need to do custom validation on my custom text control at every stage to control when the Next and Finish buttons are enabled, which means I gotta overwrite some damn event.

But I can’t. Because I can’t subclass the individual pages. Because they’re part of the same damn file and the wizard offers no access to them.

I’m almost certain that I’m going to have to completely redesign the wizard so that it’s pages are in separate files, which means I have to recode the bitch as well.

The cherry on top is that there’s zero documentation for this specific thing. None. No QWizard documentation exists for PyQt5 (if there is, they’re doing a damn good job of hiding it), so I have to read the documentation for PyQt4. Not the same animal. Close, but different. Even with the differences aside, this documentation is minimal and useless. “We’re going to tell you in very general terms what you should do, but we’ll give you zero idea how to do it. And we know the very common code method you’ll want to try first won’t work.”

And getting at this stuff when you do it in Qt Designer is WAY different. And all that documentation is in C++. Because apparently you HAVE to speak C++ if you want any real info about PyQt. Because that’s perfectly reasonable, right?

So, now I’ve lowered myself and posted a question on Stack. Because, hey, once you get past the power-tripping, mouth-breathing, basement-dwelling, neck-bearded high school punching bags picking apart your question rather than, I dunno..., BEING HELPFUL, sometimes you can get good info there. Sometimes. They seriously saved my ass at least one time.

But yeah. Fuck Python. Fuck everything Qt.

Comments
  • 1
    Finnish 🤣🤣🤣🤣🤣
  • 0
  • 2
    @iHatePython Nokia acquired Trolltech ASA on 17 June 2008 and changed the name first to Qt Software,
  • 0
    How about that. Learn something new every day. ;-) I only knew about Riverbank Software. They distribute PyQt5.
  • 2
    @iHatePython so you’re working with outdated software, because probably nobody is maintaining pyqt use kivy and chill out
  • 0
    Actually, new PyQt5 was released Oct 1. ;-)

    Never heard of Kivy. :-D
  • 1
    Welcome and great furious rant!
  • 0
  • 0
    zhe qt docs need a complete overhaul.
  • 1
    @stop I kinda agree. 😕 They could be better. What’s really frustrating is the PyQt docs. Either it’s a link to Qt docs, where all the code is C++, or it’s minimal documentation where the examples are in C++ because they basically copied the Qt docs. But, yeah, all of that needs some serious updating. I miss using MSDN / Microsoft docs. Even if the actual documentation language got a bit abstract, everything has a code sample to illustrate. Or, at least, it used to back in the olden days (~2014). 😉
  • 0
    @stop you think so? They're actually pretty decent imo

    Except when you're trying to use Qt in a language it wasn't designed for, apparently
  • 2
    "I'm developing a fairly sophisticated..."

    *Grabs popcorn*
  • 0
    Monkey patch it :P
  • 0
    Pyside is better and is open source qt lib
  • 0
    @alkuzad pyside2 is the official qt5 implementation for Python @Krokoklemme
  • 0
    Back in the days I used to create programs with Qt c++. Can you share the .ui and .py file?
  • 1
    @stop 1.) He's not using PySide though
    2.) It's a binding, not an implementation
    3.) It wasn't created by the Qt guys

    And that doesn't change that Qt wasn't designed to be used in Python
Add Comment