summaryrefslogtreecommitdiff
path: root/muse2/muse/arranger/tlist.cpp
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2012-05-28 14:15:52 +0000
committerFlorian Jung <flo@windfisch.org>2012-05-28 14:15:52 +0000
commitd2a88cfaad5ac385fc3c6212c09ad7fbc38e9454 (patch)
tree387da0b38255003e1a971629ea0de32273ac3d3c /muse2/muse/arranger/tlist.cpp
parent716f5a5b56a3b7ff59004ef0a1af5f98cb2a691c (diff)
merged with release_2_0
Diffstat (limited to 'muse2/muse/arranger/tlist.cpp')
-rw-r--r--muse2/muse/arranger/tlist.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/muse2/muse/arranger/tlist.cpp b/muse2/muse/arranger/tlist.cpp
index be997504..3d831ba9 100644
--- a/muse2/muse/arranger/tlist.cpp
+++ b/muse2/muse/arranger/tlist.cpp
@@ -34,6 +34,7 @@
#include <QWheelEvent>
#include <QIcon>
#include <QSpinBox>
+#include <QToolTip>
#include "popupmenu.h"
#include "globals.h"
@@ -164,6 +165,38 @@ void TList::redraw(const QRect& r)
update(r);
}
+
+//---------------------------------------------------------
+// event
+//---------------------------------------------------------
+
+bool TList::event(QEvent *event)
+{
+ if (event->type() == QEvent::ToolTip) {
+ QHelpEvent *helpEvent = static_cast<QHelpEvent *>(event);
+ MusECore::TrackList* l = MusEGlobal::song->tracks();
+ int idx = 0;
+ int yy = -ypos;
+ for (MusECore::iTrack i = l->begin(); i != l->end(); ++idx, yy += (*i)->height(), ++i) {
+ MusECore::Track* track = *i;
+ MusECore::Track::TrackType type = track->type();
+ int trackHeight = track->height();
+ if (trackHeight==0) // not visible
+ continue;
+ if (helpEvent->pos().y() > yy && helpEvent->pos().y() < yy + trackHeight) {
+ if (type == MusECore::Track::AUDIO_SOFTSYNTH) {
+ MusECore::SynthI *s = (MusECore::SynthI*)track;
+ QToolTip::showText(helpEvent->globalPos(),track->name() + " : " + s->synth()->description());
+ }
+ else
+ QToolTip::showText(helpEvent->globalPos(),track->name());
+ }
+ }
+ return true;
+ }
+ return QWidget::event(event);
+}
+
//---------------------------------------------------------
// paint
//---------------------------------------------------------