From 4f767f96be2382c3f73a9619097a8cbabe3f7587 Mon Sep 17 00:00:00 2001 From: "Tim E. Real" Date: Sun, 31 Oct 2010 07:35:21 +0000 Subject: Fixed Toolbar1 class. Snap, Quantize combo boxes should work now. --- muse2/muse/widgets/lcombo.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'muse2/muse/widgets/lcombo.cpp') diff --git a/muse2/muse/widgets/lcombo.cpp b/muse2/muse/widgets/lcombo.cpp index 2200cca7..c41367ed 100644 --- a/muse2/muse/widgets/lcombo.cpp +++ b/muse2/muse/widgets/lcombo.cpp @@ -36,3 +36,15 @@ LabelCombo::LabelCombo(const QString& txt, QWidget* parent, connect(box, SIGNAL(activated(int)), SIGNAL(activated(int))); } +void LabelCombo::setCurrentIndex(int i) +{ + int rc = box->model()->rowCount(); + if(rc == 0) + return; + int r = i % rc; + int c = i / rc; + if(c >= box->model()->columnCount()) + return; + box->setModelColumn(c); + box->setCurrentIndex(r); +} -- cgit v1.2.3