0

I am new to PyQt and am currently working on a project which is was written in PyQt4. I need to update it to PyQt5 and have done most of it. However, when it comes to PyKDE, it generates the following error:

from PyKDE4.kdeui import KVBox, KHBox, KColorButton RuntimeError: the PyQt4.QtCore and PyQt5.QtCore modules both wrap the QObject class

The code line using PyKDE4 is:

from PyKDE4.kdeui import KVBox, KHBox, KColorButton

Basically most of the code is already in PyQt5, but I haven't found a translation for PyKDE4. Anyone can help?

  • You cannot use both Qt4 and Qt5 elements. KVBox and KHBox are custom widgets that already have their own layout, so you must use QVBoxLayout and QHBoxLayout instead (and set them to a new QWidget, if necessary), while KColorButton is a custom QPushButton that shows a color and opens a QColorDialog when clicked, so you must create your own subclass for that. – musicamante Oct 09 '20 at 14:09
  • @musicamante thanks! I've seen you're a Qt developer, would you mind helping me on just one more thing? The other issue I'm having is that there's no PythonQt5.Qwt, do you know how can I replace it? – Andreas Oct 09 '20 at 14:28
  • I've never used it, but it is not part of PyQt, so you have to install it manually – musicamante Oct 09 '20 at 14:42

0 Answers0