summaryrefslogtreecommitdiff
path: root/muse2/muse/widgets/lcombo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'muse2/muse/widgets/lcombo.cpp')
-rw-r--r--muse2/muse/widgets/lcombo.cpp12
1 files changed, 12 insertions, 0 deletions
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);
+}