! \property QComboBox::currentText \brief the current text If the combo box is editable, the current text is the value displayed by the line edit. Otherwise, it is the value of the current item or an empty string if the combo box is empty or no current item is set. The setter setCurrentText() simply calls setEditText() if the combo box is editable. Otherwise, if there is a matching text in
| 173 | \sa editable, setEditText() |
| 174 | */ |
| 175 | QString TreeViewComboBox::currentText() const { |
| 176 | if (lineEdit()) |
| 177 | return lineEdit()->text(); |
| 178 | else if (currentModelIndex().isValid()) |
| 179 | return itemText(currentIndex()); |
| 180 | return m_currentText; |
| 181 | } |
| 182 | |
| 183 | void TreeViewComboBox::setText(const QString& text) { |
| 184 | m_currentText = text; |
no test coverage detected