diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-06 20:59:29 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-06 20:59:29 +0000 |
commit | 11f31c37e5fa4889d9989f10272f44845449cb7b (patch) | |
tree | 4383da04a76c497950d957fc6120b0fd0d9082c2 /src/gui/editors/notation/SystemFont.cpp | |
parent | 832eb69d571e8e518db45d0c0e6fbc0f00690209 (diff) | |
download | rosegarden-11f31c37e5fa4889d9989f10272f44845449cb7b.tar.gz rosegarden-11f31c37e5fa4889d9989f10272f44845449cb7b.zip |
Initial TQt conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/rosegarden@1172292 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/gui/editors/notation/SystemFont.cpp')
-rw-r--r-- | src/gui/editors/notation/SystemFont.cpp | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/src/gui/editors/notation/SystemFont.cpp b/src/gui/editors/notation/SystemFont.cpp index 71f0ce7..62b4280 100644 --- a/src/gui/editors/notation/SystemFont.cpp +++ b/src/gui/editors/notation/SystemFont.cpp @@ -22,6 +22,7 @@ COPYING included with this distribution for more information. */ +#include <tqevent.h> #include "SystemFont.h" #include "SystemFontQt.h" @@ -31,10 +32,10 @@ #include <kstddirs.h> #include "NoteFontMap.h" -#include <qfont.h> -#include <qfontinfo.h> -#include <qpixmap.h> -#include <qstring.h> +#include <tqfont.h> +#include <tqfontinfo.h> +#include <tqpixmap.h> +#include <tqstring.h> namespace Rosegarden @@ -43,13 +44,13 @@ namespace Rosegarden SystemFont * SystemFont::loadSystemFont(const SystemFontSpec &spec) { - QString name = spec.first; + TQString name = spec.first; int size = spec.second; NOTATION_DEBUG << "SystemFont::loadSystemFont: name is " << name << ", size " << size << endl; if (name == "DEFAULT") { - QFont font; + TQFont font; font.setPixelSize(size); return new SystemFontQt(font); } @@ -61,7 +62,7 @@ SystemFont::loadSystemFont(const SystemFontSpec &spec) FcChar8 *matchFamily; XftFont *xfont = 0; - Display *dpy = QPaintDevice::x11AppDisplay(); + Display *dpy = TQPaintDevice::x11AppDisplay(); static bool haveFcDirectory = false; if (!dpy) { @@ -70,7 +71,7 @@ SystemFont::loadSystemFont(const SystemFontSpec &spec) } if (!haveFcDirectory) { - QString fontDir = KGlobal::dirs()->findResource("appdata", "fonts/"); + TQString fontDir = KGlobal::dirs()->findResource("appdata", "fonts/"); if (!FcConfigAppFontAddDir(FcConfigGetCurrent(), (const FcChar8 *)fontDir.latin1())) { NOTATION_DEBUG << "SystemFont::loadSystemFont[Xft]: Failed to add font directory " << fontDir << " to fontconfig, continuing without it" << endl; @@ -90,7 +91,7 @@ SystemFont::loadSystemFont(const SystemFontSpec &spec) if (!match || result != FcResultMatch) { NOTATION_DEBUG << "SystemFont::loadSystemFont[Xft]: No match for font " << name << " (result is " << result - << "), falling back on QFont" << endl; + << "), falling back on TQFont" << endl; if (match) FcPatternDestroy(match); goto qfont; @@ -100,8 +101,8 @@ SystemFont::loadSystemFont(const SystemFontSpec &spec) NOTATION_DEBUG << "SystemFont::loadSystemFont[Xft]: match family is " << (char *)matchFamily << endl; - if (QString((char *)matchFamily).lower() != name.lower()) { - NOTATION_DEBUG << "SystemFont::loadSystemFont[Xft]: Wrong family returned, falling back on QFont" << endl; + if (TQString((char *)matchFamily).lower() != name.lower()) { + NOTATION_DEBUG << "SystemFont::loadSystemFont[Xft]: Wrong family returned, falling back on TQFont" << endl; FcPatternDestroy(match); goto qfont; } @@ -110,7 +111,7 @@ SystemFont::loadSystemFont(const SystemFontSpec &spec) if (!xfont) { FcPatternDestroy(match); NOTATION_DEBUG << "SystemFont::loadSystemFont[Xft]: Unable to load font " - << name << " via Xft, falling back on QFont" << endl; + << name << " via Xft, falling back on TQFont" << endl; goto qfont; } @@ -124,10 +125,10 @@ qfont: #endif - QFont qfont(name, size, QFont::Normal); + TQFont qfont(name, size, TQFont::Normal); qfont.setPixelSize(size); - QFontInfo info(qfont); + TQFontInfo info(qfont); NOTATION_DEBUG << "SystemFont::loadSystemFont[Qt]: have family " << info.family() << " (exactMatch " << info.exactMatch() << ")" << endl; @@ -135,7 +136,7 @@ qfont: // The Qt documentation says: // - // bool QFontInfo::exactMatch() const + // bool TQFontInfo::exactMatch() const // Returns TRUE if the matched window system font is exactly the // same as the one specified by the font; otherwise returns FALSE. // @@ -146,7 +147,7 @@ qfont: // "Fughetta [macromedia]", and exactMatch returns false. Just as // useless, but in a different way. - QString family = info.family().lower(); + TQString family = info.family().lower(); if (family == name.lower()) return new SystemFontQt(qfont); |