本文整理汇总了Python中spyderlib.qt.QtGui.QTableView.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QTableView.__init__方法的具体用法?Python QTableView.__init__怎么用?Python QTableView.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类spyderlib.qt.QtGui.QTableView
的用法示例。
在下文中一共展示了QTableView.__init__方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from spyderlib.qt.QtGui import QTableView [as 别名]
# 或者: from spyderlib.qt.QtGui.QTableView import __init__ [as 别名]
def __init__(self, parent, data):
QTableView.__init__(self, parent)
self.model = DependenciesTableModel(self, data)
self.setModel(self.model)
self.delegate = DependenciesDelegate(self)
self.setItemDelegate(self.delegate)
self.setup_table()
示例2: __init__
# 需要导入模块: from spyderlib.qt.QtGui import QTableView [as 别名]
# 或者: from spyderlib.qt.QtGui.QTableView import __init__ [as 别名]
def __init__(self, parent):
QTableView.__init__(self, parent)
self._model = None
# Setting up actions
self.date_dayfirst_action = create_action(
self, "dayfirst", triggered=ft_partial(self.parse_to_type, atype="date", dayfirst=True)
)
self.date_monthfirst_action = create_action(
self, "monthfirst", triggered=ft_partial(self.parse_to_type, atype="date", dayfirst=False)
)
self.perc_action = create_action(self, "perc", triggered=ft_partial(self.parse_to_type, atype="perc"))
self.acc_action = create_action(self, "account", triggered=ft_partial(self.parse_to_type, atype="account"))
self.str_action = create_action(self, "unicode", triggered=ft_partial(self.parse_to_type, atype="unicode"))
self.int_action = create_action(self, "int", triggered=ft_partial(self.parse_to_type, atype="int"))
self.float_action = create_action(self, "float", triggered=ft_partial(self.parse_to_type, atype="float"))
# Setting up menus
self.date_menu = QMenu()
self.date_menu.setTitle("Date")
add_actions(self.date_menu, (self.date_dayfirst_action, self.date_monthfirst_action))
self.parse_menu = QMenu(self)
self.parse_menu.addMenu(self.date_menu)
add_actions(self.parse_menu, (self.perc_action, self.acc_action))
self.parse_menu.setTitle("String to")
self.opt_menu = QMenu(self)
self.opt_menu.addMenu(self.parse_menu)
add_actions(self.opt_menu, (self.str_action, self.int_action, self.float_action))
示例3: __init__
# 需要导入模块: from spyderlib.qt.QtGui import QTableView [as 别名]
# 或者: from spyderlib.qt.QtGui.QTableView import __init__ [as 别名]
def __init__(self, parent=None):
QTableView.__init__(self, parent)
self._parent = parent
self.finder = None
self.source_model = ShortcutsModel(self)
self.proxy_model = CustomSortFilterProxy(self)
self.last_regex = ''
self.proxy_model.setSourceModel(self.source_model)
self.proxy_model.setDynamicSortFilter(True)
self.proxy_model.setFilterKeyColumn(NAME)
self.proxy_model.setFilterCaseSensitivity(Qt.CaseInsensitive)
self.setModel(self.proxy_model)
self.hideColumn(SEARCH_SCORE)
self.setItemDelegateForColumn(NAME, HTMLDelegate(self, margin=9))
self.setSelectionBehavior(QAbstractItemView.SelectRows)
self.setSelectionMode(QAbstractItemView.SingleSelection)
self.setSortingEnabled(True)
self.setEditTriggers(QAbstractItemView.AllEditTriggers)
self.selectionModel().selectionChanged.connect(self.selection)
self.verticalHeader().hide()
self.load_shortcuts()
示例4: __init__
# 需要导入模块: from spyderlib.qt.QtGui import QTableView [as 别名]
# 或者: from spyderlib.qt.QtGui.QTableView import __init__ [as 别名]
def __init__(self, parent, data):
QTableView.__init__(self, parent)
self.model = BreakpointTableModel(self, data)
self.setModel(self.model)
self.delegate = BreakpointDelegate(self)
self.setItemDelegate(self.delegate)
self.setup_table()
示例5: __init__
# 需要导入模块: from spyderlib.qt.QtGui import QTableView [as 别名]
# 或者: from spyderlib.qt.QtGui.QTableView import __init__ [as 别名]
def __init__(self, parent, model):
QTableView.__init__(self, parent)
self.setModel(model)
self.sort_old = [None]
self.header_class = self.horizontalHeader()
self.connect(self.header_class,
SIGNAL("sectionClicked(int)"), self.sortByColumn)
self.menu = self.setup_menu()
示例6: __init__
# 需要导入模块: from spyderlib.qt.QtGui import QTableView [as 别名]
# 或者: from spyderlib.qt.QtGui.QTableView import __init__ [as 别名]
def __init__(self, parent, model, dtype, shape):
QTableView.__init__(self, parent)
self.setModel(model)
self.setItemDelegate(ArrayDelegate(dtype, self))
total_width = 0
for k in range(shape[1]):
total_width += self.columnWidth(k)
self.viewport().resize(min(total_width, 1024), self.height())
self.shape = shape
self.menu = self.setup_menu()
示例7: __init__
# 需要导入模块: from spyderlib.qt.QtGui import QTableView [as 别名]
# 或者: from spyderlib.qt.QtGui.QTableView import __init__ [as 别名]
def __init__(self, parent, model):
QTableView.__init__(self, parent)
self.setModel(model)
self.sort_old = [None]
self.header_class = self.horizontalHeader()
self.header_class.sectionClicked.connect(self.sortByColumn)
self.menu = self.setup_menu()
new_shortcut(QKeySequence.Copy, self, self.copy)
self.horizontalScrollBar().valueChanged.connect(lambda val: self.load_more_data(val, columns=True))
self.verticalScrollBar().valueChanged.connect(lambda val: self.load_more_data(val, rows=True))
示例8: __init__
# 需要导入模块: from spyderlib.qt.QtGui import QTableView [as 别名]
# 或者: from spyderlib.qt.QtGui.QTableView import __init__ [as 别名]
def __init__(self, parent, model, dtype, shape):
QTableView.__init__(self, parent)
self.setModel(model)
self.setItemDelegate(ArrayDelegate(dtype, self))
total_width = 0
for k in range(shape[1]):
total_width += self.columnWidth(k)
self.viewport().resize(min(total_width, 1024), self.height())
self.shape = shape
self.menu = self.setup_menu()
new_shortcut(QKeySequence.Copy, self, self.copy)
self.horizontalScrollBar().valueChanged.connect(
lambda val: self.load_more_data(val, columns=True))
self.verticalScrollBar().valueChanged.connect(
lambda val: self.load_more_data(val, rows=True))
示例9: __init__
# 需要导入模块: from spyderlib.qt.QtGui import QTableView [as 别名]
# 或者: from spyderlib.qt.QtGui.QTableView import __init__ [as 别名]
def __init__(self, parent=None):
QTableView.__init__(self, parent)
self.model = ShortcutsModel()
self.setModel(self.model)
self.setItemDelegate(ShortcutsDelegate(self))
self.load_shortcuts()