summaryrefslogtreecommitdiffstats
path: root/juk/slideraction.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 06:00:15 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 06:00:15 +0000
commitb1057f437bf65300831a0ccb45b920787c6b318d (patch)
treef8a73db06ca1180d0da0ba6dfbe786197b4f4bc3 /juk/slideraction.cpp
parent4ddfca384ced9ad654213aef9dc2c3973720b980 (diff)
downloadtdemultimedia-b1057f437bf65300831a0ccb45b920787c6b318d.tar.gz
tdemultimedia-b1057f437bf65300831a0ccb45b920787c6b318d.zip
TQt4 port kdemultimedia
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1236079 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'juk/slideraction.cpp')
-rw-r--r--juk/slideraction.cpp74
1 files changed, 37 insertions, 37 deletions
diff --git a/juk/slideraction.cpp b/juk/slideraction.cpp
index 22d8446b..a001fc31 100644
--- a/juk/slideraction.cpp
+++ b/juk/slideraction.cpp
@@ -36,24 +36,24 @@
* to the left mouse button.
*/
-class TrackPositionSlider : public QSlider
+class TrackPositionSlider : public TQSlider
{
public:
- TrackPositionSlider(TQWidget *parent, const char *name) : TQSlider(parent, name)
+ TrackPositionSlider(TQWidget *tqparent, const char *name) : TQSlider(tqparent, name)
{
- setFocusPolicy(NoFocus);
+ setFocusPolicy(TQ_NoFocus);
}
protected:
virtual void mousePressEvent(TQMouseEvent *e)
{
- if(e->button() == LeftButton) {
- TQMouseEvent reverse(TQEvent::MouseButtonPress, e->pos(), MidButton, e->state());
+ if(e->button() == Qt::LeftButton) {
+ TQMouseEvent reverse(TQEvent::MouseButtonPress, e->pos(), Qt::MidButton, e->state());
TQSlider::mousePressEvent(&reverse);
emit sliderPressed();
}
- else if(e->button() == MidButton) {
- TQMouseEvent reverse(TQEvent::MouseButtonPress, e->pos(), LeftButton, e->state());
+ else if(e->button() == Qt::MidButton) {
+ TQMouseEvent reverse(TQEvent::MouseButtonPress, e->pos(), Qt::LeftButton, e->state());
TQSlider::mousePressEvent(&reverse);
}
}
@@ -63,15 +63,15 @@ protected:
// VolumeSlider implementation
////////////////////////////////////////////////////////////////////////////////
-VolumeSlider::VolumeSlider(Orientation o, TQWidget *parent, const char *name) :
- TQSlider(o, parent, name)
+VolumeSlider::VolumeSlider(Qt::Orientation o, TQWidget *tqparent, const char *name) :
+ TQSlider(o, tqparent, name)
{
connect(this, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotValueChanged(int)));
}
void VolumeSlider::wheelEvent(TQWheelEvent *e)
{
- if(orientation() == Horizontal) {
+ if(orientation() ==Qt::Horizontal) {
TQWheelEvent transposed(e->pos(), -(e->delta()), e->state(), e->orientation());
TQSlider::wheelEvent(&transposed);
}
@@ -86,7 +86,7 @@ void VolumeSlider::focusInEvent(TQFocusEvent *)
int VolumeSlider::volume() const
{
- if(orientation() == Horizontal)
+ if(orientation() ==Qt::Horizontal)
return value();
else
return maxValue() - value();
@@ -94,13 +94,13 @@ int VolumeSlider::volume() const
void VolumeSlider::setVolume(int value)
{
- if(orientation() == Horizontal)
+ if(orientation() ==Qt::Horizontal)
setValue(value);
else
setValue(maxValue() - value);
}
-void VolumeSlider::setOrientation(Orientation o)
+void VolumeSlider::setOrientation(Qt::Orientation o)
{
if(o == orientation())
return;
@@ -113,7 +113,7 @@ void VolumeSlider::setOrientation(Orientation o)
void VolumeSlider::slotValueChanged(int value)
{
- if(orientation() == Horizontal)
+ if(orientation() ==Qt::Horizontal)
emit signalVolumeChanged(value);
else
emit signalVolumeChanged(maxValue() - value);
@@ -126,8 +126,8 @@ void VolumeSlider::slotValueChanged(int value)
const int SliderAction::minPosition = 0;
const int SliderAction::maxPosition = 1000;
-SliderAction::SliderAction(const TQString &text, TQObject *parent, const char *name)
- : KAction(text, 0, parent, name),
+SliderAction::SliderAction(const TQString &text, TQObject *tqparent, const char *name)
+ : KAction(text, 0, tqparent, name),
m_toolBar(0),
m_layout(0),
m_trackPositionSlider(0),
@@ -143,9 +143,9 @@ SliderAction::~SliderAction()
}
-int SliderAction::plug(TQWidget *parent, int index)
+int SliderAction::plug(TQWidget *tqparent, int index)
{
- TQWidget *w = createWidget(parent);
+ TQWidget *w = createWidget(tqparent);
if(!w)
return -1;
@@ -153,8 +153,8 @@ int SliderAction::plug(TQWidget *parent, int index)
// the check for null makes sure that there is only one toolbar that this is
// "plugged" in to
- if(parent->inherits("KToolBar") && !m_toolBar) {
- m_toolBar = static_cast<KToolBar *>(parent);
+ if(tqparent->inherits("KToolBar") && !m_toolBar) {
+ m_toolBar = static_cast<KToolBar *>(tqparent);
int id = KAction::getToolButtonID();
@@ -163,7 +163,7 @@ int SliderAction::plug(TQWidget *parent, int index)
addContainer(m_toolBar, id);
connect(m_toolBar, TQT_SIGNAL(destroyed()), this, TQT_SLOT(slotToolbarDestroyed()));
- connect(m_toolBar, TQT_SIGNAL(orientationChanged(Orientation)),
+ connect(m_toolBar, TQT_SIGNAL(orientationChanged(Qt::Orientation)),
this, TQT_SLOT(slotUpdateOrientation()));
connect(m_toolBar, TQT_SIGNAL(placeChanged(TQDockWindow::Place)),
this, TQT_SLOT(slotUpdateOrientation()));
@@ -178,10 +178,10 @@ int SliderAction::plug(TQWidget *parent, int index)
}
-void SliderAction::unplug(TQWidget *parent)
+void SliderAction::unplug(TQWidget *tqparent)
{
- if (parent->inherits("KToolBar")) {
- m_toolBar = static_cast<KToolBar *>(parent);
+ if (tqparent->inherits("KToolBar")) {
+ m_toolBar = static_cast<KToolBar *>(tqparent);
int index = findContainer(m_toolBar);
if (index != -1) {
@@ -205,13 +205,13 @@ void SliderAction::slotUpdateOrientation()
return;
if(m_toolBar->barPos() == KToolBar::Right || m_toolBar->barPos() == KToolBar::Left) {
- m_trackPositionSlider->setOrientation(Vertical);
- m_volumeSlider->setOrientation(Vertical);
+ m_trackPositionSlider->setOrientation(Qt::Vertical);
+ m_volumeSlider->setOrientation(Qt::Vertical);
m_layout->setDirection(TQBoxLayout::TopToBottom);
}
else {
- m_trackPositionSlider->setOrientation(Horizontal);
- m_volumeSlider->setOrientation(Horizontal);
+ m_trackPositionSlider->setOrientation(Qt::Horizontal);
+ m_volumeSlider->setOrientation(Qt::Horizontal);
m_layout->setDirection(TQBoxLayout::LeftToRight);
}
slotUpdateSize();
@@ -221,24 +221,24 @@ void SliderAction::slotUpdateOrientation()
// private members
////////////////////////////////////////////////////////////////////////////////
-TQWidget *SliderAction::createWidget(TQWidget *parent) // virtual -- used by base class
+TQWidget *SliderAction::createWidget(TQWidget *tqparent) // virtual -- used by base class
{
- if(parent) {
- TQWidget *base = new TQWidget(parent);
- base->setBackgroundMode(parent->backgroundMode());
+ if(tqparent) {
+ TQWidget *base = new TQWidget(tqparent);
+ base->setBackgroundMode(tqparent->backgroundMode());
base->setName("kde toolbar widget");
- KToolBar *toolBar = dynamic_cast<KToolBar *>(parent);
+ KToolBar *toolBar = dynamic_cast<KToolBar *>(tqparent);
if(toolBar)
toolBar->setStretchableWidget(base);
- Orientation orientation;
+ Qt::Orientation orientation;
if(toolBar && toolBar->barPos() == KToolBar::Right || toolBar->barPos() == KToolBar::Left)
- orientation = Vertical;
+ orientation =Qt::Vertical;
else
- orientation = Horizontal;
+ orientation =Qt::Horizontal;
m_layout = new TQBoxLayout(base, TQBoxLayout::TopToBottom, 5, 5);
@@ -279,7 +279,7 @@ TQWidget *SliderAction::createWidget(TQWidget *parent) // virtual -- used by bas
m_layout->setStretchFactor(m_trackPositionSlider, 4);
m_layout->setStretchFactor(m_volumeSlider, 1);
- connect(parent, TQT_SIGNAL(modechange()), this, TQT_SLOT(slotUpdateSize()));
+ connect(tqparent, TQT_SIGNAL(modechange()), this, TQT_SLOT(slotUpdateSize()));
return base;
}