当前位置: 首页>>代码示例>>Python>>正文


Python QtCore.QAbstractTableModel类代码示例

本文整理汇总了Python中PyQt5.QtCore.QAbstractTableModel的典型用法代码示例。如果您正苦于以下问题:Python QAbstractTableModel类的具体用法?Python QAbstractTableModel怎么用?Python QAbstractTableModel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了QAbstractTableModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

 def __init__(self):
     QAbstractTableModel.__init__(self)
     pyqtbus = QtsRMQReceiversPyQtBus()
     pyqtbus.EOnRecord.connect(self.on_record, Qt.QueuedConnection)
     self.items = dict()
     self.key_row_dict = dict()
     self.header_name = list()
     self.header_name.append('帐户')
     self.header_name.append('策略ID')
     self.header_name.append('父订单ID')
     self.header_name.append('订单ID')
     self.header_name.append('算法ID')
     self.header_name.append('算法订单ID')
     self.header_name.append('市场')
     self.header_name.append('品种')
     self.header_name.append('证券代码')
     self.header_name.append('交易行为')
     self.header_name.append('状态')
     self.header_name.append('下单价格')
     self.header_name.append('成交价格')
     self.header_name.append('下单量')
     self.header_name.append('成交量')
     self.header_name.append('下单时间')
     self.header_name.append('成交时间')
     self.header_name.append('属性')
     self.header_name.append('是否撤单')
     self.header_name.append('用户ID')
     self.header_name.append('父交易行为')
     self.header_name.append('前状态')
     self.header_name.append('方向')
开发者ID:waterdiviner,项目名称:AppOps,代码行数:30,代码来源:qtsrecordview.py

示例2: __init__

 def __init__(self, objects=None, properties=None, isRowObjects=True, isDynamic=True, templateObject=None, parent=None):
     QAbstractTableModel.__init__(self, parent)
     self.objects = objects if (objects is not None) else []
     self.properties = properties if (properties is not None) else []
     self.isRowObjects = isRowObjects
     self.isDynamic = isDynamic
     self.templateObject = templateObject
开发者ID:marcel-goldschen-ohm,项目名称:ModelViewPyQt,代码行数:7,代码来源:ObjectListTableModelViewQt.py

示例3: __init__

    def __init__(self, elements=None, parent=None):
        '''
        Common interface for the labelListModel, the boxListModel, and the cropListModel
        see concrete implementations for details

        :param elements:
        :param parent:
        '''
        QAbstractTableModel.__init__(self, parent)

        if elements is None:
            elements = []
        self._elements = list(elements)
        self._selectionModel = QItemSelectionModel(self)

        def onSelectionChanged(selected, deselected):


            if selected:
                ind = selected[0].indexes()
                if len(ind)>0:
                    self.elementSelected.emit(ind[0].row())

        self._selectionModel.selectionChanged.connect(onSelectionChanged)

        self._allowRemove = True
        self._toolTipSuffixes = {}

        self.unremovable_rows=[] #rows in this list cannot be removed from the gui,
开发者ID:ilastik,项目名称:ilastik,代码行数:29,代码来源:listModel.py

示例4: __init__

 def __init__(self, parent):
     QAbstractTableModel.__init__(self, parent)
     self._data = None
     self._subs = [None]
     self._videos = [None]
     self._headers = [_("Videofile"), _("Subtitle")]
     self._main = None
     self.rowsSelected = None
开发者ID:fizyk20,项目名称:subdownloader,代码行数:8,代码来源:uploadlistview.py

示例5: __init__

    def __init__(self, headers, parent=None, *args):
        QAbstractTableModel.__init__(self, parent)
        self._anchor_positions = []
        self._headers = headers
        self._latest_known_anchor_positions = {}

        self._green_brush = QBrush(QColor(200, 255, 200))
        self._red_brush = QBrush(QColor(255, 200, 200))
开发者ID:bitcraze,项目名称:crazyflie-clients-python,代码行数:8,代码来源:anchor_position_dialog.py

示例6: __init__

    def __init__(self, cubeFile, cubeDB, parent=None, *args, **kwargs):
        QAbstractTableModel.__init__(self, parent, *args, **kwargs)
        
        self._cubeFile = cubeFile
        self._cubeData = None
        self._cubeDB   = cubeDB

        self.manager = QNetworkAccessManager( parent=self )
        self.manager.finished.connect( self.downloadFinished )
开发者ID:Acbarakat,项目名称:MtGCubeViz,代码行数:9,代码来源:models.py

示例7: __init__

 def __init__(self, model, view):
     QAbstractTableModel.__init__(self)
     self.model = model
     self.view = view
     self.view.setModel(self)
     self._lastClickedColumn = 0
     self.columnMenu = QMenu()
     for index, fieldId in enumerate(FIELD_ORDER):
         fieldName = FIELD_NAMES[fieldId]
         action = self.columnMenu.addAction(fieldName)
         action.setData(index)
         action.triggered.connect(self.columnMenuItemClicked)
     self.view.horizontalHeader().sectionClicked.connect(self.tableSectionClicked)
开发者ID:daleathan,项目名称:moneyguru,代码行数:13,代码来源:csv_options.py

