New answers tagged

2

Your "check boxes" don't work because you're putting your lines in the wrong place (run method). However, you need first to declare objects in __init__ method for connecting them to a 'change_status' function (preferably one for each check box). I'm going to exemplify this only for "Interpretation" Check Box. Snippet code is as follows: . . . def __init__(...


2

For the example, I have created a layer with one field "creation". Firstly, in Qt Designer, you must add a QComboBox widget. With a QComboBox, the user can only choose one value. Each widget have an object name. The QComboBox must have the same name as the field you want to fill in in QGIS. Secondly, in QGIS : You load your .ui file You choose your ...


5

I designed a sample form in QtDesigner. Here is the form which contains one button: In QGIS Python Console or Editor, Load this form using uic.loadUi. Define a method. Connect this method to the button click event in the form. from qgis.PyQt import uic # 1 form = uic.loadUi("c:/test/sample.ui") # 2 def load_shapefile(): layer = QgsVectorLayer("c:/...


5

You can link a ui file directly to a table under Properties > Attribute Form, and select Provide ui-file from the top combobox. You can dynamically load a ui to a Python class inheriting from QDockWidget: self.ui = uic.loadUi(os.path.join(os.path.dirname(__file__), 'myui.ui'), self)


Top 50 recent answers are included