DtkWidget 5.6.0.2
DTK Widget module
|
DSimpleListView 是 deepin 基于 QWidget 从零绘制的列表控件. 更多...
信号 | |
void | rightClickItems (QPoint pos, QList< DSimpleListItem * > items) |
void | changeColumnVisible (int index, bool visible, QList< bool > columnVisibles) |
void | changeSortingStatus (int index, bool sortingOrder) |
void | changeHoverItem (QPoint pos, DSimpleListItem *item, int columnIndex) |
void | mouseHoverChanged (DSimpleListItem *oldItem, DSimpleListItem *newItem, int columnIndex, QPoint pos) |
void | mousePressChanged (DSimpleListItem *item, int columnIndex, QPoint pos) |
void | mouseReleaseChanged (DSimpleListItem *item, int columnIndex, QPoint pos) |
Public 成员函数 | |
DSimpleListView (QWidget *parent=0) | |
void | setRowHeight (int height) |
设置行高. 更多... | |
void | setColumnTitleInfo (QList< QString > titles, QList< int > widths, int height) |
设置列标题信息 更多... | |
void | setColumnHideFlags (QList< bool > toggleHideFlags, int alwaysVisibleColumn=-1) |
设置列隐藏标志 toggleHideFlags 用于控制列的隐藏标志,用于切换显示/隐藏。 visibleColumnIndex 列始终可见的列索引,默认值为 -1,表示列始终不可见。 | |
void | setColumnSortingAlgorithms (QList< SortAlgorithm > *algorithms, int sortColumn=-1, bool descendingSort=false) |
设置列排序算法. 更多... | |
void | setSearchAlgorithm (SearchAlgorithm algorithm) |
设置搜索算法. 更多... | |
void | setClipRadius (int radius) |
设置圆角半径. 更多... | |
void | setFrame (bool enableFrame, QColor color=QColor("#000000"), double opacity=0.1) |
设置边角细节. 更多... | |
void | addItems (QList< DSimpleListItem * > items) |
添加 DSimpleListItem 列表到视图中. 更多... | |
void | removeItem (DSimpleListItem *item) |
删除一个列表项. 更多... | |
void | clearItems () |
删除所有列表项 | |
void | addSelections (QList< DSimpleListItem * > items, bool recordLastSelection=true) |
添加 DSimpleListItem 列表以在视图中选择效果 recordLastSelection 为 true 则清除最后一个选择项 items 列表项. | |
void | clearSelections (bool clearLastSelection=true) |
移除所有选择项. 更多... | |
QList< DSimpleListItem * > | getSelections () |
获取所有选择项. 更多... | |
void | refreshItems (QList< DSimpleListItem * > items) |
刷新所有项. 更多... | |
void | search (QString searchContent) |
搜索. 更多... | |
void | setSingleSelect (bool singleSelect) |
设置单一选择. 更多... | |
void | keepSelectWhenClickBlank (bool keep) |
单击空白区域时保持选择项. 更多... | |
void | selectAllItems () |
选择所有列表项. | |
void | selectFirstItem () |
选择第一项. | |
void | selectLastItem () |
选择最后一项. | |
void | selectNextItem () |
移动到下一项. | |
void | selectPrevItem () |
移动到上一项. | |
void | shiftSelectPageDown () |
从当前项选择到下一页的项. | |
void | shiftSelectPageUp () |
从当前项选择到上一页的项. | |
void | shiftSelectToEnd () |
从当前项选择到末尾项. | |
void | shiftSelectToHome () |
从当前项选择到起始项. | |
void | shiftSelectToNext () |
从当前项选择到下一项. | |
void | shiftSelectToPrev () |
从当前项选择到上一项. | |
void | scrollPageDown () |
滚动到下一页. | |
void | scrollPageUp () |
滚动到上一页. | |
void | ctrlScrollPageDown () |
void | ctrlScrollPageUp () |
void | ctrlScrollToEnd () |
void | ctrlScrollToHome () |
Protected 成员函数 | |
virtual void | leaveEvent (QEvent *event) |
bool | eventFilter (QObject *, QEvent *event) |
void | keyPressEvent (QKeyEvent *keyEvent) |
void | mouseMoveEvent (QMouseEvent *mouseEvent) |
void | mousePressEvent (QMouseEvent *mouseEvent) |
void | mouseReleaseEvent (QMouseEvent *mouseEvent) |
void | paintEvent (QPaintEvent *) |
void | wheelEvent (QWheelEvent *event) |
void | paintScrollbar (QPainter *painter) |
void | selectPrevItemWithOffset (int scrollOffset) |
void | selectNextItemWithOffset (int scrollOffset) |
void | shiftSelectNextItemWithOffset (int scrollOffset) |
void | shiftSelectPrevItemWithOffset (int scrollOffset) |
int | getBottomRenderOffset () |
int | getScrollbarY () |
int | getScrollAreaHeight () |
int | getScrollbarHeight () |
QList< int > | getRenderWidths () |
void | shiftSelectItemsWithBound (int selectionStartIndex, int selectionEndIndex) |
int | adjustRenderOffset (int offset) |
void | startScrollbarHideTimer () |
bool | isMouseAtScrollArea (int x) |
bool | isMouseAtTitleArea (int y) |
Protected 属性 | |
QPixmap | arrowDownDarkHoverImage |
QPixmap | arrowDownDarkNormalImage |
QPixmap | arrowDownDarkPressImage |
QPixmap | arrowDownHoverImage |
QPixmap | arrowDownLightHoverImage |
QPixmap | arrowDownLightNormalImage |
QPixmap | arrowDownLightPressImage |
QPixmap | arrowDownNormalImage |
QPixmap | arrowDownPressImage |
QPixmap | arrowUpDarkHoverImage |
QPixmap | arrowUpDarkNormalImage |
QPixmap | arrowUpDarkPressImage |
QPixmap | arrowUpHoverImage |
QPixmap | arrowUpLightHoverImage |
QPixmap | arrowUpLightNormalImage |
QPixmap | arrowUpLightPressImage |
QPixmap | arrowUpNormalImage |
QPixmap | arrowUpPressImage |
QString | backgroundColor = "#ffffff" |
QString | scrollbarColor = "#ffffff" |
QString | searchColor = "#000000" |
QString | titleAreaColor = "#ffffff" |
QString | titleColor = "#000000" |
QString | titleLineColor = "#000000" |
QColor | frameColor = QColor("#000000") |
double | backgroundOpacity = 0.03 |
double | frameOpacity = 0.1 |
double | titleAreaOpacity = 0.02 |
int | titleSize = 10 |
qreal | scrollbarFrameHoverOpacity = 0 |
qreal | scrollbarFrameNormalOpacity = 0 |
qreal | scrollbarFramePressOpacity = 0 |
qreal | scrollbarHoverOpacity = 0.7 |
qreal | scrollbarNormalOpacity = 0.5 |
qreal | scrollbarPressOpacity = 0.8 |
QList< bool > | columnVisibles |
DSimpleListView 是 deepin 基于 QWidget 从零绘制的列表控件.
\inmodule dtkwidget
开发者只要懂得怎么使用 QPainter 进行图形绘制,开发者就可以在 DSimpleListItem 中绘制任意行内容, 包括文本、图片、任意控件甚至每行都可以画一个小电影,而代码的复杂度不会随着绘制行内容而发生变化, 所有的行内容都源于怎么使用 QPainter.
void Dtk::Widget::DSimpleListView::addItems | ( | QList< DSimpleListItem * > | items | ) |
添加 DSimpleListItem 列表到视图中.
items 视图项列表.
void Dtk::Widget::DSimpleListView::clearSelections | ( | bool | clearLastSelection = true | ) |
移除所有选择项.
clearLastSelection 是否清除最后选中的列表项.
QList< DSimpleListItem * > Dtk::Widget::DSimpleListView::getSelections | ( | ) |
获取所有选择项.
void Dtk::Widget::DSimpleListView::keepSelectWhenClickBlank | ( | bool | keep | ) |
单击空白区域时保持选择项.
keep 是否保持选中项.
void Dtk::Widget::DSimpleListView::refreshItems | ( | QList< DSimpleListItem * > | items | ) |
刷新所有项.
items 列表项.
void Dtk::Widget::DSimpleListView::removeItem | ( | DSimpleListItem * | item | ) |
删除一个列表项.
item 列表项指针.
void Dtk::Widget::DSimpleListView::search | ( | QString | content | ) |
搜索.
content 被搜索内容.
void Dtk::Widget::DSimpleListView::setClipRadius | ( | int | radius | ) |
设置圆角半径.
radius 圆角大小.
void Dtk::Widget::DSimpleListView::setColumnSortingAlgorithms | ( | QList< SortAlgorithm > * | algorithms, |
int | sortColumn = -1 , |
||
bool | descendingSort = false |
||
) |
设置列排序算法.
algorithms 列排序算法 , sortColumn 排序的列项 , descendingSort 是否为降序排序.
void Dtk::Widget::DSimpleListView::setColumnTitleInfo | ( | QList< QString > | titles, |
QList< int > | widths, | ||
int | height | ||
) |
设置列标题信息
titles 标题列表, widths 宽度列表, height 高度.
void Dtk::Widget::DSimpleListView::setFrame | ( | bool | enableFrame, |
QColor | color = QColor("#000000") , |
||
double | opacity = 0.1 |
||
) |
设置边角细节.
enableFrame 是否绘制边角 color 边角颜色 opacity 不透明度
void Dtk::Widget::DSimpleListView::setRowHeight | ( | int | height | ) |
设置行高.
height 行高.
void Dtk::Widget::DSimpleListView::setSearchAlgorithm | ( | SearchAlgorithm | algorithm | ) |
设置搜索算法.
algorithm 搜索算法.
void Dtk::Widget::DSimpleListView::setSingleSelect | ( | bool | singleSelect | ) |
设置单一选择.
singleSelect 是否单一选择.