示例8: __init__

 def __init__(self):
     QAbstractTableModel.__init__(self)
     pyqtbus = QtsRMQReceiversPyQtBus()
     pyqtbus.EOnAccount.connect(self.on_account, Qt.QueuedConnection)
     self.items = dict()
     self.key_row_dict = dict()
     self.header_name = list()
     self.header_name.append('市场')
     self.header_name.append('品种')
     self.header_name.append('帐户')
     self.header_name.append('总资金')
     self.header_name.append('可用资金')
     self.header_name.append('冻结资金')
     self.header_name.append('日期')
     self.header_name.append('货币类型')
开发者ID:waterdiviner,项目名称:AppOps,代码行数:15,代码来源:qtsaccountview.py

示例9: headerData

 def headerData(self, section, orientation, role):
     """
     Public method to get header data from the model.
     
     @param section section number (integer)
     @param orientation orientation (Qt.Orientation)
     @param role role of the data to retrieve (integer)
     @return requested data
     """
     if role == Qt.SizeHintRole:
         fm = QFontMetrics(QFont())
         height = fm.height() + fm.height() // 3
         width = \
             fm.width(self.headerData(section, orientation, Qt.DisplayRole))
         return QSize(width, height)
     
     if orientation == Qt.Horizontal:
         if role == Qt.DisplayRole:
             try:
                 return self.__headers[section]
             except IndexError:
                 return None
         
         return None
     
     return QAbstractTableModel.headerData(self, section, orientation, role)
开发者ID:Darriall,项目名称:eric,代码行数:26,代码来源:CookieModel.py

示例10: headerData

 def headerData(self, section, orientation, role = Qt.DisplayRole):
     if role == Qt.DisplayRole:
         if orientation == Qt.Horizontal:
             return str(self.h_header[section])
         elif orientation == Qt.Vertical:
             return str(self.v_header[section])
     return QAbstractTableModel.headerData(self, section, orientation, role)
开发者ID:Acbarakat,项目名称:MtGCubeViz,代码行数:7,代码来源:models.py

示例11: flags

    def flags(self, index):
        """ Método reimplementado.
        Permite la edición en el modelo """

        flags = QAbstractTableModel.flags(self, index)
        if self.editable:
            flags |= Qt.ItemIsEditable
        return flags
开发者ID:yoshitomimaehara,项目名称:pireal,代码行数:8,代码来源:model.py

示例12: __init__

 def __init__(self):
     QAbstractTableModel.__init__(self)
     pyqtbus = QtsRMQReceiversPyQtBus()
     pyqtbus.EOnPosition.connect(self.on_position, Qt.QueuedConnection)
     self.items = dict()
     self.key_row_dict = dict()
     self.header_name = list()
     self.header_name.append('帐户')
     self.header_name.append('市场')
     self.header_name.append('品种')
     self.header_name.append('证券代码')
     self.header_name.append('类型')
     self.header_name.append('总仓位')
     self.header_name.append('可用仓位')
     self.header_name.append('冻结仓位')
     self.header_name.append('费用')
     self.header_name.append('仓位级别')
     self.header_name.append('可申赎仓位')
     self.header_name.append('今仓')
     self.header_name.append('日期')
开发者ID:waterdiviner,项目名称:AppOps,代码行数:20,代码来源:qtspositionview.py

示例13: flags

 def flags(self, index):
     flags = QAbstractTableModel.flags(self, index)
     if not index.isValid():
         return flags
     prop = self.getProperty(index)
     if prop is None:
         return flags
     flags |= Qt.ItemIsEnabled
     flags |= Qt.ItemIsSelectable
     mode = prop.get('mode', "Read/Write")
     if "Write" in mode:
         flags |= Qt.ItemIsEditable
     return flags
开发者ID:marcel-goldschen-ohm,项目名称:ModelViewPyQt,代码行数:13,代码来源:ObjectListTableModelViewQt.py

示例14: headerData

 def headerData(self, section, orientation, role=Qt.DisplayRole):
     """
     Public method to get header data from the model.
     
     @param section section number (integer)
     @param orientation orientation (Qt.Orientation)
     @param role role of the data to retrieve (integer)
     @return requested data
     """
     if orientation == Qt.Horizontal and role == Qt.DisplayRole:
         return self.__headerData[section]
     
     return QAbstractTableModel.headerData(self, section, orientation, role)
开发者ID:Darriall,项目名称:eric,代码行数:13,代码来源:E5NetworkMonitor.py

示例15: __init__

    def __init__(self, table=[[]], headers=[], colors=[], parent=None):
        """Initialization method for the PalettedTableModel. This portion
        of the code will execute every time a PalettedTableModel object
        is instantiated

        Parameters
        ----------
        Args:
            table: list
                A nested table containing the data abstracted in the
                QAbstractTableModel. Indexed as [row][column]
            headers: list
                A list containing hex color codes (or some other matplotlib
                accepted value) to define the row colors
            parent: None
                The object from which the instantiated object inherits

        Notes
        -----
        All attributes on this model were required to be set as public
        attributes (in the Python world, i.e. no leading _ to the name).
        This allows for access to the table data and color values regardless
        of whether or not the object is instantiated in __main__.

        """
        # Default parent to self
        if parent is None:
            parent = self

        # For Qt
        super(PalettedTableModel, self).__init__()

        QAbstractTableModel.__init__(self, parent)

        # Set up the table, table headers, and colors properties
        self.table = table
        self.headers = headers
        self.colors = colors
开发者ID:ajoros,项目名称:ves,代码行数:38,代码来源:table.py


注:本文中的PyQt5.QtCore.QAbstractTableModel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。