<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智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # QAbstractListModel Class Reference ## [[QtCore](index.htm) module] 該QAbstractListModel類提供了可以被子類來創建一維列表模型的抽象模型。[More...](#details) 繼承[QAbstractItemModel](qabstractitemmodel.html)。 通過繼承[AudioOutputDeviceModel](index.htm),[EffectDescriptionModel](index.htm)和[QStringListModel](qstringlistmodel.html)。 ### Methods * `__init__ (self, QObject?parent?=?None)` * `bool dropMimeData (self, QMimeData?data, Qt.DropAction?action, int?row, int?column, QModelIndex?parent)` * `QModelIndex index (self, int?row, int?column?=?0, QModelIndex?parent?=?QModelIndex())` * * * ## Detailed Description 該QAbstractListModel類提供了可以被子類來創建一維列表模型的抽象模型。 QAbstractListModel為代表的數據項的一個簡單的非分層序列模型的標準接口。它不能直接使用,但必須被繼承。 由于該模型提供了一個更專門的接口比[QAbstractItemModel](qabstractitemmodel.html),它是不適合與樹視圖的使用,你將需要繼承[QAbstractItemModel](qabstractitemmodel.html)如果你想提供一個模型用于這一目的。如果你需要使用一個號碼列表模式來管理數據,它可能是比較合適的子類[QAbstractTableModel](qabstracttablemodel.html)類代替。 簡單的模型可以通過繼承這個類并實現所需功能的最小數目來創建。例如,我們可以實現一個簡單的只讀[QStringList](qstringlist.html)為基礎的模型,它提供的字符串到列表[QListView](qlistview.html)小工具。在這種情況下,我們只需要實現[rowCount](qabstractitemmodel.html#rowCount)()函數返回的項目的列表中的號碼,并[data](qabstractitemmodel.html#data)( )函數來從列表中檢索項目。 因為該模型代表一個一維結構,該[rowCount](qabstractitemmodel.html#rowCount)()函數返回的項目中的模型的總數。該[columnCount](qabstractitemmodel.html#columnCount)( )函數用于實現互操作性與各種意見,但默認情況下,通知的意見,該模型只包含一列。 ### Subclassing 當子類QAbstractListModel ,您必須提供的實現[rowCount](qabstractitemmodel.html#rowCount)()和[data](qabstractitemmodel.html#data)()函數。表現良好的機型還提供了[headerData](qabstractitemmodel.html#headerData)()實現。 對于可編輯列表的機型,您還必須提供的一個實現[setData](qabstractitemmodel.html#setData)( ) ,實施[flags](qabstractitemmodel.html#flags)( )函數,以便它返回一個包含一個值[Qt.ItemIsEditable](qt.html#ItemFlag-enum)。 需要注意的是QAbstractListModel提供的默認實現[columnCount](qabstractitemmodel.html#columnCount)( ) ,通知的意見,有項目在這個模型只有一個列。 模型,提供接口來調整大小與列表類似的數據結構可以提供的實現[insertRows](qabstractitemmodel.html#insertRows)()和[removeRows](qabstractitemmodel.html#removeRows)( ) 。當實現這些功能,它調用相應的功能很重要,這樣所有連接的看法是知悉有任何變化: * An [insertRows](qabstractitemmodel.html#insertRows)() implementation must call [beginInsertRows](qabstractitemmodel.html#beginInsertRows)() _before_ inserting new rows into the data structure, and it must call [endInsertRows](qabstractitemmodel.html#endInsertRows)() _immediately afterwards_. * A [removeRows](qabstractitemmodel.html#removeRows)() implementation must call [beginRemoveRows](qabstractitemmodel.html#beginRemoveRows)() _before_ the rows are removed from the data structure, and it must call [endRemoveRows](qabstractitemmodel.html#endRemoveRows)() _immediately afterwards_. **Note:**可在子類化模型的一些通用準則[Model Subclassing Reference](index.htm#model-subclassing-reference)。 * * * ## Method Documentation ``` QAbstractListModel.__init__ (self, QObject?parent?=?None) ``` 該_parent_的說法,如果不是沒有,原因_self_通過Qt的,而不是PyQt的擁有。 構造一個抽象的列表模式與給定_parent_。 ``` bool QAbstractListModel.dropMimeData (self, QMimeData?data, Qt.DropAction?action, int?row, int?column, QModelIndex?parent) ``` 從重新實現[QAbstractItemModel.dropMimeData](qabstractitemmodel.html#dropMimeData)( ) 。 ``` QModelIndex QAbstractListModel.index (self, int?row, int?column?=?0, QModelIndex?parent?=?QModelIndex()) ``` [](qmodelindex.html) [從重新實現](qmodelindex.html)[QAbstractItemModel.index](qabstractitemmodel.html#index)( ) 。 返回的數據的索引_row_和_column_同_parent_。 **See also** [parent](qabstractitemmodel.html#parent)( ) 。
                  <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>

                              哎呀哎呀视频在线观看