예제 #1
0
 def setData(self, index, value, role=Qt.EditRole):
     row = index.row()
     col = index.column()
     
     project = File.allProjects(os.getcwd())[row]
     metadatakey = Metadata.listUsedAnnotations(os.getcwd())[col]
     value = str(value.toPyObject())
     
     Metadata.setMetadata(project, metadatakey, value)
     
     return True
예제 #2
0
    def headerData(self, section, orientation, role = QtCore.Qt.DisplayRole):
        if role == Qt.DisplayRole:
            if orientation == Qt.Horizontal:
                listUsedAnnotations = Metadata.listUsedAnnotations(os.getcwd())
                key = listUsedAnnotations[section]
            
                return QString(key)
            
            elif orientation == Qt.Vertical:
                project = File.allProjects(os.getcwd())[section]

                return QVariant(project)
            
        else:
            return QVariant()
예제 #3
0
 def data(self, index, role):
     if not index.isValid():
         return QVariant()
     elif role != Qt.DisplayRole and role != Qt.EditRole:
         return QVariant()
     
     project = File.allProjects(os.getcwd())[index.row()]
     metadatakey = Metadata.listUsedAnnotations(os.getcwd())[index.column()]
     annotations = Metadata.getAnnotations(project)
     if annotations.has_key(metadatakey):
         metadatavalue = annotations[metadatakey]
     else:
         metadatavalue = "<NOT SET>"
         
     return QVariant(metadatavalue)
예제 #4
0
 def columnCount(self, parent):
     return len(Metadata.listUsedAnnotations(os.getcwd()))