is there a way to use the function "Select by Attribute" in QGIS using a python command? In my plugin the user should enter a value via a GUI and this value should be used in a function which selects all features which have this attribute. The column name is fixed in the code, the function should only search for the correct value.
In my current solution the function connects QGIS to a postgresql database and runs an SQL statement. This creates a table from the result and the table is visualised as shapefile in QGIS.
In principal it would be enought to highlight the features and not to create a new shapefile of the selection. Using the "Select by Attribute" function would also skip the unnecessary database connection.
Is there a way to use the function "Select by Attribute" in python so that the features are highlighted? Using the function in QGIS all features that doesn´t match the query are temporary blanked-out that would be ok too.
Regards from Hamburg,