| 182 | } |
| 183 | |
| 184 | void EncodeComboBox::showContextMenu() |
| 185 | { |
| 186 | QPoint center = this->mapToGlobal(this->rect().center()); |
| 187 | int menuHeight = menu->sizeHint().height(); |
| 188 | int menuWidth = menu->sizeHint().width(); |
| 189 | center.setY(center.y() - menuHeight - this->rect().height() / 2); |
| 190 | center.setX(center.x() - menuWidth / 2); |
| 191 | menu->move(center); |
| 192 | menu->exec(); |
| 193 | |
| 194 | QEvent event(QEvent::HoverLeave); |
| 195 | QApplication::sendEvent(toolBtn, &event); |
| 196 | } |
| 197 | |
| 198 | void EncodeComboBox::setCheckedExclusive(QAction *action, const QString &name) |
| 199 | { |