summaryrefslogtreecommitdiffstats
path: root/ksim/library/label.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-23 01:42:07 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-23 01:42:07 +0000
commita2277b6bc715464e83882b90c2a058139b8a6b54 (patch)
treeab09b14014f59b4d8e2ddd12226aa0b22e4dfc5d /ksim/library/label.cpp
parentd3f79e04b34bd1f70a458b81b28fc8799498c8dc (diff)
downloadtdeutils-a2277b6bc715464e83882b90c2a058139b8a6b54.tar.gz
tdeutils-a2277b6bc715464e83882b90c2a058139b8a6b54.zip
TQt4 port kdeutils
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeutils@1238125 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksim/library/label.cpp')
-rw-r--r--ksim/library/label.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/ksim/library/label.cpp b/ksim/library/label.cpp
index 400b1c5..06f525e 100644
--- a/ksim/library/label.cpp
+++ b/ksim/library/label.cpp
@@ -50,20 +50,20 @@ class KSim::Label::Private
bool showShadow;
};
-KSim::Label::Label(TQWidget *parent, const char *name, WFlags fl)
- : TQWidget(parent, name, fl)
+KSim::Label::Label(TQWidget *tqparent, const char *name, WFlags fl)
+ : TQWidget(tqparent, name, fl)
{
initWidget(KSim::Types::None);
}
-KSim::Label::Label(int type, TQWidget *parent, const char *name,
- WFlags fl) : TQWidget(parent, name, fl)
+KSim::Label::Label(int type, TQWidget *tqparent, const char *name,
+ WFlags fl) : TQWidget(tqparent, name, fl)
{
initWidget(type);
}
-KSim::Label::Label(int type, const TQString &text, TQWidget *parent,
- const char *name, WFlags fl) : TQWidget(parent, name, fl)
+KSim::Label::Label(int type, const TQString &text, TQWidget *tqparent,
+ const char *name, WFlags fl) : TQWidget(tqparent, name, fl)
{
initWidget(type);
setText(text);
@@ -79,7 +79,7 @@ const TQString &KSim::Label::text() const
return d->text;
}
-void KSim::Label::configureObject(bool repaintWidget)
+void KSim::Label::configureObject(bool tqrepaintWidget)
{
TQString image = themeLoader().current().meterPixmap(type(), false);
if (image.isEmpty())
@@ -88,10 +88,10 @@ void KSim::Label::configureObject(bool repaintWidget)
d->meterImage.load(image);
KSim::ThemeLoader::self().reColourImage(d->meterImage);
d->background = d->meterImage.smoothScale(size());
- TQSize oldSize = sizeHint();
+ TQSize oldSize = tqsizeHint();
setConfigValues();
- relayoutLabel(oldSize, repaintWidget);
+ retqlayoutLabel(oldSize, tqrepaintWidget);
}
void KSim::Label::setPixmap(const TQPixmap &pixmap)
@@ -99,10 +99,10 @@ void KSim::Label::setPixmap(const TQPixmap &pixmap)
if (pixmap.serialNumber() == d->sidePixmap.serialNumber())
return;
- TQSize oldSize = sizeHint();
+ TQSize oldSize = tqsizeHint();
d->sidePixmap = pixmap;
- relayoutLabel(oldSize);
+ retqlayoutLabel(oldSize);
}
const TQPixmap &KSim::Label::pixmap() const
@@ -110,7 +110,7 @@ const TQPixmap &KSim::Label::pixmap() const
return d->sidePixmap;
}
-TQSize KSim::Label::sizeHint() const
+TQSize KSim::Label::tqsizeHint() const
{
int width = fontMetrics().size(SingleLine, text()).width();
if (!pixmap().isNull())
@@ -123,25 +123,25 @@ TQSize KSim::Label::sizeHint() const
return TQSize(width, height);
}
-TQSize KSim::Label::minimumSizeHint() const
+TQSize KSim::Label::tqminimumSizeHint() const
{
- return sizeHint();
+ return tqsizeHint();
}
void KSim::Label::clear()
{
- setText(TQString::null);
+ setText(TQString());
}
void KSim::Label::setText(const TQString &text)
{
if (text == d->text)
- return; // If the text is the same, no need to repaint etc
+ return; // If the text is the same, no need to tqrepaint etc
- TQSize oldSize = sizeHint();
- // set the text of our widget and repaint
+ TQSize oldSize = tqsizeHint();
+ // set the text of our widget and tqrepaint
d->text = text;
- relayoutLabel(oldSize);
+ retqlayoutLabel(oldSize);
}
void KSim::Label::extraTypeCall()
@@ -183,13 +183,13 @@ const TQColor &KSim::Label::shadowColour() const
void KSim::Label::setConfigValues()
{
TQFont newFont = font();
- bool repaint = themeLoader().current().fontColours(this,
+ bool tqrepaint = themeLoader().current().fontColours(this,
newFont, d->mColour, d->sColour, d->showShadow);
if (font() != newFont)
setFont(newFont);
- if (repaint)
+ if (tqrepaint)
update();
}
@@ -232,7 +232,7 @@ void KSim::Label::drawText(TQPainter *painter, const TQRect &rect,
if (!pixmap().isNull())
location.setX(pixmap().width() + 5);
- style().drawItem(painter, location, AlignCenter, colorGroup(), true,
+ tqstyle().drawItem(painter, location, AlignCenter, tqcolorGroup(), true,
0, text, -1, &color);
}
@@ -242,8 +242,8 @@ void KSim::Label::drawPixmap(TQPainter *painter, const TQRect &rect,
TQRect location(rect);
location.setWidth(pixmap.width());
- style().drawItem(painter, location, AlignCenter, colorGroup(), true,
- pixmap.isNull() ? 0 : &pixmap, TQString::null);
+ tqstyle().drawItem(painter, location, AlignCenter, tqcolorGroup(), true,
+ pixmap.isNull() ? 0 : &pixmap, TQString());
}
void KSim::Label::setTextLocation(const TQRect &rect)
@@ -268,21 +268,21 @@ const TQRect &KSim::Label::shadowLocation() const
void KSim::Label::setThemePixmap(const TQString &image)
{
- TQSize oldSize = sizeHint();
+ TQSize oldSize = tqsizeHint();
d->meterImage.reset();
d->meterImage.load(image);
KSim::ThemeLoader::self().reColourImage(d->meterImage);
d->background = d->meterImage.smoothScale(size());
- relayoutLabel(oldSize);
+ retqlayoutLabel(oldSize);
}
-void KSim::Label::relayoutLabel(const TQSize &old, bool repaint)
+void KSim::Label::retqlayoutLabel(const TQSize &old, bool tqrepaint)
{
- if (sizeHint() != old) {
+ if (tqsizeHint() != old) {
updateGeometry();
}
- if (repaint)
+ if (tqrepaint)
update();
}
@@ -294,7 +294,7 @@ void KSim::Label::initWidget(int type)
// try to reduce flicker as much as possible
setBackgroundMode(NoBackground);
- setSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding,
+ tqsetSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding,
TQSizePolicy::Fixed));
configureObject();