本文整理汇总了Python中PyQt4.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):
QAbstractTableModel.__init__(self)
self.accounts = accounts
self.subjects = subjects
self.account_order = sorted(self.accounts.keys())
self.headers = map(QVariant, [_("Email"), _("Formats"), _("Subject"), _("Auto send")])
self.default_font = QFont()
self.default_font.setBold(True)
self.default_font = QVariant(self.default_font)
self.tooltips = [NONE] + list(
map(
QVariant,
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)."
),
],
),
)
)
示例3: __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
示例4: __init__
def __init__(self, parent=None):
QAbstractTableModel.__init__(self, parent)
self.counts = (0, 0)
self.words = {} # Map of (word, locale) to location data for the word
self.spell_map = {} # Map of (word, locale) to dictionaries.recognized(word, locale)
self.sort_on = (0, False)
self.items = [] # The currently displayed items
self.filter_expression = None
self.show_only_misspelt = True
self.headers = (_('Word'), _('Count'), _('Language'), _('Misspelled?'))
示例5: __init__
def __init__(self, display_plugins):
QAbstractTableModel.__init__(self)
self.display_plugins = display_plugins
self.headers = map(
QVariant,
[
_("Plugin Name"),
_("Donate"),
_("Status"),
_("Installed"),
_("Available"),
_("Released"),
_("Calibre"),
_("Author"),
],
)
示例6: __init__
def __init__(self, parent=None):
QAbstractTableModel.__init__(self, parent)
self.fields = []
self.descs = {
'authors': _('Authors'),
'comments': _('Comments'),
'pubdate': _('Published date'),
'publisher': _('Publisher'),
'rating' : _('Rating'),
'tags' : _('Tags'),
'title': _('Title'),
'series': _('Series'),
'languages': _('Languages'),
}
self.overrides = {}
self.exclude = frozenset(['series_index'])
示例7: __init__
def __init__(self):
QAbstractTableModel.__init__(self)
SearchQueryParser.__init__(self, ["all"])
self.wait_icon = QVariant(QIcon(I("jobs.png")))
self.running_icon = QVariant(QIcon(I("exec.png")))
self.error_icon = QVariant(QIcon(I("dialog_error.png")))
self.done_icon = QVariant(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)
示例8: __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(QVariant, [_('Email'), _('Formats'), _('Subject'),
_('Auto send'), _('Alias')])
self.default_font = QFont()
self.default_font.setBold(True)
self.default_font = QVariant(self.default_font)
self.tooltips =[NONE] + list(map(QVariant, 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')
])))
示例9: flags
def flags(self, index):
if index.column() == 3:
return QAbstractTableModel.flags(self, index) | Qt.ItemIsUserCheckable
else:
return QAbstractTableModel.flags(self, index) | Qt.ItemIsEditable
示例10: flags
def flags(self, index):
flags = QAbstractTableModel.flags(self, index)
if index.isValid():
if index.row() == 0:
flags |= Qt.ItemIsDropEnabled
return flags
示例11: __init__
def __init__(self, parent):
QAbstractTableModel.__init__(self, parent)
self._imdb = []
self._headers = ["Id"]
self._main = None
self.rowSelected = None
示例12: 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)
示例13: __init__
def __init__(self, parent, bookmarks):
QAbstractTableModel.__init__(self, parent)
self.bookmarks = bookmarks[:]
示例14: flags
def flags(self, index):
flags = QAbstractTableModel.flags(self, index)
flags |= Qt.ItemIsEditable
return flags
示例15: __init__
def __init__(self, parent=None):
QAbstractTableModel.__init__(self, parent)
self.ls_data = []