<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # QComboBox Class Reference ## [[QtGui](index.htm) module] 該QComboBox表示widget是一個組合鍵,彈出的列表中。[More...](#details) 繼承[QWidget](qwidget.html)。 通過繼承[QFontComboBox](qfontcombobox.html)。 ### Types * `enum InsertPolicy { NoInsert, InsertAtTop, InsertAtCurrent, InsertAtBottom, ..., InsertAlphabetically }` * `enum SizeAdjustPolicy { AdjustToContents, AdjustToContentsOnFirstShow, AdjustToMinimumContentsLength, AdjustToMinimumContentsLengthWithIcon }` ### Methods * `__init__ (self, QWidget?parent?=?None)` * `addItem (self, QString?text, QVariant?userData?=?QVariant())` * `addItem (self, QIcon?icon, QString?text, QVariant?userData?=?QVariant())` * `addItems (self, QStringList?texts)` * `bool autoCompletion (self)` * `Qt.CaseSensitivity autoCompletionCaseSensitivity (self)` * `changeEvent (self, QEvent?e)` * `clear (self)` * `clearEditText (self)` * `QCompleter completer (self)` * `contextMenuEvent (self, QContextMenuEvent?e)` * `int count (self)` * `int currentIndex (self)` * `QString currentText (self)` * `bool duplicatesEnabled (self)` * `bool event (self, QEvent?event)` * `int findData (self, QVariant?data, int?role?=?Qt.UserRole, Qt.MatchFlags?flags?=?Qt.MatchExactly|Qt.MatchCaseSensitive)` * `int findText (self, QString?text, Qt.MatchFlags?flags?=?Qt.MatchExactly|Qt.MatchCaseSensitive)` * `focusInEvent (self, QFocusEvent?e)` * `focusOutEvent (self, QFocusEvent?e)` * `bool hasFrame (self)` * `hideEvent (self, QHideEvent?e)` * `hidePopup (self)` * `QSize iconSize (self)` * `initStyleOption (self, QStyleOptionComboBox?option)` * `inputMethodEvent (self, QInputMethodEvent)` * `QVariant inputMethodQuery (self, Qt.InputMethodQuery)` * `insertItem (self, int?index, QString?text, QVariant?userData?=?QVariant())` * `insertItem (self, int?index, QIcon?icon, QString?text, QVariant?userData?=?QVariant())` * `insertItems (self, int?index, QStringList?texts)` * `InsertPolicy insertPolicy (self)` * `insertSeparator (self, int?index)` * `bool isEditable (self)` * `QVariant itemData (self, int?index, int?role?=?Qt.UserRole)` * `QAbstractItemDelegate itemDelegate (self)` * `QIcon itemIcon (self, int?index)` * `QString itemText (self, int?index)` * `keyPressEvent (self, QKeyEvent?e)` * `keyReleaseEvent (self, QKeyEvent?e)` * `QLineEdit lineEdit (self)` * `int maxCount (self)` * `int maxVisibleItems (self)` * `int minimumContentsLength (self)` * `QSize minimumSizeHint (self)` * `QAbstractItemModel model (self)` * `int modelColumn (self)` * `mousePressEvent (self, QMouseEvent?e)` * `mouseReleaseEvent (self, QMouseEvent?e)` * `paintEvent (self, QPaintEvent?e)` * `removeItem (self, int?index)` * `resizeEvent (self, QResizeEvent?e)` * `QModelIndex rootModelIndex (self)` * `setAutoCompletion (self, bool?enable)` * `setAutoCompletionCaseSensitivity (self, Qt.CaseSensitivity?sensitivity)` * `setCompleter (self, QCompleter?c)` * `setCurrentIndex (self, int?index)` * `setDuplicatesEnabled (self, bool?enable)` * `setEditable (self, bool?editable)` * `setEditText (self, QString?text)` * `setFrame (self, bool)` * `setIconSize (self, QSize?size)` * `setInsertPolicy (self, InsertPolicy?policy)` * `setItemData (self, int?index, QVariant?value, int?role?=?Qt.UserRole)` * `setItemDelegate (self, QAbstractItemDelegate?delegate)` * `setItemIcon (self, int?index, QIcon?icon)` * `setItemText (self, int?index, QString?text)` * `setLineEdit (self, QLineEdit?edit)` * `setMaxCount (self, int?max)` * `setMaxVisibleItems (self, int?maxItems)` * `setMinimumContentsLength (self, int?characters)` * `setModel (self, QAbstractItemModel?model)` * `setModelColumn (self, int?visibleColumn)` * `setRootModelIndex (self, QModelIndex?index)` * `setSizeAdjustPolicy (self, SizeAdjustPolicy?policy)` * `setValidator (self, QValidator?v)` * `setView (self, QAbstractItemView?itemView)` * `showEvent (self, QShowEvent?e)` * `showPopup (self)` * `SizeAdjustPolicy sizeAdjustPolicy (self)` * `QSize sizeHint (self)` * `QValidator validator (self)` * `QAbstractItemView view (self)` * `wheelEvent (self, QWheelEvent?e)` ### Special Methods * `__len__ (self)` ### Qt Signals * `void activated (int)` * `void activated (const QString&)` * `void currentIndexChanged (int)` * `void currentIndexChanged (const QString&)` * `void editTextChanged (const QString&)` * `void highlighted (int)` * `void highlighted (const QString&)` * * * ## Detailed Description 該QComboBox表示widget是一個組合鍵,彈出的列表中。 一個QComboBox表示提供了展示的選項列表給用戶的方式,佔用屏幕空間的最小量的一種手段。 組合框是一個選擇窗口小部件,顯示當前的項目,可以彈出的選項列表。一個ComboBox可編輯,允許用戶修改列表中的每個項目。 組合框可以包含的像素圖和字符串;的[insertItem](qcombobox.html#insertItem)()和[setItemText](qcombobox.html#setItemText)( )函數進行適當超載。對于可編輯的組合框,該功能[clearEditText](qcombobox.html#clearEditText)( )設置,可清除顯示的字符串,不改變組合框的內容。 還有,如果一個組合框改變目前的項目發出的兩個信號,[currentIndexChanged](qcombobox.html#currentIndexChanged)()和[activated](qcombobox.html#activated)( ) 。[currentIndexChanged](qcombobox.html#currentIndexChanged)( )總是發出而不論這些變化以編程方式或通過用戶交互來完成的,而[activated](qcombobox.html#activated)()時的變化引起的用戶交互只射出。該[highlighted](qcombobox.html#highlighted)當用戶高亮顯示在組合框彈出列表中的一項( )信號被發射。有兩個版本,一個具有存在的所有三個信號[QString](qstring.html)參數和一個與`int`的說法。如果用戶選擇或突出顯示一個像素圖,只有`int`信號被發射。每當一個可編輯的組合框的文本改變了[editTextChanged](qcombobox.html#editTextChanged)()信號被發射。 當用戶進入可編輯ComboBox一個新的字符串,該部件可能會或可能不會插入它,它可以在多個位置插入。默認的策略是是[AtBottom](qcombobox.html#InsertPolicy-enum)但您可以使用此更改[setInsertPolicy](qcombobox.html#insertPolicy-prop)( ) 。 這是可能使用的輸入限制在一個可編輯的組合框[QValidator](qvalidator.html)見[setValidator](qcombobox.html#setValidator)( ) 。默認情況下,任何輸入被接受。 一個ComboBox可以使用插入功能來填充,[insertItem](qcombobox.html#insertItem)()和[insertItems](qcombobox.html#insertItems)( )為例。項目可以被改變[setItemText](qcombobox.html#setItemText)( ) 。一個項目可以被移除[removeItem](qcombobox.html#removeItem)( ) ,所有項目可以被刪除[clear](qcombobox.html#clear)( ) 。當前項的文本被退回[currentText](qcombobox.html#currentText-prop)( ) ,和一個編號項的文本與返回[text](index.htm#text)( ) 。目前的項目可以設置[setCurrentIndex](qcombobox.html#currentIndex-prop)( ) 。在組合框的項數是由返回[count](qcombobox.html#count-prop)();項目的最大數目可以被設置[setMaxCount](qcombobox.html#maxCount-prop)( ) 。您可以使用允許編輯[setEditable](qcombobox.html#editable-prop)( ) 。對于可編輯的組合框,您可以使用設置的自動完成功能[setCompleter](qcombobox.html#setCompleter)(用戶)以及是否可以添加重復設置與[setDuplicatesEnabled](qcombobox.html#duplicatesEnabled-prop)( ) 。 QComboBox表示使用[model/view framework](index.htm)其彈出的列表中,并存儲其物品。默認情況下,[QStandardItemModel](qstandarditemmodel.html)存儲的項目和一個[QListView](qlistview.html)子類顯示popuplist 。您可以訪問模型和視圖直接(與[model](qcombobox.html#model)()和[view](qcombobox.html#view)( ) ),但QComboBox表示還提供了功能設置和獲取項目數據(例如,[setItemData](qcombobox.html#setItemData)()和[itemText](qcombobox.html#itemText)())。您還可以設置一個新的模型和視圖(帶[setModel](qcombobox.html#setModel)()和[setView](qcombobox.html#setView)())。在組合框的標籤文本和圖標,在具有該模型的數據[Qt.DisplayRole](qt.html#ItemDataRole-enum)和[Qt.DecorationRole](qt.html#ItemDataRole-enum)被使用。請注意,您不能更改[SelectionMode](qabstractitemview.html#SelectionMode-enum)的[view](qcombobox.html#view)( ),例如,通過使用[setSelectionMode()](qabstractitemview.html#selectionMode-prop)。 ![Comboboxes in the different built-in styles.](https://img.kancloud.cn/65/15/6515c4f00f8cdb478b6e814ee6d9335e_672x148.png) * * * ## Type Documentation ``` QComboBox.InsertPolicy ``` 此枚舉指定什么[QComboBox](qcombobox.html)應該做的,當一個新的字符串是由用戶輸入。 | Constant | Value | Description | | --- | --- | --- | | `QComboBox.NoInsert` | `0` | 該字符串不會被插入到組合框。 | | `QComboBox.InsertAtTop` | `1` | 該字符串將被插入在組合框中的第一項。 | | `QComboBox.InsertAtCurrent` | `2` | 目前的項目將_replaced_由該字符串。 | | `QComboBox.InsertAtBottom` | `3` | 該字符串將在ComboBox中的最后一個項目之后插入。 | | `QComboBox.InsertAfterCurrent` | `4` | 該字符串中的組合框的當前項后插入。 | | `QComboBox.InsertBeforeCurrent` | `5` | 該字符串中的組合框的當前項之前插入。 | | `QComboBox.InsertAlphabetically` | `6` | 該字符串被插入在組合框中的字母順序。 | ``` QComboBox.SizeAdjustPolicy ``` 這個枚舉指定的怎么尺寸暗示[QComboBox](qcombobox.html)應調整當新內容被添加或內容的變化。 | Constant | Value | Description | | --- | --- | --- | | `QComboBox.AdjustToContents` | `0` | 組合框會一直調整到內容 | | `QComboBox.AdjustToContentsOnFirstShow` | `1` | 組合框將被調整到它的內容在第一次被示出。 | | `QComboBox.AdjustToMinimumContentsLength` | `2` | 使用AdjustToContents或AdjustToContentsOnFirstShow代替。 | | `QComboBox.AdjustToMinimumContentsLengthWithIcon` | `3` | 組合框將被調整到[minimumContentsLength](qcombobox.html#minimumContentsLength-prop)加上一個圖標的空間。出于性能的考慮使用大型模型這一政策。 | * * * ## Method Documentation ``` QComboBox.__init__ (self, QWidget?parent?=?None) ``` 該_parent_的說法,如果不是沒有,原因_self_通過Qt的,而不是PyQt的擁有。 構造一個組合框與給定_parent_使用默認的模型[QStandardItemModel](qstandarditemmodel.html)。 ``` QComboBox.addItem (self, QString?text, QVariant?userData?=?QVariant()) ``` 一個項添加到組合框與給定_text_,和包含指定_userData_(存儲在[Qt.UserRole](qt.html#ItemDataRole-enum)) 。該項目被添加到現有的項目列表。 ``` QComboBox.addItem (self, QIcon?icon, QString?text, QVariant?userData?=?QVariant()) ``` 一個項添加到組合框與給定_icon_和_text_,和包含指定_userData_(存儲在[Qt.UserRole](qt.html#ItemDataRole-enum)) 。該項目被添加到現有的項目列表。 ``` QComboBox.addItems (self, QStringList?texts) ``` 把每個串中的給定_texts_到ComboBox 。每個項目會附加到反過來現有項目的清單。 ``` bool QComboBox.autoCompletion (self) ``` ``` Qt.CaseSensitivity QComboBox.autoCompletionCaseSensitivity (self) ``` [ ``` QComboBox.changeEvent (self, QEvent?e) ``` ](qt.html#CaseSensitivity-enum) [從重新實現](qt.html#CaseSensitivity-enum)[QWidget.changeEvent](qwidget.html#changeEvent)( ) 。 ``` QComboBox.clear (self) ``` 這種方法也是一個Qt槽與C + +的簽名`void clear()`。 清除組合框,刪除所有項目。 注意:如果您已經在組合框中設置一個外部模型調用此功能時,此模式將仍然被清除。 ``` QComboBox.clearEditText (self) ``` 這種方法也是一個Qt槽與C + +的簽名`void clearEditText()`。 清除用于編輯的組合框的行編輯的內容。 ``` QCompleter QComboBox.completer (self) ``` [ 返回用于自動完成文字輸入的組合框的完成者。 這個函數中引入了Qt 4.2中。 ](qcompleter.html) [**See also**](qcompleter.html) [setCompleter](qcombobox.html#setCompleter)()和[editable](qcombobox.html#editable-prop)。 ``` QComboBox.contextMenuEvent (self, QContextMenuEvent?e) ``` 從重新實現[QWidget.contextMenuEvent](qwidget.html#contextMenuEvent)( ) 。 ``` int QComboBox.count (self) ``` ``` int QComboBox.currentIndex (self) ``` ``` QString QComboBox.currentText (self) ``` ``` bool QComboBox.duplicatesEnabled (self) ``` ``` bool QComboBox.event (self, QEvent?event) ``` 從重新實現[QObject.event](qobject.html#event)( ) 。 ``` int QComboBox.findData (self, QVariant?data, int?role?=?Qt.UserRole, Qt.MatchFlags?flags?=?Qt.MatchExactly|Qt.MatchCaseSensitive) ``` 返回該項目包含給定的索引_data_對于給定的_role_否則返回-1 。 該_flags_指定如何在ComboBox中的項目進行搜索。 ``` int QComboBox.findText (self, QString?text, Qt.MatchFlags?flags?=?Qt.MatchExactly|Qt.MatchCaseSensitive) ``` 返回該項目包含給定的索引_text_否則返回-1 。 該_flags_指定如何在ComboBox中的項目進行搜索。 ``` QComboBox.focusInEvent (self, QFocusEvent?e) ``` 從重新實現[QWidget.focusInEvent](qwidget.html#focusInEvent)( ) 。 ``` QComboBox.focusOutEvent (self, QFocusEvent?e) ``` 從重新實現[QWidget.focusOutEvent](qwidget.html#focusOutEvent)( ) 。 ``` bool QComboBox.hasFrame (self) ``` ``` QComboBox.hideEvent (self, QHideEvent?e) ``` 從重新實現[QWidget.hideEvent](qwidget.html#hideEvent)( ) 。 ``` QComboBox.hidePopup (self) ``` 隱藏在組合框的項目列表,如果它是當前可見和復位內部狀態,所以,如果自定義彈出被證明里面的重新實現[showPopup](qcombobox.html#showPopup)( ) ,那么你還需要重新實現hidePopup ( )函數來隱藏你的自定義彈出并調用基類的實現來復位內部狀態時,您的自定義彈出窗口部件被隱藏。 **See also** [showPopup](qcombobox.html#showPopup)( ) 。 ``` QSize QComboBox.iconSize (self) ``` [ ``` QComboBox.initStyleOption (self, QStyleOptionComboBox?option) ``` ](qsize.html) [初始化_option_與其它的值](qsize.html)[QComboBox](qcombobox.html)。當他們需要一個這種方法是有用的子類[QStyleOptionComboBox](qstyleoptioncombobox.html),但不希望在所有的信息填寫自己。 **See also** [QStyleOption.initFrom](qstyleoption.html#initFrom)( ) 。 ``` QComboBox.inputMethodEvent (self, QInputMethodEvent) ``` 從重新實現[QWidget.inputMethodEvent](qwidget.html#inputMethodEvent)( ) 。 ``` QVariant QComboBox.inputMethodQuery (self, Qt.InputMethodQuery) ``` 從重新實現[QWidget.inputMethodQuery](qwidget.html#inputMethodQuery)( ) 。 ``` QComboBox.insertItem (self, int?index, QString?text, QVariant?userData?=?QVariant()) ``` 插入_text_和_userData_(存儲在[Qt.UserRole](qt.html#ItemDataRole-enum))到ComboBox在給定的_index_。 如果該指數等于或大于總項數越高,新項目被添加到現有的項目列表。如果該指數為零或負數,則新項目追加到現有的項目清單。 **See also** [insertItems](qcombobox.html#insertItems)( ) 。 ``` QComboBox.insertItem (self, int?index, QIcon?icon, QString?text, QVariant?userData?=?QVariant()) ``` 插入_icon_,_text_和_userData_(存儲在[Qt.UserRole](qt.html#ItemDataRole-enum))到ComboBox在給定的_index_。 如果該指數等于或大于總項數越高,新項目被添加到現有的項目列表。如果該指數為零或負數,則新項目追加到現有的項目清單。 **See also** [insertItems](qcombobox.html#insertItems)( ) 。 ``` QComboBox.insertItems (self, int?index, QStringList?texts) ``` 從插入字符串_list_到ComboBox作為單獨的項目,開始于_index_規定。 如果該指數等于或大于總項數越高,新項目被添加到現有的項目列表。如果該指數為零或負數,則新項目追加到現有的項目清單。 **See also** [insertItem](qcombobox.html#insertItem)( ) 。 ``` InsertPolicy QComboBox.insertPolicy (self) ``` [ ``` QComboBox.insertSeparator (self, int?index) ``` 插入分隔項目到ComboBox在給定的_index_。 如果該指數等于或大于總項數越高,新項目被添加到現有的項目列表。如果該指數為零或負數,則新項目追加到現有的項目清單。 此功能被引入Qt的4.4 。 ](qcombobox.html#InsertPolicy-enum) [**See also**](qcombobox.html#InsertPolicy-enum) [insertItem](qcombobox.html#insertItem)( ) 。 ``` bool QComboBox.isEditable (self) ``` ``` QVariant QComboBox.itemData (self, int?index, int?role?=?Qt.UserRole) ``` 返回數據為給定的_role_在給定的_index_在組合框,或[QVariant.Invalid](qvariant.html#Type-enum)如果沒有數據,這個作用。 **See also** [setItemData](qcombobox.html#setItemData)( ) 。 ``` QAbstractItemDelegate QComboBox.itemDelegate (self) ``` [ 返回所使用的彈出列表視圖中的項目委讬。 ](qabstractitemdelegate.html) [**See also**](qabstractitemdelegate.html) [setItemDelegate](qcombobox.html#setItemDelegate)( ) 。 ``` QIcon QComboBox.itemIcon (self, int?index) ``` [ 返回圖標為給定的_index_在組合框。 ](qicon.html) [**See also**](qicon.html) [setItemIcon](qcombobox.html#setItemIcon)( ) 。 ``` QString QComboBox.itemText (self, int?index) ``` 返回文本為給定的_index_在組合框。 **See also** [setItemText](qcombobox.html#setItemText)( ) 。 ``` QComboBox.keyPressEvent (self, QKeyEvent?e) ``` 從重新實現[QWidget.keyPressEvent](qwidget.html#keyPressEvent)( ) 。 ``` QComboBox.keyReleaseEvent (self, QKeyEvent?e) ``` 從重新實現[QWidget.keyReleaseEvent](qwidget.html#keyReleaseEvent)( ) 。 ``` QLineEdit QComboBox.lineEdit (self) ``` [ 返回用于在組合框,或0編輯項目,如果沒有行編輯的行編輯。 唯一可編輯的組合框有一個行編輯。 ](qlineedit.html) [**See also**](qlineedit.html) [setLineEdit](qcombobox.html#setLineEdit)( ) 。 ``` int QComboBox.maxCount (self) ``` ``` int QComboBox.maxVisibleItems (self) ``` ``` int QComboBox.minimumContentsLength (self) ``` ``` QSize QComboBox.minimumSizeHint (self) ``` [](qsize.html) [從重新實現](qsize.html)[QWidget.minimumSizeHint](qwidget.html#minimumSizeHint-prop)( ) 。 ``` QAbstractItemModel QComboBox.model (self) ``` [ 返回所使用的組合框模型。 ](qabstractitemmodel.html) [**See also**](qabstractitemmodel.html) [setModel](qcombobox.html#setModel)( ) 。 ``` int QComboBox.modelColumn (self) ``` ``` QComboBox.mousePressEvent (self, QMouseEvent?e) ``` 從重新實現[QWidget.mousePressEvent](qwidget.html#mousePressEvent)( ) 。 ``` QComboBox.mouseReleaseEvent (self, QMouseEvent?e) ``` 從重新實現[QWidget.mouseReleaseEvent](qwidget.html#mouseReleaseEvent)( ) 。 ``` QComboBox.paintEvent (self, QPaintEvent?e) ``` 從重新實現[QWidget.paintEvent](qwidget.html#paintEvent)( ) 。 ``` QComboBox.removeItem (self, int?index) ``` 刪除給定的項目_index_從組合框。如果索引中刪除這將更新當前的索引。 這個函數做什么,如果_index_超出范圍。 ``` QComboBox.resizeEvent (self, QResizeEvent?e) ``` 從重新實現[QWidget.resizeEvent](qwidget.html#resizeEvent)( ) 。 ``` QModelIndex QComboBox.rootModelIndex (self) ``` [ 返回根模型項目指數在ComboBox中的項目。 ](qmodelindex.html) [**See also**](qmodelindex.html) [setRootModelIndex](qcombobox.html#setRootModelIndex)( ) 。 ``` QComboBox.setAutoCompletion (self, bool?enable) ``` ``` QComboBox.setAutoCompletionCaseSensitivity (self, Qt.CaseSensitivity?sensitivity) ``` ``` QComboBox.setCompleter (self, QCompleter?c) ``` 設置_completer_使用而不是目前的完成者的。如果_completer_為0 ,自動完成被禁用。 默認情況下,一個可編輯的組合框,一個[QCompleter](qcompleter.html)執行不區分大小寫的直列完成自動創建。 這個函數中引入了Qt 4.2中。 **See also** [completer](qcombobox.html#completer)( ) 。 ``` QComboBox.setCurrentIndex (self, int?index) ``` ``` QComboBox.setDuplicatesEnabled (self, bool?enable) ``` ``` QComboBox.setEditable (self, bool?editable) ``` ``` QComboBox.setEditText (self, QString?text) ``` 這種方法也是一個Qt槽與C + +的簽名`void setEditText(const QString&)`。 設置_text_在組合框的文本編輯。 ``` QComboBox.setFrame (self, bool) ``` ``` QComboBox.setIconSize (self, QSize?size) ``` ``` QComboBox.setInsertPolicy (self, InsertPolicy?policy) ``` ``` QComboBox.setItemData (self, int?index, QVariant?value, int?role?=?Qt.UserRole) ``` 設置數據_role_在給定的產品_index_在組合框來指定_value_。 **See also** [itemData](qcombobox.html#itemData)( ) 。 ``` QComboBox.setItemDelegate (self, QAbstractItemDelegate?delegate) ``` 設置項_delegate_在彈出的列表視圖。組合框采用委讬的所有權。 **Warning:**你不應該共享組合框,控件映射程序或視圖之間的委讬的同一實例。否則會導致不正確或不直觀的編輯行為,因為在一個給定的委讬每個視圖可能會收到[closeEditor()](qabstractitemdelegate.html#closeEditor)信號,并試圖訪問,修改或關閉一個已經被關閉的編輯器。 **See also** [itemDelegate](qcombobox.html#itemDelegate)( ) 。 ``` QComboBox.setItemIcon (self, int?index, QIcon?icon) ``` 設置_icon_在給定的產品_index_在組合框。 **See also** [itemIcon](qcombobox.html#itemIcon)( ) 。 ``` QComboBox.setItemText (self, int?index, QString?text) ``` 設置_text_在給定的產品_index_在組合框。 **See also** [itemText](qcombobox.html#itemText)( ) 。 ``` QComboBox.setLineEdit (self, QLineEdit?edit) ``` 該_edit_說法有它的所有權轉移給Qt的。 設置行_edit_使用而不是目前的行編輯widget的。 組合框取行編輯的所有權。 **See also** [lineEdit](qcombobox.html#lineEdit)( ) 。 ``` QComboBox.setMaxCount (self, int?max) ``` ``` QComboBox.setMaxVisibleItems (self, int?maxItems) ``` ``` QComboBox.setMinimumContentsLength (self, int?characters) ``` ``` QComboBox.setModel (self, QAbstractItemModel?model) ``` 設置模型是_model_。_model_不能為0 。如果你想清除一個模型的內容,請致電[clear](qcombobox.html#clear)( ) 。 **See also** [model](qcombobox.html#model)()和[clear](qcombobox.html#clear)( ) 。 ``` QComboBox.setModelColumn (self, int?visibleColumn) ``` ``` QComboBox.setRootModelIndex (self, QModelIndex?index) ``` 設置根模型項目_index_在ComboBox中的項目。 **See also** [rootModelIndex](qcombobox.html#rootModelIndex)( ) 。 ``` QComboBox.setSizeAdjustPolicy (self, SizeAdjustPolicy?policy) ``` ``` QComboBox.setValidator (self, QValidator?v) ``` 設置_validator_使用而不是目前的驗證器。 **See also** [validator](qcombobox.html#validator)( ) 。 ``` QComboBox.setView (self, QAbstractItemView?itemView) ``` 該_itemView_說法有它的所有權轉移給Qt的。 設置要使用的組合框彈出給定的視圖_itemView_。組合框采用該視圖的所有權。 注意:如果你想使用的便利性意見(如[QListWidget](qlistwidget.html),[QTableWidget](qtablewidget.html) or [QTreeWidget](qtreewidget.html)) ,請確保調用[setModel](qcombobox.html#setModel)( )在調用此函數之前的組合框與便利的小部件的模型。 **See also** [view](qcombobox.html#view)( ) 。 ``` QComboBox.showEvent (self, QShowEvent?e) ``` 從重新實現[QWidget.showEvent](qwidget.html#showEvent)( ) 。 ``` QComboBox.showPopup (self) ``` 顯示在組合框的項目列表。如果列表為空,則沒有項目將會顯示。 如果你重新實現這個函數來顯示一個自定義彈出,請確保您致電[hidePopup](qcombobox.html#hidePopup)()復位內部狀態。 **See also** [hidePopup](qcombobox.html#hidePopup)( ) 。 ``` SizeAdjustPolicy QComboBox.sizeAdjustPolicy (self) ``` [](qcombobox.html#SizeAdjustPolicy-enum) ``` QSize QComboBox.sizeHint (self) ``` [](qsize.html) [從重新實現](qsize.html)[QWidget.sizeHint](qwidget.html#sizeHint-prop)( ) 。 此實現緩存大小提示,以避免在調整大小時的內容動態改變。無效緩存的值改變[sizeAdjustPolicy](qcombobox.html#sizeAdjustPolicy-prop)。 ``` QValidator QComboBox.validator (self) ``` [ 返回用來限制文字輸入組合框的驗證。 ](qvalidator.html) [**See also**](qvalidator.html) [setValidator](qcombobox.html#setValidator)()和[editable](qcombobox.html#editable-prop)。 ``` QAbstractItemView QComboBox.view (self) ``` [ 返回用于組合框彈出列表視圖。 ](qabstractitemview.html) [**See also**](qabstractitemview.html) [setView](qcombobox.html#setView)( ) 。 ``` QComboBox.wheelEvent (self, QWheelEvent?e) ``` 從重新實現[QWidget.wheelEvent](qwidget.html#wheelEvent)( ) 。 ``` QComboBox.__len__ (self) ``` * * * ## Qt Signal Documentation ``` void activated (int) ``` 這是該信號的默認超載。 當用戶選擇在ComboBox中的項目,這個信號被發送。該項目的_index_被傳遞。請注意,即使在選擇時不改變此信號被發送。如果你需要知道什么時候該選擇實際上改變,使用信號[currentIndexChanged](qcombobox.html#currentIndexChanged)( ) 。 ``` void activated (const QString&) ``` 當用戶選擇在ComboBox中的項目,這個信號被發送。該項目的_text_被傳遞。請注意,即使在選擇時不改變此信號被發送。如果你需要知道什么時候該選擇實際上改變,使用信號[currentIndexChanged](qcombobox.html#currentIndexChanged)( ) 。 ``` void currentIndexChanged (int) ``` 這是該信號的默認超載。 這個信號被發送時的[currentIndex](qcombobox.html#currentIndex-prop)在組合框的變化既可以通過用戶交互或編程方式。該項目的_index_通過或-1,如果組合框為空或[currentIndex](qcombobox.html#currentIndex-prop)被重置。 這個函數是Qt 4.1中引入。 ``` void currentIndexChanged (const QString&) ``` 這個信號被發送時的[currentIndex](qcombobox.html#currentIndex-prop)在組合框的變化既可以通過用戶交互或編程方式。該項目的_text_被傳遞。 這個函數是Qt 4.1中引入。 ``` void editTextChanged (const QString&) ``` 這是該信號的默認超載。 當在組合框的行編輯插件的文本更改這個信號被發射。新的文本由指定_text_。 ``` void highlighted (int) ``` 這是該信號的默認超載。 當在組合框彈出列表中的項目是由用戶突出顯示該信號被發送。該項目的_index_被傳遞。 ``` void highlighted (const QString&) ``` 當在組合框彈出列表中的項目是由用戶突出顯示該信號被發送。該項目的_text_被傳遞。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看