diff options
Diffstat (limited to 'muse2/muse/widgets')
-rw-r--r-- | muse2/muse/widgets/action.h | 8 | ||||
-rw-r--r-- | muse2/muse/widgets/combobox.cpp | 4 | ||||
-rw-r--r-- | muse2/muse/widgets/lcombo.cpp | 18 | ||||
-rw-r--r-- | muse2/muse/widgets/lcombo.h | 7 | ||||
-rw-r--r-- | muse2/muse/widgets/nentry.cpp | 10 | ||||
-rw-r--r-- | muse2/muse/widgets/nentry.h | 10 | ||||
-rw-r--r-- | muse2/muse/widgets/noteinfo.cpp | 55 | ||||
-rw-r--r-- | muse2/muse/widgets/noteinfo.h | 11 | ||||
-rw-r--r-- | muse2/muse/widgets/pitchlabel.cpp | 6 | ||||
-rw-r--r-- | muse2/muse/widgets/poslabel.cpp | 6 | ||||
-rw-r--r-- | muse2/muse/widgets/poslabel.h | 3 | ||||
-rw-r--r-- | muse2/muse/widgets/sliderbase.h | 2 | ||||
-rw-r--r-- | muse2/muse/widgets/tb1.cpp | 84 | ||||
-rw-r--r-- | muse2/muse/widgets/tb1.h | 12 | ||||
-rw-r--r-- | muse2/muse/widgets/tools.cpp | 40 | ||||
-rw-r--r-- | muse2/muse/widgets/tools.h | 15 | ||||
-rw-r--r-- | muse2/muse/widgets/utils.cpp | 16 | ||||
-rw-r--r-- | muse2/muse/widgets/utils.h | 10 |
18 files changed, 209 insertions, 108 deletions
diff --git a/muse2/muse/widgets/action.h b/muse2/muse/widgets/action.h index 74635f0a..32ec96ce 100644 --- a/muse2/muse/widgets/action.h +++ b/muse2/muse/widgets/action.h @@ -8,20 +8,22 @@ #ifndef __ACTION_H__ #define __ACTION_H__ -#include <Qt3Support> +//#include <Qt3Support> +#include <QAction> //--------------------------------------------------------- // Action //--------------------------------------------------------- -class Action : public Q3Action { +class Action : public QAction { Q_OBJECT int _id; public: Action(QObject* parent, int i, const char* name = 0, bool toggle = false) - : Q3Action(parent, name, toggle) { + : QAction(name, parent) { _id = i; + setCheckable(toggle); } void setId(int i) { _id = i; } int id() const { return _id; } diff --git a/muse2/muse/widgets/combobox.cpp b/muse2/muse/widgets/combobox.cpp index 35959636..6e5b100d 100644 --- a/muse2/muse/widgets/combobox.cpp +++ b/muse2/muse/widgets/combobox.cpp @@ -9,7 +9,7 @@ #include <qcursor.h> //Added by qt3to4: #include <QMouseEvent> -#include <Q3Frame> +#include <QFrame> #include <QLabel> #include "combobox.h" @@ -24,7 +24,7 @@ ComboBox::ComboBox(QWidget* parent, const char* name) _id = -1; list = new Q3PopupMenu(0, "comboPopup"); connect(list, SIGNAL(activated(int)), SLOT(activatedIntern(int))); - setFrameStyle(Q3Frame::Panel | Q3Frame::Raised); + setFrameStyle(QFrame::Panel | QFrame::Raised); setLineWidth(2); } diff --git a/muse2/muse/widgets/lcombo.cpp b/muse2/muse/widgets/lcombo.cpp index fa647002..beb34255 100644 --- a/muse2/muse/widgets/lcombo.cpp +++ b/muse2/muse/widgets/lcombo.cpp @@ -7,11 +7,11 @@ #include "lcombo.h" -#include <qlayout.h> -#include <q3frame.h> +#include <QLayout> +#include <QFrame> #include <qlabel.h> //Added by qt3to4: -#include <Q3HBoxLayout> +#include <QHBoxLayout> //--------------------------------------------------------- // LabelCombo @@ -21,16 +21,18 @@ LabelCombo::LabelCombo(const QString& txt, QWidget* parent, const char* name) : QWidget(parent, name) { // setFixedHeight(20); - Q3HBoxLayout* layout = new Q3HBoxLayout(this); + QHBoxLayout* layout = new QHBoxLayout(this); QLabel* label = new QLabel(txt, this); - box = new QComboBox(false, this); - layout->addStretch(); + //box = new QComboBox(false, this); + box = new QComboBox(this); + box->setEditable(false); + ///layout->addStretch(); layout->addSpacing(5); layout->addWidget(label); layout->addSpacing(5); layout->addWidget(box); layout->addSpacing(5); - layout->addStretch(); + ///layout->addStretch(); connect(box, SIGNAL(activated(int)), SIGNAL(activated(int))); } @@ -46,4 +48,4 @@ void LabelCombo::clearFocus() void LabelCombo::setFocusPolicy ( Qt::FocusPolicy fp ) { box->setFocusPolicy(fp); -}
\ No newline at end of file +} diff --git a/muse2/muse/widgets/lcombo.h b/muse2/muse/widgets/lcombo.h index bdeedcb6..a0adda7d 100644 --- a/muse2/muse/widgets/lcombo.h +++ b/muse2/muse/widgets/lcombo.h @@ -8,12 +8,15 @@ #ifndef __LCOMBO_H__ #define __LCOMBO_H__ -#include <qwidget.h> -#include <qcombobox.h> +//#include <qwidget.h> +//#include <qcombobox.h> class QString; +class QWidget; + //class Q3ListBox; #include <QAbstractItemView> +#include <QComboBox> //--------------------------------------------------------- diff --git a/muse2/muse/widgets/nentry.cpp b/muse2/muse/widgets/nentry.cpp index c4006112..89c051df 100644 --- a/muse2/muse/widgets/nentry.cpp +++ b/muse2/muse/widgets/nentry.cpp @@ -5,13 +5,13 @@ // (C) Copyright 1999 Werner Schweer (ws@seh.de) //========================================================= -#include <qlayout.h> +#include <QLayout> #include <qlabel.h> //Added by qt3to4: -#include <Q3HBoxLayout> +#include <QHBoxLayout> #include <QContextMenuEvent> #include <QWheelEvent> -#include <Q3Frame> +#include <QFrame> #include <QMouseEvent> #include <QKeyEvent> #include "nentry.h" @@ -81,7 +81,7 @@ bool NentryFilter::eventFilter(QObject*, QEvent* event) //--------------------------------------------------------- Nentry::Nentry(QWidget* parent, const QString& txt, - int _lPos, bool dark) : Q3Frame(parent) + int _lPos, bool dark) : QFrame(parent) { focusW = 0; lPos = _lPos; @@ -97,7 +97,7 @@ Nentry::Nentry(QWidget* parent, const QString& txt, edit->setCursor(QCursor(Qt::arrowCursor)); // edit->setFont(font3); val = 0; - layout = new Q3HBoxLayout(this); + layout = new QHBoxLayout(this); if (txt == "") { layout->addWidget(edit, 1, Qt::AlignHCenter); } diff --git a/muse2/muse/widgets/nentry.h b/muse2/muse/widgets/nentry.h index 30ddd930..10eefeee 100644 --- a/muse2/muse/widgets/nentry.h +++ b/muse2/muse/widgets/nentry.h @@ -8,20 +8,20 @@ #ifndef __NENTRY_H__ #define __NENTRY_H__ -#include <q3frame.h> +#include <QFrame> #include <qlineedit.h> #include <qstring.h> //Added by qt3to4: #include <QWheelEvent> #include <QEvent> -#include <Q3HBoxLayout> +#include <QHBoxLayout> #include <QMouseEvent> #include <QLabel> #include <QContextMenuEvent> #include <QKeyEvent> class QTimer; -class Q3HBoxLayout; +class QHBoxLayout; class QLabel; class NentryFilter : public QObject { @@ -38,7 +38,7 @@ class NentryFilter : public QObject { // numerical entry widget with optional label //--------------------------------------------------------- -class Nentry : public Q3Frame { +class Nentry : public QFrame { Q_OBJECT int button; @@ -47,7 +47,7 @@ class Nentry : public Q3Frame { QTimer* timer; int evx; int timecount; - Q3HBoxLayout* layout; + QHBoxLayout* layout; QObject* filter; QLabel* label; int lPos; // label Position 0 - left, 1 - right diff --git a/muse2/muse/widgets/noteinfo.cpp b/muse2/muse/widgets/noteinfo.cpp index 59bce4b9..e3d869e0 100644 --- a/muse2/muse/widgets/noteinfo.cpp +++ b/muse2/muse/widgets/noteinfo.cpp @@ -21,35 +21,62 @@ // Start, L�nge, Note, Velo an, Velo aus, Kanal //--------------------------------------------------- -NoteInfo::NoteInfo(Q3MainWindow* parent) - : Q3ToolBar(tr("Note Info"), parent) +//NoteInfo::NoteInfo(QMainWindow* parent) +NoteInfo::NoteInfo(QWidget* parent) + : QToolBar(tr("Note Info"), parent) { deltaMode = false; - QLabel* label = new QLabel(tr("Start"), this, "Start"); + //QLabel* label = new QLabel(tr("Start"), this, "Start"); + QLabel* label = new QLabel(tr("Start")); label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); label->setIndent(3); - selTime = new PosEdit(this, "Start"); + addWidget(label); + //selTime = new PosEdit(this, "Start"); + selTime = new PosEdit(0, "Start"); + addWidget(selTime); - label = new QLabel(tr("Len"), this, "Len"); + //label = new QLabel(tr("Len"), this, "Len"); + label = new QLabel(tr("Len")); label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); label->setIndent(3); - selLen = new QSpinBox(0, 100000, 1, this); - - label = new QLabel(tr("Pitch"), this, "Pitch"); + addWidget(label); + //selLen = new QSpinBox(0, 100000, 1, this); + selLen = new QSpinBox(); + selLen->setRange(0, 100000); + selLen->setSingleStep(1); + addWidget(selLen); + + //label = new QLabel(tr("Pitch"), this, "Pitch"); + label = new QLabel(tr("Pitch")); label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); label->setIndent(3); - selPitch = new PitchEdit(this, "selPitch"); + addWidget(label); + //selPitch = new PitchEdit(this, "selPitch"); + selPitch = new PitchEdit(0, "selPitch"); + addWidget(selPitch); - label = new QLabel(tr("Velo On"), this, "Velocity On"); + //label = new QLabel(tr("Velo On"), this, "Velocity On"); + label = new QLabel(tr("Velo On")); label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); label->setIndent(3); - selVelOn = new QSpinBox(0, 127, 1, this); - - label = new QLabel(tr("Velo Off"), this, "Velocity Off"); + addWidget(label); + //selVelOn = new QSpinBox(0, 127, 1, this); + selVelOn = new QSpinBox(); + selVelOn->setRange(0, 127); + selVelOn->setSingleStep(1); + addWidget(selVelOn); + + //label = new QLabel(tr("Velo Off"), this, "Velocity Off"); + label = new QLabel(tr("Velo Off")); label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); label->setIndent(3); - selVelOff = new QSpinBox(0, 127, 1, this); + addWidget(label); + //selVelOff = new QSpinBox(0, 127, 1, this); + selVelOff = new QSpinBox(); + selVelOff->setRange(0, 127); + selVelOff->setSingleStep(1); + addWidget(selVelOff); connect(selLen, SIGNAL(valueChanged(int)), SLOT(lenChanged(int))); connect(selPitch, SIGNAL(valueChanged(int)), SLOT(pitchChanged(int))); diff --git a/muse2/muse/widgets/noteinfo.h b/muse2/muse/widgets/noteinfo.h index 00c798fb..9607dfc1 100644 --- a/muse2/muse/widgets/noteinfo.h +++ b/muse2/muse/widgets/noteinfo.h @@ -7,19 +7,21 @@ #ifndef __NOTE_INFO_H__ #define __NOTE_INFO_H__ -#include <q3toolbar.h> +//#include <q3toolbar.h> +#include <QToolBar> class PosEdit; class QSpinBox; class PitchEdit; -class Q3MainWindow; +//class QMainWindow; +class QWidget; class Pos; //--------------------------------------------------------- // NoteInfo //--------------------------------------------------------- -class NoteInfo : public Q3ToolBar { +class NoteInfo : public QToolBar { PosEdit* selTime; QSpinBox* selLen; PitchEdit* selPitch; @@ -31,7 +33,8 @@ class NoteInfo : public Q3ToolBar { public: enum ValType {VAL_TIME, VAL_LEN, VAL_VELON, VAL_VELOFF, VAL_PITCH }; - NoteInfo(Q3MainWindow* parent); + //NoteInfo(QMainWindow* parent); + NoteInfo(QWidget* parent = 0); void setValues(unsigned, int, int, int, int); void setDeltaMode(bool); diff --git a/muse2/muse/widgets/pitchlabel.cpp b/muse2/muse/widgets/pitchlabel.cpp index f53e6fa5..66af63fb 100644 --- a/muse2/muse/widgets/pitchlabel.cpp +++ b/muse2/muse/widgets/pitchlabel.cpp @@ -26,7 +26,8 @@ PitchLabel::PitchLabel(QWidget* parent, const char* name) setLineWidth(2); setMidLineWidth(3); setValue(0); - int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, this); // ddskrjo 0 + //int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, this); // ddskrjo 0 + int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth); setIndent(fw); } @@ -46,7 +47,8 @@ void PitchLabel::setPitchMode(bool val) QSize PitchLabel::sizeHint() const { QFontMetrics fm(font()); - int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, this); // ddskrjo 0 + //int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, this); // ddskrjo 0 + int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth); int h = fm.height() + fw * 2; // int w = 2 + fm.width(QString("A#8")) + fw * 4; int w = 2 + fm.width(QString("-9999")) + fw * 4; // must display 14Bit controller values diff --git a/muse2/muse/widgets/poslabel.cpp b/muse2/muse/widgets/poslabel.cpp index 3066b640..e71fea49 100644 --- a/muse2/muse/widgets/poslabel.cpp +++ b/muse2/muse/widgets/poslabel.cpp @@ -32,7 +32,8 @@ PosLabel::PosLabel(QWidget* parent, const char* name) setFrameStyle(WinPanel | Sunken); setLineWidth(2); setMidLineWidth(3); - int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, this); // ddskrjo 0 + //int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, this); // ddskrjo 0 + int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth); setIndent(fw); updateValue(); } @@ -44,7 +45,8 @@ PosLabel::PosLabel(QWidget* parent, const char* name) QSize PosLabel::sizeHint() const { QFontMetrics fm(font()); - int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, this); // ddskrjo 0 + //int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, this); // ddskrjo 0 + int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth); int h = fm.height() + fw * 2; int w; if (_smpte) diff --git a/muse2/muse/widgets/poslabel.h b/muse2/muse/widgets/poslabel.h index 06cd0b09..f16aa64f 100644 --- a/muse2/muse/widgets/poslabel.h +++ b/muse2/muse/widgets/poslabel.h @@ -8,7 +8,8 @@ #ifndef __POSLABEL_H__ #define __POSLABEL_H__ -#include <qlabel.h> +//#include <qlabel.h> +#include <QLabel> //--------------------------------------------------------- // PosLabel diff --git a/muse2/muse/widgets/sliderbase.h b/muse2/muse/widgets/sliderbase.h index d2de6f7c..47084246 100644 --- a/muse2/muse/widgets/sliderbase.h +++ b/muse2/muse/widgets/sliderbase.h @@ -15,7 +15,7 @@ #define __SLIDERBASE_H__ #include "drange.h" -#include <q3frame.h> +#include <QFrame> #include <qpixmap.h> #include <qdatetime.h> //#include <qbutton.h> diff --git a/muse2/muse/widgets/tb1.cpp b/muse2/muse/widgets/tb1.cpp index d2b9b4a7..f6a2aff8 100644 --- a/muse2/muse/widgets/tb1.cpp +++ b/muse2/muse/widgets/tb1.cpp @@ -57,43 +57,64 @@ static const char* quantStrings[] = { // solo time pitch raster quant //--------------------------------------------------------- -Toolbar1::Toolbar1(Q3MainWindow* parent, int r, int q, bool sp) -//Toolbar1::Toolbar1(QWidget* parent, int r, int q, bool sp) // p4.0.4 - : Q3ToolBar(QString("Quant'n'Snap-tools"), parent) +//Toolbar1::Toolbar1(QMainWindow* parent, int r, int q, bool sp) +Toolbar1::Toolbar1(QWidget* parent, int r, int q, bool sp) + : QToolBar(QString("Quant'n'Snap-tools"), parent) //: QToolBar(QString("Qant'n'Snap-tools"), parent) { + pitch = 0; showPitch = sp; - setHorizontalStretchable(false); + // ORCAN - FIXME: Check this: + //setHorizontalStretchable(false); + //setHorizontalPolicy(QSizePolicy::Minimum); + //setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred); - solo = new QToolButton(this); + solo = new QToolButton(); solo->setText(tr("Solo")); solo->setToggleButton(true); + addWidget(solo); //--------------------------------------------------- // Cursor Position //--------------------------------------------------- - QLabel* label = new QLabel(tr("Cursor"), this, "Cursor"); + //QLabel* label = new QLabel(tr("Cursor"), this, "Cursor"); + QLabel* label = new QLabel(tr("Cursor")); label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); label->setIndent(3); - pos = new PosLabel(this, "pos"); + addWidget(label); + //pos = new PosLabel(this, "pos"); + pos = new PosLabel(0, "pos"); + pos->setFixedHeight(22); + addWidget(pos); if (showPitch) { - pitch = new PitchLabel(this); + //pitch = new PitchLabel(this); + pitch = new PitchLabel(0); pitch->setEnabled(false); + pitch->setFixedHeight(22); + addWidget(pitch); } //--------------------------------------------------- // Raster, Quant. //--------------------------------------------------- - raster = new LabelCombo(tr("Snap"), this); - quant = new LabelCombo(tr("Quantize"), this); + //raster = new LabelCombo(tr("Snap"), this); + //quant = new LabelCombo(tr("Quantize"), this); + raster = new LabelCombo(tr("Snap"), 0); + quant = new LabelCombo(tr("Quantize"), 0); + //addWidget(raster); + //addWidget(quant); //Q3ListBox* rlist = new Q3ListBox(this); //Q3ListBox* qlist = new Q3ListBox(this); // p4.0.3 - QTableWidget* rlist = new QTableWidget(10, 3, this); - QTableWidget* qlist = new QTableWidget(8, 3, this); + //QTableWidget* rlist = new QTableWidget(10, 3, this); + //QTableWidget* qlist = new QTableWidget(8, 3, this); + QTableWidget* rlist = new QTableWidget(10, 3); + QTableWidget* qlist = new QTableWidget(8, 3); + //addWidget(rlist); + //addWidget(qlist); rlist->verticalHeader()->setDefaultSectionSize(22); rlist->horizontalHeader()->setDefaultSectionSize(32); rlist->setSelectionMode(QAbstractItemView::SingleSelection); @@ -130,13 +151,26 @@ Toolbar1::Toolbar1(Q3MainWindow* parent, int r, int q, bool sp) setRaster(r); setQuant(q); + addWidget(raster); + addWidget(quant); + + // FIXME: Not working right. + raster->setFixedHeight(38); + quant->setFixedHeight(38); + //--------------------------------------------------- // To Menu //--------------------------------------------------- - LabelCombo* to = new LabelCombo(tr("To"), this); + /* + //LabelCombo* to = new LabelCombo(tr("To"), this); + LabelCombo* to = new LabelCombo(tr("To"), 0); + addWidget(to); // Q3ListBox* toList = new Q3ListBox(this); - QListWidget* toList = new QListWidget(this); // p4.0.4 + //QListWidget* toList = new QListWidget(this); // p4.0.4 + QListWidget* toList = new QListWidget(); + toList->setFixedHeight(24); + //addWidget(toList); // //to->setListBox(toList); ddskrjo to->setView(toList); // p4.0.4 @@ -149,10 +183,21 @@ Toolbar1::Toolbar1(Q3MainWindow* parent, int r, int q, bool sp) toList->insertItem(CMD_RANGE_LOOP, tr("Looped Ev.")); toList->insertItem(CMD_RANGE_SELECTED, tr("Selected Ev.")); toList->insertItem(CMD_RANGE_LOOP | CMD_RANGE_SELECTED, tr("Looped+Sel.")); + */ + + addWidget(new QLabel(tr("To"))); + QComboBox* toList = new QComboBox; + toList->setFixedHeight(22); + toList->addItem(tr("All Events"), 0); + toList->addItem(tr("Looped Ev."), CMD_RANGE_LOOP); + toList->addItem(tr("Selected Ev."), CMD_RANGE_SELECTED); + toList->addItem(tr("Looped+Sel."), CMD_RANGE_LOOP | CMD_RANGE_SELECTED); + addWidget(toList); connect(raster, SIGNAL(activated(int)), SLOT(_rasterChanged(int))); connect(quant, SIGNAL(activated(int)), SLOT(_quantChanged(int))); - connect(to, SIGNAL(activated(int)), SIGNAL(toChanged(int))); + //connect(to, SIGNAL(activated(int)), SIGNAL(toChanged(int))); + connect(toList, SIGNAL(activated(int)), SIGNAL(toChanged(int))); connect(solo, SIGNAL(toggled(bool)), SIGNAL(soloChanged(bool))); pos->setEnabled(false); } @@ -181,7 +226,7 @@ void Toolbar1::_quantChanged(int index) void Toolbar1::setPitch(int val) { - if (showPitch) { + if (pitch && showPitch) { pitch->setEnabled(val != -1); pitch->setPitch(val); } @@ -189,7 +234,7 @@ void Toolbar1::setPitch(int val) void Toolbar1::setInt(int val) { - if (showPitch) { + if (pitch && showPitch) { pitch->setEnabled(val != -1); pitch->setInt(val); } @@ -202,7 +247,7 @@ void Toolbar1::setInt(int val) void Toolbar1::setTime(unsigned val) { if (!pos->isVisible()) { - printf("NOT visible\n"); + //printf("NOT visible\n"); return; } if (val == MAXINT) @@ -262,6 +307,7 @@ void Toolbar1::setSolo(bool flag) void Toolbar1::setPitchMode(bool /*flag*/) { -// pitch->setPitchMode(flag); + // if(pitch) +// pitch->setPitchMode(flag); } diff --git a/muse2/muse/widgets/tb1.h b/muse2/muse/widgets/tb1.h index 40264abf..b330ee85 100644 --- a/muse2/muse/widgets/tb1.h +++ b/muse2/muse/widgets/tb1.h @@ -9,10 +9,10 @@ #define __TB1_H__ //#include <qwidget.h> -#include <q3toolbar.h> +//#include <q3toolbar.h> #include <QWidget> // p4.0.4 -//#include <QToolBar> // +#include <QToolBar> // class PosLabel; class PitchLabel; @@ -24,8 +24,8 @@ class QToolButton; // Toolbar1 //--------------------------------------------------------- -class Toolbar1 : public Q3ToolBar { -//class Toolbar1 : public QToolBar { // p4.0.4 +//class Toolbar1 : public Q3ToolBar { +class Toolbar1 : public QToolBar { // p4.0.4 QToolButton* solo; PosLabel* pos; PitchLabel* pitch; @@ -52,8 +52,8 @@ class Toolbar1 : public Q3ToolBar { void toChanged(int); public: - Toolbar1(Q3MainWindow* parent, int r=96, - //Toolbar1(QWidget* parent, int r=96, // p4.0.4 + //Toolbar1(QMainWindow* parent = 0, int r=96, + Toolbar1(QWidget* parent, int r=96, int q=96, bool showPitch=true); void setSolo(bool val); void setPitchMode(bool flag); diff --git a/muse2/muse/widgets/tools.cpp b/muse2/muse/widgets/tools.cpp index bb6ba334..ec80230a 100644 --- a/muse2/muse/widgets/tools.cpp +++ b/muse2/muse/widgets/tools.cpp @@ -6,14 +6,18 @@ //========================================================= #include "tools.h" -#include <qpixmap.h> -#include <q3buttongroup.h> -#include <qtoolbutton.h> -#include <qtooltip.h> -#include <q3whatsthis.h> -#include <q3mainwindow.h> +//#include <qpixmap.h> +//#include <q3buttongroup.h> +//#include <qtoolbutton.h> +//#include <qtooltip.h> +//#include <q3whatsthis.h> +//#include <q3mainwindow.h> + +#include <QPixmap> +#include <QToolButton> + //Added by qt3to4: -#include <Q3ActionGroup> +#include <QActionGroup> #include "icons.h" #include "action.h" @@ -56,10 +60,12 @@ ToolB toolList[] = { // EditToolBar //--------------------------------------------------------- -EditToolBar::EditToolBar(Q3MainWindow* parent, int tools, const char*) - : Q3ToolBar(tr("Edit Tools"), parent) +//EditToolBar::EditToolBar(QMainWindow* parent, int tools, const char*) +EditToolBar::EditToolBar(QWidget* parent, int tools, const char*) + : QToolBar(tr("Edit Tools"), parent) { - Q3ActionGroup* action = new Q3ActionGroup(parent, "editaction", true); + QActionGroup* action = new QActionGroup(parent); // Parent needed. + action->setExclusive(true); nactions = 0; for (unsigned i = 0; i < sizeof(toolList)/sizeof(*toolList); ++i) { @@ -77,7 +83,8 @@ EditToolBar::EditToolBar(Q3MainWindow* parent, int tools, const char*) Action* a = new Action(action, 1<<i, t->tip, true); actions[n] = a; - a->setIconSet(QIcon(**(t->icon))); + //a->setIconSet(QIcon(**(t->icon))); + a->setIcon(QIcon(**(t->icon))); a->setToolTip(tr(t->tip)); a->setWhatsThis(tr(t->ltip)); if (first) { @@ -86,16 +93,19 @@ EditToolBar::EditToolBar(Q3MainWindow* parent, int tools, const char*) } ++n; } - action->addTo(this); - //connect(action, SIGNAL(selected(Q3Action*)), SLOT(toolChanged(QAction*))); - connect(action, SIGNAL(selected(Q3Action*)), SLOT(toolChanged(Q3Action*))); // p4.0.5 + action->setVisible(true); + //action->addTo(this); + // Note: Does not take ownership. + addActions(action->actions()); + + connect(action, SIGNAL(selected(QAction*)), SLOT(toolChanged(QAction*))); } //--------------------------------------------------------- // toolChanged //--------------------------------------------------------- -void EditToolBar::toolChanged(Q3Action* action) +void EditToolBar::toolChanged(QAction* action) { emit toolChanged(((Action*)action)->id()); } diff --git a/muse2/muse/widgets/tools.h b/muse2/muse/widgets/tools.h index efe5d57c..63304a4d 100644 --- a/muse2/muse/widgets/tools.h +++ b/muse2/muse/widgets/tools.h @@ -8,13 +8,15 @@ #ifndef __TOOLS_H__ #define __TOOLS_H__ -#include <q3toolbar.h> +//#include <q3toolbar.h> +#include <QToolBar> //Added by qt3to4: #include <QPixmap> -class Q3Action; +class QAction; class Action; -class Q3MainWindow; +//class QMainWindow; +class QWidget; enum Tool { PointerTool=1, PencilTool=2, RubberTool=4, CutTool=8, ScoreTool=16, GlueTool=32, QuantTool=64, DrawTool=128, MuteTool=256}; @@ -33,13 +35,13 @@ extern ToolB toolList[]; // EditToolBar //--------------------------------------------------------- -class EditToolBar : public Q3ToolBar { +class EditToolBar : public QToolBar { Q_OBJECT Action** actions; int nactions; private slots: - void toolChanged(Q3Action* action); + void toolChanged(QAction* action); signals: void toolChanged(int); @@ -48,7 +50,8 @@ class EditToolBar : public Q3ToolBar { void set(int id); public: - EditToolBar(Q3MainWindow*, int, const char* name = 0); + //EditToolBar(QMainWindow*, int, const char* name = 0); + EditToolBar(QWidget* /*parent*/, int /*tools*/, const char* name = 0); // Needs a parent ! ~EditToolBar(); int curTool(); }; diff --git a/muse2/muse/widgets/utils.cpp b/muse2/muse/widgets/utils.cpp index 2a4852f3..2c4aeb01 100644 --- a/muse2/muse/widgets/utils.cpp +++ b/muse2/muse/widgets/utils.cpp @@ -9,7 +9,7 @@ #include <stdlib.h> #include "utils.h" #include <math.h> -#include <q3frame.h> +#include <QFrame> #include <sys/time.h> // Quick bit-shift lookup table @@ -61,10 +61,10 @@ int num2cols(int min, int max) // hLine //--------------------------------------------------------- -Q3Frame* hLine(QWidget* w) +QFrame* hLine(QWidget* w) { - Q3Frame* delim = new Q3Frame(w); - delim->setFrameStyle(Q3Frame::HLine | Q3Frame::Sunken); + QFrame* delim = new QFrame(w); + delim->setFrameStyle(QFrame::HLine | QFrame::Sunken); return delim; } @@ -72,10 +72,10 @@ Q3Frame* hLine(QWidget* w) // vLine //--------------------------------------------------------- -Q3Frame* vLine(QWidget* w) +QFrame* vLine(QWidget* w) { - Q3Frame* delim = new Q3Frame(w); - delim->setFrameStyle(Q3Frame::VLine | Q3Frame::Sunken); + QFrame* delim = new QFrame(w); + delim->setFrameStyle(QFrame::VLine | QFrame::Sunken); return delim; } @@ -307,7 +307,7 @@ unsigned int string2u32bitmap(const QString& str) //--------------------------------------------------------- // Added by Tim. p3.3.8 -bool autoAdjustFontSize(Q3Frame* w, const QString& s, bool ignoreWidth, bool ignoreHeight, int max, int min) +bool autoAdjustFontSize(QFrame* w, const QString& s, bool ignoreWidth, bool ignoreHeight, int max, int min) { // In case the max or min was obtained from QFont::pointSize() which returns -1 // if the font is a pixel font, or if min is greater than max... diff --git a/muse2/muse/widgets/utils.h b/muse2/muse/widgets/utils.h index aaf501f0..297994c0 100644 --- a/muse2/muse/widgets/utils.h +++ b/muse2/muse/widgets/utils.h @@ -1,5 +1,5 @@ //Added by qt3to4: -#include <Q3Frame> +#include <QFrame> //========================================================= // MusE // Linux Music Editor @@ -10,7 +10,7 @@ #ifndef __UTILS_H__ #define __UTILS_H__ -class Q3Frame; +class QFrame; class QWidget; #include <qstring.h> @@ -19,11 +19,11 @@ extern QString bitmap2String(int bm); extern int string2bitmap(const QString& str); extern QString u32bitmap2String(unsigned int bm); extern unsigned int string2u32bitmap(const QString& str); -extern bool autoAdjustFontSize(Q3Frame* w, const QString& s, bool ignoreWidth = false, bool ignoreHeight = false, int max = 10, int min = 4); +extern bool autoAdjustFontSize(QFrame* w, const QString& s, bool ignoreWidth = false, bool ignoreHeight = false, int max = 10, int min = 4); extern int num2cols(int min, int max); -extern Q3Frame* hLine(QWidget* parent); -extern Q3Frame* vLine(QWidget* parent); +extern QFrame* hLine(QWidget* parent); +extern QFrame* vLine(QWidget* parent); extern void dump(const unsigned char* p, int n); extern double curTime(); |