Qt中文手冊 之 QTreeWidgetItem
標頭檔案:#include <QTreeWidgetItem>
成員函式
1、QTreeWidgetItem::QTreeWidgetItem(int type = Type)
使用型別type構造項,預設型別視窗型別
2、QTreeWidgetItem::QTreeWidgetItem(const QStringList & strings, int type = Type)
使用字串列表strings作為項的每一列,構造該項
3、QTreeWidgetItem::QTreeWidgetItem(QTreeWidget * parent,int type
指定父類(一個樹視窗),構造項
4、QTreeWidgetItem::QTreeWidgetItem(QTreeWidget * parent, constQStringList & strings, int type = Type)
參見2與3
5、QTreeWidgetItem::QTreeWidgetItem(QTreeWidget * parent,QTreeWidgetItem * preceding, int type = Type)
在preceding項後插入該項
6、QTreeWidgetItem::QTreeWidgetItem(QTreeWidgetItem * parent
將項parent作為父物件,構造該項
7、QTreeWidgetItem::QTreeWidgetItem(QTreeWidgetItem * parent, constQStringList & strings, int type = Type)
參見2與6
8、QTreeWidgetItem::QTreeWidgetItem(QTreeWidgetItem * parent,QTreeWidgetItem * preceding, int type = Type)
將項parent作為父物件,並在項preceding後插入
9、QTreeWidgetItem::QTreeWidgetItem(const QTreeWidgetItem & other
複製一個項,注意:型別type()和treeWidget()不復制
10、void QTreeWidgetItem::addChild(QTreeWidgetItem * child)
新增子項
11、void QTreeWidgetItem::addChildren(constQList<QTreeWidgetItem *> & children)
新增子項佇列
12、QBrush QTreeWidgetItem::background(int column) const
設定項的背景色
13、Qt::CheckState QTreeWidgetItem::checkState(int column) const
返回項中第column的被點選狀態:點選Qt::Checked、沒有點選Qt::Unchecked、部分點選Qt::PartiallyChecked
14、QTreeWidgetItem * QTreeWidgetItem::child(int index) const
返回項的子項中索引為index的子項
15、int QTreeWidgetItem::childCount() const
返回項的子項的數量
16、QTreeWidgetItem::ChildIndicatorPolicy QTreeWidgetItem::childIndicatorPolicy() const
返回項中子項在摺疊和開啟時的策略。
QTreeWidgetItem::ShowIndicator |
0 |
The controls for expanding and collapsing will be shown for this item even if there are no children. |
QTreeWidgetItem::DontShowIndicator |
1 |
The controls for expanding and collapsing will never be shown even if there are children. If the node is forced open the user will not be able to expand or collapse the item. |
QTreeWidgetItem::DontShowIndicatorWhenChildless |
2 |
The controls for expanding and collapsing will be shown if the item contains children. |
17、QTreeWidgetItem * QTreeWidgetItem::clone() const
複製一個項
18、int QTreeWidgetItem::columnCount() const
返回項包含幾列
19、QVariant QTreeWidgetItem::data(int column,int role) const
返回指定role在第column列的資料。
20、[protected] void QTreeWidgetItem::emitDataChanged()
傳送dataChanged訊號。注意:當繼承QTreeWidgetItem的子類重新實現data()或setData()時,才呼叫該函式。
21、Qt::ItemFlags QTreeWidgetItem::flags() const
返回項的標誌,包括是否被點選、是否被編輯、是否被選擇等標誌。
22、QFont QTreeWidgetItem::font(int column) const
返回項在第column列的字型
23、QBrush QTreeWidgetItem::foreground(int column) const
返回項在第column列的前景色
24、QIcon QTreeWidgetItem::icon(int column) const
返回項在第column列的圖示
25、int QTreeWidgetItem::indexOfChild(QTreeWidgetItem * child) const
返回子項在項中索引
26、void QTreeWidgetItem::insertChild(int index,QTreeWidgetItem * child)
在指定索引處插入子項child
27、void QTreeWidgetItem::insertChildren(int index, constQList<QTreeWidgetItem *> & children)
在指定索引index處插入子項列表
28、bool QTreeWidgetItem::isDisabled() const
該項是否使能
29、bool QTreeWidgetItem::isExpanded() const
該項是否展開
30、bool QTreeWidgetItem::isFirstColumnSpanned() const
第一列是否覆蓋其他列(只顯示第一個,其他不顯示)
31、bool QTreeWidgetItem::isHidden() const
如果該項隱藏了,返回true
32、bool QTreeWidgetItem::isSelected() const
如果該項被選擇了,返回true
33、QTreeWidgetItem * QTreeWidgetItem::parent() const
返回該項的父物件
34、[virtual] void QTreeWidgetItem::read(QDataStream & in)
從流in中讀取專案。注意只能讀到單個項中
35、void QTreeWidgetItem::removeChild(QTreeWidgetItem * child)
移除子項。注意只是移除子項,並沒有刪除。
36、void QTreeWidgetItem::setBackground(int column, constQBrush & brush)
設定該項第column列的背景色
37、void QTreeWidgetItem::setCheckState(int column,Qt::CheckState state)
設定該項第column列的點選狀態
38、void QTreeWidgetItem::setChildIndicatorPolicy(QTreeWidgetItem::ChildIndicatorPolicy policy)
設定摺疊和展開策略
39、[virtual] void QTreeWidgetItem::setData(int column,int role, const QVariant & value)
設定第column列指定角色role的數值
40、void QTreeWidgetItem::setDisabled(bool disabled)
不使能該項
41、void QTreeWidgetItem::setExpanded(bool expand)
展開該項
42、void QTreeWidgetItem::setFirstColumnSpanned(bool span)
設定第一列是否遮蓋其他列
43、void QTreeWidgetItem::setFlags(Qt::ItemFlags flags)
設定該項的標誌。例如該項是否被選擇,是否被點選,是否使能等。
44、void QTreeWidgetItem::setFont(int column, constQFont & font)
設定該項第column列的字型
45、void QTreeWidgetItem::setForeground(int column, constQBrush & brush)
設定該項第column列的前景色
46、void QTreeWidgetItem::setHidden(bool hide)
設定該項是否隱藏
47、void QTreeWidgetItem::setIcon(int column, constQIcon & icon)
設定該項第column列的圖示
48、void QTreeWidgetItem::setSelected(bool select)
設定該項是否被選擇
49、void QTreeWidgetItem::setSizeHint(int column, constQSize & size)
設定該項第column列的提示大小
50、void QTreeWidgetItem::setStatusTip(int column, constQString & statusTip)
設定該項第column列的狀體提示
51、void QTreeWidgetItem::setText(int column, constQString & text)
設定該項第column列的文字
52、void QTreeWidgetItem::setTextAlignment(int column,int alignment)
設定該項第column列文字的對齊方式
53、void QTreeWidgetItem::setToolTip(int column, constQString & toolTip)
設定該項第column列的工具提示
54、void QTreeWidgetItem::setWhatsThis(int column, constQString & whatsThis)
設定該項第column列的幫助
55、QSize QTreeWidgetItem::sizeHint(int column) const
返回該項第column列的大小提示
56、void QTreeWidgetItem::sortChildren(int column,Qt::SortOrder order)
設定該項第column列以指定的order規則排序
57、QString QTreeWidgetItem::statusTip(int column) const
返回該項第column列的狀態提示
58、QTreeWidgetItem * QTreeWidgetItem::takeChild(int index)
移除在索引index出的項,並返回該項
59、QList<QTreeWidgetItem *> QTreeWidgetItem::takeChildren()
移除該項的所有子項,並返回子項列表
60、QString QTreeWidgetItem::text(int column) const
返回該項第column列的文字
61、int QTreeWidgetItem::textAlignment(int column) const
返回該項第column列文字的對齊方式
62、QString QTreeWidgetItem::toolTip(int column) const
返回該項第column列的工具提示資訊
63、QTreeWidget * QTreeWidgetItem::treeWidget() const
返回該項所在的tree視窗
64、int QTreeWidgetItem::type() const
返回該項的型別
65、QString QTreeWidgetItem::whatsThis(int column) const
返回該項第column列的幫助資訊
66、[virtual] void QTreeWidgetItem::write(QDataStream & out) const
將該項寫到輸出流,只能是單個項
67、[virtual] bool QTreeWidgetItem::operator<(constQTreeWidgetItem & other) const
運算子“<”過載,和另一個項比較他們的 文字
68、QTreeWidgetItem & QTreeWidgetItem::operator=(constQTreeWidgetItem & other)
運算子“=”過載,複製另一個項。