• PySide 模块
  • PySide.QtGui
  • 内容表

    上一话题

    QFrame

    下一话题

    QAbstractScrollArea

    QToolBox

    概要

    函数

    虚函数

    信号

    详细描述

    PySide.QtGui.QToolBox class provides a column of tabbed widget items.

    A toolbox is a widget that displays a column of tabs one above the other, with the current item displayed below the current tab. Every tab has an index position within the column of tabs. A tab's item is a PySide.QtGui.QWidget .

    Each item has an PySide.QtGui.QToolBox.itemText() , an optional PySide.QtGui.QToolBox.itemIcon() , an optional PySide.QtGui.QToolBox.itemToolTip() ,和 PySide.QtGui.QToolBox.widget() . The item's attributes can be changed with PySide.QtGui.QToolBox.setItemText() , PySide.QtGui.QToolBox.setItemIcon() ,和 PySide.QtGui.QToolBox.setItemToolTip() . Each item can be enabled or disabled individually with PySide.QtGui.QToolBox.setItemEnabled() .

    Items are added using PySide.QtGui.QToolBox.addItem() , or inserted at particular positions using PySide.QtGui.QToolBox.insertItem() . The total number of items is given by PySide.QtGui.QToolBox.count() . Items can be deleted with delete, or removed from the toolbox with PySide.QtGui.QToolBox.removeItem() . Combining PySide.QtGui.QToolBox.removeItem() and PySide.QtGui.QToolBox.insertItem() allows you to move items to different positions.

    The index of the current item widget is returned by PySide.QtGui.QToolBox.currentIndex() , and set with PySide.QtGui.QToolBox.setCurrentIndex() . The index of a particular item can be found using PySide.QtGui.QToolBox.indexOf() , and the item at a given index is returned by item() .

    PySide.QtGui.QToolBox.currentChanged() signal is emitted when the current item is changed.

    class PySide.QtGui. QToolBox ( [ parent=None [ , f=0 ] ] )
    参数:
    PySide.QtGui.QToolBox. addItem ( widget , text )
    参数:
    返回类型:

    PySide.QtCore.int

    这是重载函数。

    Adds the widget w in a new tab at bottom of the toolbox. The new tab's text is set to text 。返回新选项卡的索引。

    PySide.QtGui.QToolBox. addItem ( widget , icon , text )
    参数:
    返回类型:

    PySide.QtCore.int

    添加 widget in a new tab at bottom of the toolbox. The new tab's text is set to text ,和 iconSet is displayed to the left of the text 。返回新选项卡的索引。

    PySide.QtGui.QToolBox. count ( )
    返回类型: PySide.QtCore.int

    This property holds The number of items contained in the toolbox..

    默认情况下,此特性拥有 0 值。

    PySide.QtGui.QToolBox. currentChanged ( index )
    参数: index PySide.QtCore.int
    PySide.QtGui.QToolBox. currentIndex ( )
    返回类型: PySide.QtCore.int

    This property holds the index of the current item.

    By default, for an empty toolbox, this property has a value of -1.

    PySide.QtGui.QToolBox. currentWidget ( )
    返回类型: PySide.QtGui.QWidget

    Returns a pointer to the current widget, or 0 if there is no such item.

    PySide.QtGui.QToolBox. indexOf ( widget )
    参数: widget PySide.QtGui.QWidget
    返回类型: PySide.QtCore.int

    Returns the index of widget , or -1 if the item does not exist.

    PySide.QtGui.QToolBox. insertItem ( index , widget , icon , text )
    参数:
    返回类型:

    PySide.QtCore.int

    插入 widget 在位置 index , or at the bottom of the toolbox if index is out of range. The new item's text is set to text ,和 icon is displayed to the left of the text . Returns the new item's index.

    PySide.QtGui.QToolBox. insertItem ( index , widget , text )
    参数:
    返回类型:

    PySide.QtCore.int

    这是重载函数。

    插入 widget 在位置 index , or at the bottom of the toolbox if index is out of range. The new item's text is set to text . Returns the new item's index.

    PySide.QtGui.QToolBox. isItemEnabled ( index )
    参数: index PySide.QtCore.int
    返回类型: PySide.QtCore.bool

    Returns true if the item at position index is enabled; otherwise returns false.

    PySide.QtGui.QToolBox. itemIcon ( index )
    参数: index PySide.QtCore.int
    返回类型: PySide.QtGui.QIcon

    Returns the icon of the item at position index ,或 null 图标若 index 超出范围。

    PySide.QtGui.QToolBox. itemInserted ( index )
    参数: index PySide.QtCore.int

    This virtual handler is called after a new item was added or inserted at position index .

    PySide.QtGui.QToolBox. itemRemoved ( index )
    参数: index PySide.QtCore.int

    This virtual handler is called after an item was removed from position index .

    PySide.QtGui.QToolBox. itemText ( index )
    参数: index PySide.QtCore.int
    返回类型: unicode

    Returns the text of the item at position index ,或空字符串若 index 超出范围。

    PySide.QtGui.QToolBox. itemToolTip ( index )
    参数: index PySide.QtCore.int
    返回类型: unicode

    Returns the tooltip of the item at position index ,或空字符串若 index 超出范围。

    PySide.QtGui.QToolBox. removeItem ( index )
    参数: index PySide.QtCore.int

    Removes the item at position index from the toolbox. Note that the widget is not deleted.

    PySide.QtGui.QToolBox. setCurrentIndex ( index )
    参数: index PySide.QtCore.int

    This property holds the index of the current item.

    By default, for an empty toolbox, this property has a value of -1.

    PySide.QtGui.QToolBox. setCurrentWidget ( widget )
    参数: widget PySide.QtGui.QWidget

    Makes``widget`` the current widget. The widget must be an item in this tool box.

    PySide.QtGui.QToolBox. setItemEnabled ( index , enabled )
    参数:
    • index PySide.QtCore.int
    • enabled PySide.QtCore.bool

    enabled is true then the item at position index 被启用;否则项在位置 index 是禁用的。

    PySide.QtGui.QToolBox. setItemIcon ( index , icon )
    参数:

    Sets the icon of the item at position index to icon .

    PySide.QtGui.QToolBox. setItemText ( index , text )
    参数:
    • index PySide.QtCore.int
    • text – unicode

    Sets the text of the item at position index to text .

    If the provided text contains an ampersand character (‘&'), a mnemonic is automatically created for it. The character that follows the ‘&' will be used as the shortcut key. Any previous mnemonic will be overwritten, or cleared if no mnemonic is defined by the text. See the QShortcut documentation for details (to display an actual ampersand, use ‘&&').

    PySide.QtGui.QToolBox. setItemToolTip ( index , toolTip )
    参数:
    • index PySide.QtCore.int
    • toolTip – unicode

    Sets the tooltip of the item at position index to toolTip .

    PySide.QtGui.QToolBox. widget ( index )
    参数: index PySide.QtCore.int
    返回类型: PySide.QtGui.QWidget

    Returns the widget at position index , or 0 if there is no such item.