- Timestamp:
- Mar 14, 2007 11:38:46 AM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 19526
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/QIRichLabel.h
r1017 r1467 95 95 void drawContents ( QPainter * ); 96 96 void fontChange ( const QFont & ); 97 void mouseMoveEvent (QMouseEvent *); 98 void mousePressEvent (QMouseEvent *); 97 99 void resizeEvent ( QResizeEvent* ); 98 100 void focusInEvent ( QFocusEvent* ); … … 102 104 signals: 103 105 void textChanged(); 106 void clickedOnLink (const QString&); 104 107 105 108 private slots: -
trunk/src/VBox/Frontends/VirtualBox/src/QIRichLabel.cpp
r1213 r1467 42 42 #include <qaction.h> 43 43 #include <qclipboard.h> 44 #include <qcursor.h> 44 45 45 46 class QLabelPrivate … … 115 116 popupMenu = new QPopupMenu (this, "contextMenu"); 116 117 copyAction->addTo (popupMenu); 118 119 setMouseTracking (true); 117 120 } 118 121 … … 369 372 d->msh = sz; 370 373 return sz; 374 } 375 376 377 void QIRichLabel::mouseMoveEvent (QMouseEvent *aEvent) 378 { 379 if (!doc) return; 380 381 QString link = doc->anchorAt (aEvent->pos()); 382 if (!link.isEmpty()) /* Mouse cursor above link */ 383 setCursor (QCursor (Qt::PointingHandCursor)); 384 else /* Mouse cursor above non-link */ 385 setCursor (QCursor (Qt::ArrowCursor)); 386 } 387 388 389 void QIRichLabel::mousePressEvent (QMouseEvent *aEvent) 390 { 391 if (!doc) return; 392 393 QString link = doc->anchorAt (aEvent->pos()); 394 if (!link.isEmpty()) /* Mouse clicked on the link */ 395 emit clickedOnLink (link); 371 396 } 372 397
Note:
See TracChangeset
for help on using the changeset viewer.