summaryrefslogtreecommitdiffstats
path: root/lib/kotext/KFontDialog_local.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kotext/KFontDialog_local.cpp')
-rw-r--r--lib/kotext/KFontDialog_local.cpp386
1 files changed, 193 insertions, 193 deletions
diff --git a/lib/kotext/KFontDialog_local.cpp b/lib/kotext/KFontDialog_local.cpp
index aa1df371..d979fc66 100644
--- a/lib/kotext/KFontDialog_local.cpp
+++ b/lib/kotext/KFontDialog_local.cpp
@@ -1,6 +1,6 @@
/*
- Requires the Qt widget libraries, available at no cost at
+ Requires the TQt widget libraries, available at no cost at
http://www.troll.no
Copyright (C) 1996 Bernd Johannes Wuebben <wuebben@kde.org>
@@ -28,18 +28,18 @@
#include <stdio.h>
#include <stdlib.h>
-#include <qcombobox.h>
-#include <qcheckbox.h>
-#include <qfile.h>
-#include <qfont.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qscrollbar.h>
-#include <qstringlist.h>
-#include <qfontdatabase.h>
-#include <qwhatsthis.h>
-#include <qtooltip.h>
+#include <tqcombobox.h>
+#include <tqcheckbox.h>
+#include <tqfile.h>
+#include <tqfont.h>
+#include <tqgroupbox.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqscrollbar.h>
+#include <tqstringlist.h>
+#include <tqfontdatabase.h>
+#include <tqwhatsthis.h>
+#include <tqtooltip.h>
#include <kapplication.h>
#include <kcharsets.h>
@@ -47,7 +47,7 @@
#include <kdialog.h>
#include <kglobal.h>
#include <kglobalsettings.h>
-#include <qlineedit.h>
+#include <tqlineedit.h>
#include <klistbox.h>
#include <klocale.h>
#include <kstandarddirs.h>
@@ -59,21 +59,21 @@
#include "KFontDialog_local.h"
#include "KFontDialog_local.moc"
-static int minimumListWidth( const QListBox *list )
+static int minimumListWidth( const TQListBox *list )
{
int w=0;
for( uint i=0; i<list->count(); i++ )
{
int itemWidth = list->item(i)->width(list);
- w = QMAX(w,itemWidth);
+ w = TQMAX(w,itemWidth);
}
if( w == 0 ) { w = 40; }
w += list->frameWidth() * 2;
- w += list->verticalScrollBar()->sizeHint().width();
+ w += list->verticalScrollBar()->tqsizeHint().width();
return w;
}
-static int minimumListHeight( const QListBox *list, int numVisibleEntry )
+static int minimumListHeight( const TQListBox *list, int numVisibleEntry )
{
int w = list->count() > 0 ? list->item(0)->height(list) :
list->fontMetrics().lineSpacing();
@@ -87,104 +87,104 @@ class KFontChooser_local::KFontChooser_localPrivate
{
public:
KFontChooser_localPrivate()
- { m_palette.setColor(QPalette::Active, QColorGroup::Text, Qt::black);
- m_palette.setColor(QPalette::Active, QColorGroup::Base, Qt::white); }
- QPalette m_palette;
+ { m_palette.setColor(TQPalette::Active, TQColorGroup::Text, TQt::black);
+ m_palette.setColor(TQPalette::Active, TQColorGroup::Base, TQt::white); }
+ TQPalette m_palette;
};
-KFontChooser_local::KFontChooser_local(QWidget *parent, const char *name,
- bool onlyFixed, const QStringList &fontList,
+KFontChooser_local::KFontChooser_local(TQWidget *tqparent, const char *name,
+ bool onlyFixed, const TQStringList &fontList,
bool makeFrame, int visibleListSize, bool diff,
- QButton::ToggleState *sizeIsRelativeState )
- : QWidget(parent, name), usingFixed(onlyFixed)
+ TQButton::ToggleState *sizeIsRelativeState )
+ : TQWidget(tqparent, name), usingFixed(onlyFixed)
{
charsetsCombo = 0;
- QString mainWhatsThisText =
+ TQString mainWhatsThisText =
i18n( "Here you can choose the font to be used." );
- QWhatsThis::add( this, mainWhatsThisText );
+ TQWhatsThis::add( this, mainWhatsThisText );
d = new KFontChooser_localPrivate;
- QVBoxLayout *topLayout = new QVBoxLayout( this, 0, KDialog::spacingHint() );
+ TQVBoxLayout *topLayout = new TQVBoxLayout( this, 0, KDialog::spacingHint() );
int checkBoxGap = KDialog::spacingHint() / 2;
- QWidget *page;
- QGridLayout *gridLayout;
+ TQWidget *page;
+ TQGridLayout *gridLayout;
int row = 0;
if( makeFrame )
{
- page = new QGroupBox( i18n("Requested Font"), this );
+ page = new TQGroupBox( i18n("Requested Font"), this );
topLayout->addWidget(page);
- gridLayout = new QGridLayout( page, 5, 3, KDialog::marginHint(), KDialog::spacingHint() );
+ gridLayout = new TQGridLayout( page, 5, 3, KDialog::marginHint(), KDialog::spacingHint() );
gridLayout->addRowSpacing( 0, fontMetrics().lineSpacing() );
row = 1;
}
else
{
- page = new QWidget( this );
+ page = new TQWidget( this );
topLayout->addWidget(page);
- gridLayout = new QGridLayout( page, 4, 3, 0, KDialog::spacingHint() );
+ gridLayout = new TQGridLayout( page, 4, 3, 0, KDialog::spacingHint() );
}
//
// first, create the labels across the top
//
- QHBoxLayout *familyLayout = new QHBoxLayout();
+ TQHBoxLayout *familyLayout = new TQHBoxLayout();
familyLayout->addSpacing( checkBoxGap );
if (diff) {
- familyCheckbox = new QCheckBox(i18n("Font"), page);
- connect(familyCheckbox, SIGNAL(toggled(bool)), SLOT(toggled_checkbox()));
- familyLayout->addWidget(familyCheckbox, 0, Qt::AlignLeft);
- QString familyCBToolTipText =
+ familyCheckbox = new TQCheckBox(i18n("Font"), page);
+ connect(familyCheckbox, TQT_SIGNAL(toggled(bool)), TQT_SLOT(toggled_checkbox()));
+ familyLayout->addWidget(familyCheckbox, 0, TQt::AlignLeft);
+ TQString familyCBToolTipText =
i18n("Change font family?");
- QString familyCBWhatsThisText =
+ TQString familyCBWhatsThisText =
i18n("Enable this checkbox to change the font family settings.");
- QWhatsThis::add( familyCheckbox, familyCBWhatsThisText );
- QToolTip::add( familyCheckbox, familyCBToolTipText );
+ TQWhatsThis::add( familyCheckbox, familyCBWhatsThisText );
+ TQToolTip::add( familyCheckbox, familyCBToolTipText );
familyLabel = 0;
} else {
familyCheckbox = 0;
- familyLabel = new QLabel( i18n("Font:"), page, "familyLabel" );
- familyLayout->addWidget(familyLabel, 1, Qt::AlignLeft);
+ familyLabel = new TQLabel( i18n("Font:"), page, "familyLabel" );
+ familyLayout->addWidget(familyLabel, 1, TQt::AlignLeft);
}
gridLayout->addLayout(familyLayout, row, 0 );
- QHBoxLayout *styleLayout = new QHBoxLayout();
+ TQHBoxLayout *styleLayout = new TQHBoxLayout();
if (diff) {
- styleCheckbox = new QCheckBox(i18n("Font style"), page);
- connect(styleCheckbox, SIGNAL(toggled(bool)), SLOT(toggled_checkbox()));
- styleLayout->addWidget(styleCheckbox, 0, Qt::AlignLeft);
- QString styleCBToolTipText =
+ styleCheckbox = new TQCheckBox(i18n("Font style"), page);
+ connect(styleCheckbox, TQT_SIGNAL(toggled(bool)), TQT_SLOT(toggled_checkbox()));
+ styleLayout->addWidget(styleCheckbox, 0, TQt::AlignLeft);
+ TQString styleCBToolTipText =
i18n("Change font style?");
- QString styleCBWhatsThisText =
+ TQString styleCBWhatsThisText =
i18n("Enable this checkbox to change the font style settings.");
- QWhatsThis::add( styleCheckbox, styleCBWhatsThisText );
- QToolTip::add( styleCheckbox, styleCBToolTipText );
+ TQWhatsThis::add( styleCheckbox, styleCBWhatsThisText );
+ TQToolTip::add( styleCheckbox, styleCBToolTipText );
styleLabel = 0;
} else {
styleCheckbox = 0;
- styleLabel = new QLabel( i18n("Font style:"), page, "styleLabel");
- styleLayout->addWidget(styleLabel, 1, Qt::AlignLeft);
+ styleLabel = new TQLabel( i18n("Font style:"), page, "styleLabel");
+ styleLayout->addWidget(styleLabel, 1, TQt::AlignLeft);
}
styleLayout->addSpacing( checkBoxGap );
gridLayout->addLayout(styleLayout, row, 1 );
- QHBoxLayout *sizeLayout = new QHBoxLayout();
+ TQHBoxLayout *sizeLayout = new TQHBoxLayout();
if (diff) {
- sizeCheckbox = new QCheckBox(i18n("Size"),page);
- connect(sizeCheckbox, SIGNAL(toggled(bool)), SLOT(toggled_checkbox()));
- sizeLayout->addWidget(sizeCheckbox, 0, Qt::AlignLeft);
- QString sizeCBToolTipText =
+ sizeCheckbox = new TQCheckBox(i18n("Size"),page);
+ connect(sizeCheckbox, TQT_SIGNAL(toggled(bool)), TQT_SLOT(toggled_checkbox()));
+ sizeLayout->addWidget(sizeCheckbox, 0, TQt::AlignLeft);
+ TQString sizeCBToolTipText =
i18n("Change font size?");
- QString sizeCBWhatsThisText =
+ TQString sizeCBWhatsThisText =
i18n("Enable this checkbox to change the font size settings.");
- QWhatsThis::add( sizeCheckbox, sizeCBWhatsThisText );
- QToolTip::add( sizeCheckbox, sizeCBToolTipText );
+ TQWhatsThis::add( sizeCheckbox, sizeCBWhatsThisText );
+ TQToolTip::add( sizeCheckbox, sizeCBToolTipText );
sizeLabel = 0;
} else {
sizeCheckbox = 0;
- sizeLabel = new QLabel( i18n("Size:"), page, "sizeLabel");
- sizeLayout->addWidget(sizeLabel, 1, Qt::AlignLeft);
+ sizeLabel = new TQLabel( i18n("Size:"), page, "sizeLabel");
+ sizeLayout->addWidget(sizeLabel, 1, TQt::AlignLeft);
}
sizeLayout->addSpacing( checkBoxGap );
sizeLayout->addSpacing( checkBoxGap ); // prevent label from eating border
@@ -198,12 +198,12 @@ KFontChooser_local::KFontChooser_local(QWidget *parent, const char *name,
familyListBox = new KListBox( page, "familyListBox");
familyListBox->setEnabled( !diff );
gridLayout->addWidget( familyListBox, row, 0 );
- QString fontFamilyWhatsThisText =
+ TQString fontFamilyWhatsThisText =
i18n("Here you can choose the font family to be used." );
- QWhatsThis::add( familyListBox, fontFamilyWhatsThisText );
- QWhatsThis::add(diff?(QWidget *) familyCheckbox:(QWidget *) familyLabel, fontFamilyWhatsThisText );
- connect(familyListBox, SIGNAL(highlighted(const QString &)),
- SLOT(family_chosen_slot(const QString &)));
+ TQWhatsThis::add( familyListBox, fontFamilyWhatsThisText );
+ TQWhatsThis::add(diff?(TQWidget *) familyCheckbox:(TQWidget *) familyLabel, fontFamilyWhatsThisText );
+ connect(familyListBox, TQT_SIGNAL(highlighted(const TQString &)),
+ TQT_SLOT(family_chosen_slot(const TQString &)));
if(!fontList.isEmpty())
{
familyListBox->insertStringList(fontList);
@@ -220,10 +220,10 @@ KFontChooser_local::KFontChooser_local(QWidget *parent, const char *name,
styleListBox = new KListBox( page, "styleListBox");
styleListBox->setEnabled( !diff );
gridLayout->addWidget(styleListBox, row, 1);
- QString fontStyleWhatsThisText =
+ TQString fontStyleWhatsThisText =
i18n("Here you can choose the font style to be used." );
- QWhatsThis::add( styleListBox, fontStyleWhatsThisText );
- QWhatsThis::add(diff?(QWidget *)styleCheckbox:(QWidget *)styleLabel, fontFamilyWhatsThisText );
+ TQWhatsThis::add( styleListBox, fontStyleWhatsThisText );
+ TQWhatsThis::add(diff?(TQWidget *)styleCheckbox:(TQWidget *)styleLabel, fontFamilyWhatsThisText );
styleListBox->insertItem(i18n("Regular"));
styleListBox->insertItem(i18n("Italic"));
styleListBox->insertItem(i18n("Bold"));
@@ -232,8 +232,8 @@ KFontChooser_local::KFontChooser_local(QWidget *parent, const char *name,
styleListBox->setMinimumHeight(
minimumListHeight( styleListBox, visibleListSize ) );
- connect(styleListBox, SIGNAL(highlighted(const QString &)),
- SLOT(style_chosen_slot(const QString &)));
+ connect(styleListBox, TQT_SIGNAL(highlighted(const TQString &)),
+ TQT_SLOT(style_chosen_slot(const TQString &)));
sizeListBox = new KListBox( page, "sizeListBox");
@@ -243,38 +243,38 @@ KFontChooser_local::KFontChooser_local(QWidget *parent, const char *name,
sizeListBox->setEnabled( !diff );
sizeOfFont->setEnabled( !diff );
if( sizeIsRelativeState ) {
- QString sizeIsRelativeCBText =
+ TQString sizeIsRelativeCBText =
i18n("Relative");
- QString sizeIsRelativeCBToolTipText =
+ TQString sizeIsRelativeCBToolTipText =
i18n("Font size<br><i>fixed</i> or <i>relative</i><br>to environment");
- QString sizeIsRelativeCBWhatsThisText =
+ TQString sizeIsRelativeCBWhatsThisText =
i18n("Here you can switch between fixed font size and font size "
"to be calculated dynamically and adjusted to changing "
"environment (e.g. widget dimensions, paper size)." );
- sizeIsRelativeCheckBox = new QCheckBox( sizeIsRelativeCBText,
+ sizeIsRelativeCheckBox = new TQCheckBox( sizeIsRelativeCBText,
page,
"sizeIsRelativeCheckBox" );
sizeIsRelativeCheckBox->setTristate( diff );
- QGridLayout *sizeLayout2 = new QGridLayout( 3,2, KDialog::spacingHint()/2, "sizeLayout2" );
+ TQGridLayout *sizeLayout2 = new TQGridLayout( 3,2, KDialog::spacingHint()/2, "sizeLayout2" );
gridLayout->addLayout(sizeLayout2, row, 2);
sizeLayout2->setColStretch( 1, 1 ); // to prevent text from eating the right border
sizeLayout2->addMultiCellWidget( sizeOfFont, 0, 0, 0, 1);
sizeLayout2->addMultiCellWidget(sizeListBox, 1,1, 0,1);
- sizeLayout2->addWidget(sizeIsRelativeCheckBox, 2, 0, Qt::AlignLeft);
- QWhatsThis::add( sizeIsRelativeCheckBox, sizeIsRelativeCBWhatsThisText );
- QToolTip::add( sizeIsRelativeCheckBox, sizeIsRelativeCBToolTipText );
+ sizeLayout2->addWidget(sizeIsRelativeCheckBox, 2, 0, TQt::AlignLeft);
+ TQWhatsThis::add( sizeIsRelativeCheckBox, sizeIsRelativeCBWhatsThisText );
+ TQToolTip::add( sizeIsRelativeCheckBox, sizeIsRelativeCBToolTipText );
}
else {
sizeIsRelativeCheckBox = 0L;
- QGridLayout *sizeLayout2 = new QGridLayout( 2,1, KDialog::spacingHint()/2, "sizeLayout2" );
+ TQGridLayout *sizeLayout2 = new TQGridLayout( 2,1, KDialog::spacingHint()/2, "sizeLayout2" );
gridLayout->addLayout(sizeLayout2, row, 2);
sizeLayout2->addWidget( sizeOfFont, 0, 0);
sizeLayout2->addMultiCellWidget(sizeListBox, 1,1, 0,0);
}
- QString fontSizeWhatsThisText =
+ TQString fontSizeWhatsThisText =
i18n("Here you can choose the font size to be used." );
- QWhatsThis::add( sizeListBox, fontSizeWhatsThisText );
- QWhatsThis::add( diff?(QWidget *)sizeCheckbox:(QWidget *)sizeLabel, fontSizeWhatsThisText );
+ TQWhatsThis::add( sizeListBox, fontSizeWhatsThisText );
+ TQWhatsThis::add( diff?(TQWidget *)sizeCheckbox:(TQWidget *)sizeLabel, fontSizeWhatsThisText );
fillSizeList();
sizeListBox->setMinimumWidth( minimumListWidth(sizeListBox) +
@@ -282,48 +282,48 @@ KFontChooser_local::KFontChooser_local(QWidget *parent, const char *name,
sizeListBox->setMinimumHeight(
minimumListHeight( sizeListBox, visibleListSize ) );
- connect( sizeOfFont, SIGNAL( valueChanged(int) ),
- SLOT(size_value_slot(int)));
+ connect( sizeOfFont, TQT_SIGNAL( valueChanged(int) ),
+ TQT_SLOT(size_value_slot(int)));
- connect( sizeListBox, SIGNAL(highlighted(const QString&)),
- SLOT(size_chosen_slot(const QString&)) );
- sizeListBox->setSelected(sizeListBox->findItem(QString::number(10)), true); // default to 10pt.
+ connect( sizeListBox, TQT_SIGNAL(highlighted(const TQString&)),
+ TQT_SLOT(size_chosen_slot(const TQString&)) );
+ sizeListBox->setSelected(sizeListBox->tqfindItem(TQString::number(10)), true); // default to 10pt.
row ++;
row ++;
- sampleEdit = new QLineEdit( page, "sampleEdit");
- QFont tmpFont( KGlobalSettings::generalFont().family(), 64, QFont::Black );
+ sampleEdit = new TQLineEdit( page, "sampleEdit");
+ TQFont tmpFont( KGlobalSettings::generalFont().family(), 64, TQFont::Black );
sampleEdit->setFont(tmpFont);
sampleEdit->setText(i18n("The Quick Brown Fox Jumps Over The Lazy Dog"));
sampleEdit->setMinimumHeight( sampleEdit->fontMetrics().lineSpacing() );
- sampleEdit->setAlignment(Qt::AlignCenter);
+ sampleEdit->tqsetAlignment(TQt::AlignCenter);
gridLayout->addMultiCellWidget(sampleEdit, 4, 4, 0, 2);
- QString sampleEditWhatsThisText =
+ TQString sampleEditWhatsThisText =
i18n("This sample text illustrates the current settings. "
"You may edit it to test special characters." );
- QWhatsThis::add( sampleEdit, sampleEditWhatsThisText );
- connect(this, SIGNAL(fontSelected(const QFont &)),
- SLOT(displaySample(const QFont &)));
+ TQWhatsThis::add( sampleEdit, sampleEditWhatsThisText );
+ connect(this, TQT_SIGNAL(fontSelected(const TQFont &)),
+ TQT_SLOT(displaySample(const TQFont &)));
- QVBoxLayout *vbox;
+ TQVBoxLayout *vbox;
if( makeFrame )
{
- page = new QGroupBox( i18n("Actual Font"), this );
+ page = new TQGroupBox( i18n("Actual Font"), this );
topLayout->addWidget(page);
- vbox = new QVBoxLayout( page, KDialog::spacingHint() );
+ vbox = new TQVBoxLayout( page, KDialog::spacingHint() );
vbox->addSpacing( fontMetrics().lineSpacing() );
}
else
{
- page = new QWidget( this );
+ page = new TQWidget( this );
topLayout->addWidget(page);
- vbox = new QVBoxLayout( page, 0, KDialog::spacingHint() );
- QLabel *label = new QLabel( i18n("Actual Font"), page );
+ vbox = new TQVBoxLayout( page, 0, KDialog::spacingHint() );
+ TQLabel *label = new TQLabel( i18n("Actual Font"), page );
vbox->addWidget( label );
}
- xlfdEdit = new QLineEdit( page, "xlfdEdit" );
+ xlfdEdit = new TQLineEdit( page, "xlfdEdit" );
vbox->addWidget( xlfdEdit );
// lets initialize the display if possible
@@ -333,8 +333,8 @@ KFontChooser_local::KFontChooser_local(QWidget *parent, const char *name,
setSizeIsRelative( *sizeIsRelativeState );
KConfig *config = KGlobal::config();
- KConfigGroupSaver saver(config, QString::fromLatin1("General"));
- showXLFDArea(config->readBoolEntry(QString::fromLatin1("fontSelectorShowXLFD"), false));
+ KConfigGroupSaver saver(config, TQString::tqfromLatin1("General"));
+ showXLFDArea(config->readBoolEntry(TQString::tqfromLatin1("fontSelectorShowXLFD"), false));
}
KFontChooser_local::~KFontChooser_local()
@@ -357,57 +357,57 @@ void KFontChooser_local::fillSizeList() {
};
for(int i = 0; c[i]; ++i)
{
- sizeListBox->insertItem(QString::number(c[i]));
+ sizeListBox->insertItem(TQString::number(c[i]));
}
}
-void KFontChooser_local::setColor( const QColor & col )
+void KFontChooser_local::setColor( const TQColor & col )
{
- d->m_palette.setColor( QPalette::Active, QColorGroup::Text, col );
- QPalette pal = sampleEdit->palette();
- pal.setColor( QPalette::Active, QColorGroup::Text, col );
+ d->m_palette.setColor( TQPalette::Active, TQColorGroup::Text, col );
+ TQPalette pal = sampleEdit->palette();
+ pal.setColor( TQPalette::Active, TQColorGroup::Text, col );
sampleEdit->setPalette( pal );
}
-QColor KFontChooser_local::color() const
+TQColor KFontChooser_local::color() const
{
- return d->m_palette.color( QPalette::Active, QColorGroup::Text );
+ return d->m_palette.color( TQPalette::Active, TQColorGroup::Text );
}
-void KFontChooser_local::setBackgroundColor( const QColor & col )
+void KFontChooser_local::setBackgroundColor( const TQColor & col )
{
- d->m_palette.setColor( QPalette::Active, QColorGroup::Base, col );
- QPalette pal = sampleEdit->palette();
- pal.setColor( QPalette::Active, QColorGroup::Base, col );
+ d->m_palette.setColor( TQPalette::Active, TQColorGroup::Base, col );
+ TQPalette pal = sampleEdit->palette();
+ pal.setColor( TQPalette::Active, TQColorGroup::Base, col );
sampleEdit->setPalette( pal );
}
-QColor KFontChooser_local::backgroundColor() const
+TQColor KFontChooser_local::backgroundColor() const
{
- return d->m_palette.color( QPalette::Active, QColorGroup::Base );
+ return d->m_palette.color( TQPalette::Active, TQColorGroup::Base );
}
-void KFontChooser_local::setSizeIsRelative( QButton::ToggleState relative )
+void KFontChooser_local::setSizeIsRelative( TQButton::ToggleState relative )
{
// check or uncheck or gray out the "relative" checkbox
if( sizeIsRelativeCheckBox ) {
- if( QButton::NoChange == relative )
+ if( TQButton::NoChange == relative )
sizeIsRelativeCheckBox->setNoChange();
else
- sizeIsRelativeCheckBox->setChecked( QButton::On == relative );
+ sizeIsRelativeCheckBox->setChecked( TQButton::On == relative );
}
}
-QButton::ToggleState KFontChooser_local::sizeIsRelative() const
+TQButton::ToggleState KFontChooser_local::sizeIsRelative() const
{
return sizeIsRelativeCheckBox
? sizeIsRelativeCheckBox->state()
- : QButton::NoChange;
+ : TQButton::NoChange;
}
-QSize KFontChooser_local::sizeHint( void ) const
+TQSize KFontChooser_local::tqsizeHint( void ) const
{
- return minimumSizeHint();
+ return tqminimumSizeHint();
}
@@ -428,12 +428,12 @@ void KFontChooser_local::enableColumn( int column, bool state )
}
-void KFontChooser_local::setFont( const QFont& aFont, bool onlyFixed )
+void KFontChooser_local::setFont( const TQFont& aFont, bool onlyFixed )
{
selFont = aFont;
selectedSize=aFont.pointSize();
if (selectedSize == -1)
- selectedSize = QFontInfo(aFont).pointSize();
+ selectedSize = TQFontInfo(aFont).pointSize();
if( onlyFixed != usingFixed)
{
@@ -463,28 +463,28 @@ void KFontChooser_local::toggled_checkbox()
sizeOfFont->setEnabled( sizeCheckbox->isChecked() );
}
-void KFontChooser_local::family_chosen_slot(const QString& family)
+void KFontChooser_local::family_chosen_slot(const TQString& family)
{
- QString currentFamily;
+ TQString currentFamily;
if (family.isEmpty())
currentFamily = familyListBox->currentText();
else
currentFamily = family;
- QFontDatabase dbase;
- QStringList styles = QStringList(dbase.styles(currentFamily));
+ TQFontDatabase dbase;
+ TQStringList styles = TQStringList(dbase.tqstyles(currentFamily));
styleListBox->clear();
currentStyles.clear();
- for ( QStringList::Iterator it = styles.begin(); it != styles.end(); ++it ) {
- QString style = *it;
- int pos = style.find("Plain");
- if(pos >=0) style = style.replace(pos,5,i18n("Regular"));
- pos = style.find("Normal");
- if(pos >=0) style = style.replace(pos,6,i18n("Regular"));
- pos = style.find("Oblique");
- if(pos >=0) style = style.replace(pos,7,i18n("Italic"));
- if(!styleListBox->findItem(style)) {
+ for ( TQStringList::Iterator it = styles.begin(); it != styles.end(); ++it ) {
+ TQString style = *it;
+ int pos = style.tqfind("Plain");
+ if(pos >=0) style = style.tqreplace(pos,5,i18n("Regular"));
+ pos = style.tqfind("Normal");
+ if(pos >=0) style = style.tqreplace(pos,6,i18n("Regular"));
+ pos = style.tqfind("Oblique");
+ if(pos >=0) style = style.tqreplace(pos,7,i18n("Italic"));
+ if(!styleListBox->tqfindItem(style)) {
styleListBox->insertItem(i18n(style.utf8()));
currentStyles.insert(i18n(style.utf8()), *it);
}
@@ -495,21 +495,21 @@ void KFontChooser_local::family_chosen_slot(const QString& family)
}
styleListBox->blockSignals(true);
- QListBoxItem *item = styleListBox->findItem(selectedStyle);
+ TQListBoxItem *item = styleListBox->tqfindItem(selectedStyle);
if (item)
- styleListBox->setSelected(styleListBox->findItem(selectedStyle), true);
+ styleListBox->setSelected(styleListBox->tqfindItem(selectedStyle), true);
else
styleListBox->setSelected(0, true);
styleListBox->blockSignals(false);
- style_chosen_slot(QString::null);
+ style_chosen_slot(TQString());
if (!family.isEmpty() )
selectedFamily = family;
}
-void KFontChooser_local::size_chosen_slot(const QString& size){
+void KFontChooser_local::size_chosen_slot(const TQString& size){
selectedSize=size.toInt();
sizeOfFont->setValue(selectedSize);
@@ -522,9 +522,9 @@ void KFontChooser_local::size_value_slot(int val) {
emit fontSelected(selFont);
}
-void KFontChooser_local::style_chosen_slot(const QString& style)
+void KFontChooser_local::style_chosen_slot(const TQString& style)
{
- QString currentStyle;
+ TQString currentStyle;
if (style.isEmpty())
currentStyle = styleListBox->currentText();
else
@@ -533,25 +533,25 @@ void KFontChooser_local::style_chosen_slot(const QString& style)
int diff=0; // the difference between the font size requested and what we can show.
sizeListBox->clear();
- QFontDatabase dbase;
+ TQFontDatabase dbase;
if(dbase.isSmoothlyScalable(familyListBox->currentText(), currentStyles[currentStyle])) { // is vector font
//sampleEdit->setPaletteBackgroundPixmap( VectorPixmap ); // TODO
fillSizeList();
} else { // is bitmap font.
//sampleEdit->setPaletteBackgroundPixmap( BitmapPixmap ); // TODO
- QValueList<int> sizes = dbase.smoothSizes(familyListBox->currentText(), currentStyles[currentStyle]);
+ TQValueList<int> sizes = dbase.tqsmoothSizes(familyListBox->currentText(), currentStyles[currentStyle]);
if(sizes.count() > 0) {
- QValueList<int>::iterator it;
+ TQValueList<int>::iterator it;
diff=1000;
for ( it = sizes.begin(); it != sizes.end(); ++it ) {
if(*it <= selectedSize || diff > *it - selectedSize) diff = selectedSize - *it;
- sizeListBox->insertItem(QString::number(*it));
+ sizeListBox->insertItem(TQString::number(*it));
}
} else // there are times QT does not provide the list..
fillSizeList();
}
sizeListBox->blockSignals(true);
- sizeListBox->setSelected(sizeListBox->findItem(QString::number(selectedSize)), true);
+ sizeListBox->setSelected(sizeListBox->tqfindItem(TQString::number(selectedSize)), true);
sizeListBox->blockSignals(false);
sizeListBox->ensureCurrentVisible();
@@ -562,14 +562,14 @@ void KFontChooser_local::style_chosen_slot(const QString& style)
selectedStyle = style;
}
-void KFontChooser_local::displaySample(const QFont& font)
+void KFontChooser_local::displaySample(const TQFont& font)
{
sampleEdit->setFont(font);
sampleEdit->setCursorPosition(0);
xlfdEdit->setText(font.rawName());
xlfdEdit->setCursorPosition(0);
- //QFontInfo a = QFontInfo(font);
+ //TQFontInfo a = TQFontInfo(font);
//kdDebug() << "font: " << a.family () << ", " << a.pointSize () << endl;
//kdDebug() << " (" << font.toString() << ")\n";
}
@@ -578,12 +578,12 @@ void KFontChooser_local::setupDisplay()
{
// Calling familyListBox->setCurrentItem() causes the value of selFont
// to change, so we save the family, style and size beforehand.
- QString family = selFont.family().lower();
+ TQString family = TQString(selFont.family()).lower();
int style = (selFont.bold() ? 2 : 0) + (selFont.italic() ? 1 : 0);
int size = selFont.pointSize();
if (size == -1)
- size = QFontInfo(selFont).pointSize();
- QString sizeStr = QString::number(size);
+ size = TQFontInfo(selFont).pointSize();
+ TQString sizeStr = TQString::number(size);
int numEntries, i;
@@ -598,9 +598,9 @@ void KFontChooser_local::setupDisplay()
// 1st Fallback
if ( (i == numEntries) )
{
- if (family.contains('['))
+ if (family.tqcontains('['))
{
- family = family.left(family.find('[')).stripWhiteSpace();
+ family = family.left(family.tqfind('[')).stripWhiteSpace();
for (i = 0; i < numEntries; i++) {
if (family == familyListBox->text(i).lower()) {
familyListBox->setCurrentItem(i);
@@ -613,7 +613,7 @@ void KFontChooser_local::setupDisplay()
// 2nd Fallback
if ( (i == numEntries) )
{
- QString fallback = family+" [";
+ TQString fallback = family+" [";
for (i = 0; i < numEntries; i++) {
if (familyListBox->text(i).lower().startsWith(fallback)) {
familyListBox->setCurrentItem(i);
@@ -651,16 +651,16 @@ void KFontChooser_local::setupDisplay()
}
-void KFontChooser_local::getFontList( QStringList &list, uint fontListCriteria)
+void KFontChooser_local::getFontList( TQStringList &list, uint fontListCriteria)
{
- QFontDatabase dbase;
- QStringList lstSys(dbase.families());
+ TQFontDatabase dbase;
+ TQStringList lstSys(dbase.tqfamilies());
// if we have criteria; then check fonts before adding
if (fontListCriteria)
{
- QStringList lstFonts;
- for (QStringList::Iterator it = lstSys.begin(); it != lstSys.end(); ++it)
+ TQStringList lstFonts;
+ for (TQStringList::Iterator it = lstSys.begin(); it != lstSys.end(); ++it)
{
if ((fontListCriteria & FixedWidthFonts) > 0 && !dbase.isFixedPitch(*it)) continue;
if (((fontListCriteria & (SmoothScalableFonts | ScalableFonts)) == ScalableFonts) &&
@@ -671,7 +671,7 @@ void KFontChooser_local::getFontList( QStringList &list, uint fontListCriteria)
if((fontListCriteria & FixedWidthFonts) > 0) {
// Fallback.. if there are no fixed fonts found, it's probably a
- // bug in the font server or Qt. In this case, just use 'fixed'
+ // bug in the font server or TQt. In this case, just use 'fixed'
if (lstFonts.count() == 0)
lstFonts.append("fixed");
}
@@ -684,7 +684,7 @@ void KFontChooser_local::getFontList( QStringList &list, uint fontListCriteria)
list = lstSys;
}
-void KFontChooser_local::addFont( QStringList &list, const char *xfont )
+void KFontChooser_local::addFont( TQStringList &list, const char *xfont )
{
const char *ptr = strchr( xfont, '-' );
if ( !ptr )
@@ -694,16 +694,16 @@ void KFontChooser_local::addFont( QStringList &list, const char *xfont )
if ( !ptr )
return;
- QString font = QString::fromLatin1(ptr + 1);
+ TQString font = TQString::tqfromLatin1(ptr + 1);
int pos;
- if ( ( pos = font.find( '-' ) ) > 0 ) {
+ if ( ( pos = font.tqfind( '-' ) ) > 0 ) {
font.truncate( pos );
- if ( font.find( QString::fromLatin1("open look"), 0, false ) >= 0 )
+ if ( font.tqfind( TQString::tqfromLatin1("open look"), 0, false ) >= 0 )
return;
- QStringList::Iterator it = list.begin();
+ TQStringList::Iterator it = list.begin();
for ( ; it != list.end(); ++it )
if ( *it == font )
@@ -714,13 +714,13 @@ void KFontChooser_local::addFont( QStringList &list, const char *xfont )
void KFontChooser_local::fillFamilyListBox(bool onlyFixedFonts)
{
- QStringList fontList;
+ TQStringList fontList;
getFontList(fontList, onlyFixedFonts?FixedWidthFonts:0);
familyListBox->clear();
familyListBox->insertStringList(fontList);
}
-void KFontChooser_local::setFamilyList( QStringList list )
+void KFontChooser_local::setFamilyList( TQStringList list )
{
familyListBox->blockSignals( true );
familyListBox->clear();
@@ -733,21 +733,21 @@ void KFontChooser_local::showXLFDArea(bool show)
{
if( show )
{
- xlfdEdit->parentWidget()->show();
+ xlfdEdit->tqparentWidget()->show();
}
else
{
- xlfdEdit->parentWidget()->hide();
+ xlfdEdit->tqparentWidget()->hide();
}
}
///////////////////////////////////////////////////////////////////////////////
-KFontDialog_local::KFontDialog_local( QWidget *parent, const char* name,
+KFontDialog_local::KFontDialog_local( TQWidget *tqparent, const char* name,
bool onlyFixed, bool modal,
- const QStringList &fontList, bool makeFrame, bool diff,
- QButton::ToggleState *sizeIsRelativeState )
- : KDialogBase( parent, name, modal, i18n("Select Font"), Ok|Cancel, Ok )
+ const TQStringList &fontList, bool makeFrame, bool diff,
+ TQButton::ToggleState *sizeIsRelativeState )
+ : KDialogBase( tqparent, name, modal, i18n("Select Font"), Ok|Cancel, Ok )
{
chooser = new KFontChooser_local( this, "fontChooser",
onlyFixed, fontList, makeFrame, 8,
@@ -756,11 +756,11 @@ KFontDialog_local::KFontDialog_local( QWidget *parent, const char* name,
}
-int KFontDialog_local::getFontDiff( QFont &theFont, int &diffFlags, bool onlyFixed,
- QWidget *parent, bool makeFrame,
- QButton::ToggleState *sizeIsRelativeState )
+int KFontDialog_local::getFontDiff( TQFont &theFont, int &diffFlags, bool onlyFixed,
+ TQWidget *tqparent, bool makeFrame,
+ TQButton::ToggleState *sizeIsRelativeState )
{
- KFontDialog_local dlg( parent, "Font Selector", onlyFixed, true, QStringList(),
+ KFontDialog_local dlg( tqparent, "Font Selector", onlyFixed, true, TQStringList(),
makeFrame, true, sizeIsRelativeState );
dlg.setFont( theFont, onlyFixed );
@@ -775,11 +775,11 @@ int KFontDialog_local::getFontDiff( QFont &theFont, int &diffFlags, bool onlyFix
return result;
}
-int KFontDialog_local::getFont( QFont &theFont, bool onlyFixed,
- QWidget *parent, bool makeFrame,
- QButton::ToggleState *sizeIsRelativeState )
+int KFontDialog_local::getFont( TQFont &theFont, bool onlyFixed,
+ TQWidget *tqparent, bool makeFrame,
+ TQButton::ToggleState *sizeIsRelativeState )
{
- KFontDialog_local dlg( parent, "Font Selector", onlyFixed, true, QStringList(),
+ KFontDialog_local dlg( tqparent, "Font Selector", onlyFixed, true, TQStringList(),
makeFrame, false, sizeIsRelativeState );
dlg.setFont( theFont, onlyFixed );
@@ -794,13 +794,13 @@ int KFontDialog_local::getFont( QFont &theFont, bool onlyFixed,
}
-int KFontDialog_local::getFontAndText( QFont &theFont, QString &theString,
- bool onlyFixed, QWidget *parent,
+int KFontDialog_local::getFontAndText( TQFont &theFont, TQString &theString,
+ bool onlyFixed, TQWidget *tqparent,
bool makeFrame,
- QButton::ToggleState *sizeIsRelativeState )
+ TQButton::ToggleState *sizeIsRelativeState )
{
- KFontDialog_local dlg( parent, "Font and Text Selector", onlyFixed, true,
- QStringList(), makeFrame, false, sizeIsRelativeState );
+ KFontDialog_local dlg( tqparent, "Font and Text Selector", onlyFixed, true,
+ TQStringList(), makeFrame, false, sizeIsRelativeState );
dlg.setFont( theFont, onlyFixed );
int result = dlg.exec();