QTreeView类和相关类的应用记录

void QTreeView::resizeColumnToContents(int column)
// Resizes the column given to the size of its contents.
// 将指定列宽度适应现在的文字内容显示。
 void QTreeView::setColumnWidth(int column, int width)
// Sets the width of the given column to the width specified.
// 设置指定列宽度。
void QStandardItemModel::setHorizontalHeaderLabels(const QStringList & labels)
// Sets the horizontal header labels using labels. 
// If necessary, the column count is increased to the size of labels.
void QStandardItemModel::clear();
// Removes all items (including header items) from the model 
// and sets the number of rows and columns to zero.
// 删除所有数据,并且设置行列数为0
void QStandardItem::insertRow(int row, const QList<QStandardItem *> & items)
// Inserts a row at row containing items. 
// If necessary, the column count is increased to the size of items.
// 插入一条数据。
void QTreeView::setExpanded(const QModelIndex & index, bool expanded)
// Sets the item referred to by index to either collapse or expanded, 
// depending on the value of expanded.
// 设置index指定的项是折叠的还是展开的。

猜你喜欢

转载自blog.csdn.net/jean7155/article/details/48995991