summaryrefslogtreecommitdiffstats
path: root/cervisia/tooltip.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-12 01:36:19 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-12 01:36:19 +0000
commit99a2774ca6f1cab334de5d43fe36fc44ae889a4c (patch)
treeeff34cf0762227f6baf2a93e8fef48d4bed2651c /cervisia/tooltip.cpp
parent1c104292188541106338d4940b0f04beeb4301a0 (diff)
downloadtdesdk-99a2774ca6f1cab334de5d43fe36fc44ae889a4c.tar.gz
tdesdk-99a2774ca6f1cab334de5d43fe36fc44ae889a4c.zip
TQt4 convert kdesdk
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1236185 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'cervisia/tooltip.cpp')
-rw-r--r--cervisia/tooltip.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/cervisia/tooltip.cpp b/cervisia/tooltip.cpp
index 728945ca..efc5108e 100644
--- a/cervisia/tooltip.cpp
+++ b/cervisia/tooltip.cpp
@@ -49,8 +49,8 @@ void ToolTip::maybeTip(const TQPoint& pos)
{
text = truncateLines(text,
font(),
- parentWidget()->mapToGlobal(pos),
- KGlobalSettings::desktopGeometry(parentWidget()));
+ tqparentWidget()->mapToGlobal(pos),
+ KGlobalSettings::desktopGeometry(tqparentWidget()));
tip(rect, text);
}
}
@@ -66,18 +66,18 @@ TQString truncateLines(const TQString& text,
const TQChar newLine('\n');
const int lineSpacing(fm.lineSpacing());
- const int numberOfLines(text.contains(newLine) + 1);
+ const int numberOfLines(text.tqcontains(newLine) + 1);
const int maxNumberOfLines(size.height() / lineSpacing);
if (numberOfLines <= maxNumberOfLines)
return text;
- const TQChar* unicode(text.unicode());
- for (int count(maxNumberOfLines); count; ++unicode)
- if (*unicode == newLine)
+ const TQChar* tqunicode(text.tqunicode());
+ for (int count(maxNumberOfLines); count; ++tqunicode)
+ if (*tqunicode == newLine)
--count;
- return text.left(unicode - text.unicode() - 1);
+ return text.left(tqunicode - text.tqunicode() - 1);
}
@@ -94,12 +94,12 @@ TQString truncateLines(const TQString& text,
- desktopGeometry.top() - 10);
// calculate the tooltip's size
- const TQSimpleRichText layoutedText(text, font);
+ const TQSimpleRichText tqlayoutedText(text, font);
// only if the tooltip's size is bigger in x- and y-direction the text must
// be truncated otherwise the tip is moved to a position where it fits
- return ((layoutedText.widthUsed() > maxWidth)
- && (layoutedText.height() > maxHeight))
+ return ((tqlayoutedText.widthUsed() > maxWidth)
+ && (tqlayoutedText.height() > maxHeight))
? truncateLines(text, TQFontMetrics(font), TQSize(maxWidth, maxHeight))
: text;
}