From 5bfbd5d4f0b235703a3130d8b18f97b2d27bb5ae Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sun, 30 Mar 2008 20:18:58 +0000 Subject: [PATCH] on model-change, ensure QPushButton's state is correct git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@815 0778d3d1-df1d-0410-868b-ea421aaaa00d --- include/automatable_button.h | 4 +++- src/widgets/automatable_button.cpp | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/include/automatable_button.h b/include/automatable_button.h index 0ef28a112..3aabe36c0 100644 --- a/include/automatable_button.h +++ b/include/automatable_button.h @@ -1,7 +1,7 @@ /* * automatable_button.h - class automatableButton, the base for all buttons * - * Copyright (c) 2006-2007 Tobias Doerffel + * Copyright (c) 2006-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -47,6 +47,8 @@ public: model()->setJournalling( _on ); } + virtual void modelChanged( void ); + public slots: virtual void update( void ); diff --git a/src/widgets/automatable_button.cpp b/src/widgets/automatable_button.cpp index 646b5eef8..3651bcced 100644 --- a/src/widgets/automatable_button.cpp +++ b/src/widgets/automatable_button.cpp @@ -63,6 +63,17 @@ automatableButton::~automatableButton() +void automatableButton::modelChanged( void ) +{ + if( QPushButton::isChecked() != model()->value() ) + { + QPushButton::setChecked( model()->value() ); + } +} + + + + void automatableButton::update( void ) { if( QPushButton::isChecked() != model()->value() )