當前位置: 首頁>>代碼示例>>Python>>正文


Python QAbstractTableModel.__init__方法代碼示例

本文整理匯總了Python中PySide.QtCore.QAbstractTableModel.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python QAbstractTableModel.__init__方法的具體用法?Python QAbstractTableModel.__init__怎麽用?Python QAbstractTableModel.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PySide.QtCore.QAbstractTableModel的用法示例。


在下文中一共展示了QAbstractTableModel.__init__方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import __init__ [as 別名]
    def __init__(self, runner=None):
        _OptionsModelMixin.__init__(self)
        QAbstractTableModel.__init__(self)

        self._runner = runner

        def _column0(runner, options):
            return str(options)
        def _column1(runner, options):
            STATE_ICONS = \
                {LocalRunner.STATE_QUEUED: getIcon('media-playback-pause'),
                 LocalRunner.STATE_RUNNING: getIcon('media-playback-start'),
                 LocalRunner.STATE_SIMULATED: getIcon('face-smile'),
                 LocalRunner.STATE_ERROR: getIcon('face-sad')}
            try:
                return STATE_ICONS.get(runner.options_state(options))
            except KeyError:
                return None
        def _column2(runner, options):
            try:
                progress = runner.options_progress(options) * 100
            except KeyError:
                progress = 0.0
            return '{0:n}%'.format(progress)
        def _column3(runner, options):
            try:
                return runner.options_status(options)
            except KeyError:
                return ''

        self._data_getter = {0: _column0, 1: _column1, 2: _column2, 3: _column3}
開發者ID:pymontecarlo,項目名稱:pymontecarlo-gui,代碼行數:33,代碼來源:runner.py

示例2: __init__

# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import __init__ [as 別名]
 def __init__(self, results, headerdata, parent=None, *args): 
     """ datain: a list of lists
         headerdata: a list of strings
     """
     QAbstractTableModel.__init__(self, parent, *args) 
     #self.arraydata = datain
     self.headerdata = headerdata
     self.results = results
開發者ID:bordstein,項目名稱:hamster,代碼行數:10,代碼來源:whooshresmodel.py

示例3: __init__

# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import __init__ [as 別名]
 def __init__(self, dataset = Dataset(), parent = None):
     '''Construtor de DatasetModel. 
     
     Parâmetros:
     
     dataset    : objeto Dataset para ser atribuído a *_dataset*
     '''
     QAbstractTableModel.__init__(self, parent)
     self._dataset = dataset
開發者ID:davidevandro,項目名稱:ProjetoFinal,代碼行數:11,代碼來源:model_dataset.py

示例4: __init__

# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import __init__ [as 別名]
    def __init__ ( self, editor, parent ):
        """ Initialise the object.
        """
        QAbstractTableModel.__init__( self, parent )

        self.setSupportedDragActions( Qt.CopyAction | Qt.MoveAction )

        self._editor = editor
        self._row    = editor.data_row_for
        self._font   = set()
開發者ID:davidmorrill,項目名稱:facets,代碼行數:12,代碼來源:grid_editor.py

示例5: __init__

# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import __init__ [as 別名]
 def __init__(self, dados = [], parent = None):
     '''Construtor de DatasetModel. 
     
     Parâmetros:
     
     dados   : objeto Dataset para ser atribuído a *_dataset*
     '''
     QAbstractTableModel.__init__(self, parent)
     self._dados = dados
     self._estatistica = dados.describe()
開發者ID:davidevandro,項目名稱:ProjetoFinal,代碼行數:12,代碼來源:model_estatistica_nominal.py

示例6: __init__

# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import __init__ [as 別名]
    def __init__(self):
        """ Build the Transactions Table """
        QAbstractTableModel.__init__(self)
        self.columns = self.getColumns()

        self.roleResponses = {Qt.DisplayRole:self.getData,
                              Qt.EditRole:self.getData,
                              Qt.ToolTipRole:self.getTip,
                              Qt.StatusTipRole:self.getTip,
                              Qt.TextAlignmentRole:self.getTextAlignment}
開發者ID:cloew,項目名稱:PersonalAccountingSoftware,代碼行數:12,代碼來源:table_model.py

示例7: __init__

# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import __init__ [as 別名]
 def __init__(self, tabList=None, parent=None):
     QAbstractTableModel.__init__(self, parent)
     self.__headers = [
         'Char', 'Freq', 'ASCII', 'Huff', u'Ĉ ASCII', u'Ĉ Huff']
     if tabList is None:
         tabList = [['' for x in range(len(self.__headers))]]
     for x in range(len(tabList)):
         missingCols = len(self.__headers) - len(tabList[x])
         for x in range(missingCols):
             tabList[x].append('/')
     self.__tabList = tabList
     self.hlRow = []
