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前面

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