- Timestamp:
- Aug 7, 2008 2:03:27 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 34247
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/QILabel_p.h
r9799 r11206 30 30 /* Qt includes */ 31 31 #include <QLabel> 32 33 class QAction; 32 34 33 35 class QILabelPrivate: public QLabel … … 135 137 QSize mOwnSizeHint; 136 138 bool mStartDragging; 139 QAction *mCopyAction; 137 140 }; 138 141 -
trunk/src/VBox/Frontends/VirtualBox4/src/QILabel.cpp
r10780 r11206 360 360 { 361 361 /* Create a context menu for the copy to clipboard action. */ 362 QMenu *menu = new QMenu(); 363 menu->addAction (tr ("&Copy") + "\t" + QString (QKeySequence (QKeySequence::Copy)), this, SLOT (copy())); 364 menu->exec (aEvent->globalPos()); 365 }else 362 QMenu menu; 363 mCopyAction->setText (tr ("&Copy")); 364 menu.addAction (mCopyAction); 365 menu.exec (aEvent->globalPos()); 366 } else 366 367 QLabel::contextMenuEvent (aEvent); 367 368 } … … 416 417 /* Open links with the QDesktopService */ 417 418 setOpenExternalLinks (true); 419 420 /* Create invisible copy action */ 421 mCopyAction = new QAction (this); 422 addAction (mCopyAction); 423 mCopyAction->setShortcut (QKeySequence (QKeySequence::Copy)); 424 mCopyAction->setShortcutContext (Qt::WidgetShortcut); 425 connect (mCopyAction, SIGNAL (triggered()), this, SLOT (copy())); 418 426 } 419 427
Note:
See TracChangeset
for help on using the changeset viewer.