diff options
author | Orcan Ogetbil <oget.fedora@gmail.com> | 2010-12-02 05:54:36 +0000 |
---|---|---|
committer | Orcan Ogetbil <oget.fedora@gmail.com> | 2010-12-02 05:54:36 +0000 |
commit | 657ba10e4ec0fd5a5a57d0ebf9172b534a66c889 (patch) | |
tree | 8e8f5f3c41f7656536a3a7e5a72334ed60f8c2c2 /muse2/muse/arranger | |
parent | ffe6b074794c48f8f5e9428911bbad72a257f15a (diff) |
Please see the ChangeLog
Diffstat (limited to 'muse2/muse/arranger')
-rw-r--r-- | muse2/muse/arranger/alayout.cpp | 11 | ||||
-rw-r--r-- | muse2/muse/arranger/alayout.h | 5 | ||||
-rw-r--r-- | muse2/muse/arranger/arranger.cpp | 138 | ||||
-rw-r--r-- | muse2/muse/arranger/arranger.h | 37 | ||||
-rw-r--r-- | muse2/muse/arranger/tlist.cpp | 128 | ||||
-rw-r--r-- | muse2/muse/arranger/tlist.h | 41 |
6 files changed, 142 insertions, 218 deletions
diff --git a/muse2/muse/arranger/alayout.cpp b/muse2/muse/arranger/alayout.cpp index 5f6ec0d1..b5374754 100644 --- a/muse2/muse/arranger/alayout.cpp +++ b/muse2/muse/arranger/alayout.cpp @@ -6,13 +6,10 @@ //========================================================= #include "alayout.h" -#include <QScrollBar> -#include <QList> -//Added by qt3to4: -//#include <Q3PtrList> - #include "arranger.h" +#include <QScrollBar> + //--------------------------------------------------------- // wadd //--------------------------------------------------------- @@ -35,10 +32,10 @@ void TLLayout::wadd(int idx, QWidget* w) class TLLayoutIterator // : public QGLayoutIterator ddskrjo { int idx; - Q3PtrList<QLayoutItem> *list; + QList<QLayoutItem*> list; public: - TLLayoutIterator(Q3PtrList<QLayoutItem> *l) : idx(0), list(l) {} + TLLayoutIterator(QList<QLayoutItem*> l) : idx(0), list(l) {} QLayoutItem *current() { return idx < int(list->count()) ? list->at(idx) : 0; } QLayoutItem *next() { idx++; return current(); } QLayoutItem *takeCurrent() { return list->take( idx ); } diff --git a/muse2/muse/arranger/alayout.h b/muse2/muse/arranger/alayout.h index 05d418b5..b85b5e9a 100644 --- a/muse2/muse/arranger/alayout.h +++ b/muse2/muse/arranger/alayout.h @@ -9,12 +9,12 @@ #define __ALAYOUT_H__ #include <QLayout> -//#include <Q3PtrList> #include <QList> +class QLayoutItem; class QScrollBar; + class WidgetStack; -class QLayoutItem; //--------------------------------------------------------- // TLLayout @@ -25,7 +25,6 @@ class TLLayout : public QLayout { Q_OBJECT - //Q3PtrList<QLayoutItem> ilist; QList<QLayoutItem*> ilist; QLayoutItem* li[6]; QScrollBar* sb; diff --git a/muse2/muse/arranger/arranger.cpp b/muse2/muse/arranger/arranger.cpp index cf9bdac4..c15492ae 100644 --- a/muse2/muse/arranger/arranger.cpp +++ b/muse2/muse/arranger/arranger.cpp @@ -8,33 +8,17 @@ #include "config.h" #include <stdio.h> - #include <values.h> -#include <QLayout> -//#include <qcombobox.h> -#include <QToolButton> -#include <QButtonGroup> -#include <QLabel> -//#include <q3accel.h> + #include <QComboBox> -//#include <q3whatsthis.h> -//#include <q3toolbar.h> -#include <QToolBar> -//#include <QToolTip> -#include <q3hbox.h> -#include <QStringList> -#include <q3filedialog.h> -#include <QCheckBox> -#include <QPushButton> -//#include <q3mainwindow.h> +#include <QGridLayout> +#include <QKeyEvent> +#include <QLabel> +#include <QList> #include <QMainWindow> -#include <q3widgetstack.h> #include <QScrollBar> -//Added by qt3to4: -#include <QKeyEvent> -#include <Q3ValueList> -#include <QGridLayout> -#include <QPixmap> +#include <QToolBar> +#include <QToolButton> #include <QVBoxLayout> #include <QWheelEvent> @@ -64,27 +48,40 @@ #include "gconfig.h" #include "mixer/astrip.h" #include "spinbox.h" + //--------------------------------------------------------- -// TWhatsThis::text +// Arranger::setHeaderToolTips //--------------------------------------------------------- -QString TWhatsThis::text(const QPoint& pos) +void Arranger::setHeaderToolTips() { - int section = header->sectionAt(pos.x()); - if (section == -1) - return QString::null; - switch(section) { - case COL_RECORD: return Q3Header::tr("Enable recording. Click to toggle."); break; - case COL_MUTE: return Q3Header::tr("Mute indicator. Click to toggle.\nRight-click to toggle track on/off.\nMute is designed for rapid, repeated action.\nOn/Off is not!"); break; - case COL_SOLO: return Q3Header::tr("Solo indicator. Click to toggle.\nConnected tracks are also 'phantom' soloed,\n indicated by a dark square."); break; - case COL_CLASS: return Q3Header::tr("Track type. Right-click to change\n midi and drum track types."); break; - case COL_NAME: return Q3Header::tr("Track name. Double-click to edit.\nRight-click for more options."); break; - case COL_OCHANNEL: return Q3Header::tr("Midi/drum track: Output channel number.\nAudio track: Channels.\nMid/right-click to change."); break; - case COL_OPORT: return Q3Header::tr("Midi/drum track: Output port.\nSynth track: Assigned midi port.\nLeft-click to change.\nRight-click to show GUI."); break; - case COL_TIMELOCK: return Q3Header::tr("Time lock"); break; - default: break; - } - return QString::null; + header->setToolTip(COL_RECORD, tr("Enable Recording")); + header->setToolTip(COL_MUTE, tr("Mute/Off Indicator")); + header->setToolTip(COL_SOLO, tr("Solo Indicator")); + header->setToolTip(COL_CLASS, tr("Track Type")); + header->setToolTip(COL_NAME, tr("Track Name")); + header->setToolTip(COL_OCHANNEL, tr("Midi output channel number or audio channels")); + header->setToolTip(COL_OPORT, tr("Midi output port or synth midi port")); + header->setToolTip(COL_TIMELOCK, tr("Time Lock")); + //header->setToolTip(COL_AUTOMATION, tr("Automation parameter selection")); + } + + + +//--------------------------------------------------------- +// Arranger::setHeaderWhatsThis +//--------------------------------------------------------- + +void Arranger::setHeaderWhatsThis() + { + header->setWhatsThis(COL_RECORD, tr("Enable recording. Click to toggle.")); + header->setWhatsThis(COL_MUTE, tr("Mute indicator. Click to toggle.\nRight-click to toggle track on/off.\nMute is designed for rapid, repeated action.\nOn/Off is not!")); + header->setWhatsThis(COL_SOLO, tr("Solo indicator. Click to toggle.\nConnected tracks are also 'phantom' soloed,\n indicated by a dark square.")); + header->setWhatsThis(COL_CLASS, tr("Track type. Right-click to change\n midi and drum track types.")); + header->setWhatsThis(COL_NAME, tr("Track name. Double-click to edit.\nRight-click for more options.")); + header->setWhatsThis(COL_OCHANNEL, tr("Midi/drum track: Output channel number.\nAudio track: Channels.\nMid/right-click to change.")); + header->setWhatsThis(COL_OPORT, tr("Midi/drum track: Output port.\nSynth track: Assigned midi port.\nLeft-click to change.\nRight-click to show GUI.")); + header->setWhatsThis(COL_TIMELOCK, tr("Time lock")); } //--------------------------------------------------------- @@ -150,7 +147,7 @@ Arranger::Arranger(QMainWindow* parent, const char* name) lenEntry = new SpinBox(1, 10000, 1); lenEntry->setValue(song->len()); lenEntry->setToolTip(tr("song length - bars")); - Q3WhatsThis::add(lenEntry, tr("song length - bars")); + lenEntry->setWhatsThis(tr("song length - bars")); toolbar->addWidget(lenEntry); connect(lenEntry, SIGNAL(valueChanged(int)), SLOT(songlenChanged(int))); @@ -252,44 +249,41 @@ Arranger::Arranger(QMainWindow* parent, const char* name) ib->setOn(showTrackinfoFlag); connect(ib, SIGNAL(toggled(bool)), SLOT(showTrackInfo(bool))); - header = new Header(tracklist, "header"); + header = new HeaderNew(tracklist); header->setFixedHeight(30); QFontMetrics fm1(header->font()); int fw = 8; - header->addLabel(tr("R"), fm1.width('R')+fw); - header->addLabel(tr("M"), fm1.width('M')+fw); - header->addLabel(tr("S"), fm1.width('S')+fw); - header->addLabel(tr("C"), fm1.width('C')+fw); - header->addLabel(tr("Track"), 100); - //header->addLabel(tr("O-Port"), 60); - header->addLabel(tr("Port"), 60); - header->addLabel(tr("Ch"), 30); - header->addLabel(tr("T"), fm1.width('T')+fw); - //header->addLabel(tr("Automation"),30); - header->setResizeEnabled(false, COL_RECORD); - header->setResizeEnabled(false, COL_MUTE); - header->setResizeEnabled(false, COL_SOLO); - header->setResizeEnabled(false, COL_CLASS); - header->setResizeEnabled(false, COL_OCHANNEL); - header->setResizeEnabled(false, COL_TIMELOCK); - //header->setResizeEnabled(true, COL_AUTOMATION); - header->setResizeEnabled(true, COL_NAME); - header->setResizeEnabled(true, COL_OPORT); - - header->setTracking(true); - - new THeaderTip(header); - new TWhatsThis(header, header); - + header->setColumnLabel(tr("R"), COL_RECORD, fm1.width('R')+fw); + header->setColumnLabel(tr("M"), COL_MUTE, fm1.width('M')+fw); + header->setColumnLabel(tr("S"), COL_SOLO, fm1.width('S')+fw); + header->setColumnLabel(tr("C"), COL_CLASS, fm1.width('C')+fw); + header->setColumnLabel(tr("Track"), COL_NAME, 100); + header->setColumnLabel(tr("Port"), COL_OPORT, 60); + header->setColumnLabel(tr("Ch"), COL_OCHANNEL, 30); + header->setColumnLabel(tr("T"), COL_TIMELOCK, fm1.width('T')+fw); + //header->setColumnLabel(tr("Automation"), COL_AUTOMATION, 30); + header->setResizeMode(COL_RECORD, QHeaderView::Fixed); + header->setResizeMode(COL_MUTE, QHeaderView::Fixed); + header->setResizeMode(COL_SOLO, QHeaderView::Fixed); + header->setResizeMode(COL_CLASS, QHeaderView::Fixed); + header->setResizeMode(COL_NAME, QHeaderView::Interactive); + header->setResizeMode(COL_OPORT, QHeaderView::Interactive); + header->setResizeMode(COL_OCHANNEL, QHeaderView::Fixed); + header->setResizeMode(COL_TIMELOCK, QHeaderView::Fixed); + //header->setResizeMode(COL_AUTOMATION, QHeaderView::Interactive); + + setHeaderToolTips(); + setHeaderWhatsThis(); + header->setMovable (true ); list = new TList(header, tracklist, "tracklist"); connect(list, SIGNAL(selectionChanged()), SLOT(trackSelectionChanged())); - connect(header, SIGNAL(sizeChange(int,int,int)), list, SLOT(redraw())); - connect(header, SIGNAL(moved(int,int)), list, SLOT(redraw())); - connect(header, SIGNAL(moved(int,int)), this, SLOT(headerMoved())); + connect(header, SIGNAL(sectionResized(int,int,int)), list, SLOT(redraw())); + connect(header, SIGNAL(sectionMoved(int,int,int)), list, SLOT(redraw())); + connect(header, SIGNAL(sectionMoved(int,int,int)), this, SLOT(headerMoved())); // tracklist: // @@ -327,7 +321,7 @@ Arranger::Arranger(QMainWindow* parent, const char* name) list->setScroll(vscroll); - Q3ValueList<int> vallist; + QList<int> vallist; vallist.append(tgrid->maximumSize().width()); split->setSizes(vallist); @@ -417,7 +411,7 @@ Arranger::Arranger(QMainWindow* parent, const char* name) void Arranger::headerMoved() { - header->setStretchEnabled(true, COL_NAME); + //header->setResizeMode(COL_NAME, QHeaderView::Stretch); } //--------------------------------------------------------- diff --git a/muse2/muse/arranger/arranger.h b/muse2/muse/arranger/arranger.h index b95b9379..f8c0bd3b 100644 --- a/muse2/muse/arranger/arranger.h +++ b/muse2/muse/arranger/arranger.h @@ -10,52 +10,33 @@ #include <vector> -#include <QWidget> -#include <q3header.h> -#include <q3whatsthis.h> -//Added by qt3to4: -#include <QWheelEvent> -#include <QMenu> - #include "midieditor.h" #include "pcanvas.h" #include "ui_mtrackinfobase.h" #include "trackautomationview.h" +class QAction; +class QCheckBox; class QMainWindow; +class QMenu; +class QScrollBar; class QToolButton; -class Header; +class QWheelEvent; + +class HeaderNew; class TList; class ScrollScale; -class QScrollBar; class MTScale; class Track; class Xml; class Splitter; class LabelCombo; class PosLabel; -class QCheckBox; class MidiTrackInfoBase; class TLLayout; class WidgetStack; class AudioStrip; class SpinBox; -class QAction; -//class QModelIndex; - -//--------------------------------------------------------- -// TWhatsThis -//--------------------------------------------------------- - -class TWhatsThis : public Q3WhatsThis { - Header* header; - protected: - QString text(const QPoint&); - public: - TWhatsThis(QWidget* parent, Header* h) : Q3WhatsThis(parent) { - header = h; - } - }; //--------------------------------------------------------- // WidgetStack @@ -99,7 +80,7 @@ class Arranger : public QWidget { ScrollScale* hscroll; QScrollBar* vscroll; TList* list; - Header* header; + HeaderNew* header; MTScale* time; SpinBox* lenEntry; bool showTrackinfoFlag; @@ -130,6 +111,8 @@ class Arranger : public QWidget { void genWaveTrackInfo(); void updateMidiTrackInfo(int flags); void switchInfo(int); + void setHeaderToolTips(); + void setHeaderWhatsThis(); private slots: void _setRaster(int); diff --git a/muse2/muse/arranger/tlist.cpp b/muse2/muse/arranger/tlist.cpp index 15a1cdf9..f2a3677e 100644 --- a/muse2/muse/arranger/tlist.cpp +++ b/muse2/muse/arranger/tlist.cpp @@ -9,19 +9,15 @@ #include <cmath> -#include <qpainter.h> -#include <qlineedit.h> -#include <QMenu> -#include <qmessagebox.h> -#include <qscrollbar.h> -#include <qtimer.h> -#include <qfileinfo.h> -//Added by qt3to4: #include <QKeyEvent> -#include <QPixmap> -#include <QResizeEvent> +#include <QLineEdit> +#include <QMenu> +#include <QMessageBox> #include <QMouseEvent> +#include <QPainter> #include <QPaintEvent> +#include <QPixmap> +#include <QResizeEvent> #include <QWheelEvent> #include "globals.h" @@ -56,41 +52,10 @@ static const int MIN_TRACKHEIGHT = 20; static const int WHEEL_DELTA = 120; //--------------------------------------------------------- -// THeaderTip::maybeTip -//--------------------------------------------------------- - -void THeaderTip::maybeTip(const QPoint &pos) - { -#if 0 //ddskrjo - Header* w = (Header*)parentWidget(); - int section = w->sectionAt(pos.x()); - if (section == -1) - return; - QRect r(w->sectionPos(section), 0, w->sectionSize(section), - w->height()); - QString p; - switch (section) { - case COL_RECORD: p = Q3Header::tr("Enable Recording"); break; - case COL_MUTE: p = Q3Header::tr("Mute/Off Indicator"); break; - case COL_SOLO: p = Q3Header::tr("Solo Indicator"); break; - case COL_CLASS: p = Q3Header::tr("Track Type"); break; - case COL_NAME: p = Q3Header::tr("Track Name"); break; - case COL_OCHANNEL: p = Q3Header::tr("Midi output channel number or audio channels"); break; - //case COL_OPORT: p = QHeader::tr("Output Port"); break; - case COL_OPORT: p = Q3Header::tr("Midi output port or synth midi port"); break; - case COL_TIMELOCK: p = Q3Header::tr("Time Lock"); break; -// case COL_AUTOMATION: p = QHeader::tr("Automation parameter selection"); break; - default: return; - } - tip(r, p); -#endif - } - -//--------------------------------------------------------- // TList //--------------------------------------------------------- -TList::TList(Header* hdr, QWidget* parent, const char* name) +TList::TList(HeaderNew* hdr, QWidget* parent, const char* name) : QWidget(parent, name, Qt::WNoAutoErase | Qt::WResizeNoErase) { ypos = 0; @@ -250,7 +215,7 @@ void TList::paint(const QRect& r) int x = 0; for (int index = 0; index < header->count(); ++index) { - int section = header->mapToSection(index); + int section = header->visualIndex(index); int w = header->sectionSize(section); QRect r = p.xForm(QRect(x+2, yy, w-4, trackHeight)); @@ -398,7 +363,7 @@ void TList::paint(const QRect& r) int xpos = 0; p.setPen(Qt::gray); for (int index = 0; index < n; index++) { - int section = header->mapToSection(index); + int section = header->visualIndex(index); xpos += header->sectionSize(section); p.drawLine(xpos, 0, xpos, height()); } @@ -474,14 +439,14 @@ Track* TList::y2Track(int y) const void TList::mouseDoubleClickEvent(QMouseEvent* ev) { int x = ev->x(); - int section = header->sectionAt(x); + int section = header->logicalIndexAt(x); if (section == -1) return; Track* t = y2Track(ev->y() + ypos); if (t) { - int colx = header->sectionPos(section); + int colx = header->sectionPosition(section); int colw = header->sectionSize(section); int coly = t->y() - ypos; int colh = t->height(); @@ -489,7 +454,7 @@ void TList::mouseDoubleClickEvent(QMouseEvent* ev) if (section == COL_NAME) { editTrack = t; if (editor == 0) { - editor = new QLineEdit(this); + editor = new QLineEdit(this); /*connect(editor, SIGNAL(returnPressed()), SLOT(returnPressed()));*/ editor->setFrame(true); @@ -615,12 +580,12 @@ void TList::oportPropertyPopupMenu(Track* t, int x, int y) { SynthI* synth = (SynthI*)t; - Q3PopupMenu* p = new Q3PopupMenu(this); - p->setCheckable(true); - p->insertItem(tr("Show Gui"), 0); + QMenu* p = new QMenu; + QAction* act = p->addAction(tr("Show Gui")); + act->setCheckable(true); printf("synth hasgui %d, gui visible %d\n",synth->hasGui(), synth->guiVisible()); - p->setItemEnabled(0, synth->hasGui()); - p->setItemChecked(0, synth->guiVisible()); + act->setEnabled(synth->hasGui()); + act->setChecked(synth->guiVisible()); #ifndef OSC_SUPPORT #ifdef DSSI_SUPPORT @@ -633,8 +598,8 @@ void TList::oportPropertyPopupMenu(Track* t, int x, int y) #endif #endif - int n = p->exec(mapToGlobal(QPoint(x, y)), 0); - if (n == 0) { + act = p->exec(mapToGlobal(QPoint(x, y)), 0); + if (act) { bool show = !synth->guiVisible(); audio->msgShowInstrumentGui(synth, show); } @@ -648,26 +613,26 @@ void TList::oportPropertyPopupMenu(Track* t, int x, int y) int oPort = ((MidiTrack*)t)->outPort(); MidiPort* port = &midiPorts[oPort]; - Q3PopupMenu* p = new Q3PopupMenu(this); - p->setCheckable(true); - p->insertItem(tr("Show Gui"), 0); - - p->setItemEnabled(0, port->hasGui()); - p->setItemChecked(0, port->guiVisible()); + QMenu* p = new QMenu; + QAction* act = p->addAction(tr("Show Gui")); + act->setCheckable(true); + printf("synth hasgui %d, gui visible %d\n",port->hasGui(), port->guiVisible()); + act->setEnabled(port->hasGui()); + act->setChecked(port->guiVisible()); #ifndef OSC_SUPPORT #ifdef DSSI_SUPPORT MidiDevice* dev = port->device(); if(dev && dev->isSynti() && (dynamic_cast<DssiSynthIF*>(((SynthI*)dev)->sif()))) { - p->setItemChecked(0, false); - p->setItemEnabled(0, false); + act->setChecked(false); + act->setEnabled(false); } #endif #endif - int n = p->exec(mapToGlobal(QPoint(x, y)), 0); - if (n == 0) { + act = p->exec(mapToGlobal(QPoint(x, y)), 0); + if (act) { bool show = !port->guiVisible(); audio->msgShowInstrumentGui(port->instrument(), show); } @@ -690,8 +655,9 @@ void TList::tracklistChanged() void TList::keyPressEvent(QKeyEvent* e) { - if (editMode) { + if (editMode && ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter)) { // First time we get a keypress event when lineedit is open is on the return key: + // -- Not true for Qt4. Modifier keys also send key events - Orcan returnPressed(); return; } @@ -793,10 +759,10 @@ void TList::mousePressEvent(QMouseEvent* ev) Track* t = y2Track(y + ypos); - TrackColumn col = TrackColumn(header->sectionAt(x)); + TrackColumn col = TrackColumn(header->logicalIndexAt(x)); if (t == 0) { if (button == Qt::RightButton) { - QMenu* p = new QMenu(this); + QMenu* p = new QMenu; p->clear(); QAction* midi = p->addAction(*addtrack_addmiditrackIcon, tr("Add Midi Track")); @@ -826,7 +792,7 @@ void TList::mousePressEvent(QMouseEvent* ev) synp->setTitle(QT_TR_NOOP("Add Synth")); // Add the 'Add Synth' sub-menu to the menu. - p->addMenu(synp); + p->addMenu(synp); // Show the menu QAction* act = p->exec(ev->globalPos(), 0); @@ -1007,12 +973,13 @@ void TList::mousePressEvent(QMouseEvent* ev) } else if (button == Qt::RightButton) { mode = NORMAL; - Q3PopupMenu* p = new Q3PopupMenu(this); + QMenu* p = new QMenu; p->clear(); - p->insertItem(QIcon(*automation_clear_dataIcon), tr("Delete Track"), 0); // ddskrjo - p->insertItem(QIcon(*track_commentIcon), tr("Track Comment"), 1); - int n = p->exec(ev->globalPos(), 0); - if (n != -1) { + p->addAction(QIcon(*automation_clear_dataIcon), tr("Delete Track"))->setData(0); // ddskrjo + p->addAction(QIcon(*track_commentIcon), tr("Track Comment"))->setData(1); + QAction* act = p->exec(ev->globalPos(), 0); + if (act) { + int n = act->data().toInt(); switch (n) { case 0: // delete track song->removeTrack0(t); @@ -1208,7 +1175,7 @@ void TList::mouseMoveEvent(QMouseEvent* ev) break; case RESIZE: { - if(sTrack >= 0 && sTrack < song->tracks()->size()) + if(sTrack >= 0 && (unsigned) sTrack < song->tracks()->size()) { Track* t = song->tracks()->index(sTrack); if(t) @@ -1262,7 +1229,7 @@ void TList::wheelEvent(QWheelEvent* ev) emit redirectWheelEvent(ev); return; } - TrackColumn col = TrackColumn(header->sectionAt(x)); + TrackColumn col = TrackColumn(header->logicalIndexAt(x)); int delta = ev->delta() / WHEEL_DELTA; ev->accept(); @@ -1463,15 +1430,16 @@ void TList::resizeEvent(QResizeEvent* ev) void TList::classesPopupMenu(Track* t, int x, int y) { - Q3PopupMenu p(this); + QMenu p; p.clear(); - p.insertItem(QIcon(*addtrack_addmiditrackIcon), tr("Midi"), Track::MIDI); - p.insertItem(QIcon(*addtrack_drumtrackIcon), tr("Drum"), Track::DRUM); - int n = p.exec(mapToGlobal(QPoint(x, y)), 0); + p.addAction(QIcon(*addtrack_addmiditrackIcon), tr("Midi"))->setData(Track::MIDI); + p.addAction(QIcon(*addtrack_drumtrackIcon), tr("Drum"))->setData(Track::DRUM); + QAction* act = p.exec(mapToGlobal(QPoint(x, y)), 0); - if (n == -1) + if (!act) return; + int n = act->data().toInt(); if (Track::TrackType(n) == Track::MIDI && t->type() == Track::DRUM) { // // Drum -> Midi diff --git a/muse2/muse/arranger/tlist.h b/muse2/muse/arranger/tlist.h index 147a61e2..4e911711 100644 --- a/muse2/muse/arranger/tlist.h +++ b/muse2/muse/arranger/tlist.h @@ -8,25 +8,20 @@ #ifndef __TLIST_H__ #define __TLIST_H__ -#include <qtooltip.h> -#include <q3whatsthis.h> -#include <q3header.h> -//Added by qt3to4: -#include <QPixmap> -#include <QResizeEvent> -#include <QWheelEvent> -#include <QMouseEvent> -#include <QKeyEvent> -#include <QPaintEvent> #include "track.h" -class QPainter; -class ScrollScale; -class QScrollBar; +class QKeyEvent; class QLineEdit; +class QMouseEvent; +class QPaintEvent; +class QResizeEvent; +class QScrollBar; +class QWheelEvent; + +class ScrollScale; class Track; class Xml; -class Header; +class HeaderNew; enum TrackColumn { COL_RECORD = 0, @@ -41,19 +36,6 @@ enum TrackColumn { }; // COL_AUTOMATION, -- not enabled -//---------------------------------------------------------- -// THeaderTip -//---------------------------------------------------------- - -class THeaderTip { //: public QToolTip { ddskrjo - - public: - THeaderTip(QWidget * parent) {} //: QToolTip(parent) {} ddskrjo - virtual ~THeaderTip() {} - protected: - void maybeTip(const QPoint &); - }; - //--------------------------------------------------------- // TList //--------------------------------------------------------- @@ -70,7 +52,7 @@ class TList : public QWidget { bool resizeFlag; // true if resize cursor is shown - Header* header; + HeaderNew* header; QScrollBar* scroll; QLineEdit* editor; Track* editTrack; @@ -101,6 +83,7 @@ class TList : public QWidget { Track* y2Track(int) const; void classesPopupMenu(Track*, int x, int y); TrackList getRecEnabledTracks(); + void setHeaderToolTips(); private slots: void returnPressed(); @@ -120,7 +103,7 @@ class TList : public QWidget { void selectTrackBelow(); public: - TList(Header*, QWidget* parent, const char* name); + TList(HeaderNew*, QWidget* parent, const char* name); void setScroll(QScrollBar* s) { scroll = s; } Track* track() const { return editTrack; } void writeStatus(int level, Xml&, const char* name) const; |