| 148 | QString DeviceBrowser::getIdOfIndex(int idx) { return (list[idx]->property(devBrowserId).toString()); } |
| 149 | |
| 150 | void DeviceBrowser::nextDevice() |
| 151 | { |
| 152 | int maxIdx = list.size(); |
| 153 | int nextIdx = currentIdx; |
| 154 | |
| 155 | do { // find next visible and enabled button |
| 156 | nextIdx = (nextIdx + 1) % maxIdx; |
| 157 | nextIdx = (nextIdx < 0) ? nextIdx + maxIdx : nextIdx; // wrap around negative |
| 158 | } while(!(list.at(nextIdx)->isVisible() && list.at(nextIdx)->isEnabled())); |
| 159 | |
| 160 | QString nextId = getIdOfIndex(nextIdx); |
| 161 | Q_EMIT requestDevice(nextId, 1); // start animation |
| 162 | list[nextIdx]->setChecked(true); // set checked afterwards |
| 163 | } |
| 164 | |
| 165 | void DeviceBrowser::prevDevice() |
| 166 | { |
nothing calls this directly
no test coverage detected