擅长:python、mysql、java
<p>您需要将您的操作添加到小部件中,然后才能对其进行处理。从QAction的QT文档:</p>
<blockquote>
<p>Actions are added to widgets using
QWidget::addAction() or
QGraphicsWidget::addAction(). Note
that an action must be added to a
widget before it can be used; this is
also true when the shortcut should be
global (i.e., Qt::ApplicationShortcut
as Qt::ShortcutContext).</p>
</blockquote>
<p>这并不意味着它们将以菜单项或其他方式可见——只是它们将作为小部件事件循环的一部分而成为进程。在</p>