0

I am currently trying to port from PyQt4 to PySide6 an application that uses the QXmlDefaultHandler, however this class (as many others) is no longer supported in Qt6 (as can be seen here).

So I am looking for a solution on how I can adapt the code and replace the QXmlDefaultHandler in my inheritance setup. The application I am porting is an example from the book "Rapid GUI Programming with Python and Qt", and here's the specific file in question. I am new to dealing with that part of Qt, and I am not particularly determined to keep it as is, but I'd like to find as close a replacement as possible to the original code, in order to keep the book relevant with the updated examples.

musicamante
  • 41,230
  • 6
  • 33
  • 58
Martin
  • 105
  • 1
  • 10
  • The reported file is already using Qt6. Considering the documentation and that post, that class seems still supported, even if it's "temporarily" deprecated. I cannot test it right now, but the question is: does it work? Because if it does, then there seem to be no substitute at this moment, and this is expected: Qt6, being it a major version transition, has gone through important changes, with many classes and functions considered obsolete/deprecated while still supported waiting for the main API to be robust enough to provide the *new* support, while keeping the previous available. – musicamante Feb 24 '22 at 05:39
  • Long story short, if it works, keep using it until the proper support is established again with the (possibly) new API. Remember that major versions require some time to get properly updated for less required aspects: for instance, the whole QtMultimedia module had to wait until 6.2 to be reinstated. While this might not seem optimal, it's actually pretty common, especially with extremely extended frameworks like Qt is. – musicamante Feb 24 '22 at 05:43
  • @musicamante Sorry if I wasn't clear, the file I linked is a work in progress that I started for the conversion, the original file only imports from PyQt4. Additionally the QXmlDefaultHandler is present in the file because I have not been able to find a suitable replacement yet, as a result the application that I linked is not working in its current state, I did link it so that people could see what I was trying to port over to PySide6. Also I doubt that these classes will be reimplemented considering what is mentioned here :https://www.qt.io/blog/parsing-xml-with-qt-updates-for-qt-6 – Martin Feb 24 '22 at 07:56
  • Then I'm afraid that you have to switch to the new implementation using QXmlStreamReader and rewrite that part of your code. – musicamante Feb 25 '22 at 01:06

0 Answers0