void EventPropertyWidgetQt::setButtonText() { std::string text = eventproperty_->getEvent()->modifierNames(); if (text != "") text.append("+"); KeyboardEvent* keyboardEvent = dynamic_cast<KeyboardEvent*>(eventproperty_->getEvent()); if (keyboardEvent) { text += std::string(1, static_cast<char>(keyboardEvent->button())); } MouseEvent* mouseEvent = dynamic_cast<MouseEvent*>(eventproperty_->getEvent()); if (mouseEvent) { text += mouseEvent->buttonName(); } button_->setText(QString::fromStdString(text)); }