QFileDialog remains open after selection made

المشرف العام

Administrator
طاقم الإدارة
I have created a QGIS plugin to import a tab separated value file, using:

filename = QFileDialog.getOpenFileName(self.dlg, "Select file to import ", path, '*.*')uri="file:///"+filename+"?"+"delimiter=%s&xField=%s&yField=%s"%("\t", "Set Grid Easting", "Set Grid Northing")vlayer = QgsVectorLayer(uri, "SpreadTests", "delimitedtext")QgsMapLayerRegistry.instance().addMapLayer(vlayer)It works as expected except that the dialog box to select the file stays open after a selection is made. Is there something I am doing wrong? or something else I need to add? Thanks for any help offered.



أكثر...
 
أعلى