summaryrefslogtreecommitdiffstats
path: root/kdeui/kurllabel.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-13 08:32:36 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-13 08:32:36 +0000
commitf7e71d47719ab6094cf4a9fafffa5ea351973522 (patch)
tree30834aa632d442019e14f88685001d94657d060b /kdeui/kurllabel.cpp
parentb31cfd9a1ee986fe2ae9a693f3afd7f171dd897c (diff)
downloadtdelibs-f7e71d47719ab6094cf4a9fafffa5ea351973522.tar.gz
tdelibs-f7e71d47719ab6094cf4a9fafffa5ea351973522.zip
Initial conversion for TQt for Qt4 3.4.0 TP2
This will also compile with TQt for Qt3, and should not cause any problems with dependent modules such as kdebase. If it does then it needs to be fixed! git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1214149 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdeui/kurllabel.cpp')
-rw-r--r--kdeui/kurllabel.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/kdeui/kurllabel.cpp b/kdeui/kurllabel.cpp
index d4d4ff7c0..884ff6a59 100644
--- a/kdeui/kurllabel.cpp
+++ b/kdeui/kurllabel.cpp
@@ -87,7 +87,7 @@ KURLLabel::KURLLabel (const TQString& url, const TQString& text,
setFont (font());
setUseCursor (true);
setLinkColor (d->LinkColor);
- setFocusPolicy( TQWidget::StrongFocus ); //better accessibility
+ setFocusPolicy( TQ_StrongFocus ); //better accessibility
setMouseTracking (true);
}
@@ -98,7 +98,7 @@ KURLLabel::KURLLabel (TQWidget* parent, const char* name)
setFont (font());
setUseCursor (true);
setLinkColor (d->LinkColor);
- setFocusPolicy( TQWidget::StrongFocus ); //better accessibility
+ setFocusPolicy( TQ_StrongFocus ); //better accessibility
setMouseTracking (true);
}
@@ -122,17 +122,17 @@ void KURLLabel::mouseReleaseEvent (TQMouseEvent* e)
switch (e->button())
{
- case LeftButton:
+ case Qt::LeftButton:
emit leftClickedURL ();
emit leftClickedURL (d->URL);
break;
- case MidButton:
+ case Qt::MidButton:
emit middleClickedURL ();
emit middleClickedURL (d->URL);
break;
- case RightButton:
+ case Qt::RightButton:
emit rightClickedURL ();
emit rightClickedURL (d->URL);
break;
@@ -308,7 +308,7 @@ void KURLLabel::enterEvent (TQEvent* e)
TQLabel::enterEvent (e);
TQRect r( activeRect() );
- if (!r.contains( static_cast<TQMouseEvent*>(e)->pos() ))
+ if (!r.contains( TQT_TQMOUSEEVENT(e)->pos() ))
return;
if (!d->AltPixmap.isNull() && pixmap())
@@ -353,10 +353,10 @@ bool KURLLabel::event (TQEvent *e)
{
if (e && e->type() == TQEvent::ParentPaletteChange)
{
- // use parentWidget() unless you are a toplevel widget, then try qAapp
- TQPalette p = parentWidget() ? parentWidget()->palette() : qApp->palette();
+ // use tqparentWidget() unless you are a toplevel widget, then try qAapp
+ TQPalette p = tqparentWidget() ? tqparentWidget()->palette() : tqApp->palette();
p.setBrush(TQColorGroup::Base, p.brush(TQPalette::Normal, TQColorGroup::Background));
- p.setColor(TQColorGroup::Foreground, palette().active().foreground());
+ p.setColor(TQColorGroup::Foreground, tqpalette().active().foreground());
setPalette(p);
d->LinkColor = KGlobalSettings::linkColor();
setLinkColor(d->LinkColor);
@@ -367,12 +367,12 @@ bool KURLLabel::event (TQEvent *e)
if (result && hasFocus()) {
TQPainter p(this);
TQRect r( activeRect() );
- style().drawPrimitive( TQStyle::PE_FocusRect, &p, r, colorGroup() );
+ tqstyle().tqdrawPrimitive( TQStyle::PE_FocusRect, &p, r, tqcolorGroup() );
}
return result;
}
else if (e->type() == TQEvent::KeyPress) {
- TQKeyEvent* ke = static_cast<TQKeyEvent*>(e);
+ TQKeyEvent* ke = TQT_TQKEYEVENT(e);
if (ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Return) {
setLinkColor (d->HighlightedLinkColor);
d->Timer->start (300);
@@ -384,12 +384,12 @@ bool KURLLabel::event (TQEvent *e)
}
else if (e->type() == TQEvent::MouseButtonPress) {
TQRect r( activeRect() );
- d->MousePressed = r.contains(static_cast<TQMouseEvent*>(e)->pos());
+ d->MousePressed = r.contains(TQT_TQMOUSEEVENT(e)->pos());
}
else if (e->type() == TQEvent::MouseMove) {
if (d->Cursor) {
TQRect r( activeRect() );
- bool inside = r.contains(static_cast<TQMouseEvent*>(e)->pos());
+ bool inside = r.contains(TQT_TQMOUSEEVENT(e)->pos());
if (d->WasInsideRect != inside) {
if (inside)
TQLabel::setCursor(*d->Cursor);
@@ -407,7 +407,7 @@ TQRect KURLLabel::activeRect() const
TQRect r( contentsRect() );
if (text().isEmpty() || (!d->MarginAltered && sizePolicy() == TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed)))
return r; //fixed size is sometimes used with pixmap
- int hAlign = TQApplication::horizontalAlignment( alignment() );
+ int hAlign = TQApplication::horizontalAlignment( tqalignment() );
int indentX = (hAlign && indent()>0) ? indent() : 0;
TQFontMetrics fm(font());
r.setWidth( QMIN(fm.width(text()), r.width()));
@@ -428,17 +428,17 @@ void KURLLabel::setMargin( int margin )
d->MarginAltered = true;
}
-void KURLLabel::setFocusPolicy( FocusPolicy policy )
+void KURLLabel::setFocusPolicy( TQ_FocusPolicy policy )
{
TQLabel::setFocusPolicy(policy);
if (!d->MarginAltered) {
- TQLabel::setMargin(policy == NoFocus ? 0 : 3); //better default : better look when focused
+ TQLabel::setMargin(policy == TQ_NoFocus ? 0 : 3); //better default : better look when focused
}
}
-void KURLLabel::setSizePolicy ( TQSizePolicy policy )
+void KURLLabel::tqsetSizePolicy ( TQSizePolicy policy )
{
- TQLabel::setSizePolicy(policy);
+ TQLabel::tqsetSizePolicy(policy);
if (!d->MarginAltered && policy.horData()==TQSizePolicy::Fixed && policy.verData()==TQSizePolicy::Fixed) {
TQLabel::setMargin(0); //better default : better look when fixed size
}