Example #1
0
    def __init__(self, parent=None, rows=[], name='ListBox', columns=[]):
        self.__clist_rows__ = rows
        if len(self.__clist_rows__):
            test_row = self.__clist_rows__[0]
            if not (hasattr(test_row, '_keylist_')
                    or hasattr(test_row, '_desc_')):
                if columns:
                    if len(columns) == 1:
                        nrows = [[x] for x in self.__clist_rows__]
                        self.__clist_rows__ = nrows
                    dbrows = [
                        DbBaseRow(columns, x) for x in self.__clist_rows__
                    ]
                    self.__clist_rows__ = dbrows
                    self.__clist_row_desc = self.__clist_rows__[0]._keylist_
                    self.__col_titles__ = self.__clist_row_desc

                else:
                    self.__clist_row_desc = None
                    self.__col_titles__ = ['nothing']
            else:
                if hasattr(test_row, '_desc_'):
                    self.__clist_row_desc = [x[0] for x in test_row._desc_]
                else:
                    self.__clist_row_desc = test_row._keylist_
                self.__col_titles__ = self.__clist_row_desc
        else:
            self.__col_titles__ = ['nothing']
            self.__clist_rows__ = []
        QListView.__init__(self, None)
        self.__setup_listbox()
        self.show()
        self.append_rows()
Example #2
0
 def __init__(self, parent=None, rows=[], name='ListBox', columns=[]):
     self.__clist_rows__ = rows
     if len(self.__clist_rows__):
         test_row = self.__clist_rows__[0]
         if not (hasattr(test_row, '_keylist_') or hasattr(test_row, '_desc_')):
             if columns:
                 if len(columns) == 1:
                     nrows = [[x] for x in self.__clist_rows__]
                     self.__clist_rows__ = nrows
                 dbrows = [DbBaseRow(columns, x) for x in self.__clist_rows__]
                 self.__clist_rows__ = dbrows
                 self.__clist_row_desc = self.__clist_rows__[0]._keylist_
                 self.__col_titles__ = self.__clist_row_desc
                 
             else:
                 self.__clist_row_desc = None
                 self.__col_titles__ = ['nothing']
         else:
             if hasattr(test_row, '_desc_'):
                 self.__clist_row_desc = [x[0] for x in test_row._desc_]
             else:
                 self.__clist_row_desc = test_row._keylist_
             self.__col_titles__ = self.__clist_row_desc
     else:
         self.__col_titles__ = ['nothing']
         self.__clist_rows__ = []
     QListView.__init__(self, None)
     self.__setup_listbox()
     self.show()
     self.append_rows()
Example #3
0
 def __init__(self, scene):
     QListView.__init__(self)
     self.scene = scene
     decorateWindow(self, m18n("Explain Scores").replace("&", ""))
     self.setGeometry(0, 0, 300, 400)
     self.model = QStringListModel()
     self.setModel(self.model)
     StateSaver(self)
     self.refresh()
Example #4
0
 def __init__(self, scene):
     QListView.__init__(self)
     self.scene = scene
     decorateWindow(self, i18n('Explain Scores').replace('&', ''))
     self.setGeometry(0, 0, 300, 400)
     self.model = QStringListModel()
     self.setModel(self.model)
     StateSaver(self)
     self.refresh()
Example #5
0
 def __init__(self, parent=None):
     QListView.__init__(self, parent)
     self.data = None
     self.col2str = None
     self.setRootIsDecorated(True)
     self.setSorting(-1)
     self.clipBoard = None
     self.accelFilter = None
     self.keyBindingDescriptor = {
         "Ctrl+N": "new",
         "Ctrl+A": "attach",
         "Ctrl+I,Ctrl+L": "insertLeft",
         "Ctrl+I,Ctrl+R": "insertRight",
         "Ctrl+P": "prune",
         "Ctrl+S": "splice"
     }
     self.setKeyBindings(self.keyBindingDescriptor)
 def __init__(self, parent=None):
     QListView.__init__(self, parent)
     self.data = None
     self.col2str = None
     self.setRootIsDecorated(True)
     self.setSorting(-1)
     self.clipBoard = None
     self.accelFilter = None
     self.keyBindingDescriptor = {
         "Ctrl+N": "new",
         "Ctrl+A": "attach",
         "Ctrl+I,Ctrl+L": "insertLeft",
         "Ctrl+I,Ctrl+R": "insertRight",
         "Ctrl+P": "prune",
         "Ctrl+S": "splice",
     }
     self.setKeyBindings(self.keyBindingDescriptor)