本文整理汇总了Python中PyQt5.QtWidgets.QTableWidget.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QTableWidget.__init__方法的具体用法?Python QTableWidget.__init__怎么用?Python QTableWidget.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QTableWidget
的用法示例。
在下文中一共展示了QTableWidget.__init__方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt5.QtWidgets import QTableWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QTableWidget import __init__ [as 别名]
def __init__(self, parent, configuration):
QTableWidget.__init__(self, 5, 1, parent)
self._configuration = configuration
self._manual_change = True
self.setVerticalHeaderLabels(
["Duration (cycles)", "Duration (ms)", "Cycles / ms",
'RAM access time', 'Execution Time Model'])
self.horizontalHeader().setStretchLastSection(True)
self.horizontalHeader().hide()
self.setItem(0, 0, QTableWidgetItem(str(configuration.duration)))
self.setItem(1, 0, QTableWidgetItem(str(
float(configuration.duration) / configuration.cycles_per_ms)))
self.setItem(2, 0, QTableWidgetItem(str(configuration.cycles_per_ms)))
self.setItem(
3, 0, QTableWidgetItem(str(configuration.memory_access_time)))
item = QComboBox(self)
selected = 0
for i, (etm_name, etm_code) in \
enumerate(execution_time_model_names.items()):
item.addItem(etm_name)
if etm_code == configuration.etm:
selected = i
item.setCurrentIndex(selected)
self.setCellWidget(4, 0, item)
def activation_handler(x):
configuration.etm = execution_time_model_names[str(x)]
configuration.conf_changed()
item.activated['QString'].connect(activation_handler)
# self._update_observe_window()
self.cellChanged.connect(self._cell_changed)
示例2: __init__
# 需要导入模块: from PyQt5.QtWidgets import QTableWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QTableWidget import __init__ [as 别名]
def __init__(self, parent=None, featureGroups=[], sigmas=[], computeIn2d=[], window_size=3.5):
"""
Args:
featureGroups: A list with schema: [ (groupName1, [entry, entry...]),
(groupName2, [entry, entry...]), ... ]
sigmas: List of sigmas (applies to all features)
computeIn2d: List of booleans to indicate which sigma column should be computed in 2d (rather than 3d)
"""
QTableWidget.__init__(self, parent)
self.setCornerButtonEnabled(False)
self.setEditTriggers(QAbstractItemView.AllEditTriggers)
self.setSelectionMode(QAbstractItemView.ExtendedSelection)
self.setShowGrid(False)
self.setMouseTracking(1)
self.verticalHeader().setHighlightSections(False)
self.verticalHeader().setSectionsClickable(True)
self.verticalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
self.verticalHeader().sectionPressed.disconnect()
self.verticalHeader().sectionClicked.connect(self._expandOrCollapseVHeader)
self.horizontalHeader().setHighlightSections(False)
self.horizontalHeader().setSectionsClickable(False)
# self.horizontalHeader().installEventFilter(self)
self.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
self.itemSelectionChanged.connect(self._itemSelectionChanged)
self.cellChanged.connect(self._cellChanged)
if featureGroups or sigmas or computeIn2d:
self.setup(featureGroups, sigmas, computeIn2d, window_size)
示例3: __init__
# 需要导入模块: from PyQt5.QtWidgets import QTableWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QTableWidget import __init__ [as 别名]
def __init__(self, parent = None):
QTableWidget.__init__(self, parent)
# init
# ------------------------------------------------
#FIXME: move this somewhere else maybe?
self.tmpSelectedItems = []
#FIXME: what does this do? put a comment, why 30,30?
self._sigmaList = None
self._featureGroupMapping = None # Schema: [ (groupName1, [entry, entry...]),
# (groupName2, [entry, entry...]) ]
#layout
# ------------------------------------------------
self.setCornerButtonEnabled(False)
self.setEditTriggers(QAbstractItemView.NoEditTriggers)
self.setSelectionMode(QAbstractItemView.NoSelection)
self.setShowGrid(False)
self.viewport().installEventFilter(self)
self.setMouseTracking(1)
self.verticalHeader().setHighlightSections(False)
self.verticalHeader().setSectionsClickable(True)
self.horizontalHeader().setHighlightSections(False)
self.horizontalHeader().setSectionsClickable(True)
self.horizontalHeader().setMouseTracking(True)
self.horizontalHeader().installEventFilter(self)
self.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
self.verticalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
self.itemSelectionChanged.connect(self._tableItemSelectionChanged)
self.cellDoubleClicked.connect(self._featureTableItemDoubleClicked)
self.verticalHeader().sectionClicked.connect(self._expandOrCollapseVHeader)
示例4: __init__
# 需要导入模块: from PyQt5.QtWidgets import QTableWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QTableWidget import __init__ [as 别名]
def __init__(self, parent, result):
QTableWidget.__init__(self, len(result.model.logs), 3, parent=parent)
self.setWindowTitle("Logs")
self.setHorizontalHeaderLabels(["Date (cycles)", "Date (ms)", "Message"])
self.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
self.horizontalHeader().setStretchLastSection(True)
self.horizontalHeader().setMinimumSectionSize(60)
self.verticalHeader().hide()
self._sim = result.model
self.result = result
self.update()
示例5: __init__
# 需要导入模块: from PyQt5.QtWidgets import QTableWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QTableWidget import __init__ [as 别名]
def __init__(self, parent, result):
QTableWidget.__init__(
self, len(result.model.processors) + 1, 3, parent)
self.result = result
self.setHorizontalHeaderLabels(["Total load", "Payload",
"System load", "Theoric min"])
self.setVerticalHeaderLabels(
[x.name for x in result.model.processors] + ["Average"])
self.setEditTriggers(QAbstractItemView.NoEditTriggers)
self.update()
示例6: __init__
# 需要导入模块: from PyQt5.QtWidgets import QTableWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QTableWidget import __init__ [as 别名]
def __init__(self, parent, configuration, simulation_tab):
QTableWidget.__init__(self, 5, 2, parent)
self._header = ['Scheduler', 'Scheduler Path',
'Overhead schedule (cycles)',
'Overhead on activate (cycles)',
'Overhead on terminate (cycles)']
self._dict_header = {
'scheduler': 0,
'scheduler_path': 1,
'overhead_schedule': 2,
'overhead_activate': 3,
'overhead_terminate': 4
}
self._configuration = configuration
self._simulation_tab = simulation_tab
self.refresh_table()
self.cellChanged.connect(self._cell_changed)
self.cellActivated.connect(self._cell_activated)
示例7: __init__
# 需要导入模块: from PyQt5.QtWidgets import QTableWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QTableWidget import __init__ [as 别名]
def __init__(self, parent, configuration):
self._ignore_cell_changed = False
self._manual_change = True
self._configuration = configuration
self._caches_list = configuration.caches_list
QTableWidget.__init__(self, len(self._caches_list), 5, parent)
self.horizontalHeader().setStretchLastSection(True)
self.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
self.setHorizontalHeaderLabels(["id", "Name", "Size", 'Access Time',
"Miss penalty"])
self.setVerticalHeaderLabels([""])
self.verticalHeader().hide()
self.setSelectionBehavior(QAbstractItemView.SelectRows)
curRow = 0
for cache in self._caches_list:
self._add_cache_to_table(curRow, cache)
curRow += 1
self.cellChanged.connect(self._cell_changed)
示例8: __init__
# 需要导入模块: from PyQt5.QtWidgets import QTableWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QTableWidget import __init__ [as 别名]
def __init__(self, parent, configuration):
QTableWidget.__init__(self, 0, 0, parent)
self._ignore_cell_changed = False
self.horizontalHeader().setSectionResizeMode(QHeaderView.Interactive)
self.horizontalHeader().setStretchLastSection(True)
self.verticalHeader().hide()
self._configuration = configuration
self.setSelectionBehavior(QAbstractItemView.SelectRows)
self._header = ["id", "Name", "Task type", "Abort on miss",
"Act. Date (ms)", "Period (ms)",
"List of Act. dates (ms)", "Deadline (ms)",
"WCET (ms)", "ACET (ms)", "ET Std Dev (ms)",
"Base CPI", "Instructions", "MIX",
"Stack file", "Preemption cost", "Followed by"]
self._dict_header = {
'id': 0,
'name': 1,
'task_type': 2,
'abort': 3,
'activation_date': 4,
'period': 5,
'list_activation_dates': 6,
'deadline': 7,
'wcet': 8,
'acet': 9,
'et_stddev': 10,
'base_cpi': 11,
'n_instr': 12,
'mix': 13,
'sdp': 14,
'preemption_cost': 15,
'followed': 16
}
self.refresh_table()
self.resizeColumnsToContents()
self.cellChanged.connect(self._cell_changed)
self.cellActivated.connect(self._cell_activated)
示例9: __init__
# 需要导入模块: from PyQt5.QtWidgets import QTableWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QTableWidget import __init__ [as 别名]
def __init__(self, game, parent):
QTableWidget.__init__(
self, settings.ROWS, settings.COLUMNS, parent)
self.parent = parent
self.game = game
self.refresh_data(game, parent)
示例10: __init__
# 需要导入模块: from PyQt5.QtWidgets import QTableWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QTableWidget import __init__ [as 别名]
def __init__(self):
QTableWidget.__init__(self)
self.setWindowTitle("QTableWidget Cell Click")
self.setRowCount(1)
self.setColumnCount(2)
示例11: __init__
# 需要导入模块: from PyQt5.QtWidgets import QTableWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QTableWidget import __init__ [as 别名]
def __init__(self, parent=None):
QTableWidget.__init__(self, parent)
self.axistags = None
示例12: __init__
# 需要导入模块: from PyQt5.QtWidgets import QTableWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QTableWidget import __init__ [as 别名]
def __init__(self, *args):
QTableWidget.__init__(self, *args)
self.setmydata()
self.itemSelectionChanged.connect(self.slot)
self.setItemDelegate(delegate(self))