Missing variant in QStyle.SubControl
Matthieu Dartiailh
m.dartiailh at gmail.com
Wed Jan 26 20:10:56 GMT 2022
Here what I tried in a console (on windows, PyQt6 has been installed
from pip):
Python 3.10.0 | packaged by conda-forge | (default, Nov 10 2021,
13:20:59) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from PyQt6.QtWidgets import QStyle
>>> dir(QStyle.SubControl)
['SC_All', 'SC_CustomBase', 'SC_None', 'SC_ScrollBarAddLine',
'SC_ScrollBarAddPage', 'SC_ScrollBarFirst', 'SC_ScrollBarGroove',
'SC_ScrollBarLast', 'SC_ScrollBarSlider', 'SC_ScrollBarSubLine',
'SC_ScrollBarSubPage', 'SC_TitleBarLabel', '__class__', '__doc__',
'__members__', '__module__']
and pip reports:
PyQt6 6.2.2
PyQt6-Qt6 6.2.2
PyQt6-sip 13.2.0
Doing the same in a different environment with PySide6 I get as expected:
>>> from PySide6.QtWidgets import QStyle
>>> QStyle.SubControl
<class 'PySide6.QtWidgets.QStyle.SubControl'>
>>> dir(QStyle.SubControl)
['SC_All', 'SC_ComboBoxArrow', 'SC_ComboBoxEditField',
'SC_ComboBoxFrame', 'SC_ComboBoxListBoxPopup', 'SC_CustomBase',
'SC_DialGroove', 'SC_DialHandle', 'SC_DialTickmarks',
'SC_GroupBoxCheckBox', 'SC_GroupBoxContents', 'SC_GroupBoxFrame',
'SC_GroupBoxLabel', 'SC_MdiCloseButton', 'SC_MdiMinButton',
'SC_MdiNormalButton', 'SC_None', 'SC_ScrollBarAddLine',
'SC_ScrollBarAddPage', 'SC_ScrollBarFirst', 'SC_ScrollBarGroove',
'SC_ScrollBarLast', 'SC_ScrollBarSlider', 'SC_ScrollBarSubLine',
'SC_ScrollBarSubPage', 'SC_SliderGroove', 'SC_SliderHandle',
'SC_SliderTickmarks', 'SC_SpinBoxDown', 'SC_SpinBoxEditField',
'SC_SpinBoxFrame', 'SC_SpinBoxUp', 'SC_TitleBarCloseButton',
'SC_TitleBarContextHelpButton', 'SC_TitleBarLabel',
'SC_TitleBarMaxButton', 'SC_TitleBarMinButton',
'SC_TitleBarNormalButton', 'SC_TitleBarShadeButton',
'SC_TitleBarSysMenu', 'SC_TitleBarUnshadeButton', 'SC_ToolButton',
'SC_ToolButtonMenu', '__add__', '__and__', '__bool__', '__class__',
'__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__',
'__getattribute__', '__gt__', '__hash__', '__index__', '__init__',
'__init_subclass__', '__int__', '__invert__', '__le__', '__lt__',
'__module__', '__mul__', '__ne__', '__new__', '__or__', '__pos__',
'__radd__', '__rand__', '__reduce__', '__reduce_ex__', '__repr__',
'__rmul__', '__ror__', '__rsub__', '__rxor__', '__setattr__',
'__sizeof__', '__str__', '__sub__', '__subclasshook__', '__xor__',
'name', 'values']
Am I doing anything obviously wrong ?
Thanks again
Matthieu
Le 1/26/2022 à 5:34 PM, Phil Thompson a écrit :
> On 26/01/2022 12:25, Matthieu Dartiailh wrote:
>> Hi,
>>
>> It appears that a number of values are missing from the
>> QStyle.SubControl enum. In PyQt 6.2, the following variants are
>> available:
>> SC_All', 'SC_CustomBase', 'SC_None', 'SC_ScrollBarAddLine',
>> 'SC_ScrollBarAddPage', 'SC_ScrollBarFirst', 'SC_ScrollBarGroove',
>> 'SC_ScrollBarLast', 'SC_ScrollBarSlider', 'SC_ScrollBarSubLine',
>> 'SC_ScrollBarSubPage', 'SC_TitleBarLabel'
>> while the Qt documentation
>> (https://doc.qt.io/qt-5/qstyle.html#SubControl-enum), list many others
>> in particular the SC_Slider* ones.
>>
>> Could those missing variants be added ?
>
> I don't know what you are looking at but they are all there.
>
> Phil
More information about the PyQt
mailing list