Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix crash when clicking outline (#1299)
On PyQt5 5.15.11 (the current latest), subElementRect (from qproxystyle) expects three arguments, not two. This isn't consistent with the other subElementRect functions, so I strongly suspect that the problem is somewhere upstream. I see this behavior in the docs and in the package itself, so I don't see a very good way around it. The bindings for subElementRect aren't consistent: ``` bindings/QtWidgets/qcommonstyle.sip 39: virtual QRect subElementRect(QStyle::SubElement r, const QStyleOption *opt, const QWidget *widget = 0) const; bindings/QtWidgets/qproxystyle.sip 41: virtual QRect subElementRect(QStyle::SubElement element, const QStyleOption *option, const QWidget *widget) const; bindings/QtWidgets/qstyle.sip 270: virtual QRect subElementRect(QStyle::SubElement subElement, const QStyleOption *option, const QWidget *widget = 0) const = 0; ``` (`widget` in `qproxystyle` should have a default value of `0`/`nullptr`, but it doesn't) This also shows up in the docs. These have a default: https://www.riverbankcomputing.com/static/Docs/PyQt5/api/qtwidgets/qcommonstyle.html##subElementRect https://www.riverbankcomputing.com/static/Docs/PyQt5/api/qtwidgets/qstyle.html##subElementRect but the one we're using here doesn't: https://www.riverbankcomputing.com/static/Docs/PyQt5/api/qtwidgets/qproxystyle.html##subElementRect Even if other versions have a default value, it should work fine as a positional argument, and `None` would be the default value anyway.
- Loading branch information