With the following line of code, I get a list of field names for the layer
fields = layer.fields().names()
However, I would like to get only those fields with the datatype
Integer. How would I do that? I checked the class QgsFields but I don't see a function that relates to the datatype. Is there a way to do that?