本文整理汇总了Python中PyQt5.QtWidgets.QTableView.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QTableView.__init__方法的具体用法?Python QTableView.__init__怎么用?Python QTableView.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QTableView
的用法示例。
在下文中一共展示了QTableView.__init__方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt5.QtWidgets import QTableView [as 别名]
# 或者: from PyQt5.QtWidgets.QTableView import __init__ [as 别名]
def __init__(self, *args):
# Invoke parent init
QTableView.__init__(self, *args)
# Get a reference to the window object
self.win = get_app().window
# Get Model data
self.clip_properties_model = PropertiesModel(self)
# Keep track of mouse press start position to determine when to start drag
self.selected = []
self.selected_item = None
# Setup header columns
self.setModel(self.clip_properties_model.model)
self.setSelectionBehavior(QAbstractItemView.SelectRows)
self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
self.setWordWrap(True)
# Get table header
horizontal_header = self.horizontalHeader()
horizontal_header.setSectionResizeMode(QHeaderView.Stretch)
vertical_header = self.verticalHeader()
vertical_header.setVisible(False)
# Refresh view
self.clip_properties_model.update_model()
# Resize columns
self.resizeColumnToContents(0)
self.resizeColumnToContents(1)
# Connect filter signals
get_app().window.txtPropertyFilter.textChanged.connect(self.filter_changed)
示例2: __init__
# 需要导入模块: from PyQt5.QtWidgets import QTableView [as 别名]
# 或者: from PyQt5.QtWidgets.QTableView import __init__ [as 别名]
def __init__(self, model, parent=None):
QTableView.__init__(self, parent)
# Custom delegates.
self._checkBoxDelegate = CheckBoxDelegateQt()
self._floatEditDelegate = FloatEditDelegateQt()
self._dateTimeEditDelegates = [] # Each of these can have different formats.
self._comboBoxDelegates = [] # Each of these can have different choices.
self._pushButtonDelegates = [] # Each of these can have different text.
self._fileDialogDelegate = FileDialogDelegateQt()
# Set the model.
self.setModel(model)
示例3: __init__
# 需要导入模块: from PyQt5.QtWidgets import QTableView [as 别名]
# 或者: from PyQt5.QtWidgets.QTableView import __init__ [as 别名]
def __init__(self, *args):
# Invoke parent init
QTableView.__init__(self, *args)
# Get a reference to the window object
self.win = get_app().window
# Get Model data
self.clip_properties_model = PropertiesModel(self)
self.transition_model = TransitionsModel(self)
self.files_model = FilesModel(self)
# Keep track of mouse press start position to determine when to start drag
self.selected = []
self.selected_label = None
self.selected_item = None
self.new_value = None
self.original_data = None
# Setup header columns
self.setModel(self.clip_properties_model.model)
self.setSelectionBehavior(QAbstractItemView.SelectRows)
self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
self.setWordWrap(True)
# Set delegate
delegate = PropertyDelegate()
self.setItemDelegateForColumn(1, delegate)
self.previous_x = -1
# Get table header
horizontal_header = self.horizontalHeader()
horizontal_header.setSectionResizeMode(QHeaderView.Stretch)
vertical_header = self.verticalHeader()
vertical_header.setVisible(False)
# Refresh view
self.clip_properties_model.update_model()
self.transition_model.update_model()
self.files_model.update_model()
# Resize columns
self.resizeColumnToContents(0)
self.resizeColumnToContents(1)
# Connect filter signals
get_app().window.txtPropertyFilter.textChanged.connect(self.filter_changed)
get_app().window.InsertKeyframe.connect(self.Insert_Action_Triggered)
self.doubleClicked.connect(self.doubleClickedCB)
self.loadProperties.connect(self.select_item)
示例4: __init__
# 需要导入模块: from PyQt5.QtWidgets import QTableView [as 别名]
# 或者: from PyQt5.QtWidgets.QTableView import __init__ [as 别名]
def __init__(self, parent):
QTableView.__init__(self, parent)
self.setAcceptDrops(True)
示例5: __init__
# 需要导入模块: from PyQt5.QtWidgets import QTableView [as 别名]
# 或者: from PyQt5.QtWidgets.QTableView import __init__ [as 别名]
def __init__(self, *args, **kwargs):
QTableView.__init__(self, *args, **kwargs)
示例6: __init__
# 需要导入模块: from PyQt5.QtWidgets import QTableView [as 别名]
# 或者: from PyQt5.QtWidgets.QTableView import __init__ [as 别名]
def __init__(self, data=[], parent=None):
QTableView.__init__(self, parent)
self.setSelectionMode(QAbstractItemView.SingleSelection)
self.setSelectionBehavior(QAbstractItemView.SelectRows)
self.verticalHeader().setSectionsMovable(True)
示例7: __init__
# 需要导入模块: from PyQt5.QtWidgets import QTableView [as 别名]
# 或者: from PyQt5.QtWidgets.QTableView import __init__ [as 别名]
def __init__(self, *args):
QTableView.__init__(self, *args)
self.setAlternatingRowColors(True)
self.setSelectionBehavior(QTableView.SelectRows)
self.setShowGrid(False)
示例8: __init__
# 需要导入模块: from PyQt5.QtWidgets import QTableView [as 别名]
# 或者: from PyQt5.QtWidgets.QTableView import __init__ [as 别名]
def __init__(self, parent):
QTableView.__init__(self, parent)