diff options
author | Orcan Ogetbil <oget.fedora@gmail.com> | 2010-12-09 00:03:41 +0000 |
---|---|---|
committer | Orcan Ogetbil <oget.fedora@gmail.com> | 2010-12-09 00:03:41 +0000 |
commit | 45f00094ca990cacd3e3a6b5516259b280b4e182 (patch) | |
tree | bb0d1c25db9a3869836924f27307056bd911ee6b /muse2/muse/widgets/combobox.cpp | |
parent | 4a1be16bbfafb8455b54336c4465da8f8bfe3ab6 (diff) |
Converted Qt3 methods to Qt4. Ported song.cpp
Diffstat (limited to 'muse2/muse/widgets/combobox.cpp')
-rw-r--r-- | muse2/muse/widgets/combobox.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/muse2/muse/widgets/combobox.cpp b/muse2/muse/widgets/combobox.cpp index 4d8ba519..cf7442ec 100644 --- a/muse2/muse/widgets/combobox.cpp +++ b/muse2/muse/widgets/combobox.cpp @@ -24,7 +24,7 @@ ComboBox::ComboBox(QWidget* parent, const char* name) _currentItem = 0; _id = -1; list = new QMenu(0); - connect(list, SIGNAL(activated(int)), SLOT(activatedIntern(int))); + connect(list, SIGNAL(triggered(QAction*)), SLOT(activatedIntern(QAction*))); setFrameStyle(QFrame::Panel | QFrame::Raised); setLineWidth(2); } @@ -47,11 +47,11 @@ void ComboBox::mousePressEvent(QMouseEvent*) // activated //--------------------------------------------------------- -void ComboBox::activatedIntern(int n) +void ComboBox::activatedIntern(QAction* act) { - _currentItem = n; - emit activated(n, _id); - setText(list->text(_currentItem)); + _currentItem = act->data().toInt(); + emit activated(_currentItem, _id); + setText(act->text()); } //--------------------------------------------------------- @@ -61,7 +61,15 @@ void ComboBox::activatedIntern(int n) void ComboBox::setCurrentItem(int i) { _currentItem = i; - setText(list->text(list->idAt(_currentItem))); + // ORCAN - CHECK + QList<QAction *> actions = list->actions(); + for (QList<QAction *>::iterator it = actions.begin(); it != actions.end(); ++it) { + QAction* act = *it; + if (act->data().toInt() == i) { + setText(act->text()); + break; + } + } } //--------------------------------------------------------- |