diff options
Diffstat (limited to 'muse2')
-rw-r--r-- | muse2/ChangeLog | 1 | ||||
-rw-r--r-- | muse2/muse/widgets/scrollscale.cpp | 30 | ||||
-rw-r--r-- | muse2/muse/widgets/scrollscale.h | 15 | ||||
-rw-r--r-- | muse2/muse/widgets/splitter.cpp | 15 | ||||
-rw-r--r-- | muse2/muse/widgets/splitter.h | 2 |
5 files changed, 30 insertions, 33 deletions
diff --git a/muse2/ChangeLog b/muse2/ChangeLog index 0c91a94c..0d434539 100644 --- a/muse2/ChangeLog +++ b/muse2/ChangeLog @@ -4,6 +4,7 @@ old Header class. We can probably remove it soon. (Orcan) - Ported help.cpp as is. But maybe we should use QDesktopServices to open user's default browser instead of the browser specified in a config option. (Orcan) + - Ported scrollscale and splitter (Orcan) 01.12.2010 - Ported listedit. (Orcan) - I missed to port one action call in drumedit. Now it's (hopefully) done. (Orcan) diff --git a/muse2/muse/widgets/scrollscale.cpp b/muse2/muse/widgets/scrollscale.cpp index 1ff22c6a..08650d18 100644 --- a/muse2/muse/widgets/scrollscale.cpp +++ b/muse2/muse/widgets/scrollscale.cpp @@ -7,15 +7,14 @@ #include <stdio.h> #include <cmath> -#include <qslider.h> -#include <qscrollbar.h> -#include <qlayout.h> -#include <qtoolbutton.h> -#include <qtooltip.h> -#include <qlabel.h> -//Added by qt3to4: -#include <Q3BoxLayout> + +#include <QBoxLayout> +#include <QLabel> #include <QResizeEvent> +#include <QScrollBar> +#include <QSlider> +#include <QToolButton> +#include <QToolTip> // #include "globals.h" #include "scrollscale.h" @@ -240,24 +239,25 @@ ScrollScale::ScrollScale ( int s1, int s2, int cs, int max_, Qt::Orientation o, delta/=2; } - scale = new QSlider ( 0, 1024, 1, cur, o, this ); - scroll = new QScrollBar ( o, this ); + scale = new QSlider ( 0, 1024, 1, cur, o); + scroll = new QScrollBar ( o ); setScale ( cur ); if ( o == Qt::Horizontal ) { - box = new Q3BoxLayout ( this, Q3BoxLayout::LeftToRight ); + box = new QBoxLayout ( QBoxLayout::LeftToRight); scale->setMaximumWidth ( 70 ); scroll->setMinimumWidth ( 50 ); } else { - box = new Q3BoxLayout ( this, Q3BoxLayout::Down ); + box = new QBoxLayout ( QBoxLayout::TopToBottom); scroll->setMinimumHeight ( 50 ); scale->setMaximumHeight ( 70 ); } box->addWidget ( scroll, 10 ); box->addWidget ( scale, 5 ); + setLayout(box); connect ( scale, SIGNAL ( valueChanged ( int ) ), SLOT ( setScale ( int ) ) ); connect ( scale, SIGNAL ( valueChanged ( int ) ), SIGNAL ( lscaleChanged ( int ) ) ); connect ( scroll, SIGNAL ( valueChanged ( int ) ), SIGNAL ( scrollChanged ( int ) ) ); @@ -276,11 +276,11 @@ void ScrollScale::setPageButtons ( bool flag ) { if ( up == 0 ) { - up = new QToolButton ( this ); + up = new QToolButton; up->setPixmap ( * ( upIcon ) ); - down = new QToolButton ( this ); + down = new QToolButton; down->setPixmap ( * ( downIcon ) ); - pageNo = new QLabel ( this ); + pageNo = new QLabel; QString s; s.setNum ( _page+1 ); pageNo->setText ( s ); diff --git a/muse2/muse/widgets/scrollscale.h b/muse2/muse/widgets/scrollscale.h index 572e5906..5373adcf 100644 --- a/muse2/muse/widgets/scrollscale.h +++ b/muse2/muse/widgets/scrollscale.h @@ -8,18 +8,13 @@ #ifndef __SCROLLSCALE_H__ #define __SCROLLSCALE_H__ -#include <qwidget.h> -#include <qslider.h> -//Added by qt3to4: -#include <QResizeEvent> -#include <Q3BoxLayout> -#include <QLabel> +#include <QWidget> -// class QSlider; +class QBoxLayout; +class QLabel; +class QResizeEvent; class QScrollBar; -class Q3BoxLayout; class QToolButton; -class QLabel; //--------------------------------------------------------- // ScrollScale @@ -31,7 +26,7 @@ class ScrollScale : public QWidget { int minVal, maxVal; int scaleVal, scaleMin, scaleMax; bool showMagFlag; - Q3BoxLayout* box; + QBoxLayout* box; bool noScale; bool pageButtons; int _page; diff --git a/muse2/muse/widgets/splitter.cpp b/muse2/muse/widgets/splitter.cpp index d1f9cfd9..68925d57 100644 --- a/muse2/muse/widgets/splitter.cpp +++ b/muse2/muse/widgets/splitter.cpp @@ -7,17 +7,18 @@ #include "splitter.h" #include "xml.h" -#include <qstringlist.h> -//Added by qt3to4: -#include <Q3ValueList> + +#include <QList> +#include <QStringList> //--------------------------------------------------------- // Splitter //--------------------------------------------------------- Splitter::Splitter(Qt::Orientation o, QWidget* parent, const char* name) - : QSplitter(o, parent, name) + : QSplitter(o, parent) { + setObjectName(name); setOpaqueResize(true); } @@ -27,10 +28,10 @@ Splitter::Splitter(Qt::Orientation o, QWidget* parent, const char* name) void Splitter::writeStatus(int level, Xml& xml) { - Q3ValueList<int> vl = sizes(); + QList<int> vl = sizes(); //xml.nput(level++, "<%s>", name()); xml.nput(level++, "<%s>", Xml::xmlString(name()).latin1()); - Q3ValueListIterator<int> ivl = vl.begin(); + QList<int>::iterator ivl = vl.begin(); for (; ivl != vl.end(); ++ivl) { xml.nput("%d ", *ivl); } @@ -44,7 +45,7 @@ void Splitter::writeStatus(int level, Xml& xml) void Splitter::readStatus(Xml& xml) { - Q3ValueList<int> vl; + QList<int> vl; for (;;) { Xml::Token token = xml.parse(); diff --git a/muse2/muse/widgets/splitter.h b/muse2/muse/widgets/splitter.h index 8be4da5b..98a64087 100644 --- a/muse2/muse/widgets/splitter.h +++ b/muse2/muse/widgets/splitter.h @@ -8,7 +8,7 @@ #ifndef __SPLITTER_H__ #define __SPLITTER_H__ -#include <qsplitter.h> +#include <QSplitter> class Xml; |