Added unittests for auto-raised QToolButtons.

Added unittests for different arrow types both auto-raised and not.
main
Alex Huszagh 2022-04-29 12:38:17 -05:00
parent aeb45a3e91
commit 0377357dc0
7 changed files with 3999 additions and 3969 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1608,26 +1608,26 @@ QToolButton[autoRaise="false"]::left-arrow,
QToolButton[autoRaise="false"]::up-arrow,
QToolButton[autoRaise="false"]::down-arrow
{
/* Undo the padding when we have an arrow */
padding-right: -1.2em;
subcontrol-origin: margin;
subcontrol-position: right;
}
QToolButton[autoRaise="false"]::right-arrow
QToolButton::right-arrow
{
image: url(dark:right_arrow.svg);
}
QToolButton[autoRaise="false"]::left-arrow
QToolButton::left-arrow
{
image: url(dark:left_arrow.svg);
}
QToolButton[autoRaise="false"]::up-arrow
QToolButton::up-arrow
{
image: url(dark:up_arrow.svg);
}
QToolButton[autoRaise="false"]::down-arrow
QToolButton::down-arrow
{
image: url(dark:down_arrow.svg);
}
@ -1640,6 +1640,7 @@ QToolButton[autoRaise="false"]:hover
QToolButton[autoRaise="false"]:checked,
QToolButton[autoRaise="false"]:pressed
{
border: 0.04em solid #3daee9;
background-color: #3daee9;
padding: 0.23em;
padding-right: 1.2em;
@ -1717,6 +1718,7 @@ QToolButton[autoRaise="true"]:hover
QToolButton[autoRaise="true"]:checked,
QToolButton[autoRaise="true"]:pressed
{
border: 0.04em solid #3daee9;
background-color: #3daee9;
}

View File

@ -1608,26 +1608,26 @@ QToolButton[autoRaise="false"]::left-arrow,
QToolButton[autoRaise="false"]::up-arrow,
QToolButton[autoRaise="false"]::down-arrow
{
/* Undo the padding when we have an arrow */
padding-right: -1.2em;
subcontrol-origin: margin;
subcontrol-position: right;
}
QToolButton[autoRaise="false"]::right-arrow
QToolButton::right-arrow
{
image: url(light:right_arrow.svg);
}
QToolButton[autoRaise="false"]::left-arrow
QToolButton::left-arrow
{
image: url(light:left_arrow.svg);
}
QToolButton[autoRaise="false"]::up-arrow
QToolButton::up-arrow
{
image: url(light:up_arrow.svg);
}
QToolButton[autoRaise="false"]::down-arrow
QToolButton::down-arrow
{
image: url(light:down_arrow.svg);
}
@ -1640,6 +1640,7 @@ QToolButton[autoRaise="false"]:hover
QToolButton[autoRaise="false"]:checked,
QToolButton[autoRaise="false"]:pressed
{
border: 0.04em solid rgba(51, 164, 223, 0.5);
background-color: rgba(51, 164, 223, 0.5);
padding: 0.23em;
padding-right: 1.2em;
@ -1717,6 +1718,7 @@ QToolButton[autoRaise="true"]:hover
QToolButton[autoRaise="true"]:checked,
QToolButton[autoRaise="true"]:pressed
{
border: 0.04em solid rgba(51, 164, 223, 0.5);
background-color: rgba(51, 164, 223, 0.5);
}

View File

@ -1608,26 +1608,26 @@ QToolButton[autoRaise="false"]::left-arrow,
QToolButton[autoRaise="false"]::up-arrow,
QToolButton[autoRaise="false"]::down-arrow
{
/* Undo the padding when we have an arrow */
padding-right: -1.2em;
subcontrol-origin: margin;
subcontrol-position: right;
}
QToolButton[autoRaise="false"]::right-arrow
QToolButton::right-arrow
{
image: url(:/dark/right_arrow.svg);
}
QToolButton[autoRaise="false"]::left-arrow
QToolButton::left-arrow
{
image: url(:/dark/left_arrow.svg);
}
QToolButton[autoRaise="false"]::up-arrow
QToolButton::up-arrow
{
image: url(:/dark/up_arrow.svg);
}
QToolButton[autoRaise="false"]::down-arrow
QToolButton::down-arrow
{
image: url(:/dark/down_arrow.svg);
}
@ -1640,6 +1640,7 @@ QToolButton[autoRaise="false"]:hover
QToolButton[autoRaise="false"]:checked,
QToolButton[autoRaise="false"]:pressed
{
border: 0.04em solid #3daee9;
background-color: #3daee9;
padding: 0.23em;
padding-right: 1.2em;
@ -1717,6 +1718,7 @@ QToolButton[autoRaise="true"]:hover
QToolButton[autoRaise="true"]:checked,
QToolButton[autoRaise="true"]:pressed
{
border: 0.04em solid #3daee9;
background-color: #3daee9;
}

View File

@ -1608,26 +1608,26 @@ QToolButton[autoRaise="false"]::left-arrow,
QToolButton[autoRaise="false"]::up-arrow,
QToolButton[autoRaise="false"]::down-arrow
{
/* Undo the padding when we have an arrow */
padding-right: -1.2em;
subcontrol-origin: margin;
subcontrol-position: right;
}
QToolButton[autoRaise="false"]::right-arrow
QToolButton::right-arrow
{
image: url(:/light/right_arrow.svg);
}
QToolButton[autoRaise="false"]::left-arrow
QToolButton::left-arrow
{
image: url(:/light/left_arrow.svg);
}
QToolButton[autoRaise="false"]::up-arrow
QToolButton::up-arrow
{
image: url(:/light/up_arrow.svg);
}
QToolButton[autoRaise="false"]::down-arrow
QToolButton::down-arrow
{
image: url(:/light/down_arrow.svg);
}
@ -1640,6 +1640,7 @@ QToolButton[autoRaise="false"]:hover
QToolButton[autoRaise="false"]:checked,
QToolButton[autoRaise="false"]:pressed
{
border: 0.04em solid rgba(51, 164, 223, 0.5);
background-color: rgba(51, 164, 223, 0.5);
padding: 0.23em;
padding-right: 1.2em;
@ -1717,6 +1718,7 @@ QToolButton[autoRaise="true"]:hover
QToolButton[autoRaise="true"]:checked,
QToolButton[autoRaise="true"]:pressed
{
border: 0.04em solid rgba(51, 164, 223, 0.5);
background-color: rgba(51, 164, 223, 0.5);
}

View File

@ -1608,26 +1608,26 @@ QToolButton[autoRaise="false"]::left-arrow,
QToolButton[autoRaise="false"]::up-arrow,
QToolButton[autoRaise="false"]::down-arrow
{
/* Undo the padding when we have an arrow */
padding-right: -1.2em;
subcontrol-origin: margin;
subcontrol-position: right;
}
QToolButton[autoRaise="false"]::right-arrow
QToolButton::right-arrow
{
image: url(^style^right_arrow.svg);
}
QToolButton[autoRaise="false"]::left-arrow
QToolButton::left-arrow
{
image: url(^style^left_arrow.svg);
}
QToolButton[autoRaise="false"]::up-arrow
QToolButton::up-arrow
{
image: url(^style^up_arrow.svg);
}
QToolButton[autoRaise="false"]::down-arrow
QToolButton::down-arrow
{
image: url(^style^down_arrow.svg);
}
@ -1640,6 +1640,7 @@ QToolButton[autoRaise="false"]:hover
QToolButton[autoRaise="false"]:checked,
QToolButton[autoRaise="false"]:pressed
{
border: 0.04em solid ^highlight^;
background-color: ^highlight^;
padding: 0.23em;
padding-right: 1.2em;
@ -1717,6 +1718,7 @@ QToolButton[autoRaise="true"]:hover
QToolButton[autoRaise="true"]:checked,
QToolButton[autoRaise="true"]:pressed
{
border: 0.04em solid ^highlight^;
background-color: ^highlight^;
}

View File

@ -826,6 +826,26 @@ def test_toolbutton(widget, window, *_):
return child, layout_type
def test_raised_toolbutton(widget, window, *_):
layout_type = 'horizontal'
child = [
QtWidgets.QToolButton(widget),
QtWidgets.QToolButton(widget),
QtWidgets.QToolButton(widget),
QtWidgets.QToolButton(widget),
]
window.setTabOrder(child[0], child[1])
window.setTabOrder(child[1], child[2])
window.setTabOrder(child[2], child[3])
child[0].setArrowType(LeftArrow)
child[1].setArrowType(RightArrow)
child[2].setArrowType(UpArrow)
child[3].setArrowType(DownArrow)
for item in child:
item.setAutoRaise(True)
return child, layout_type
def test_pushbutton(widget, *_):
layout_type = 'horizontal'
child = []