本文整理匯總了Python中PySide.QtCore.QAbstractTableModel.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python QAbstractTableModel.__init__方法的具體用法?Python QAbstractTableModel.__init__怎麽用?Python QAbstractTableModel.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PySide.QtCore.QAbstractTableModel
的用法示例。
在下文中一共展示了QAbstractTableModel.__init__方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import __init__ [as 別名]
def __init__(self, runner=None):
_OptionsModelMixin.__init__(self)
QAbstractTableModel.__init__(self)
self._runner = runner
def _column0(runner, options):
return str(options)
def _column1(runner, options):
STATE_ICONS = \
{LocalRunner.STATE_QUEUED: getIcon('media-playback-pause'),
LocalRunner.STATE_RUNNING: getIcon('media-playback-start'),
LocalRunner.STATE_SIMULATED: getIcon('face-smile'),
LocalRunner.STATE_ERROR: getIcon('face-sad')}
try:
return STATE_ICONS.get(runner.options_state(options))
except KeyError:
return None
def _column2(runner, options):
try:
progress = runner.options_progress(options) * 100
except KeyError:
progress = 0.0
return '{0:n}%'.format(progress)
def _column3(runner, options):
try:
return runner.options_status(options)
except KeyError:
return ''
self._data_getter = {0: _column0, 1: _column1, 2: _column2, 3: _column3}
示例2: __init__
# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import __init__ [as 別名]
def __init__(self, results, headerdata, parent=None, *args):
""" datain: a list of lists
headerdata: a list of strings
"""
QAbstractTableModel.__init__(self, parent, *args)
#self.arraydata = datain
self.headerdata = headerdata
self.results = results
示例3: __init__
# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import __init__ [as 別名]
def __init__(self, dataset = Dataset(), parent = None):
'''Construtor de DatasetModel.
Parâmetros:
dataset : objeto Dataset para ser atribuído a *_dataset*
'''
QAbstractTableModel.__init__(self, parent)
self._dataset = dataset
示例4: __init__
# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import __init__ [as 別名]
def __init__ ( self, editor, parent ):
""" Initialise the object.
"""
QAbstractTableModel.__init__( self, parent )
self.setSupportedDragActions( Qt.CopyAction | Qt.MoveAction )
self._editor = editor
self._row = editor.data_row_for
self._font = set()
示例5: __init__
# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import __init__ [as 別名]
def __init__(self, dados = [], parent = None):
'''Construtor de DatasetModel.
Parâmetros:
dados : objeto Dataset para ser atribuído a *_dataset*
'''
QAbstractTableModel.__init__(self, parent)
self._dados = dados
self._estatistica = dados.describe()
示例6: __init__
# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import __init__ [as 別名]
def __init__(self):
""" Build the Transactions Table """
QAbstractTableModel.__init__(self)
self.columns = self.getColumns()
self.roleResponses = {Qt.DisplayRole:self.getData,
Qt.EditRole:self.getData,
Qt.ToolTipRole:self.getTip,
Qt.StatusTipRole:self.getTip,
Qt.TextAlignmentRole:self.getTextAlignment}
示例7: __init__
# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import __init__ [as 別名]
def __init__(self, tabList=None, parent=None):
QAbstractTableModel.__init__(self, parent)
self.__headers = [
'Char', 'Freq', 'ASCII', 'Huff', u'Ĉ ASCII', u'Ĉ Huff']
if tabList is None:
tabList = [['' for x in range(len(self.__headers))]]
for x in range(len(tabList)):
missingCols = len(self.__headers) - len(tabList[x])
for x in range(missingCols):
tabList[x].append('/')
self.__tabList = tabList
self.hlRow = []
示例8: __init__
# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import __init__ [as 別名]
def __init__(self, result):
QAbstractTableModel.__init__(self)
self._result = result
self._transitions = sorted(result.iter_transitions())
self._header_sections = ["Transition", "PG", "PE", "CG", "CE", "BG", "BE", "TG", "TE"]
self._data_funcs = [
lambda r, t: r.intensity(t, False, False),
lambda r, t: r.intensity(t, True, False),
lambda r, t: r.characteristic_fluorescence(t, False),
lambda r, t: r.characteristic_fluorescence(t, True),
lambda r, t: r.bremsstrahlung_fluorescence(t, False),
lambda r, t: r.bremsstrahlung_fluorescence(t, True),
lambda r, t: r.intensity(t, False, True),
lambda r, t: r.intensity(t, True, True),
]
self._show_uncertainty = True
self._factor = 1.0
示例9: __init__
# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import __init__ [as 別名]
def __init__(self, watcher=None):
""" Init model """
QAbstractTableModel.__init__(self)
self.table_view = None
self.watcher = watcher
self.watcher.fileChanged.connect(self.file_watch_file_change)
self.watcher.directoryChanged.connect(self.file_watch_directory_change)
self.is_reloading_file = False
self.suspend_force_sort = False
self.supported_format_dict = dict(
[(n_type, nodeAttr) for n_type, nice, nodeAttr in MTTSettings.SUPPORTED_TYPE])
self.db = None
# create database table
try:
self._database_create_table()
except sqlite3.Error, e:
mtt_log('Error init DB :\n\t>> %s <<\n' % e, msg_type='error',
verbose=False)
sys.exit(1)
示例10: __init__
# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import __init__ [as 別名]
def __init__(self, parent, infoDict, header, *args):
QAbstractTableModel.__init__(self, parent, *args)
self.infoDict = infoDict
self.header_labels = header
示例11: __init__
# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import __init__ [as 別名]
def __init__(self, addons, latestVersions, parent=None):
QAbstractTableModel.__init__(self, parent)
self.addons = addons
self.latestVersions = latestVersions
self.parent = parent
示例12: __init__
# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import __init__ [as 別名]
def __init__(self, parent, mylist, header, *args):
QAbstractTableModel.__init__(self, parent, *args)
self.mylist = mylist
self.header = header
示例13: __init__
# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import __init__ [as 別名]
def __init__(self, parent, list, *args):
QAbstractTableModel.__init__(self, parent, *args)
self.list = list
self.header = []
self.generate_headers()
示例14: __init__
# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import __init__ [as 別名]
def __init__(self, table, parent=None):
QAbstractTableModel.__init__(self, parent)
self.table = table
示例15: __init__
# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import __init__ [as 別名]
def __init__(self, parent, datalist, header, *args):
QAbstractTableModel.__init__(self, parent, *args)
self.header = []
self.list = []
self.set_list(datalist, header)