当前位置: 首页>>代码示例>>Python>>正文


Python QgsAttributeTableModel.index方法代码示例

本文整理汇总了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)
开发者ID:alexlopespereira,项目名称:sipamsar,代码行数:70,代码来源:Upload_Images.py


注:本文中的qgis.gui.QgsAttributeTableModel.index方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。