| 167 | { |
| 168 | d->_isPopupPressed = true; |
| 169 | setFocus(Qt::MouseFocusReason); |
| 170 | event->accept(); |
| 171 | update(); |
| 172 | return; |
| 173 | } |
| 174 | QComboBox::mousePressEvent(event); |
| 175 | } |
| 176 | |
| 177 | void ElaMultiSelectComboBox::mouseReleaseEvent(QMouseEvent* event) |
| 178 | { |
| 179 | Q_D(ElaMultiSelectComboBox); |
| 180 | if (event->button() == Qt::LeftButton && d->_pressedTagIndex.isValid()) |
| 181 | { |
| 182 | const QPersistentModelIndex pressedIndex = d->_pressedTagIndex; |
| 183 | d->_pressedTagIndex = QModelIndex(); |
| 184 | for (const auto& tag: d->_getSelectionTags()) |
| 185 | { |
| 186 | if (tag.index == pressedIndex && tag.closeRect.contains(event->pos())) |
| 187 | { |
| 188 | d->onItemPressed(tag.index); |
| 189 | break; |
| 190 | } |
| 191 | } |
| 192 | event->accept(); |
| 193 | update(); |
| 194 | return; |
| 195 | } |
| 196 | if (event->button() == Qt::LeftButton && d->_isPopupPressed) |
| 197 | { |
| 198 | d->_isPopupPressed = false; |
| 199 | if (isEnabled() && rect().contains(event->pos())) |
| 200 | { |
| 201 | if (d->_popup->getIsVisible()) |
| 202 | { |
| 203 | hidePopup(); |
| 204 | } |
| 205 | else |
| 206 | { |
| 207 | showPopup(); |
| 208 | } |
| 209 | } |
nothing calls this directly
no outgoing calls
no test coverage detected