summaryrefslogtreecommitdiffstats
path: root/arts/tools/levelmeters.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:43:15 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:43:15 +0000
commite654398e46e37abf457b2b1122ab898d2c51c49f (patch)
treed39ee6440f3c3663c3ead84a2d4cc2d034667e96 /arts/tools/levelmeters.cpp
parente4f29b18e19394b9352f52a6c0d0d0e3932cf511 (diff)
downloadtdemultimedia-e654398e46e37abf457b2b1122ab898d2c51c49f.tar.gz
tdemultimedia-e654398e46e37abf457b2b1122ab898d2c51c49f.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1157644 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'arts/tools/levelmeters.cpp')
-rw-r--r--arts/tools/levelmeters.cpp64
1 files changed, 32 insertions, 32 deletions
diff --git a/arts/tools/levelmeters.cpp b/arts/tools/levelmeters.cpp
index 3b2ca1ac..1d0b080c 100644
--- a/arts/tools/levelmeters.cpp
+++ b/arts/tools/levelmeters.cpp
@@ -1,13 +1,13 @@
-#include <qlayout.h>
-#include <qpainter.h>
-#include <qfontmetrics.h>
-#include <qptrlist.h>
+#include <tqlayout.h>
+#include <tqpainter.h>
+#include <tqfontmetrics.h>
+#include <tqptrlist.h>
#include <kled.h>
#include "levelmeters.h"
const int PeakBar::peakMillis=1500;
-PeakBar::PeakBar(QWidget *parent)
+PeakBar::PeakBar(TQWidget *parent)
: ACLevelMeter(parent)
, maxValue( 0.0f )
, minValue( 0.0f )
@@ -19,19 +19,19 @@ PeakBar::PeakBar(QWidget *parent)
lastValues.setAutoDelete( TRUE );
- setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
- setSizePolicy(QSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred));
+ setFrameStyle(TQFrame::StyledPanel | TQFrame::Sunken);
+ setSizePolicy(TQSizePolicy(TQSizePolicy::Maximum, TQSizePolicy::Preferred));
setBackgroundMode(NoBackground);
setMinimumSize(frameWidth()+7, 70);
}
void PeakBar::frameChanged() {
setMinimumSize(frameWidth()+7, 70);
- QFrame::frameChanged();
+ TQFrame::frameChanged();
}
-QSize PeakBar::sizeHint() const {
- return QSize(13, 250);
+TQSize PeakBar::sizeHint() const {
+ return TQSize(13, 250);
}
void PeakBar::checkMinMax() {
@@ -47,7 +47,7 @@ void PeakBar::checkMinMax() {
maxValue= 0.f;
minValue= 1.f;
clipped = false;
- for (QPtrListIterator<Observation> it(lastValues); it.current(); ++it) {
+ for (TQPtrListIterator<Observation> it(lastValues); it.current(); ++it) {
float value= it.current()->value;
if (value>maxValue)
maxValue= value;
@@ -59,9 +59,9 @@ void PeakBar::checkMinMax() {
}
}
-void PeakBar::drawContents(QPainter *p)
+void PeakBar::drawContents(TQPainter *p)
{
- QRect size= contentsRect();
+ TQRect size= contentsRect();
checkMinMax();
@@ -69,7 +69,7 @@ void PeakBar::drawContents(QPainter *p)
p->setPen(NoPen);
p->drawRect(size);
- QRect bar= size;
+ TQRect bar= size;
p->setBrush(clipped ? red : blue);
if (horizontalMode) {
bar.setWidth((int)(bar.width()*currentValue));
@@ -109,10 +109,10 @@ void PeakBar::setValue(float f) {
// -------------------------------------------------------------
-PeakLevelMeters::PeakLevelMeters(QWidget *parent):
+PeakLevelMeters::PeakLevelMeters(TQWidget *parent):
StereoLevelMeter(parent), left(this), right(this), scaleView(this)
{
- QBoxLayout *layout= new QHBoxLayout(this);
+ TQBoxLayout *layout= new TQHBoxLayout(this);
layout->addWidget(&left);
// layout->setStretchFactor(&left, 0);
layout->addWidget(&right);
@@ -122,7 +122,7 @@ PeakLevelMeters::PeakLevelMeters(QWidget *parent):
left.setLineWidth(2);
right.setLineWidth(2);
scaleView.setScaleMargins(right.frameWidth());
- setSizePolicy(QSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred));
+ setSizePolicy(TQSizePolicy(TQSizePolicy::Maximum, TQSizePolicy::Preferred));
setDbRange(36);
}
@@ -142,9 +142,9 @@ void PeakLevelMeters::setValues(float leftVal, float rightVal) {
right.setValue(f);
}
-ScaleView::ScaleView(QWidget *parent): QFrame(parent) {
+ScaleView::ScaleView(TQWidget *parent): TQFrame(parent) {
font.setPixelSize(10);
- setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred));
+ setSizePolicy(TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Preferred));
}
void ScaleView::setDbRange(int db) {
@@ -152,16 +152,16 @@ void ScaleView::setDbRange(int db) {
repaint();
}
-QSize ScaleView::sizeHint() const {
- return QSize(QFontMetrics(font).width("-88")+8, 250);
+TQSize ScaleView::sizeHint() const {
+ return TQSize(TQFontMetrics(font).width("-88")+8, 250);
}
-void ScaleView::drawContents(QPainter *p) {
- QRect size= contentsRect();
+void ScaleView::drawContents(TQPainter *p) {
+ TQRect size= contentsRect();
size.rTop()+= upperMargin;
size.rBottom()-= lowerMargin;
- QFrame::drawContents(p); // clear background
+ TQFrame::drawContents(p); // clear background
int step=3;
while (dbRange/step*20>size.height())
@@ -173,7 +173,7 @@ void ScaleView::drawContents(QPainter *p) {
p->setPen(black);
p->setFont(font);
- QString numStr;
+ TQString numStr;
for (int i=0; i<=dbRange; i++) {
int y= size.top()+(size.height()-1)*i/dbRange;
if (i%step==0) {
@@ -187,12 +187,12 @@ void ScaleView::drawContents(QPainter *p) {
// -------------------------------------------------------------
-LedMeter::LedMeter(QWidget *parent, bool blueState) : ACLevelMeter(parent) {
+LedMeter::LedMeter(TQWidget *parent, bool blueState) : ACLevelMeter(parent) {
setBackgroundColor(black);
- QBoxLayout * l = new QVBoxLayout( this );
+ TQBoxLayout * l = new TQVBoxLayout( this );
l->setAutoAdd(TRUE);
for(int i=0;i<12;i++) {
- QColor c;
+ TQColor c;
if(blueState)
c = blue;
else {
@@ -202,8 +202,8 @@ LedMeter::LedMeter(QWidget *parent, bool blueState) : ACLevelMeter(parent) {
}
// put each led in its own frame, since it seems to be broken
- QFrame *lframe = new QFrame(this);
- QBoxLayout *lfl = new QVBoxLayout( lframe );
+ TQFrame *lframe = new TQFrame(this);
+ TQBoxLayout *lfl = new TQVBoxLayout( lframe );
lfl->setAutoAdd(TRUE);
leds[i] =
new KLed(c,KLed::Off, KLed::Sunken, KLed::Circular,lframe);
@@ -223,10 +223,10 @@ void LedMeter::setValue(float f)
// -------------------------------------------------------------
-StereoLedMeters::StereoLedMeters(QWidget *parent)
+StereoLedMeters::StereoLedMeters(TQWidget *parent)
: StereoLevelMeter(parent), left(this), right(this)
{
- QBoxLayout *layout= new QHBoxLayout(this);
+ TQBoxLayout *layout= new TQHBoxLayout(this);
layout->addWidget(&left);
layout->addWidget(&right);
}