I want to read the field name as string format from a QgsFieldComboBox. How to read?

I tried like following but not working for some comparison.

selectedField = self.dlg.QgsFieldcomboBox.currentField
  • what did you put into the comboBox? We need to see more code than just this line to be able to help you
    – Ian Turton
    Jul 12, 2022 at 12:35
  • Welcome to GIS SE! We're a little different from other sites; this isn't a discussion forum but a Q&A site. Your questions should as much as possible describe not just what you want to do, but precisely what you have tried and where you are stuck trying that. Please check out our short tour for more about how the site works
    – Ian Turton
    Jul 12, 2022 at 12:35
  • 1
    It's currentField() with params! Otherwise you don't call the method. This will return a string.
    – Ben W
    Jul 12, 2022 at 13:42

1 Answer 1


When you use currentField without () you get the method itself, you don't call the method. Use selectedField = self.dlg.QgsFieldcomboBox.currentField().

currentField() returns the field name as string.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.