QToolBox 类提供选项卡化 Widget 项的列。 更多...
继承 QFrame .
QToolBox 类提供选项卡化 Widget 项的列。
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 QWidget .
Each item has an itemText (),可选 itemIcon (),可选 itemToolTip (), and a widget (). The item's attributes can be changed with setItemText (), setItemIcon (),和 setItemToolTip (). Each item can be enabled or disabled individually with setItemEnabled ().
Items are added using addItem (), or inserted at particular positions using insertItem (). The total number of items is given by count (). Items can be deleted with delete, or removed from the toolbox with removeItem (). Combining removeItem () 和 insertItem () allows you to move items to different positions.
The index of the current item widget is returned by currentIndex (), and set with setCurrentIndex (). The index of a particular item can be found using indexOf (), and the item at a given index is returned by item ().
currentChanged () signal is emitted when the current item is changed.
parent argument, if not None, causes self to be owned by Qt instead of PyQt.
Constructs a new toolbox with the given parent 和 flags, f .
item argument has it's ownership transferred to Qt.
添加 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 . Returns the new tab's index.
item argument has it's ownership transferred to Qt.
这是重载函数。
Adds the widget w in a new tab at bottom of the toolbox. The new tab's text is set to text . Returns the new tab's index.
重实现自 QWidget.changeEvent ().
Returns a pointer to the current widget, or 0 if there is no such item.
另请参阅 currentIndex () 和 setCurrentWidget ().
重实现自 QObject.event ().
Returns the index of widget , or -1 if the item does not exist.
item argument has it's ownership transferred to Qt.
插入 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.
widget argument has it's ownership transferred to Qt.
这是重载函数。
插入 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.
Returns true if the item at position index is enabled; otherwise returns false.
Returns the icon of the item at position index ,或 null icon if index 超出范围。
另请参阅 setItemIcon ().
This virtual handler is called after a new item was added or inserted at position index .
另请参阅 itemRemoved ().
This virtual handler is called after an item was removed from position index .
另请参阅 itemInserted ().
Returns the text of the item at position index ,或 empty string if index 超出范围。
另请参阅 setItemText ().
Returns the tooltip of the item at position index ,或 empty string if index 超出范围。
另请参阅 setItemToolTip ().
Removes the item at position index from the toolbox. Note that the widget is not deleted.
This method is also a Qt slot with the C++ signature void setCurrentIndex(int) .
This method is also a Qt slot with the C++ signature void setCurrentWidget(QWidget*) .
Makes widget 当前小部件。 widget 必须是 an item in this tool box.
另请参阅 addItem (), setCurrentIndex (), and currentWidget ().
若 enabled is true then the item at position index 被启用;否则项在位置 index is disabled.
另请参阅 isItemEnabled ().
Sets the icon of the item at position index to icon .
另请参阅 itemIcon ().
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 '&&').
另请参阅 itemText ().
Sets the tooltip of the item at position index to toolTip .
另请参阅 itemToolTip ().
重实现自 QWidget.showEvent ().
Returns the widget at position index , or 0 if there is no such item.
This is the default overload of this signal.
This signal is emitted when the current item is changed. The new current item's index is passed in index , or -1 if there is no current item.