! Sets the current item to be the item at \a index and selects it. \sa currentIndex() */
| 104 | \sa currentIndex() |
| 105 | */ |
| 106 | void TreeViewComboBox::setCurrentModelIndex(const QModelIndex& index) { |
| 107 | m_treeView->setCurrentIndex(index); |
| 108 | if (index.isValid()) { |
| 109 | setToolTip(m_model->data(index, Qt::ToolTipRole).toString()); |
| 110 | QComboBox::setItemText(0, index.data().toString()); |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | /*! |
| 115 | Returns the model index of the current item. |
no test coverage detected