Tuesday 15 May 2018

Closing windows by code QGIS 2.18


Im trying to close the window (by code) that appears right after the "add feature" tool is called. This is the window im talking:


enter image description here


This is my plugin code:



    def run(self):
"""Run method that performs all the real work"""
self.iface.actionAddFeature().trigger()
# CLOSE WINDOW CODE HERE

Everything i tried closed my QGIS program. Is what im asking possible? If so, how?



Answer



def run(self):
"""Run method that performs all the real work"""
self.iface.actionAddFeature().trigger()

QSettings().setValue(/qgis/digitizing/disable_enter_attribute_values_dialog', False)

Turning "ON":


QSettings().setValue(/qgis/digitizing/disable_enter_attribute_values_dialog', True )


Turning "OFF":


QSettings().setValue(/qgis/digitizing/disable_enter_attribute_values_dialog', False )


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...