use automatableModelView::addDefaultActions()

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1065 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-06-03 16:02:48 +00:00
parent 8291fc72e5
commit 7a5acc719b
3 changed files with 29 additions and 12 deletions

View File

@@ -113,10 +113,7 @@ void automatableButton::contextMenuEvent( QContextMenuEvent * _me )
}
captionMenu contextMenu( target->accessibleName() );
contextMenu.addAction( embed::getIconPixmap( "automation" ),
tr( "&Open in automation editor" ),
pattern,
SLOT( openInAutomationEditor() ) );
addDefaultActions( &contextMenu );
contextMenu.exec( QCursor::pos() );
}

View File

@@ -64,10 +64,7 @@ automatableSlider::~automatableSlider()
void automatableSlider::contextMenuEvent( QContextMenuEvent * _me )
{
captionMenu contextMenu( accessibleName() );
contextMenu.addAction( embed::getIconPixmap( "automation" ),
tr( "&Open in automation editor" ),
model()->getAutomationPattern(),
SLOT( openInAutomationEditor() ) );
addDefaultActions( &contextMenu );
contextMenu.exec( QCursor::pos() );
}

View File

@@ -64,6 +64,8 @@ lcdSpinBox::lcdSpinBox( int _num_digits, QWidget * _parent,
}
lcdSpinBox::lcdSpinBox( int _num_digits, const QString & _lcd_style,
QWidget * _parent, const QString & _name ) :
QWidget( _parent ),
@@ -89,12 +91,16 @@ lcdSpinBox::lcdSpinBox( int _num_digits, const QString & _lcd_style,
}
lcdSpinBox::~lcdSpinBox()
{
delete m_lcdPixmap;
}
void lcdSpinBox::paintEvent( QPaintEvent * _me )
{
QRect ur = _me->rect();
@@ -183,6 +189,8 @@ void lcdSpinBox::paintEvent( QPaintEvent * _me )
}
void lcdSpinBox::update( void )
{
QString s = m_textForValue[model()->value()];
@@ -203,6 +211,8 @@ void lcdSpinBox::update( void )
}
void lcdSpinBox::setLabel( const QString & _txt )
{
m_label = _txt;
@@ -210,12 +220,16 @@ void lcdSpinBox::setLabel( const QString & _txt )
}
void lcdSpinBox::setEnabled( bool _on )
{
QWidget::setEnabled( _on );
}
void lcdSpinBox::setMarginWidth( int _width )
{
m_marginWidth = _width;
@@ -224,6 +238,8 @@ void lcdSpinBox::setMarginWidth( int _width )
}
void lcdSpinBox::updateSize()
{
int margin = 1;
@@ -242,6 +258,8 @@ void lcdSpinBox::updateSize()
}
void lcdSpinBox::contextMenuEvent( QContextMenuEvent * _me )
{
m_origMousePos = _me->globalPos();
@@ -259,14 +277,13 @@ void lcdSpinBox::contextMenuEvent( QContextMenuEvent * _me )
mouseReleaseEvent( NULL );
captionMenu contextMenu( accessibleName() );
contextMenu.addAction( embed::getIconPixmap( "automation" ),
tr( "&Open in automation editor" ),
model()->getAutomationPattern(),
SLOT( openInAutomationEditor() ) );
addDefaultActions( &contextMenu );
contextMenu.exec( QCursor::pos() );
}
void lcdSpinBox::mousePressEvent( QMouseEvent * _me )
{
if( _me->button() == Qt::LeftButton && _me->y() < m_cellHeight + 2 )
@@ -278,6 +295,8 @@ void lcdSpinBox::mousePressEvent( QMouseEvent * _me )
}
void lcdSpinBox::mouseMoveEvent( QMouseEvent * _me )
{
if( _me->buttons() & Qt::LeftButton )
@@ -294,6 +313,8 @@ void lcdSpinBox::mouseMoveEvent( QMouseEvent * _me )
}
void lcdSpinBox::mouseReleaseEvent( QMouseEvent * _me )
{
model()->addJournalEntryFromOldToCurVal();
@@ -303,6 +324,8 @@ void lcdSpinBox::mouseReleaseEvent( QMouseEvent * _me )
}
void lcdSpinBox::wheelEvent( QWheelEvent * _we )
{
_we->accept();