diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-02 22:38:52 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-02 22:38:52 +0000 |
commit | 458efa7b0c935cbaafa2791021a5f8f7241aa876 (patch) | |
tree | 624583f2873febe23770bee3fa94b5c24bd59f4f /src/gui/widgets/Fader.cpp | |
parent | 747037b72944ae2c02962b7c5c96e0a7f8852e38 (diff) | |
download | rosegarden-458efa7b0c935cbaafa2791021a5f8f7241aa876.tar.gz rosegarden-458efa7b0c935cbaafa2791021a5f8f7241aa876.zip |
Initial TQt4 port of Rosegarden
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/rosegarden@1230242 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/gui/widgets/Fader.cpp')
-rw-r--r-- | src/gui/widgets/Fader.cpp | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/src/gui/widgets/Fader.cpp b/src/gui/widgets/Fader.cpp index fc77f8e..021252e 100644 --- a/src/gui/widgets/Fader.cpp +++ b/src/gui/widgets/Fader.cpp @@ -45,8 +45,8 @@ Fader::PixmapCache Fader::m_pixmapCache; Fader::Fader(AudioLevel::FaderType type, - int w, int h, TQWidget *parent) : - TQWidget(parent), + int w, int h, TQWidget *tqparent) : + TQWidget(tqparent), m_integral(false), m_vertical(h > w), m_min(0), @@ -56,7 +56,7 @@ Fader::Fader(AudioLevel::FaderType type, m_float(new TextFloat(this)), m_floatTimer(new TQTimer()) { - setBackgroundMode(Qt::NoBackground); + setBackgroundMode(TQt::NoBackground); setFixedSize(w, h); // provisional calculateButtonPixmap(); // if (m_vertical) { @@ -73,7 +73,7 @@ Fader::Fader(AudioLevel::FaderType type, m_sliderMax = width() - m_sliderMin; } - m_outlineColour = colorGroup().mid(); + m_outlineColour = tqcolorGroup().mid(); calculateGroovePixmap(); setFader(0.0); @@ -83,8 +83,8 @@ Fader::Fader(AudioLevel::FaderType type, } Fader::Fader(int min, int max, int deflt, - int w, int h, TQWidget *parent) : - TQWidget(parent), + int w, int h, TQWidget *tqparent) : + TQWidget(tqparent), m_integral(true), m_vertical(h > w), m_min(min), @@ -93,7 +93,7 @@ Fader::Fader(int min, int max, int deflt, m_float(new TextFloat(this)), m_floatTimer(new TQTimer()) { - setBackgroundMode(Qt::NoBackground); + setBackgroundMode(TQt::NoBackground); setFixedSize(w, h); // provisional calculateButtonPixmap(); // if (m_vertical) { @@ -110,7 +110,7 @@ Fader::Fader(int min, int max, int deflt, m_sliderMax = width() - m_sliderMin; } - m_outlineColour = colorGroup().mid(); + m_outlineColour = tqcolorGroup().mid(); calculateGroovePixmap(); setFader(deflt); @@ -120,8 +120,8 @@ Fader::Fader(int min, int max, int deflt, } Fader::Fader(int min, int max, int deflt, - bool vertical, TQWidget *parent) : - TQWidget(parent), + bool vertical, TQWidget *tqparent) : + TQWidget(tqparent), m_integral(true), m_vertical(vertical), m_min(min), @@ -130,7 +130,7 @@ Fader::Fader(int min, int max, int deflt, m_float(new TextFloat(this)), m_floatTimer(new TQTimer()) { - setBackgroundMode(Qt::NoBackground); + setBackgroundMode(TQt::NoBackground); calculateButtonPixmap(); if (m_vertical) { @@ -141,7 +141,7 @@ Fader::Fader(int min, int max, int deflt, m_sliderMax = width() - m_sliderMin; } - m_outlineColour = colorGroup().mid(); + m_outlineColour = tqcolorGroup().mid(); calculateGroovePixmap(); setFader(deflt); @@ -320,7 +320,7 @@ Fader::mousePressEvent(TQMouseEvent *e) { m_clickMousePos = -1; - if (e->button() == LeftButton) { + if (e->button() == Qt::LeftButton) { if (e->type() == TQEvent::MouseButtonDblClick) { setFader(0); @@ -397,17 +397,17 @@ Fader::showFloatText() TQString text; if (m_integral) { - text = TQString("%1").arg(int(m_value)); + text = TQString("%1").tqarg(int(m_value)); } else if (m_value == AudioLevel::DB_FLOOR) { text = "Off"; } else { float v = fabs(m_value); text = TQString("%1%2.%3%4%5 dB") - .arg(m_value < 0 ? '-' : '+') - .arg(int(v)) - .arg(int(v * 10) % 10) - .arg(int(v * 100) % 10) - .arg(int(v * 1000) % 10); + .tqarg(m_value < 0 ? '-' : '+') + .tqarg(int(v)) + .tqarg(int(v * 10) % 10) + .tqarg(int(v * 100) % 10) + .tqarg(int(v * 1000) % 10); } m_float->setText(text); @@ -415,12 +415,12 @@ Fader::showFloatText() // Reposition - we need to sum the relative positions up to the // topLevel or dialog to please move(). // - TQWidget *par = parentWidget(); + TQWidget *par = tqparentWidget(); TQPoint totalPos = this->pos(); - while (par->parentWidget() && !par->isTopLevel() && !par->isDialog()) { + while (par->tqparentWidget() && !par->isTopLevel() && !par->isDialog()) { totalPos += par->pos(); - par = par->parentWidget(); + par = par->tqparentWidget(); } // Move just top/right @@ -447,9 +447,9 @@ Fader::calculateGroovePixmap() delete map; map = new TQPixmap(width(), height()); - map->fill(colorGroup().background()); + map->fill(tqcolorGroup().background()); TQPainter paint(map); - paint.setBrush(colorGroup().background()); + paint.setBrush(tqcolorGroup().background()); if (m_vertical) { @@ -464,9 +464,9 @@ Fader::calculateGroovePixmap() if (position >= 0 && position < m_sliderMax - m_sliderMin) { if (dB == 0) - paint.setPen(colorGroup().dark()); + paint.setPen(tqcolorGroup().dark()); else - paint.setPen(colorGroup().midlight()); + paint.setPen(tqcolorGroup().midlight()); paint.drawLine(1, (m_sliderMax - position), width() - 2, (m_sliderMax - position)); } @@ -477,8 +477,8 @@ Fader::calculateGroovePixmap() } } - paint.setPen(colorGroup().dark()); - paint.setBrush(colorGroup().mid()); + paint.setPen(tqcolorGroup().dark()); + paint.setBrush(tqcolorGroup().mid()); paint.drawRect(width() / 2 - 3, height() - m_sliderMax, 6, m_sliderMax - m_sliderMin); paint.end(); @@ -511,48 +511,48 @@ Fader::calculateButtonPixmap() buttonWidth = width() - 2; map = new TQPixmap(buttonWidth, buttonHeight); - map->fill(colorGroup().background()); + map->fill(tqcolorGroup().background()); int x = 0; int y = 0; TQPainter paint(map); - paint.setPen(colorGroup().light()); + paint.setPen(tqcolorGroup().light()); paint.drawLine(x + 1, y, x + buttonWidth - 2, y); paint.drawLine(x, y + 1, x, y + buttonHeight - 2); - paint.setPen(colorGroup().midlight()); + paint.setPen(tqcolorGroup().midlight()); paint.drawLine(x + 1, y + 1, x + buttonWidth - 2, y + 1); paint.drawLine(x + 1, y + 1, x + 1, y + buttonHeight - 2); - paint.setPen(colorGroup().mid()); + paint.setPen(tqcolorGroup().mid()); paint.drawLine(x + 2, y + buttonHeight - 2, x + buttonWidth - 2, y + buttonHeight - 2); paint.drawLine(x + buttonWidth - 2, y + 2, x + buttonWidth - 2, y + buttonHeight - 2); - paint.setPen(colorGroup().dark()); + paint.setPen(tqcolorGroup().dark()); paint.drawLine(x + 1, y + buttonHeight - 1, x + buttonWidth - 2, y + buttonHeight - 1); paint.drawLine(x + buttonWidth - 1, y + 1, x + buttonWidth - 1, y + buttonHeight - 2); - paint.setPen(colorGroup().shadow()); + paint.setPen(tqcolorGroup().shadow()); paint.drawLine(x + 1, y + buttonHeight / 2, x + buttonWidth - 2, y + buttonHeight / 2); - paint.setPen(colorGroup().mid()); + paint.setPen(tqcolorGroup().mid()); paint.drawLine(x + 1, y + buttonHeight / 2 - 1, x + buttonWidth - 2, y + buttonHeight / 2 - 1); paint.drawPoint(x, y + buttonHeight / 2); - paint.setPen(colorGroup().light()); + paint.setPen(tqcolorGroup().light()); paint.drawLine(x + 1, y + buttonHeight / 2 + 1, x + buttonWidth - 2, y + buttonHeight / 2 + 1); - paint.setPen(colorGroup().button()); - paint.setBrush(colorGroup().button()); + paint.setPen(tqcolorGroup().button()); + paint.setBrush(tqcolorGroup().button()); paint.drawRect(x + 2, y + 2, buttonWidth - 4, buttonHeight / 2 - 4); paint.drawRect(x + 2, y + buttonHeight / 2 + 2, buttonWidth - 4, buttonHeight / 2 - 4); |