summaryrefslogtreecommitdiffstats
path: root/kmix/mdwslider.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 /kmix/mdwslider.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 'kmix/mdwslider.cpp')
-rw-r--r--kmix/mdwslider.cpp136
1 files changed, 68 insertions, 68 deletions
diff --git a/kmix/mdwslider.cpp b/kmix/mdwslider.cpp
index 81d51668..3867af9f 100644
--- a/kmix/mdwslider.cpp
+++ b/kmix/mdwslider.cpp
@@ -58,15 +58,15 @@
MDWSlider::MDWSlider(Mixer *mixer, MixDevice* md,
bool showMuteLED, bool showRecordLED,
bool small, Qt::Orientation orientation,
- TQWidget* parent, ViewBase* mw, const char* name) :
- MixDeviceWidget(mixer,md,small,orientation,parent,mw,name),
+ TQWidget* tqparent, ViewBase* mw, const char* name) :
+ MixDeviceWidget(mixer,md,small,orientation,tqparent,mw,name),
m_linked(true), m_valueStyle( NNONE), m_iconLabel( 0 ), m_muteLED( 0 ), m_recordLED( 0 ), m_label( 0 ), _layout(0)
{
// create actions (on _mdwActions, see MixDeviceWidget)
- new KToggleAction( i18n("&Split Channels"), 0, this, TQT_SLOT(toggleStereoLinked()),
+ new KToggleAction( i18n("&Split Channels"), 0, TQT_TQOBJECT(this), TQT_SLOT(toggleStereoLinked()),
_mdwActions, "stereo" );
- new KToggleAction( i18n("&Hide"), 0, this, TQT_SLOT(setDisabled()), _mdwActions, "hide" );
+ new KToggleAction( i18n("&Hide"), 0, TQT_TQOBJECT(this), TQT_SLOT(setDisabled()), _mdwActions, "hide" );
KToggleAction *a = new KToggleAction(i18n("&Muted"), 0, 0, 0, _mdwActions, "mute" );
connect( a, TQT_SIGNAL(toggled(bool)), TQT_SLOT(toggleMuted()) );
@@ -76,17 +76,17 @@ MDWSlider::MDWSlider(Mixer *mixer, MixDevice* md,
connect( a, TQT_SIGNAL(toggled(bool)), TQT_SLOT( toggleRecsrc()) );
}
- new KAction( i18n("C&onfigure Global Shortcuts..."), 0, this, TQT_SLOT(defineKeys()), _mdwActions, "keys" );
+ new KAction( i18n("C&onfigure Global Shortcuts..."), 0, TQT_TQOBJECT(this), TQT_SLOT(defineKeys()), _mdwActions, "keys" );
// create widgets
createWidgets( showMuteLED, showRecordLED );
- m_keys->insert( "Increase volume", i18n( "Increase Volume of '%1'" ).arg(m_mixdevice->name().utf8().data()), TQString::null,
- KShortcut(), KShortcut(), this, TQT_SLOT( increaseVolume() ) );
- m_keys->insert( "Decrease volume", i18n( "Decrease Volume of '%1'" ).arg(m_mixdevice->name().utf8().data()), TQString::null,
- KShortcut(), KShortcut(), this, TQT_SLOT( decreaseVolume() ) );
- m_keys->insert( "Toggle mute", i18n( "Toggle Mute of '%1'" ).arg(m_mixdevice->name().utf8().data()), TQString::null,
- KShortcut(), KShortcut(), this, TQT_SLOT( toggleMuted() ) );
+ m_keys->insert( "Increase volume", i18n( "Increase Volume of '%1'" ).tqarg(m_mixdevice->name().utf8().data()), TQString(),
+ KShortcut(), KShortcut(), TQT_TQOBJECT(this), TQT_SLOT( increaseVolume() ) );
+ m_keys->insert( "Decrease volume", i18n( "Decrease Volume of '%1'" ).tqarg(m_mixdevice->name().utf8().data()), TQString(),
+ KShortcut(), KShortcut(), TQT_TQOBJECT(this), TQT_SLOT( decreaseVolume() ) );
+ m_keys->insert( "Toggle mute", i18n( "Toggle Mute of '%1'" ).tqarg(m_mixdevice->name().utf8().data()), TQString(),
+ KShortcut(), KShortcut(), TQT_TQOBJECT(this), TQT_SLOT( toggleMuted() ) );
installEventFilter( this ); // filter for popup
@@ -115,25 +115,25 @@ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED )
{
if ( _orientation == Qt::Vertical ) {
_layout = new TQVBoxLayout( this );
- _layout->setAlignment(Qt::AlignCenter);
+ _layout->tqsetAlignment(TQt::AlignCenter);
}
else {
_layout = new TQHBoxLayout( this );
- _layout->setAlignment(Qt::AlignCenter);
+ _layout->tqsetAlignment(TQt::AlignCenter);
}
// -- MAIN SLIDERS LAYOUT ---
TQBoxLayout *slidersLayout;
if ( _orientation == Qt::Vertical ) {
slidersLayout = new TQHBoxLayout( _layout );
- slidersLayout->setAlignment(Qt::AlignVCenter);
+ slidersLayout->tqsetAlignment(TQt::AlignVCenter);
}
else {
slidersLayout = new TQVBoxLayout( _layout );
- slidersLayout->setAlignment(Qt::AlignHCenter);
+ slidersLayout->tqsetAlignment(TQt::AlignHCenter);
}
- /* cesken: This is inconsistent. Why should vertical and horizontal layout differ?
+ /* cesken: This is inconsistent. Why should vertical and horizontal tqlayout differ?
* Also it eats too much space - especially when you don't show sliders at all.
* Even more on the vertical panel applet (see Bug #97667)
if ( _orientation == Qt::Horizontal )
@@ -145,11 +145,11 @@ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED )
TQBoxLayout *labelLayout;
if ( _orientation == Qt::Vertical ) {
labelLayout = new TQVBoxLayout( slidersLayout );
- labelLayout->setAlignment(Qt::AlignHCenter);
+ labelLayout->tqsetAlignment(TQt::AlignHCenter);
}
else {
labelLayout = new TQHBoxLayout( slidersLayout );
- labelLayout->setAlignment(Qt::AlignVCenter);
+ labelLayout->tqsetAlignment(TQt::AlignVCenter);
}
if ( _orientation == Qt::Vertical ) {
m_label = new VerticalText( this, m_mixdevice->name().utf8().data() );
@@ -183,22 +183,22 @@ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED )
TQBoxLayout *sliLayout;
if ( _orientation == Qt::Vertical ) {
sliLayout = new TQVBoxLayout( slidersLayout );
- sliLayout->setAlignment(Qt::AlignHCenter);
+ sliLayout->tqsetAlignment(TQt::AlignHCenter);
}
else {
sliLayout = new TQHBoxLayout( slidersLayout );
- sliLayout->setAlignment(Qt::AlignVCenter);
+ sliLayout->tqsetAlignment(TQt::AlignVCenter);
}
// --- ICON ----------------------------
TQBoxLayout *iconLayout;
if ( _orientation == Qt::Vertical ) {
iconLayout = new TQHBoxLayout( sliLayout );
- iconLayout->setAlignment(Qt::AlignVCenter);
+ iconLayout->tqsetAlignment(TQt::AlignVCenter);
}
else {
iconLayout = new TQVBoxLayout( sliLayout );
- iconLayout->setAlignment(Qt::AlignHCenter);
+ iconLayout->tqsetAlignment(TQt::AlignHCenter);
}
m_iconLabel = 0L;
@@ -213,36 +213,36 @@ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED )
// --- MUTE LED
if ( showMuteLED ) {
- TQBoxLayout *ledlayout;
+ TQBoxLayout *ledtqlayout;
if ( _orientation == Qt::Vertical ) {
- ledlayout = new TQHBoxLayout( sliLayout );
- ledlayout->setAlignment(Qt::AlignVCenter);
+ ledtqlayout = new TQHBoxLayout( sliLayout );
+ ledtqlayout->tqsetAlignment(TQt::AlignVCenter);
}
else {
- ledlayout = new TQVBoxLayout( sliLayout );
- ledlayout->setAlignment(Qt::AlignHCenter);
+ ledtqlayout = new TQVBoxLayout( sliLayout );
+ ledtqlayout->tqsetAlignment(TQt::AlignHCenter);
}
if( m_mixdevice->hasMute() )
{
- ledlayout->addStretch();
+ ledtqlayout->addStretch();
// create mute LED
- m_muteLED = new KLedButton( Qt::green, KLed::On, KLed::Sunken,
+ m_muteLED = new KLedButton( TQt::green, KLed::On, KLed::Sunken,
KLed::Circular, this, "MuteLED" );
m_muteLED->setFixedSize( TQSize(16, 16) );
m_muteLED->resize( TQSize(16, 16) );
- ledlayout->addWidget( m_muteLED );
+ ledtqlayout->addWidget( m_muteLED );
TQToolTip::add( m_muteLED, i18n( "Mute" ) );
connect( m_muteLED, TQT_SIGNAL(stateChanged(bool)), this, TQT_SLOT(toggleMuted()) );
m_muteLED->installEventFilter( this );
- ledlayout->addStretch();
+ ledtqlayout->addStretch();
} // has Mute LED
else {
// we don't have a MUTE LED. We create a dummy widget
- // !! possibly not neccesary any more (we are layouted)
+ // !! possibly not neccesary any more (we are tqlayouted)
TQWidget *qw = new TQWidget(this, "Spacer");
qw->setFixedSize( TQSize(16, 16) );
- ledlayout->addWidget(qw);
+ ledtqlayout->addWidget(qw);
qw->installEventFilter( this );
} // has no Mute LED
@@ -253,11 +253,11 @@ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED )
TQBoxLayout *volLayout;
if ( _orientation == Qt::Vertical ) {
volLayout = new TQHBoxLayout( sliLayout );
- volLayout->setAlignment(Qt::AlignVCenter);
+ volLayout->tqsetAlignment(TQt::AlignVCenter);
}
else {
volLayout = new TQVBoxLayout( sliLayout );
- volLayout->setAlignment(Qt::AlignHCenter);
+ volLayout->tqsetAlignment(TQt::AlignHCenter);
}
// Sliders and volume number indication
@@ -273,11 +273,11 @@ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED )
if ( _orientation == Qt::Vertical ) {
slinumLayout = new TQVBoxLayout( volLayout );
- slinumLayout->setAlignment(Qt::AlignHCenter);
+ slinumLayout->tqsetAlignment(TQt::AlignHCenter);
}
else {
slinumLayout = new TQHBoxLayout( volLayout );
- slinumLayout->setAlignment(Qt::AlignVCenter);
+ slinumLayout->tqsetAlignment(TQt::AlignVCenter);
}
// create labels to hold volume values (taken from qamix/kamix)
@@ -285,7 +285,7 @@ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED )
slinumLayout->addWidget( number );
number->setFrameStyle( TQFrame::Panel | TQFrame::Sunken );
number->setLineWidth( 2 );
- number->setMinimumWidth( number->sizeHint().width() );
+ number->setMinimumWidth( number->tqsizeHint().width() );
number->setPaletteBackgroundColor( TQColor(190, 250, 190) );
// don't show the value by default
number->hide();
@@ -302,7 +302,7 @@ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED )
slider = new TQSlider( 0, maxvol, maxvol/10,
maxvol - m_mixdevice->getVolume( chid ), _orientation,
this, m_mixdevice->name().ascii() );
- slider->setMinimumSize( slider->sizeHint() );
+ slider->setMinimumSize( slider->tqsizeHint() );
}
slider->setBackgroundOrigin(AncestorOrigin);
@@ -314,7 +314,7 @@ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED )
slider->hide();
number->hide();
}
- slinumLayout->addWidget( slider ); // add to layout
+ slinumLayout->addWidget( slider ); // add to tqlayout
m_sliders.append ( slider ); // add to list
_slidersChids.append(chid); // Remember slider-chid association
connect( slider, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(volumeChange(int)) );
@@ -327,44 +327,44 @@ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED )
sliLayout->addSpacing( 5 );
// --- LED LAYOUT TO CENTER ---
- TQBoxLayout *reclayout;
+ TQBoxLayout *rectqlayout;
if ( _orientation == Qt::Vertical ) {
- reclayout = new TQHBoxLayout( sliLayout );
- reclayout->setAlignment(Qt::AlignVCenter);
+ rectqlayout = new TQHBoxLayout( sliLayout );
+ rectqlayout->tqsetAlignment(TQt::AlignVCenter);
}
else {
- reclayout = new TQVBoxLayout( sliLayout );
- reclayout->setAlignment(Qt::AlignHCenter);
+ rectqlayout = new TQVBoxLayout( sliLayout );
+ rectqlayout->tqsetAlignment(TQt::AlignHCenter);
}
if( m_mixdevice->isRecordable() ) {
- reclayout->addStretch();
- m_recordLED = new KLedButton( Qt::red,
+ rectqlayout->addStretch();
+ m_recordLED = new KLedButton( TQt::red,
m_mixdevice->isRecSource()?KLed::On:KLed::Off,
KLed::Sunken, KLed::Circular, this, "RecordLED" );
m_recordLED->setFixedSize( TQSize(16, 16) );
- reclayout->addWidget( m_recordLED );
+ rectqlayout->addWidget( m_recordLED );
connect(m_recordLED, TQT_SIGNAL(stateChanged(bool)), this, TQT_SLOT(setRecsrc(bool)));
m_recordLED->installEventFilter( this );
TQToolTip::add( m_recordLED, i18n( "Record" ) );
- reclayout->addStretch();
+ rectqlayout->addStretch();
}
else
{
// we don't have a RECORD LED. We create a dummy widget
- // !! possibly not neccesary any more (we are layouted)
+ // !! possibly not neccesary any more (we are tqlayouted)
TQWidget *qw = new TQWidget(this, "Spacer");
qw->setFixedSize( TQSize(16, 16) );
- reclayout->addWidget(qw);
+ rectqlayout->addWidget(qw);
qw->installEventFilter( this );
} // has no Record LED
} // showRecordLED
- layout()->activate();
+ tqlayout()->activate();
}
-QPixmap
+TQPixmap
MDWSlider::icon( int icontype )
{
TQPixmap miniDevPM;
@@ -432,13 +432,13 @@ MDWSlider::setIcon( int icontype )
m_iconLabel->resize( 10, 10 );
} else
m_iconLabel->setPixmap( miniDevPM );
- m_iconLabel->setAlignment( Qt::AlignCenter );
+ m_iconLabel->tqsetAlignment( TQt::AlignCenter );
} else
{
kdError(67100) << "Pixmap missing." << endl;
}
- layout()->activate();
+ tqlayout()->activate();
}
bool
@@ -514,7 +514,7 @@ MDWSlider::setStereoLinked(bool value)
if( slider && static_cast<TQSlider *>(slider)->tickmarks() )
setTicks( true );
- layout()->activate();
+ tqlayout()->activate();
}
@@ -529,7 +529,7 @@ MDWSlider::setLabeled(bool value)
else
m_label->hide();
- layout()->activate();
+ tqlayout()->activate();
}
void
@@ -558,7 +558,7 @@ MDWSlider::setTicks( bool ticks )
}
}
- layout()->activate();
+ tqlayout()->activate();
}
void
@@ -579,7 +579,7 @@ MDWSlider::setValueStyle( ValueStyle valueStyle )
}
}
}
- layout()->activate();
+ tqlayout()->activate();
}
void
@@ -592,7 +592,7 @@ MDWSlider::setIcons(bool value)
else
m_iconLabel->hide();
- layout()->activate();
+ tqlayout()->activate();
}
} // if it has an icon
}
@@ -925,7 +925,7 @@ void MDWSlider::showContextMenu()
a = _mdwActions->action( "keys" );
if ( a && m_keys ) {
- KActionSeparator sep( this );
+ KActionSeparator sep( TQT_TQOBJECT(this) );
sep.plug( menu );
a->plug( menu );
}
@@ -934,24 +934,24 @@ void MDWSlider::showContextMenu()
menu->popup( pos );
}
-TQSize MDWSlider::sizeHint() const {
+TQSize MDWSlider::tqsizeHint() const {
if ( _layout != 0 ) {
- return _layout->sizeHint();
+ return _layout->tqsizeHint();
}
else {
- // layout not (yet) created
- return TQWidget::sizeHint();
+ // tqlayout not (yet) created
+ return TQWidget::tqsizeHint();
}
}
/**
- * An event filter for the various QWidgets. We watch for Mouse press Events, so
+ * An event filter for the various TQWidgets. We watch for Mouse press Events, so
* that we can popup the context menu.
*/
bool MDWSlider::eventFilter( TQObject* obj, TQEvent* e )
{
if (e->type() == TQEvent::MouseButtonPress) {
- TQMouseEvent *qme = static_cast<TQMouseEvent*>(e);
+ TQMouseEvent *qme = TQT_TQMOUSEEVENT(e);
if (qme->button() == Qt::RightButton) {
showContextMenu();
return true;
@@ -959,7 +959,7 @@ bool MDWSlider::eventFilter( TQObject* obj, TQEvent* e )
}
// Attention: We don't filter WheelEvents for KSmallSlider, because it handles WheelEvents itself
else if ( (e->type() == TQEvent::Wheel) && !obj->isA("KSmallSlider") ) {
- TQWheelEvent *qwe = static_cast<TQWheelEvent*>(e);
+ TQWheelEvent *qwe = TQT_TQWHEELEVENT(e);
if (qwe->delta() > 0) {
increaseVolume();
}