From: Masayuki Satoh Date: Sat, 23 Aug 2014 15:00:57 +0000 (+0900) Subject: Ver0.09pre X-Git-Url: http://git.osdn.net/view?p=gefu%2FGefu.git;a=commitdiff_plain;h=c76e770c862bc3f6a30b3ddc776a4cfb409d6f5f Ver0.09pre --- diff --git a/simpletextview.cpp b/simpletextview.cpp index 2588732..c6eb52a 100644 --- a/simpletextview.cpp +++ b/simpletextview.cpp @@ -122,6 +122,20 @@ void SimpleTextView::keyPressEvent(QKeyEvent *event) } if (!ksq.isEmpty()) { + foreach (QObject *obj, this->children()) { + QAction *action = qobject_cast(obj); + if (action && action->isEnabled()) { + foreach (const QKeySequence &keySeq, action->shortcuts()) { + if (ksq == keySeq.toString()) { + qDebug() << "emit " << ksq << " " << action->objectName(); + emit action->triggered(); + event->accept(); + return; + } + } + } + } + foreach (QObject *obj, getMainWnd()->children()) { QAction *action = qobject_cast(obj); if (action && action->isEnabled()) {