diff options
-rw-r--r-- | muse2/ChangeLog | 2 | ||||
-rw-r--r-- | muse2/muse/ctrl/ctrledit.cpp | 20 | ||||
-rw-r--r-- | muse2/muse/ctrl/ctrledit.h | 8 | ||||
-rw-r--r-- | muse2/muse/widgets/vscale.cpp | 9 | ||||
-rw-r--r-- | muse2/muse/widgets/vscale.h | 7 |
5 files changed, 21 insertions, 25 deletions
diff --git a/muse2/ChangeLog b/muse2/ChangeLog index b2792258..9ebf90b7 100644 --- a/muse2/ChangeLog +++ b/muse2/ChangeLog @@ -1,3 +1,5 @@ +30.11.2010 + - Ported vscale and ctrledit. (Orcan) 29.11.2010 - In Mess::processEvent(), added ME_PITCHBEND case. For synths which don't override processEvent (like Vam and Deicsonze). Pitchbend should work in them now. (Tim) diff --git a/muse2/muse/ctrl/ctrledit.cpp b/muse2/muse/ctrl/ctrledit.cpp index bca9d550..fd9f108f 100644 --- a/muse2/muse/ctrl/ctrledit.cpp +++ b/muse2/muse/ctrl/ctrledit.cpp @@ -17,13 +17,7 @@ #include "instruments/minstrument.h" #include "gconfig.h" -#include <qlayout.h> -#include <qpainter.h> -#include <qtoolbutton.h> -#include <q3popupmenu.h> -#include <qlabel.h> -//Added by qt3to4: -#include <Q3HBoxLayout> +#include <QHBoxLayout> //--------------------------------------------------------- // setTool @@ -39,12 +33,13 @@ void CtrlEdit::setTool(int t) //--------------------------------------------------------- CtrlEdit::CtrlEdit(QWidget* parent, MidiEditor* e, int xmag, - bool expand, const char* name) : QWidget(parent, name) + bool expand, const char* name) : QWidget(parent) { - Q3HBoxLayout* hbox = new Q3HBoxLayout(this); - panel = new CtrlPanel(this, e, "panel"); - canvas = new CtrlCanvas(e, this, xmag, "ctrlcanvas", panel); - QWidget* vscale = new VScale(this); + setObjectName(name); + QHBoxLayout* hbox = new QHBoxLayout; + panel = new CtrlPanel(0, e, "panel"); + canvas = new CtrlCanvas(e, 0, xmag, "ctrlcanvas", panel); + QWidget* vscale = new VScale; canvas->setOrigin(-(config.division/4), 0); @@ -54,6 +49,7 @@ CtrlEdit::CtrlEdit(QWidget* parent, MidiEditor* e, int xmag, hbox->addWidget(panel, expand ? 100 : 0, Qt::AlignRight); hbox->addWidget(canvas, 100); hbox->addWidget(vscale, 0); + setLayout(hbox); connect(panel, SIGNAL(destroyPanel()), SLOT(destroy())); connect(panel, SIGNAL(controllerChanged(int)), canvas, SLOT(setController(int))); diff --git a/muse2/muse/ctrl/ctrledit.h b/muse2/muse/ctrl/ctrledit.h index 2af7c528..61bf9b46 100644 --- a/muse2/muse/ctrl/ctrledit.h +++ b/muse2/muse/ctrl/ctrledit.h @@ -8,15 +8,12 @@ #ifndef __CTRL_EDIT_H__ #define __CTRL_EDIT_H__ -#include <qwidget.h> -//Added by qt3to4: -#include <QLabel> +#include <QWidget> + #include "ctrlcanvas.h" #include "song.h" class MidiEditor; -class QLabel; -class QToolButton; class CtrlView; class CtrlPanel; class Xml; @@ -29,6 +26,7 @@ class Xml; class CtrlEdit : public QWidget { CtrlCanvas* canvas; CtrlPanel* panel; + Q_OBJECT private slots: diff --git a/muse2/muse/widgets/vscale.cpp b/muse2/muse/widgets/vscale.cpp index c0679882..943124e5 100644 --- a/muse2/muse/widgets/vscale.cpp +++ b/muse2/muse/widgets/vscale.cpp @@ -6,8 +6,8 @@ //========================================================= #include "vscale.h" -#include <qpainter.h> -//Added by qt3to4: + +#include <QPainter> #include <QPaintEvent> //--------------------------------------------------------- @@ -18,10 +18,11 @@ void VScale::paintEvent(QPaintEvent*) { int h = height(); int w = width(); - QPainter p(this); + QPainter p; + p.begin(this); p.drawLine(w/2, h/4, w, h/4); p.drawLine(0, h/2, w, h/2); p.drawLine(w/2, (3*h)/4, w, (3*h)/4); - setFixedWidth(18); + p.end(); } diff --git a/muse2/muse/widgets/vscale.h b/muse2/muse/widgets/vscale.h index b6b381ac..79a527ac 100644 --- a/muse2/muse/widgets/vscale.h +++ b/muse2/muse/widgets/vscale.h @@ -8,9 +8,8 @@ #ifndef __VSCALE_H__ #define __VSCALE_H__ -#include <qwidget.h> -//Added by qt3to4: -#include <QPaintEvent> +class QPaintEvent; +class QWidget; //--------------------------------------------------------- // VScale @@ -22,7 +21,7 @@ class VScale : public QWidget { virtual void paintEvent(QPaintEvent*); public: - VScale(QWidget* parent) : QWidget(parent) {} + VScale(QWidget* parent=0) : QWidget(parent) {setFixedWidth(18);} }; #endif |