summaryrefslogtreecommitdiffstats
path: root/src/gui/editors/notation/FontViewFrame.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-06 20:59:29 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-06 20:59:29 +0000
commit11f31c37e5fa4889d9989f10272f44845449cb7b (patch)
tree4383da04a76c497950d957fc6120b0fd0d9082c2 /src/gui/editors/notation/FontViewFrame.cpp
parent832eb69d571e8e518db45d0c0e6fbc0f00690209 (diff)
downloadrosegarden-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/FontViewFrame.cpp')
-rw-r--r--src/gui/editors/notation/FontViewFrame.cpp64
1 files changed, 32 insertions, 32 deletions
diff --git a/src/gui/editors/notation/FontViewFrame.cpp b/src/gui/editors/notation/FontViewFrame.cpp
index ab0498f..d2a668f 100644
--- a/src/gui/editors/notation/FontViewFrame.cpp
+++ b/src/gui/editors/notation/FontViewFrame.cpp
@@ -28,12 +28,12 @@
#include <klocale.h>
#include <kmessagebox.h>
-#include <qfontmetrics.h>
-#include <qframe.h>
-#include <qsize.h>
-#include <qstring.h>
-#include <qwidget.h>
-#include <qpainter.h>
+#include <tqfontmetrics.h>
+#include <tqframe.h>
+#include <tqsize.h>
+#include <tqstring.h>
+#include <tqwidget.h>
+#include <tqpainter.h>
#ifdef HAVE_XFT
#include <ft2build.h>
@@ -46,8 +46,8 @@
namespace Rosegarden
{
-FontViewFrame::FontViewFrame( int pixelSize, QWidget* parent, const char* name ) :
- QFrame(parent, name),
+FontViewFrame::FontViewFrame( int pixelSize, TQWidget* parent, const char* name ) :
+ TQFrame(parent, name),
m_fontSize(pixelSize),
m_tableFont(0)
{
@@ -63,7 +63,7 @@ FontViewFrame::~FontViewFrame()
}
void
-FontViewFrame::setFont(QString font)
+FontViewFrame::setFont(TQString font)
{
m_fontName = font;
loadFont();
@@ -104,9 +104,9 @@ FontViewFrame::loadFont()
FcChar8 *matchFamily;
FcPatternGetString(match, FC_FAMILY, 0, &matchFamily);
- if (QString((const char *)matchFamily).lower() != m_fontName.lower()) {
+ if (TQString((const char *)matchFamily).lower() != m_fontName.lower()) {
KMessageBox::sorry(this, i18n("Warning: No good match for font name %1 (best is %2)").
- arg(m_fontName).arg(QString((const char *)matchFamily)));
+ arg(m_fontName).arg(TQString((const char *)matchFamily)));
m_fontName = (const char *)matchFamily;
}
@@ -114,7 +114,7 @@ FontViewFrame::loadFont()
if (!m_tableFont) {
KMessageBox::error(this, i18n("Error: Unable to open best-match font %1").
- arg(QString((const char *)matchFamily)));
+ arg(TQString((const char *)matchFamily)));
}
#endif
}
@@ -125,46 +125,46 @@ void FontViewFrame::setGlyphs(bool glyphs)
update();
}
-QSize FontViewFrame::sizeHint() const
+TQSize FontViewFrame::sizeHint() const
{
- return QSize(16 * m_fontSize * 3 / 2 + margin() + 2 * frameWidth(),
+ return TQSize(16 * m_fontSize * 3 / 2 + margin() + 2 * frameWidth(),
16 * m_fontSize * 3 / 2 + margin() + 2 * frameWidth());
}
-QSize FontViewFrame::cellSize() const
+TQSize FontViewFrame::cellSize() const
{
- QFontMetrics fm = fontMetrics();
- return QSize( fm.maxWidth(), fm.lineSpacing() + 1 );
+ TQFontMetrics fm = fontMetrics();
+ return TQSize( fm.maxWidth(), fm.lineSpacing() + 1 );
}
-void FontViewFrame::paintEvent( QPaintEvent* e )
+void FontViewFrame::paintEvent( TQPaintEvent* e )
{
#ifdef HAVE_XFT
if (!m_tableFont)
return ;
- QFrame::paintEvent(e);
- QPainter p(this);
+ TQFrame::paintEvent(e);
+ TQPainter p(this);
int ll = 25;
int ml = frameWidth() + margin() + ll + 1;
int mt = frameWidth() + margin();
- QSize cell((width() - 16 - ml) / 17, (height() - 16 - mt) / 17);
+ TQSize cell((width() - 16 - ml) / 17, (height() - 16 - mt) / 17);
if ( !cell.width() || !cell.height() )
return ;
- QColor body(255, 255, 192);
- QColor negative(255, 192, 192);
- QColor positive(192, 192, 255);
- QColor rnegative(255, 128, 128);
- QColor rpositive(128, 128, 255);
+ TQColor body(255, 255, 192);
+ TQColor negative(255, 192, 192);
+ TQColor positive(192, 192, 255);
+ TQColor rnegative(255, 128, 128);
+ TQColor rpositive(128, 128, 255);
Drawable drawable = (Drawable)handle();
XftDraw *draw = XftDrawCreate(x11AppDisplay(), drawable,
(Visual *)x11Visual(), x11Colormap());
- QColor pen(Qt::black);
+ TQColor pen(Qt::black);
XftColor col;
col.color.red = pen.red () | pen.red() << 8;
col.color.green = pen.green () | pen.green() << 8;
@@ -185,18 +185,18 @@ void FontViewFrame::paintEvent( QPaintEvent* e )
if (j == 0)
continue;
p.setFont(kapp->font());
- QFontMetrics afm(kapp->font());
- QString s = QString("%1").arg(m_row * 256 + (j - 1) * 16);
+ TQFontMetrics afm(kapp->font());
+ TQString s = TQString("%1").arg(m_row * 256 + (j - 1) * 16);
p.drawText(x - afm.width(s), y, s);
- p.setPen(QColor(190, 190, 255));
+ p.setPen(TQColor(190, 190, 255));
p.drawLine(0, y, width(), y);
p.setPen(Qt::black);
continue;
} else if (j == 0) {
p.setFont(kapp->font());
- QString s = QString("%1").arg(i - 1);
+ TQString s = TQString("%1").arg(i - 1);
p.drawText(x, y, s);
- p.setPen(QColor(190, 190, 255));
+ p.setPen(TQColor(190, 190, 255));
p.drawLine(x, 0, x, height());
p.setPen(Qt::black);
continue;