当前位置: 首页>>代码示例>>Python>>正文


Python QTableWidget.__init__方法代码示例

本文整理汇总了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)
开发者ID:MaximeCheramy,项目名称:simso-gui,代码行数:36,代码来源:GeneralTab.py

示例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)
开发者ID:ilastik,项目名称:ilastik,代码行数:33,代码来源:featureTableWidget.py

示例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)
开发者ID:DerThorsten,项目名称:ilastik,代码行数:33,代码来源:featureTableWidget.py

示例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()
开发者ID:MaximeCheramy,项目名称:simso-gui,代码行数:13,代码来源:Logs.py

示例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()
开发者ID:MaximeCheramy,项目名称:simso-gui,代码行数:13,代码来源:LoadTab.py

示例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)
开发者ID:MaximeCheramy,项目名称:simso-gui,代码行数:20,代码来源:SchedulerTab.py

示例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)
开发者ID:MaximeCheramy,项目名称:simso-gui,代码行数:21,代码来源:CachesTab.py

示例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)
开发者ID:MaximeCheramy,项目名称:simso-gui,代码行数:43,代码来源:TasksTab.py

示例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)
开发者ID:truseva,项目名称:python-minesweeper,代码行数:8,代码来源:graphic_interface.py

示例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)
开发者ID:skyballoon,项目名称:PyQtTest,代码行数:7,代码来源:QTableWidget1.py

示例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
开发者ID:DerThorsten,项目名称:ilastik,代码行数:5,代码来源:axistagsEditorWidget.py

示例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))
开发者ID:esmam,项目名称:MRATPython27,代码行数:7,代码来源:tableData.py


注:本文中的PyQt5.QtWidgets.QTableWidget.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。