关于qt:什么是QScrollBar :: add-line?

What is QScrollBar::add-line?

从文档中,

The ::add-line subcontrol can be used to style the button to add a
line. By default, the add-line subcontrol is placed in top right
corner of the Border rectangle of the widget. Depending on the
orientation the ::right-arrow or ::down-arrow. By default, the arrows
are placed in the center of the Contents rectangle of the add-line
subcontrol.

"设置按钮样式以添加行"的含义是什么?线条的外观是什么?它的形状如何?这样的行的功能是什么?

AFAIK,一个滚动条由一个背景矩形,两个箭头按钮和一个矩形作为手柄组成:
scroll-bar


the button to add a line

这是一个在滚动区域(沿滚动条的方向,水平或垂直)上添加一行的按钮,即要滚动一行(向下/向右,子行控件将向上滚动一行/左)。

这只是您在屏幕截图中已经标识的带有箭头的常规按钮。正如我们在大多数GUI中看到的那样,滚动条的默认按钮和行为。

这一行实际上在QAbstractSlider文档中称为single step

这些样式表控件QScrollBar::add-line:horizontalQScrollBar::sub-line:horizontalQScrollBar::add-page:horizontalQScrollBar:left-arrow:horizontal等允许自定义小部件这些部分的外观。

另一个控件QScrollBar::add-page:将允许您自定义小部件区域,该区域不仅可以滚动一行,还可以滚动一页。
页面的大小可以由setPageStep(int)定义,而一行的大小可以由setSingleStep(int)

定义。

没有按钮可以添加/下一页。取而代之的是,您必须单击手柄和按钮之间的空白以添加/替换一行。

根据我测试的内容(Qt5.10),只有在您还自定义QScrollBar的情况下,此内容才会得到处理。 Scheff Customizing QScrollBar给出的文档示例显示了您可以在QScrollBar上自定义内容的完整用法。