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


Python QDateTime.currentDateTimeUtc方法代码示例

本文整理汇总了Python中qgis.PyQt.QtCore.QDateTime.currentDateTimeUtc方法的典型用法代码示例。如果您正苦于以下问题:Python QDateTime.currentDateTimeUtc方法的具体用法?Python QDateTime.currentDateTimeUtc怎么用?Python QDateTime.currentDateTimeUtc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在qgis.PyQt.QtCore.QDateTime的用法示例。


在下文中一共展示了QDateTime.currentDateTimeUtc方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: outattrPrep

# 需要导入模块: from qgis.PyQt.QtCore import QDateTime [as 别名]
# 或者: from qgis.PyQt.QtCore.QDateTime import currentDateTimeUtc [as 别名]
    def outattrPrep(self, dlg, lyr):
        feat = QgsFeature()

        species = ''
        production = ''
        most = QDateTime.currentDateTimeUtc()

        rn = dlg.tableWidget.rowCount()
        for i in range(rn):
            if i==0:
                species = dlg.tableWidget.item(i, 0).text()
                production = dlg.tableWidget.item(i, 1).text()
            else:
                species = species + ' | ' + dlg.tableWidget.item(i, 0).text()
                production = production + ' | ' + dlg.tableWidget.item(i, 1).text()

        flds = lyr.dataProvider().fields()
        feat.setFields(flds, True)
        feat.setAttribute(feat.fieldNameIndex('localid'), dlg.lineEdit_3.text())
        feat.setAttribute(feat.fieldNameIndex('code'), dlg.lineEdit_5.text())
        feat.setAttribute(feat.fieldNameIndex('largescale'), dlg.comboBox_4.currentText())
        feat.setAttribute(feat.fieldNameIndex('disease'), dlg.comboBox_2.currentText())
        feat.setAttribute(feat.fieldNameIndex('animalno'), dlg.lineEdit_6.text())
        feat.setAttribute(feat.fieldNameIndex('species'), species)
        feat.setAttribute(feat.fieldNameIndex('production'), production)
        feat.setAttribute(feat.fieldNameIndex('year'), dlg.lineEdit_4.text())
        feat.setAttribute(feat.fieldNameIndex('status'), dlg.comboBox_3.currentText())
        feat.setAttribute(feat.fieldNameIndex('suspect'), self.dateCheck(dlg.dateEdit.date()))
        feat.setAttribute(feat.fieldNameIndex('confirmation'), self.dateCheck(dlg.dateEdit_2.date()))
        feat.setAttribute(feat.fieldNameIndex('expiration'), self.dateCheck(dlg.dateEdit_3.date()))
        feat.setAttribute(feat.fieldNameIndex('notes'), dlg.textEdit.toPlainText())
        feat.setAttribute(feat.fieldNameIndex('hrid'), self.hashIDer(most))
        feat.setAttribute(feat.fieldNameIndex('timestamp'), most.toString('dd/MM/yyyy hh:mm:ss'))
        return feat
开发者ID:IZSVenezie,项目名称:VetEpiGIS-Tool,代码行数:36,代码来源:qvfuncs.py


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