本文整理汇总了Python中spyderlib.qt.QtCore.QAbstractTableModel.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QAbstractTableModel.__init__方法的具体用法?Python QAbstractTableModel.__init__怎么用?Python QAbstractTableModel.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类spyderlib.qt.QtCore.QAbstractTableModel
的用法示例。
在下文中一共展示了QAbstractTableModel.__init__方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from spyderlib.qt.QtCore import QAbstractTableModel [as 别名]
# 或者: from spyderlib.qt.QtCore.QAbstractTableModel import __init__ [as 别名]
def __init__(self, parent, data):
QAbstractTableModel.__init__(self, parent)
if data is None:
data = {}
self._data = None
self.breakpoints = None
self.set_data(data)
示例2: __init__
# 需要导入模块: from spyderlib.qt.QtCore import QAbstractTableModel [as 别名]
# 或者: from spyderlib.qt.QtCore.QAbstractTableModel import __init__ [as 别名]
def __init__(self, data, format="%.3f", xlabels=None, ylabels=None,
readonly=False, parent=None):
QAbstractTableModel.__init__(self)
self.dialog = parent
self.changes = {}
self.xlabels = xlabels
self.ylabels = ylabels
self.readonly = readonly
self.test_array = np.array([0], dtype=data.dtype)
# for complex numbers, shading will be based on absolute value
# but for all other types it will be the real part
if data.dtype in (np.complex64, np.complex128):
self.color_func = np.abs
else:
self.color_func = np.real
# Backgroundcolor settings
huerange = [.66, .99] # Hue
self.sat = .7 # Saturation
self.val = 1. # Value
self.alp = .6 # Alpha-channel
self._data = data
self._format = format
self.total_rows = self._data.shape[0]
self.total_cols = self._data.shape[1]
size = self.total_rows * self.total_cols
try:
self.vmin = np.nanmin(self.color_func(data))
self.vmax = np.nanmax(self.color_func(data))
if self.vmax == self.vmin:
self.vmin -= 1
self.hue0 = huerange[0]
self.dhue = huerange[1]-huerange[0]
self.bgcolor_enabled = True
except TypeError:
self.vmin = None
self.vmax = None
self.hue0 = None
self.dhue = None
self.bgcolor_enabled = False
# Use paging when the total size, number of rows or number of
# columns is too large
if size > LARGE_SIZE:
self.rows_loaded = self.ROWS_TO_LOAD
self.cols_loaded = self.COLS_TO_LOAD
else:
if self.total_rows > LARGE_NROWS:
self.rows_loaded = self.ROWS_TO_LOAD
else:
self.rows_loaded = self.total_rows
if self.total_cols > LARGE_COLS:
self.cols_loaded = self.COLS_TO_LOAD
else:
self.cols_loaded = self.total_cols
示例3: __init__
# 需要导入模块: from spyderlib.qt.QtCore import QAbstractTableModel [as 别名]
# 或者: from spyderlib.qt.QtCore.QAbstractTableModel import __init__ [as 别名]
def __init__(self, parent):
QAbstractTableModel.__init__(self)
self.shortcuts = []
self._parent = parent
self.letters = ''
self.label = QLabel()
self.widths = []
# Needed to compensate for the HTMLDelegate color selection unawarness
palette = parent.palette()
self.text_color = palette.text().color().name()
self.text_color_highlight = palette.highlightedText().color().name()
示例4: __init__
# 需要导入模块: from spyderlib.qt.QtCore import QAbstractTableModel [as 别名]
# 或者: from spyderlib.qt.QtCore.QAbstractTableModel import __init__ [as 别名]
def __init__(self, dataFrame, format="%.3g", parent=None):
QAbstractTableModel.__init__(self)
self.dialog = parent
self.df = dataFrame
self._format = format
self.bgcolor_enabled = True
self.complex_intran = None
huerange = [.66, .99] # Hue
self.sat = .7 # Saturation
self.val = 1. # Value
self.alp = .6 # Alpha-channel
self.hue0 = huerange[0]
self.dhue = huerange[1]-huerange[0]
self.max_min_col = None
self.max_min_col_update()
self.colum_avg_enabled = True
self.colum_avg(1)
示例5: __init__
# 需要导入模块: from spyderlib.qt.QtCore import QAbstractTableModel [as 别名]
# 或者: from spyderlib.qt.QtCore.QAbstractTableModel import __init__ [as 别名]
def __init__(self, dataFrame, format="%.3g", parent=None):
QAbstractTableModel.__init__(self)
self.dialog = parent
self.df = dataFrame
self.df_index = dataFrame.index.tolist()
self.df_header = dataFrame.columns.tolist()
self._format = format
self.complex_intran = None
self.total_rows = self.df.shape[0]
self.total_cols = self.df.shape[1]
size = self.total_rows * self.total_cols
huerange = [.66, .99] # Hue
self.sat = .7 # Saturation
self.val = 1. # Value
self.alp = .6 # Alpha-channel
self.hue0 = huerange[0]
self.dhue = huerange[1]-huerange[0]
self.max_min_col = None
if size < LARGE_SIZE:
self.max_min_col_update()
self.colum_avg_enabled = True
self.bgcolor_enabled = True
self.colum_avg(1)
else:
self.colum_avg_enabled = False
self.bgcolor_enabled = False
self.colum_avg(0)
# Use paging when the total size, number of rows or number of
# columns is too large
if size > LARGE_SIZE:
self.rows_loaded = self.ROWS_TO_LOAD
self.cols_loaded = self.COLS_TO_LOAD
else:
if self.total_rows > LARGE_NROWS:
self.rows_loaded = self.ROWS_TO_LOAD
else:
self.rows_loaded = self.total_rows
if self.total_cols > LARGE_COLS:
self.cols_loaded = self.COLS_TO_LOAD
else:
self.cols_loaded = self.total_cols
示例6: __init__
# 需要导入模块: from spyderlib.qt.QtCore import QAbstractTableModel [as 别名]
# 或者: from spyderlib.qt.QtCore.QAbstractTableModel import __init__ [as 别名]
def __init__(self, data, format="%.3f", xlabels=None, ylabels=None,
readonly=False, parent=None):
QAbstractTableModel.__init__(self)
self.dialog = parent
self.changes = {}
self.xlabels = xlabels
self.ylabels = ylabels
self.readonly = readonly
self.test_array = np.array([0], dtype=data.dtype)
# for complex numbers, shading will be based on absolute value
# but for all other types it will be the real part
if data.dtype in (np.complex64, np.complex128):
self.color_func = np.abs
else:
self.color_func = np.real
# Backgroundcolor settings
huerange = [.66, .99] # Hue
self.sat = .7 # Saturation
self.val = 1. # Value
self.alp = .6 # Alpha-channel
self._data = data
self._format = format
try:
self.vmin = self.color_func(data).min()
self.vmax = self.color_func(data).max()
if self.vmax == self.vmin:
self.vmin -= 1
self.hue0 = huerange[0]
self.dhue = huerange[1]-huerange[0]
self.bgcolor_enabled = True
except TypeError:
self.vmin = None
self.vmax = None
self.hue0 = None
self.dhue = None
self.bgcolor_enabled = False
示例7: __init__
# 需要导入模块: from spyderlib.qt.QtCore import QAbstractTableModel [as 别名]
# 或者: from spyderlib.qt.QtCore.QAbstractTableModel import __init__ [as 别名]
def __init__(self, parent, dependencies):
QAbstractTableModel.__init__(self, parent)
self.dependencies = None
self.set_data(dependencies)
示例8: __init__
# 需要导入模块: from spyderlib.qt.QtCore import QAbstractTableModel [as 别名]
# 或者: from spyderlib.qt.QtCore.QAbstractTableModel import __init__ [as 别名]
def __init__(self, data=[], parent=None):
QAbstractTableModel.__init__(self, parent)
self._data = data
示例9: __init__
# 需要导入模块: from spyderlib.qt.QtCore import QAbstractTableModel [as 别名]
# 或者: from spyderlib.qt.QtCore.QAbstractTableModel import __init__ [as 别名]
def __init__(self):
QAbstractTableModel.__init__(self)
self.shortcuts = []