3

How can I find a QString in a QComboBox? I want to get the index of the element in the combobox that's corresponding to my string. Is there a native method?

Thanks in advance.

Marco Carletti
  • 318
  • 2
  • 5
  • 16
  • The Qt documentation is really well done. I would start there for any questions like this that you have in the future. Most methods are reasonably named in a descriptive manner. A few that caught me off guard is the use of `take` like in `takeTopLevelItem` within a `QTreeWidget` instead of `remove`. – Drise May 23 '12 at 14:52
  • You are right. I must learn how to use online documentation. Thanks! – Marco Carletti May 24 '12 at 07:35

1 Answers1

6

I think that the findText method is what you're looking for

Jokahero
  • 1,074
  • 10
  • 21