| 147 | } |
| 148 | |
| 149 | void QuickOpenWidget::updateTimerInterval(bool cheapFilterChange) |
| 150 | { |
| 151 | const int MAX_ITEMS = 10000; |
| 152 | if (cheapFilterChange && m_model->rowCount(QModelIndex()) < MAX_ITEMS) { |
| 153 | // cheap change and there are currently just a few items, |
| 154 | // so apply filter instantly |
| 155 | m_filterTimer.setInterval(0); |
| 156 | } else if (m_model->unfilteredRowCount() < MAX_ITEMS) { |
| 157 | // not a cheap change, but there are generally |
| 158 | // just a few items in the list: apply filter instantly |
| 159 | m_filterTimer.setInterval(0); |
| 160 | } else { |
| 161 | // otherwise use a timer to prevent sluggishness while typing |
| 162 | m_filterTimer.setInterval(300); |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | void QuickOpenWidget::showEvent(QShowEvent* e) |
| 167 | { |
nothing calls this directly
no test coverage detected