本文整理汇总了Python中qgis.gui.QgsAttributeTableModel.index方法的典型用法代码示例。如果您正苦于以下问题:Python QgsAttributeTableModel.index方法的具体用法?Python QgsAttributeTableModel.index怎么用?Python QgsAttributeTableModel.index使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qgis.gui.QgsAttributeTableModel
的用法示例。
在下文中一共展示了QgsAttributeTableModel.index方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from qgis.gui import QgsAttributeTableModel [as 别名]
# 或者: from qgis.gui.QgsAttributeTableModel import index [as 别名]
#.........这里部分代码省略.........
:param message: String for translation.
:type message: str, QString
:returns: Translated version of message.
:rtype: QString
"""
# noinspection PyTypeChecker,PyArgumentList,PyCallByClass
return QCoreApplication.translate('UploadImages', message)
def copyFiles(self):
#actlayer1 = qgis.utils.iface.activeLayer()
#features1 = actlayer1.selectedFeatures()
self.dlg.progressBar.setMaximum(len(self.features))
self.dlg.progressBar.setValue(0)
msgBox = PyQt4.QtGui.QMessageBox()
diretorioDestino = self.dlg.lineEdit.text()
if(diretorioDestino):
pass
else:
msgBox.setText("Selecione a Pasta de Destino!")
msgBox.setStandardButtons(QMessageBox.Ok);
msgBox.exec_()
return
#actlayer = qgis.utils.iface.activeLayer()
index = self.modelt.index(0,0)
contadorBarra = 0
for row in range(self.modelt.rowCount()):
self.downloadArquivo(self.modelt.data(self.modelt.index(row,self.dlg.comboBoxCampos.currentIndex()),
0),diretorioDestino)
contadorBarra += 1
self.dlg.progressBar.setValue(contadorBarra)
#pyqtRemoveInputHook()
#pdb.set_trace()
if self.downloadOK is not False:
self.downloadOK = True
if self.downloadOK is True:
msgBox.setText("Imagens Copiadas com Sucesso!")
msgBox.setStandardButtons(QMessageBox.Ok);
msgBox.exec_()
self.dlg.accept()
def downloadArquivo(self, caminhoArquivo, diretorioDestino):
print("Inicio3")
#caminhoArquivo = r'\\172.23.5.17\cotec\divabd\Mario\SIGRH.png'
caminhoSalvar = caminhoArquivo[caminhoArquivo.find("\\indice_imagens\\"):]
#caminhoSalvar = '\cotec\divabd\Mario\SIGRH.png'
caminhoSalvar.replace("\\", "/")
print("caminho 2 = "+caminhoArquivo)
print("CaminhoSalvar"+caminhoSalvar)
#nomeArquivo = caminhoArquivo
#print("NomeArquivo="+nomeArquivo)
nomeArquivo = os.path.basename(caminhoArquivo)
print(caminhoArquivo)