開發者ID:mathieufrh,項目名稱:huffmanwizard,代碼行數:14,代碼來源:huffgui.py

示例8: __init__

# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import __init__ [as 別名]
    def __init__(self, result):
        QAbstractTableModel.__init__(self)
        self._result = result
        self._transitions = sorted(result.iter_transitions())

        self._header_sections = ["Transition", "PG", "PE", "CG", "CE", "BG", "BE", "TG", "TE"]
        self._data_funcs = [
            lambda r, t: r.intensity(t, False, False),
            lambda r, t: r.intensity(t, True, False),
            lambda r, t: r.characteristic_fluorescence(t, False),
            lambda r, t: r.characteristic_fluorescence(t, True),
            lambda r, t: r.bremsstrahlung_fluorescence(t, False),
            lambda r, t: r.bremsstrahlung_fluorescence(t, True),
            lambda r, t: r.intensity(t, False, True),
            lambda r, t: r.intensity(t, True, True),
        ]

        self._show_uncertainty = True
        self._factor = 1.0
開發者ID:pymontecarlo,項目名稱:pymontecarlo-gui,代碼行數:21,代碼來源:result.py

示例9: __init__

# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import __init__ [as 別名]
 def __init__(self, watcher=None):
     """ Init model """
     QAbstractTableModel.__init__(self)
     self.table_view = None
     self.watcher = watcher
     self.watcher.fileChanged.connect(self.file_watch_file_change)
     self.watcher.directoryChanged.connect(self.file_watch_directory_change)
     self.is_reloading_file = False
     self.suspend_force_sort = False
     self.supported_format_dict = dict(
         [(n_type, nodeAttr) for n_type, nice, nodeAttr in MTTSettings.SUPPORTED_TYPE])
     self.db = None
     # create database table
     try:
         self._database_create_table()
     except sqlite3.Error, e:
         mtt_log('Error init DB :\n\t>> %s <<\n' % e, msg_type='error',
                 verbose=False)
         sys.exit(1)
開發者ID:Bioeden,項目名稱:dbMayaTextureToolkit,代碼行數:21,代碼來源:mttModel.py

示例10: __init__

# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import __init__ [as 別名]
 def __init__(self, parent, infoDict, header, *args):
   QAbstractTableModel.__init__(self, parent, *args)
   self.infoDict = infoDict
   self.header_labels = header
開發者ID:weijer,項目名稱:dotStudio,代碼行數:6,代碼來源:markers.py

示例11: __init__

# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import __init__ [as 別名]
 def __init__(self, addons, latestVersions, parent=None):
     QAbstractTableModel.__init__(self, parent)        
     self.addons = addons
     self.latestVersions = latestVersions
     self.parent = parent
開發者ID:floppytech,項目名稱:wowaddonmanager,代碼行數:7,代碼來源:addonmodel.py

示例12: __init__

# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import __init__ [as 別名]
 def __init__(self, parent, mylist, header, *args):
     QAbstractTableModel.__init__(self, parent, *args)
     self.mylist = mylist
     self.header = header
開發者ID:Sapphire64,項目名稱:JulieNotes,代碼行數:6,代碼來源:main.py

示例13: __init__

# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import __init__ [as 別名]
 def __init__(self, parent, list, *args):
     QAbstractTableModel.__init__(self, parent, *args)
     self.list = list
     self.header = []
     self.generate_headers()
開發者ID:ReneHollander,項目名稱:wien-wahl,代碼行數:7,代碼來源:ContentTableModel.py

示例14: __init__

# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import __init__ [as 別名]
 def __init__(self, table, parent=None):
     QAbstractTableModel.__init__(self, parent)
     self.table = table
開發者ID:MiguelCarrilhoGT,項目名稱:snippets,代碼行數:5,代碼來源:table_resize.py

示例15: __init__

# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import __init__ [as 別名]
 def __init__(self, parent, datalist, header, *args):
     QAbstractTableModel.__init__(self, parent, *args)
     self.header = []
     self.list = []
     self.set_list(datalist, header)
開發者ID:mritter-tgm,項目名稱:Wahlanalyse,代碼行數:7,代碼來源:model.py


注:本文中的PySide.QtCore.QAbstractTableModel.__init__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。