From 993d6ff36b3c1aaa7354e2d10a159f1d8854629c Mon Sep 17 00:00:00 2001 From: Paul Giblock Date: Thu, 22 Nov 2007 12:48:02 +0000 Subject: [PATCH] Fixed project load bug git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@606 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 9 +++++++++ src/core/track.cpp | 5 ++--- src/widgets/text_float.cpp | 3 +-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9ebb29ca0..fc473edf1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-11-22 Paul Giblock + * src/widgets/text_float.cpp: + * src/core/track.cpp: + - fixed segfaults from clicking on track content objects after loading a + project. + - I don't have a copy of 3.1 to reference, so I don't know where the + textFloat is normally displayed. Feel free to adjust. + + 2007-11-21 Tobias Doerffel * src/lib/sample_buffer.cpp: diff --git a/src/core/track.cpp b/src/core/track.cpp index a3a333933..4b8d4bb68 100644 --- a/src/core/track.cpp +++ b/src/core/track.cpp @@ -325,8 +325,8 @@ void trackContentObject::mouseMoveEvent( QMouseEvent * _me ) s_textFloat->setText( QString( "%1:%2" ). arg( m_startPosition.getTact() + 1 ). arg( m_startPosition.getTact64th() ) ); - s_textFloat->move( mapTo( topLevelWidget(), QPoint( 0, 0 ) ) + - QPoint( -2 - s_textFloat->width(), 8 ) ); + s_textFloat->move( QPoint(8, s_textFloat->parentWidget()->height() - + s_textFloat->height() - 24 ) ); } else if( m_action == MOVE_SELECTION ) { @@ -587,7 +587,6 @@ trackContentObject * trackContentWidget::getTCO( int _tco_num ) printf( "called trackContentWidget::getTCO( %d, TRUE ), " "but TCO %d doesn't exist\n", _tco_num, _tco_num ); return( getTrack()->addTCO( getTrack()->createTCO( _tco_num * 64 ) ) ); -// return( NULL ); } diff --git a/src/widgets/text_float.cpp b/src/widgets/text_float.cpp index 4462574eb..c21fdca8a 100644 --- a/src/widgets/text_float.cpp +++ b/src/widgets/text_float.cpp @@ -91,8 +91,7 @@ void textFloat::reparent( QWidget * _new_parent ) // Get position and reparent to either top level or dialog // - while( _new_parent->parentWidget() && !_new_parent->isTopLevel() && - !_new_parent->windowType() == Qt::Dialog ) + while( _new_parent->parentWidget() && !_new_parent->inherits("QMdiSubWindow")) { _new_parent = _new_parent->parentWidget(); position += _new_parent->pos();