绑定右键单击Qt应用程序

时间:2019-01-21 08:18:32

标签: c++ qt

我有以下代码,当我按“ U”键时会更改点的可见性,我想更改可见性(我按“ Qt :: RightClick”将“ Qt :: Key_u”更改为“ Qt :: Key_u”)右键单击”,但没有用。

  QShortcut *keyModifyVisibility = new QShortcut(this);
  keyModifyVisibility->setWhatsThis(tr("Modify current visibility"));
  keyModifyVisibility->setKey(Qt::Key_U);
  connect(keyModifyVisibility, SIGNAL(activated()), this, 
  SLOT(ModifyVisibility()));

0 个答案:

没有答案