Qt例程之direcoryview

QModelIndex QAbstractItemView::currentIndex() const
Returns the model index of the current item.
//返回當前item的model index

##QHeaderView
void setStretchLastSection(bool stretch)
stretchLastSection : bool
This property holds whether the last visible section in the header takes up all the available space.
//是否最後訪問的在頭部的section佔據所有可用空間

void setSortIndicatorShown(bool show)
showSortIndicator : bool
This property holds whether the sort indicator is shown.
//是否排序表示器可見

void QHeaderView::setSortIndicator(int logicalIndex, Qt::SortOrder order)
Sets the sort indicator for the section specified by the given logicalIndex in the direction specified by order,
and removes the sort indicator from any other section that was showing it.
//通過給定的index爲指定的section設置排序表示器使用由order指定的方式
移除其他section的選擇表示器。

void QHeaderView::setClickable(bool clickable)
If clickable is true, the header will respond to single clicks.
//header響應單個click

QTreeView****

The QTreeView class provides a default model/view implementation of a tree view
//樹狀圖的默認model/view的實現

virtual void setModel(QAbstractItemModel * model)
Reimplemented from QAbstractItemView::setModel().
//QAbstractItemView::setModel()的重新實現

void QTreeView::scrollTo(const QModelIndex & index, ScrollHint hint = EnsureVisible)
Reimplemented from QAbstractItemView::scrollTo().
Scroll the contents of the tree view until the given model item index is visible.
//滾動樹狀視圖的內容直到給定的model 項index是可見的
The hint parameter specifies more precisely where the item should be located after the operation.
If any of the parents of the model item are collapsed, they will be expanded to ensure that the model item is visible.

QHeaderView * header() const

void QTreeView::resizeColumnToContents(int column)
Resizes the column given to the size of its contents.
//重置列,考慮到內容的大小

void QTreeView::expand(const QModelIndex & index)
Expands the model item specified by the index.
//通過index擴展mode item

QDirModel****

QModelIndex QDirModel::mkdir(const QModelIndex & parent, const QString & name)
Create a directory with the name in the parent model item.
//使用名字創建目錄,在父model item

bool QDirModel::rmdir(const QModelIndex & index)s
Removes the directory corresponding to the model item index in the directory model and deletes the corresponding directory
from the file system, returning true if successful. If the directory cannot be removed, false is returned.
//移除對應於model index的目錄,從文件系統刪除對應的目錄,成功返回true

bool QDirModel::remove(const QModelIndex & index)
Removes the model item index from the directory model and deletes the corresponding file from the file system,
returning true if successful. If the item cannot be removed, false is returned.
//從目錄model移除model item 的index,從文件系統刪除對應的文件

QString QDirModel::fileName(const QModelIndex & index) const
Returns the name of the item stored in the model under the index given.
//在給定的index下,返回存儲在model的item的名字

QFileInfo***

QFileInfo QDirModel::fileInfo(const QModelIndex & index) const
Returns the file information for the specified model index.
//返回指定model index的文件信息

bool QFileInfo::isDir() const
Returns true if this object points to a directory or to a symbolic link to a directory; otherwise returns false.
//如果是目錄或者目錄的軟連接

QMessageBox***

StandardButton QMessageBox::information(QWidget * parent, const QString & title, const QString & text, StandardButtons buttons = Ok, StandardButton defaultButton = NoButton)
Opens an information message box with the given title and text in front of the specified parent widget.
//打開一個信息消息框,用給定的title和text,在指定的父widget前面

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章