Esempio n. 1
0
class ListFeaturesForm(QDialog):
    openFeatureForm = pyqtSignal(object, QgsFeature, QgsMapLayer)

    def __init__(self):
        QDialog.__init__(self)
        self.ui = Ui_ListFeatueForm()
        self.ui.setupUi(self)
        self.ui.featureList.itemClicked.connect(self.openForm)
        self.setWindowFlags(Qt.FramelessWindowHint)
        scr = QApplication.desktop().screenGeometry(0)
        self.move( scr.center() - self.rect().center() )

    def loadFeatureList(self, featureDict):
        for feature, formAndLayer in featureDict.items():

            #TODO We don't handle default forms just yet
            if formAndLayer[0] == "Default":
                continue
                
            featureitem = FeatureItem( feature, formAndLayer[0], formAndLayer[1] )
            self.ui.featureList.addItem( featureitem )

    def openForm(self, item):
        form = item.editForm
        feature = item.qgsFeature
        layer = item.layer
        self.close()
        self.openFeatureForm.emit(form, feature, layer)
Esempio n. 2
0
 def __init__(self):
     QDialog.__init__(self)
     self.ui = Ui_ListFeatueForm()
     self.ui.setupUi(self)
     self.ui.featureList.itemClicked.connect(self.openForm)
     self.setWindowFlags(Qt.FramelessWindowHint)
     scr = QApplication.desktop().screenGeometry(0)
     self.move(scr.center() - self.rect().center())
Esempio n. 3
0
 def __init__(self):
     QDialog.__init__(self)
     self.ui = Ui_ListFeatueForm()
     self.ui.setupUi(self)
     self.ui.featureList.itemClicked.connect(self.openForm)
     self.setWindowFlags(Qt.FramelessWindowHint)
     scr = QApplication.desktop().screenGeometry(0)
     self.move( scr.center() - self.rect().center() )
Esempio n. 4
0
class ListFeaturesForm(QDialog):
    openFeatureForm = pyqtSignal(QgsVectorLayer, QgsFeature)

    def __init__(self):
        QDialog.__init__(self)
        self.ui = Ui_ListFeatueForm()
        self.ui.setupUi(self)
        self.ui.featureList.itemClicked.connect(self.openForm)
        self.setWindowFlags(Qt.FramelessWindowHint)
        scr = QApplication.desktop().screenGeometry(0)
        self.move(scr.center() - self.rect().center())

    def loadFeatureList(self, featuresmaps):
        for feature, layer in featuresmaps:
            featureitem = FeatureItem(feature, layer)
            self.ui.featureList.addItem(featureitem)

    def openForm(self, item):
        feature = item.qgsFeature
        layer = item.layer
        self.close()
        self.openFeatureForm.emit(layer, feature)
Esempio n. 5
0
class ListFeaturesForm(QDialog):
    openFeatureForm = pyqtSignal(QgsVectorLayer, QgsFeature)

    def __init__(self):
        QDialog.__init__(self)
        self.ui = Ui_ListFeatueForm()
        self.ui.setupUi(self)
        self.ui.featureList.itemClicked.connect(self.openForm)
        self.setWindowFlags(Qt.FramelessWindowHint)
        scr = QApplication.desktop().screenGeometry(0)
        self.move( scr.center() - self.rect().center() )

    def loadFeatureList(self, featuresmaps):
        for feature, layer  in featuresmaps:               
            featureitem = FeatureItem( feature, layer )
            self.ui.featureList.addItem( featureitem )

    def openForm(self, item):
        feature = item.qgsFeature
        layer = item.layer
        self.close()
        self.openFeatureForm.emit(layer, feature)