Advertisement
Guest User

Untitled

a guest
Aug 28th, 2012
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement