Thanks for the additional information. Still it is a bug in Spyder, not
in Qt:

1) Cleanlooks and Plastique styles are inheriting from QProxyStyle.
2) So in Spyder’s HTMLDelegate.paint method, options.widget.style() returns a 
QProxyStyle.
3) In QProxyStyle.subElementRect method, the third argument is not optional, so 
should be specified: https://doc.qt.io/qt-5/qproxystyle.html#subElementRect

In C++, if the two-argument call is used, the compiler would ignore
QProxyStyle::subElementRect and fall back to
QCommonStyle::subElementRect. However, in Python there is no concept of
overloading methods so this is not possible.

So Qt and PyQt behave according to their documentation.

Replacing style.subElementRect(QStyle.SE_ItemViewItemText, options) with
style.subElementRect(QStyle.SE_ItemViewItemText, options, None) in
Spyder code seems to help.

With regards to crash when using GTK2, it is a different and known
issue. Qt uses GTK3 platformtheme (i.e. dialogs) by default, and it is
incompatible with GTK2. If you want to use GTK2 then you should export
QT_QPA_PLATFORMTHEME=gtk2. But I recommend against using GTK2 as it is
deprecated.

** Changed in: qtstyleplugins-src (Ubuntu)
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1832019

Title:
  Error when going to 'Tools -> Preferences -> Keyboard shortcuts' in
  Spyder3 in Bionic

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pyqt5/+bug/1832019/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to