! Displays the tree view of items in the combobox. Triggers showTopLevelOnly() to show toplevel items only. */
| 124 | Triggers showTopLevelOnly() to show toplevel items only. |
| 125 | */ |
| 126 | void TreeViewComboBox::showPopup() { |
| 127 | if (!m_treeView->model() || !m_treeView->model()->hasChildren()) |
| 128 | return; |
| 129 | |
| 130 | QModelIndex root = m_treeView->model()->index(0, 0); |
| 131 | showTopLevelOnly(root); |
| 132 | m_groupBox->show(); |
| 133 | m_groupBox->resize(this->width(), 250); |
| 134 | m_groupBox->move(mapToGlobal(this->rect().topLeft())); |
| 135 | |
| 136 | setEditText(m_currentText); |
| 137 | m_lineEdit->setText(QString()); // delete the previous search string |
| 138 | m_lineEdit->setFocus(); |
| 139 | } |
| 140 | |
| 141 | /*! |
| 142 | \reimp |