本文整理汇总了Python中PyQt5.Qt.QAbstractTableModel类的典型用法代码示例。如果您正苦于以下问题:Python QAbstractTableModel类的具体用法?Python QAbstractTableModel怎么用?Python QAbstractTableModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QAbstractTableModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, parent=None):
QAbstractTableModel.__init__(self, parent)
self.gui_parent = parent
self.plugins = []
self.enabled_overrides = {}
self.cover_overrides = {}
示例2: __init__
def __init__(self, accounts, subjects, aliases={}, tags={}):
QAbstractTableModel.__init__(self)
self.accounts = accounts
self.subjects = subjects
self.aliases = aliases
self.tags = tags
self.sorted_on = (0, True)
self.account_order = self.accounts.keys()
self.do_sort()
self.headers = map(unicode, [_('Email'), _('Formats'), _('Subject'),
_('Auto send'), _('Alias'), _('Auto send only tags')])
self.default_font = QFont()
self.default_font.setBold(True)
self.default_font = (self.default_font)
self.tooltips =[None] + list(map(unicode, map(textwrap.fill,
[_('Formats to email. The first matching format will be sent.'),
_('Subject of the email to use when sending. When left blank '
'the title will be used for the subject. Also, the same '
'templates used for "Save to disk" such as {title} and '
'{author_sort} can be used here.'),
'<p>'+_('If checked, downloaded news will be automatically '
'mailed to this email address '
'(provided it is in one of the listed formats and has not been filtered by tags).'),
_('Friendly name to use for this email address'),
_('If specified, only news with one of these tags will be sent to'
' this email address. All news downloads have their title as a'
' tag, so you can use this to easily control which news downloads'
' are sent to this email address.')
])))
示例3: __init__
def __init__(self, accounts, subjects, aliases={}):
QAbstractTableModel.__init__(self)
self.accounts = accounts
self.subjects = subjects
self.aliases = aliases
self.account_order = sorted(self.accounts.keys())
self.headers = map(unicode, [_("Email"), _("Formats"), _("Subject"), _("Auto send"), _("Alias")])
self.default_font = QFont()
self.default_font.setBold(True)
self.default_font = self.default_font
self.tooltips = [None] + list(
map(
unicode,
map(
textwrap.fill,
[
_("Formats to email. The first matching format will be sent."),
_(
"Subject of the email to use when sending. When left blank "
"the title will be used for the subject. Also, the same "
'templates used for "Save to disk" such as {title} and '
"{author_sort} can be used here."
),
"<p>"
+ _(
"If checked, downloaded news will be automatically "
"mailed <br>to this email address "
"(provided it is in one of the listed formats)."
),
_("Friendly name to use for this email address"),
],
),
)
)
示例4: headerData
def headerData(self, section, orientation, role=Qt.DisplayRole):
if role == Qt.DisplayRole and orientation == Qt.Horizontal:
try:
return self.COLUMN_HEADERS[section]
except IndexError:
pass
return QAbstractTableModel.headerData(self, section, orientation, role)
示例5: __init__
def __init__(self, parent=None, columns_to_center=[], *args):
"""
datain: a list of lists
headerdata: a list of strings
"""
QAbstractTableModel.__init__(self, parent, *args)
self.arraydata = parent.tabledata
self.centered_columns = columns_to_center
self.headerdata = parent.annotations_header
self.show_confidence_colors = parent.show_confidence_colors
self.AUTHOR_COL = parent.AUTHOR_COL
self.CONFIDENCE_COL = parent.CONFIDENCE_COL
self.ENABLED_COL = parent.ENABLED_COL
self.LAST_ANNOTATION_COL = parent.LAST_ANNOTATION_COL
self.READER_APP_COL = parent.READER_APP_COL
self.TITLE_COL = parent.TITLE_COL
示例6: __init__
def __init__(self):
QAbstractTableModel.__init__(self)
SearchQueryParser.__init__(self, ['all'])
self.wait_icon = (QIcon(I('jobs.png')))
self.running_icon = (QIcon(I('exec.png')))
self.error_icon = (QIcon(I('dialog_error.png')))
self.done_icon = (QIcon(I('ok.png')))
self.jobs = []
self.add_job = Dispatcher(self._add_job)
self.server = Server(limit=int(config['worker_limit']/2.0),
enforce_cpu_limit=config['enforce_cpu_limit'])
self.threaded_server = ThreadedJobServer()
self.changed_queue = Queue()
self.timer = QTimer(self)
self.timer.timeout.connect(self.update, type=Qt.QueuedConnection)
self.timer.start(1000)
示例7: __init__
def __init__(self, accounts, subjects, aliases={}):
QAbstractTableModel.__init__(self)
self.accounts = accounts
self.subjects = subjects
self.aliases = aliases
self.account_order = sorted(self.accounts.keys())
self.headers = map(unicode, [_('Email'), _('Formats'), _('Subject'),
_('Auto send'), _('Alias')])
self.default_font = QFont()
self.default_font.setBold(True)
self.default_font = (self.default_font)
self.tooltips =[None] + list(map(unicode, map(textwrap.fill,
[_('Formats to email. The first matching format will be sent.'),
_('Subject of the email to use when sending. When left blank '
'the title will be used for the subject. Also, the same '
'templates used for "Save to disk" such as {title} and '
'{author_sort} can be used here.'),
'<p>'+_('If checked, downloaded news will be automatically '
'mailed <br>to this email address '
'(provided it is in one of the listed formats).'),
_('Friendly name to use for this email address')
])))
示例8: __init__
def __init__(self, display_plugins):
QAbstractTableModel.__init__(self)
self.display_plugins = display_plugins
self.headers = list(map(unicode_type, [_('Plugin name'), _('Donate'), _('Status'), _('Installed'),
_('Available'), _('Released'), _('calibre'), _('Author')]))
示例9: headerData
def headerData(self, section, orientation, role=Qt.DisplayRole):
if orientation == Qt.Horizontal and role == Qt.DisplayRole:
return _('Font family') if section == 1 else _('Embedded')
return QAbstractTableModel.headerData(self, section, orientation, role)
示例10: __init__
def __init__(self, parent=None):
QAbstractTableModel.__init__(self, parent)
self.items = []
self.font_data = {}
self.sorted_on = ('name', True)
示例11: __init__
def __init__(self, parent, books = [], db = None):
QAbstractTableModel.__init__(self, parent)
self.db = db
self.books = self.makeMetadataFromParsedOpds(books)
self.filterBooks()
示例12: __init__
def __init__(self, results, parent=None):
QAbstractTableModel.__init__(self, parent)
self.results = results
self.yes_icon = (QIcon(I('ok.png')))
示例13: flags
def flags(self, index):
if index.column() == 3:
return QAbstractTableModel.flags(self, index)|Qt.ItemIsUserCheckable
else:
return QAbstractTableModel.flags(self, index)|Qt.ItemIsEditable
示例14: flags
def flags(self, index):
col = index.column()
ans = QAbstractTableModel.flags(self, index)
if col == 0:
return ans | Qt.ItemIsUserCheckable
return Qt.ItemIsEditable | ans
示例15: __init__
def __init__(self, parent=None):
self.files = self.sort_keys = ()
self.total_size = 0
QAbstractTableModel.__init__(self, parent)