QTreeView類和相關類的應用記錄
阿新 • • 發佈:2019-01-01
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指定的項是摺疊的還是展開的。