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

    上一话题

    QStandardItemModel

    下一话题

    QFileSystemModel

    QProxyModel

    概要

    函数

    虚函数

    详细描述

    PySide.QtGui.QProxyModel class provides support for processing data passed between another model and a view.

    If you want to do filtering and sorting, see PySide.QtGui.QSortFilterProxyModel .

    Proxy models provide a standard model interface that can be used to manipulate the data retrieved through an underlying model. They can be used to perform operations such as sorting and filtering on the data obtained without changing the contents of the model.

    Just as with subclasses of PySide.QtGui.QAbstractItemView , PySide.QtGui.QProxyModel provides the PySide.QtGui.QProxyModel.setModel() function that is used to specify the model to be acted on by the proxy. Views can be connected to either the underlying model or the proxy model with QAbstractItemView.setModel() .

    Since views rely on the information provided in model indexes to identify items of data from models, and to position these items in some visual representation, proxy models must create their own model indexes instead of supplying model indexes from their underlying models.

    另请参阅

    模型/视图编程 PySide.QtCore.QAbstractItemModel

    class PySide.QtGui. QProxyModel ( [ parent=None ] )
    参数: parent PySide.QtCore.QObject

    Constructs a proxy model with the given parent .

    PySide.QtGui.QProxyModel. connectToModel ( model )
    参数: model PySide.QtCore.QAbstractItemModel

    Connect to all the signals emitted by given model .

    PySide.QtGui.QProxyModel. disconnectFromModel ( model )
    参数: model PySide.QtCore.QAbstractItemModel

    Disconnect from all the signals emitted by the given model .

    PySide.QtGui.QProxyModel. model ( )
    返回类型: PySide.QtCore.QAbstractItemModel

    Returns the model that contains the data that is available through the proxy model.

    PySide.QtGui.QProxyModel. setModel ( model )
    参数: model PySide.QtCore.QAbstractItemModel

    设置给定 model to be processed by the proxy model.

    PySide.QtGui.QProxyModel. setProxyModel ( source_index )
    参数: source_index PySide.QtCore.QModelIndex
    返回类型: PySide.QtCore.QModelIndex

    Change the model pointer in the given source_index to point to the proxy model.

    PySide.QtGui.QProxyModel. setSourceModel ( proxy_index )
    参数: proxy_index PySide.QtCore.QModelIndex
    返回类型: PySide.QtCore.QModelIndex

    Change the model pointer in the given proxy_index to point to the source model.