View difference between Paste ID: mRc7VfNh and HrcyezDV
SHOW: | | - or go back to the newest paste.
1
else if (QToolButton* button = qobject_cast<QToolButton*>(w))
2
{
3
  if (!strTipText.isEmpty())
4
    strTipText.remove(QChar('&'));
5
6
  icon = button->icon();
7
  QString str = button->text();
8
  str.remove(QChar('&'));
9
  if (strTipText != str)
10
    strTitleText = str;
11
12
  //////////////////////////
13
  //////////// THIS IS NEW
14
  QAction * defAction = button->defaultAction();
15
  if ( defAction )
16
  {
17
    QKeySequence keyShortcut = defAction->shortcut();
18
    QString strShortcutString = keyShortcut.toString();
19
    strTitleText += " (" + strShortcutString + ")";
20
  }
21
  //////////// THIS IS NEW
22
  //////////////////////////
23
}