From e654398e46e37abf457b2b1122ab898d2c51c49f Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:43:15 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1157644 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- juk/slideraction.cpp | 94 ++++++++++++++++++++++++++-------------------------- 1 file changed, 47 insertions(+), 47 deletions(-) (limited to 'juk/slideraction.cpp') diff --git a/juk/slideraction.cpp b/juk/slideraction.cpp index eacb4242..22d8446b 100644 --- a/juk/slideraction.cpp +++ b/juk/slideraction.cpp @@ -18,10 +18,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "slideraction.h" @@ -39,22 +39,22 @@ class TrackPositionSlider : public QSlider { public: - TrackPositionSlider(QWidget *parent, const char *name) : QSlider(parent, name) + TrackPositionSlider(TQWidget *parent, const char *name) : TQSlider(parent, name) { setFocusPolicy(NoFocus); } protected: - virtual void mousePressEvent(QMouseEvent *e) + virtual void mousePressEvent(TQMouseEvent *e) { if(e->button() == LeftButton) { - QMouseEvent reverse(QEvent::MouseButtonPress, e->pos(), MidButton, e->state()); - QSlider::mousePressEvent(&reverse); + TQMouseEvent reverse(TQEvent::MouseButtonPress, e->pos(), MidButton, e->state()); + TQSlider::mousePressEvent(&reverse); emit sliderPressed(); } else if(e->button() == MidButton) { - QMouseEvent reverse(QEvent::MouseButtonPress, e->pos(), LeftButton, e->state()); - QSlider::mousePressEvent(&reverse); + TQMouseEvent reverse(TQEvent::MouseButtonPress, e->pos(), LeftButton, e->state()); + TQSlider::mousePressEvent(&reverse); } } }; @@ -63,23 +63,23 @@ protected: // VolumeSlider implementation //////////////////////////////////////////////////////////////////////////////// -VolumeSlider::VolumeSlider(Orientation o, QWidget *parent, const char *name) : - QSlider(o, parent, name) +VolumeSlider::VolumeSlider(Orientation o, TQWidget *parent, const char *name) : + TQSlider(o, parent, name) { - connect(this, SIGNAL(valueChanged(int)), this, SLOT(slotValueChanged(int))); + connect(this, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotValueChanged(int))); } -void VolumeSlider::wheelEvent(QWheelEvent *e) +void VolumeSlider::wheelEvent(TQWheelEvent *e) { if(orientation() == Horizontal) { - QWheelEvent transposed(e->pos(), -(e->delta()), e->state(), e->orientation()); - QSlider::wheelEvent(&transposed); + TQWheelEvent transposed(e->pos(), -(e->delta()), e->state(), e->orientation()); + TQSlider::wheelEvent(&transposed); } else - QSlider::wheelEvent(e); + TQSlider::wheelEvent(e); } -void VolumeSlider::focusInEvent(QFocusEvent *) +void VolumeSlider::focusInEvent(TQFocusEvent *) { clearFocus(); } @@ -108,7 +108,7 @@ void VolumeSlider::setOrientation(Orientation o) blockSignals(true); setValue(maxValue() - value()); blockSignals(false); - QSlider::setOrientation(o); + TQSlider::setOrientation(o); } void VolumeSlider::slotValueChanged(int value) @@ -126,7 +126,7 @@ void VolumeSlider::slotValueChanged(int value) const int SliderAction::minPosition = 0; const int SliderAction::maxPosition = 1000; -SliderAction::SliderAction(const QString &text, QObject *parent, const char *name) +SliderAction::SliderAction(const TQString &text, TQObject *parent, const char *name) : KAction(text, 0, parent, name), m_toolBar(0), m_layout(0), @@ -143,9 +143,9 @@ SliderAction::~SliderAction() } -int SliderAction::plug(QWidget *parent, int index) +int SliderAction::plug(TQWidget *parent, int index) { - QWidget *w = createWidget(parent); + TQWidget *w = createWidget(parent); if(!w) return -1; @@ -162,11 +162,11 @@ int SliderAction::plug(QWidget *parent, int index) addContainer(m_toolBar, id); - connect(m_toolBar, SIGNAL(destroyed()), this, SLOT(slotToolbarDestroyed())); - connect(m_toolBar, SIGNAL(orientationChanged(Orientation)), - this, SLOT(slotUpdateOrientation())); - connect(m_toolBar, SIGNAL(placeChanged(QDockWindow::Place)), - this, SLOT(slotUpdateOrientation())); + connect(m_toolBar, TQT_SIGNAL(destroyed()), this, TQT_SLOT(slotToolbarDestroyed())); + connect(m_toolBar, TQT_SIGNAL(orientationChanged(Orientation)), + this, TQT_SLOT(slotUpdateOrientation())); + connect(m_toolBar, TQT_SIGNAL(placeChanged(TQDockWindow::Place)), + this, TQT_SLOT(slotUpdateOrientation())); slotUpdateOrientation(); return (containerCount() - 1); @@ -178,7 +178,7 @@ int SliderAction::plug(QWidget *parent, int index) } -void SliderAction::unplug(QWidget *parent) +void SliderAction::unplug(TQWidget *parent) { if (parent->inherits("KToolBar")) { m_toolBar = static_cast(parent); @@ -207,12 +207,12 @@ void SliderAction::slotUpdateOrientation() if(m_toolBar->barPos() == KToolBar::Right || m_toolBar->barPos() == KToolBar::Left) { m_trackPositionSlider->setOrientation(Vertical); m_volumeSlider->setOrientation(Vertical); - m_layout->setDirection(QBoxLayout::TopToBottom); + m_layout->setDirection(TQBoxLayout::TopToBottom); } else { m_trackPositionSlider->setOrientation(Horizontal); m_volumeSlider->setOrientation(Horizontal); - m_layout->setDirection(QBoxLayout::LeftToRight); + m_layout->setDirection(TQBoxLayout::LeftToRight); } slotUpdateSize(); } @@ -221,10 +221,10 @@ void SliderAction::slotUpdateOrientation() // private members //////////////////////////////////////////////////////////////////////////////// -QWidget *SliderAction::createWidget(QWidget *parent) // virtual -- used by base class +TQWidget *SliderAction::createWidget(TQWidget *parent) // virtual -- used by base class { if(parent) { - QWidget *base = new QWidget(parent); + TQWidget *base = new TQWidget(parent); base->setBackgroundMode(parent->backgroundMode()); base->setName("kde toolbar widget"); @@ -240,38 +240,38 @@ QWidget *SliderAction::createWidget(QWidget *parent) // virtual -- used by base else orientation = Horizontal; - m_layout = new QBoxLayout(base, QBoxLayout::TopToBottom, 5, 5); + m_layout = new TQBoxLayout(base, TQBoxLayout::TopToBottom, 5, 5); - m_layout->addItem(new QSpacerItem(20, 1)); + m_layout->addItem(new TQSpacerItem(20, 1)); - QLabel *trackPositionLabel = new QLabel(base); + TQLabel *trackPositionLabel = new TQLabel(base); trackPositionLabel->setName("kde toolbar widget"); trackPositionLabel->setPixmap(SmallIcon("player_time")); - QToolTip::add(trackPositionLabel, i18n("Track position")); + TQToolTip::add(trackPositionLabel, i18n("Track position")); m_layout->addWidget(trackPositionLabel); m_trackPositionSlider = new TrackPositionSlider(base, "trackPositionSlider"); m_trackPositionSlider->setMaxValue(maxPosition); - QToolTip::add(m_trackPositionSlider, i18n("Track position")); + TQToolTip::add(m_trackPositionSlider, i18n("Track position")); m_layout->addWidget(m_trackPositionSlider); - connect(m_trackPositionSlider, SIGNAL(sliderPressed()), this, SLOT(slotSliderPressed())); - connect(m_trackPositionSlider, SIGNAL(sliderReleased()), this, SLOT(slotSliderReleased())); + connect(m_trackPositionSlider, TQT_SIGNAL(sliderPressed()), this, TQT_SLOT(slotSliderPressed())); + connect(m_trackPositionSlider, TQT_SIGNAL(sliderReleased()), this, TQT_SLOT(slotSliderReleased())); - m_layout->addItem(new QSpacerItem(10, 1)); + m_layout->addItem(new TQSpacerItem(10, 1)); - QLabel *volumeLabel = new QLabel(base); + TQLabel *volumeLabel = new TQLabel(base); volumeLabel->setName("kde toolbar widget"); volumeLabel->setPixmap(SmallIcon("player_volume")); - QToolTip::add(volumeLabel, i18n("Volume")); + TQToolTip::add(volumeLabel, i18n("Volume")); m_layout->addWidget(volumeLabel); m_volumeSlider = new VolumeSlider(orientation, base, "volumeSlider"); m_volumeSlider->setMaxValue(100); - QToolTip::add(m_volumeSlider, i18n("Volume")); + TQToolTip::add(m_volumeSlider, i18n("Volume")); m_layout->addWidget(m_volumeSlider); - connect(m_volumeSlider, SIGNAL(signalVolumeChanged(int)), SIGNAL(signalVolumeChanged(int))); - connect(m_volumeSlider, SIGNAL(sliderPressed()), this, SLOT(slotVolumeSliderPressed())); - connect(m_volumeSlider, SIGNAL(sliderReleased()), this, SLOT(slotVolumeSliderReleased())); + connect(m_volumeSlider, TQT_SIGNAL(signalVolumeChanged(int)), TQT_SIGNAL(signalVolumeChanged(int))); + connect(m_volumeSlider, TQT_SIGNAL(sliderPressed()), this, TQT_SLOT(slotVolumeSliderPressed())); + connect(m_volumeSlider, TQT_SIGNAL(sliderReleased()), this, TQT_SLOT(slotVolumeSliderReleased())); m_volumeSlider->setName("kde toolbar widget"); m_trackPositionSlider->setName("kde toolbar widget"); @@ -279,7 +279,7 @@ QWidget *SliderAction::createWidget(QWidget *parent) // virtual -- used by base m_layout->setStretchFactor(m_trackPositionSlider, 4); m_layout->setStretchFactor(m_volumeSlider, 1); - connect(parent, SIGNAL(modechange()), this, SLOT(slotUpdateSize())); + connect(parent, TQT_SIGNAL(modechange()), this, TQT_SLOT(slotUpdateSize())); return base; } -- cgit v1.2.1