mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Make tooltips works
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
		
							parent
							
								
									2089c124a5
								
							
						
					
					
						commit
						ce8d30b938
					
				
					 2 changed files with 12 additions and 0 deletions
				
			
		|  | @ -11,6 +11,7 @@ | |||
| #include <QIcon> | ||||
| #include <QPropertyAnimation> | ||||
| #include <QGraphicsSceneHoverEvent> | ||||
| #include <QMouseEvent> | ||||
| 
 | ||||
| #include "../color.h" | ||||
| #include "../display.h" | ||||
|  | @ -136,6 +137,16 @@ ProfileGraphicsView::ProfileGraphicsView(QWidget* parent) : QGraphicsView(parent | |||
| 	fill_profile_color(); | ||||
| } | ||||
| 
 | ||||
| void ProfileGraphicsView::mouseMoveEvent(QMouseEvent* event) | ||||
| { | ||||
| 	toolTip->clear(); | ||||
| 	QList<QGraphicsItem*> items = scene()->items( mapToScene(event->pos() ), Qt::IntersectsItemShape, Qt::DescendingOrder, transform()); | ||||
| 	Q_FOREACH(QGraphicsItem *item, items){ | ||||
| 		if (!item->toolTip().isEmpty()) | ||||
| 			toolTip->addToolTip(item->toolTip()); | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| bool ProfileGraphicsView::eventFilter(QObject* obj, QEvent* event) | ||||
| { | ||||
| 	// This will "Eat" the default tooltip behavior.
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue