Questions tagged «macro»

1
如何立即应用QSettings中的更改?
使用PyQGIS,您可以更改各种设置,例如使“图层面板”(或目录)中的组变为粗体: from PyQt4.QtCore import QSettings QSettings().setValue("/Qgis/legendGroupsBold", True) 可以写入设置,可以从选项或键入中看到: QSettings().value("/Qgis/legendGroupsBold") >>> u'true' 但这并没有得到应用。我以为使用 QSettings().sync() 可能会有帮助,但不幸的是没有帮助。应用它的唯一方法是转到GUI(Settings > Options),然后单击OK或重新启动QGIS。 是否有通过PyQGIS做到这一点的方法? 内容: 我想将此添加为项目文件中的宏,以确保(出于美观目的)仅组名为粗体,而图层名则为非粗体。因此,理想的是在项目加载后应用QSettings(在项目关闭时将重新应用初始设置)。
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.