From 28673e7a80cec5b963839094c42291e7a6d35cf5 Mon Sep 17 00:00:00 2001 From: Andreas Brandmaier Date: Mon, 23 Jan 2006 14:03:13 +0000 Subject: [PATCH] added own cursor drawing git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@58 0778d3d1-df1d-0410-868b-ea421aaaa00d --- plugins/bit_invader/graph.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/bit_invader/graph.cpp b/plugins/bit_invader/graph.cpp index 44e685b2d..bc008de32 100644 --- a/plugins/bit_invader/graph.cpp +++ b/plugins/bit_invader/graph.cpp @@ -128,7 +128,7 @@ void graph::mousePressEvent( QMouseEvent * _me ) // toggle mouse state m_mouseDown = true; -// setCursor( QCursor::BlankCursor ); + setCursor( QCursor::BlankCursor ); m_lastCursorX = x; } @@ -157,6 +157,7 @@ void graph::mouseReleaseEvent( QMouseEvent * _me ) // toggle mouse state m_mouseDown = false; setCursor( QCursor::ArrowCursor ); + update(); } @@ -194,7 +195,12 @@ void graph::paintEvent( QPaintEvent * ) } // draw Pointer - // mapFromGlobal( QCursor::pos() ); + if (m_mouseDown) { + QPoint cursor = mapFromGlobal( QCursor::pos() ); + p.setPen( QColor( 0xAA, 0xFF, 0x00 ) ); + p.drawLine( 2, cursor.y(), 130, cursor.y() ); + p.drawLine( cursor.x(), 2, cursor.x(), 102 ); + } #ifndef QT4 // and blit all the drawn stuff on the screen...