diff options
Diffstat (limited to 'lib/koproperty/editors/fontedit.cpp')
-rw-r--r-- | lib/koproperty/editors/fontedit.cpp | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/lib/koproperty/editors/fontedit.cpp b/lib/koproperty/editors/fontedit.cpp index 9d0101fa..65ae80cf 100644 --- a/lib/koproperty/editors/fontedit.cpp +++ b/lib/koproperty/editors/fontedit.cpp @@ -22,14 +22,14 @@ #include "fontedit.h" #include "editoritem.h" -#include <qpushbutton.h> -#include <qpainter.h> -#include <qlayout.h> -#include <qvariant.h> -#include <qfont.h> -#include <qfontmetrics.h> -#include <qlabel.h> -#include <qtooltip.h> +#include <tqpushbutton.h> +#include <tqpainter.h> +#include <tqlayout.h> +#include <tqvariant.h> +#include <tqfont.h> +#include <tqfontmetrics.h> +#include <tqlabel.h> +#include <tqtooltip.h> #include <kdeversion.h> #include <kfontrequester.h> @@ -44,32 +44,32 @@ namespace KoProperty { class FontEditRequester : public KFontRequester { public: - FontEditRequester(QWidget* parent) - : KFontRequester(parent) + FontEditRequester(TQWidget* tqparent) + : KFontRequester(tqparent) { - label()->setPaletteBackgroundColor(palette().active().base()); + label()->setPaletteBackgroundColor(tqpalette().active().base()); label()->setMinimumWidth(0); - label()->setFrameShape(QFrame::Box); + label()->setFrameShape(TQFrame::Box); label()->setIndent(-1); #if KDE_VERSION >= KDE_MAKE_VERSION(3,4,0) - label()->setFocusPolicy(ClickFocus); + label()->setFocusPolicy(TQ_ClickFocus); KAcceleratorManager::setNoAccel(label()); #endif - layout()->remove(label()); - layout()->remove(button());//->reparent(this, 0, QPoint(0,0)); - delete layout(); + tqlayout()->remove(label()); + tqlayout()->remove(button());//->reparent(this, 0, TQPoint(0,0)); + delete tqlayout(); button()->setText(i18n("...")); - QToolTip::add(button(), i18n("Change font")); - button()->setFocusPolicy(NoFocus); - button()->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - QFontMetrics fm(button()->font()); + TQToolTip::add(button(), i18n("Change font")); + button()->setFocusPolicy(TQ_NoFocus); + button()->tqsetSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed); + TQFontMetrics fm(button()->font()); button()->setFixedWidth(fm.width(button()->text()+' ')); } - virtual void resizeEvent(QResizeEvent *e) + virtual void resizeEvent(TQResizeEvent *e) { KFontRequester::resizeEvent(e); label()->move(0,0); - label()->resize(e->size()-QSize(button()->width(),-1)); + label()->resize(e->size()-TQSize(button()->width(),-1)); button()->move(label()->width(),0); button()->setFixedSize(button()->width(), height()); } @@ -79,35 +79,35 @@ class FontEditRequester : public KFontRequester using namespace KoProperty; -FontEdit::FontEdit(Property *property, QWidget *parent, const char *name) - : Widget(property, parent, name) +FontEdit::FontEdit(Property *property, TQWidget *tqparent, const char *name) + : Widget(property, tqparent, name) { m_edit = new FontEditRequester(this); m_edit->setMinimumHeight(5); setEditor(m_edit); setFocusWidget(m_edit->label()); - connect(m_edit, SIGNAL(fontSelected(const QFont& )), this, SLOT(slotValueChanged(const QFont&))); + connect(m_edit, TQT_SIGNAL(fontSelected(const TQFont& )), this, TQT_SLOT(slotValueChanged(const TQFont&))); } FontEdit::~FontEdit() {} -QVariant +TQVariant FontEdit::value() const { return m_edit->font(); } -static QString sampleText(const QVariant &value) +static TQString sampleText(const TQVariant &value) { - QFontInfo fi(value.toFont()); - return fi.family() + (fi.bold() ? " " + i18n("Bold") : QString()) + - (fi.italic() ? " " + i18n("Italic") : QString::null) + - " " + QString::number(fi.pointSize()); + TQFontInfo fi(value.toFont()); + return fi.family() + (fi.bold() ? " " + i18n("Bold") : TQString()) + + (fi.italic() ? " " + i18n("Italic") : TQString()) + + " " + TQString::number(fi.pointSize()); } void -FontEdit::setValue(const QVariant &value, bool emitChange) +FontEdit::setValue(const TQVariant &value, bool emitChange) { m_edit->blockSignals(true); m_edit->setFont(value.toFont()); @@ -118,27 +118,27 @@ FontEdit::setValue(const QVariant &value, bool emitChange) } void -FontEdit::drawViewer(QPainter *p, const QColorGroup &, const QRect &r, const QVariant &value) +FontEdit::drawViewer(TQPainter *p, const TQColorGroup &, const TQRect &r, const TQVariant &value) { p->eraseRect(r); p->setFont(value.toFont()); - QRect r2(r); + TQRect r2(r); r2.setLeft(r2.left()+KPROPEDITOR_ITEM_MARGIN); r2.setBottom(r2.bottom()+1); - p->drawText(r2, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, sampleText(value)); + p->drawText(r2, TQt::AlignLeft | TQt::AlignVCenter | TQt::SingleLine, sampleText(value)); } void -FontEdit::slotValueChanged(const QFont &) +FontEdit::slotValueChanged(const TQFont &) { emit valueChanged(this); } bool -FontEdit::eventFilter(QObject* watched, QEvent* e) +FontEdit::eventFilter(TQObject* watched, TQEvent* e) { - if(e->type() == QEvent::KeyPress) { - QKeyEvent* ev = static_cast<QKeyEvent*>(e); + if(e->type() == TQEvent::KeyPress) { + TQKeyEvent* ev = TQT_TQKEYEVENT(e); if(ev->key() == Key_Space) { m_edit->button()->animateClick(); return true; |