本文整理匯總了Python中PyQt5.QtCore.QAbstractTableModel.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python QAbstractTableModel.__init__方法的具體用法?Python QAbstractTableModel.__init__怎麽用?Python QAbstractTableModel.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PyQt5.QtCore.QAbstractTableModel
的用法示例。
在下文中一共展示了QAbstractTableModel.__init__方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from PyQt5.QtCore import QAbstractTableModel [as 別名]
# 或者: from PyQt5.QtCore.QAbstractTableModel import __init__ [as 別名]
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('方向')
示例2: __init__
# 需要導入模塊: from PyQt5.QtCore import QAbstractTableModel [as 別名]
# 或者: from PyQt5.QtCore.QAbstractTableModel import __init__ [as 別名]
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
示例3: __init__
# 需要導入模塊: from PyQt5.QtCore import QAbstractTableModel [as 別名]
# 或者: from PyQt5.QtCore.QAbstractTableModel import __init__ [as 別名]
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,
示例4: __init__
# 需要導入模塊: from PyQt5.QtCore import QAbstractTableModel [as 別名]
# 或者: from PyQt5.QtCore.QAbstractTableModel import __init__ [as 別名]
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
示例5: __init__
# 需要導入模塊: from PyQt5.QtCore import QAbstractTableModel [as 別名]
# 或者: from PyQt5.QtCore.QAbstractTableModel import __init__ [as 別名]
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))
示例6: __init__
# 需要導入模塊: from PyQt5.QtCore import QAbstractTableModel [as 別名]
# 或者: from PyQt5.QtCore.QAbstractTableModel import __init__ [as 別名]
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 )
示例7: __init__
# 需要導入模塊: from PyQt5.QtCore import QAbstractTableModel [as 別名]
# 或者: from PyQt5.QtCore.QAbstractTableModel import __init__ [as 別名]
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)
示例8: __init__
# 需要導入模塊: from PyQt5.QtCore import QAbstractTableModel [as 別名]
# 或者: from PyQt5.QtCore.QAbstractTableModel import __init__ [as 別名]
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('貨幣類型')
示例9: __init__
# 需要導入模塊: from PyQt5.QtCore import QAbstractTableModel [as 別名]
# 或者: from PyQt5.QtCore.QAbstractTableModel import __init__ [as 別名]
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('日期')
示例10: __init__
# 需要導入模塊: from PyQt5.QtCore import QAbstractTableModel [as 別名]
# 或者: from PyQt5.QtCore.QAbstractTableModel import __init__ [as 別名]
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
示例11: __init__
# 需要導入模塊: from PyQt5.QtCore import QAbstractTableModel [as 別名]
# 或者: from PyQt5.QtCore.QAbstractTableModel import __init__ [as 別名]
def __init__(self, parent, header, data, *args):
QAbstractTableModel.__init__(self, parent, *args)
self.header = header
self.data = data
示例12: __init__
# 需要導入模塊: from PyQt5.QtCore import QAbstractTableModel [as 別名]
# 或者: from PyQt5.QtCore.QAbstractTableModel import __init__ [as 別名]
def __init__(self, matrix, parent=None, *args):
QAbstractTableModel.__init__(self, parent, *args)
self.matrix = matrix
示例13: __init__
# 需要導入模塊: from PyQt5.QtCore import QAbstractTableModel [as 別名]
# 或者: from PyQt5.QtCore.QAbstractTableModel import __init__ [as 別名]
def __init__(self, rows_data_list, header_list, parent=None, *args):
QAbstractTableModel.__init__(self, parent, *args)
self.rows = rows_data_list
self.headers = header_list
return
示例14: __init__
# 需要導入模塊: from PyQt5.QtCore import QAbstractTableModel [as 別名]
# 或者: from PyQt5.QtCore.QAbstractTableModel import __init__ [as 別名]
def __init__(self, datain, headerdata, parent=None, *args):
QAbstractTableModel.__init__(self, parent, *args)
self.arraydata = datain * 2
self.headerdata = headerdata
示例15: __init__
# 需要導入模塊: from PyQt5.QtCore import QAbstractTableModel [as 別名]
# 或者: from PyQt5.QtCore.QAbstractTableModel import __init__ [as 別名]
def __init__(self, internal_container, parent=None):
QAbstractTableModel.__init__(self, parent)
self._internal_container = internal_container
self._object_attributes = []