summaryrefslogtreecommitdiffstats
path: root/kdeui/kfontdialog.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:46:43 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:46:43 +0000
commitffe8a83e053396df448e9413828527613ca3bd46 (patch)
treea73d4169e02df4a50f9a12cb165fcd0ab5bac7c6 /kdeui/kfontdialog.cpp
parent682bf3bfdcbcbb1fca85e8a36ed03e062e0555d5 (diff)
downloadtdelibs-ffe8a83e053396df448e9413828527613ca3bd46.tar.gz
tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1157647 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdeui/kfontdialog.cpp')
-rw-r--r--kdeui/kfontdialog.cpp326
1 files changed, 163 insertions, 163 deletions
diff --git a/kdeui/kfontdialog.cpp b/kdeui/kfontdialog.cpp
index 64de6e4c6..4044c7b68 100644
--- a/kdeui/kfontdialog.cpp
+++ b/kdeui/kfontdialog.cpp
@@ -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>
@@ -56,7 +56,7 @@
#include "kfontdialog.moc"
-static int minimumListWidth( const QListBox *list )
+static int minimumListWidth( const TQListBox *list )
{
int w=0;
for( uint i=0; i<list->count(); i++ )
@@ -70,7 +70,7 @@ static int minimumListWidth( const QListBox *list )
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();
@@ -84,103 +84,103 @@ class KFontChooser::KFontChooserPrivate
{
public:
KFontChooserPrivate()
- { 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, Qt::black);
+ m_palette.setColor(TQPalette::Active, TQColorGroup::Base, Qt::white); }
+ TQPalette m_palette;
};
-KFontChooser::KFontChooser(QWidget *parent, const char *name,
- bool onlyFixed, const QStringList &fontList,
+KFontChooser::KFontChooser(TQWidget *parent, 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(parent, 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 KFontChooserPrivate;
- 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()));
+ familyCheckbox = new TQCheckBox(i18n("Font"), page);
+ connect(familyCheckbox, TQT_SIGNAL(toggled(bool)), TQT_SLOT(toggled_checkbox()));
familyLayout->addWidget(familyCheckbox, 0, Qt::AlignLeft);
- QString familyCBToolTipText =
+ 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" );
+ familyLabel = new TQLabel( i18n("Font:"), page, "familyLabel" );
familyLayout->addWidget(familyLabel, 1, Qt::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()));
+ styleCheckbox = new TQCheckBox(i18n("Font style"), page);
+ connect(styleCheckbox, TQT_SIGNAL(toggled(bool)), TQT_SLOT(toggled_checkbox()));
styleLayout->addWidget(styleCheckbox, 0, Qt::AlignLeft);
- QString styleCBToolTipText =
+ 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");
+ styleLabel = new TQLabel( i18n("Font style:"), page, "styleLabel");
styleLayout->addWidget(styleLabel, 1, Qt::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()));
+ sizeCheckbox = new TQCheckBox(i18n("Size"),page);
+ connect(sizeCheckbox, TQT_SIGNAL(toggled(bool)), TQT_SLOT(toggled_checkbox()));
sizeLayout->addWidget(sizeCheckbox, 0, Qt::AlignLeft);
- QString sizeCBToolTipText =
+ 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");
+ sizeLabel = new TQLabel( i18n("Size:"), page, "sizeLabel");
sizeLayout->addWidget(sizeLabel, 1, Qt::AlignLeft);
}
sizeLayout->addSpacing( checkBoxGap );
@@ -195,12 +195,12 @@ KFontChooser::KFontChooser(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);
@@ -217,10 +217,10 @@ KFontChooser::KFontChooser(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"));
@@ -229,8 +229,8 @@ KFontChooser::KFontChooser(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");
@@ -240,38 +240,38 @@ KFontChooser::KFontChooser(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 );
+ 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) +
@@ -279,49 +279,49 @@ KFontChooser::KFontChooser(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->findItem(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);
//i18n: This is a classical test phrase. (It contains all letters from A to Z.)
sampleEdit->setText(i18n("The Quick Brown Fox Jumps Over The Lazy Dog"));
sampleEdit->setMinimumHeight( sampleEdit->fontMetrics().lineSpacing() );
sampleEdit->setAlignment(Qt::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
@@ -331,8 +331,8 @@ KFontChooser::KFontChooser(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::fromLatin1("General"));
+ showXLFDArea(config->readBoolEntry(TQString::fromLatin1("fontSelectorShowXLFD"), false));
}
KFontChooser::~KFontChooser()
@@ -355,55 +355,55 @@ void KFontChooser::fillSizeList() {
};
for(int i = 0; c[i]; ++i)
{
- sizeListBox->insertItem(QString::number(c[i]));
+ sizeListBox->insertItem(TQString::number(c[i]));
}
}
-void KFontChooser::setColor( const QColor & col )
+void KFontChooser::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::color() const
+TQColor KFontChooser::color() const
{
- return d->m_palette.color( QPalette::Active, QColorGroup::Text );
+ return d->m_palette.color( TQPalette::Active, TQColorGroup::Text );
}
-void KFontChooser::setBackgroundColor( const QColor & col )
+void KFontChooser::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::backgroundColor() const
+TQColor KFontChooser::backgroundColor() const
{
- return d->m_palette.color( QPalette::Active, QColorGroup::Base );
+ return d->m_palette.color( TQPalette::Active, TQColorGroup::Base );
}
-void KFontChooser::setSizeIsRelative( QButton::ToggleState relative )
+void KFontChooser::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::sizeIsRelative() const
+TQButton::ToggleState KFontChooser::sizeIsRelative() const
{
return sizeIsRelativeCheckBox
? sizeIsRelativeCheckBox->state()
- : QButton::NoChange;
+ : TQButton::NoChange;
}
-QSize KFontChooser::sizeHint( void ) const
+TQSize KFontChooser::sizeHint( void ) const
{
return minimumSizeHint();
}
@@ -426,12 +426,12 @@ void KFontChooser::enableColumn( int column, bool state )
}
-void KFontChooser::setFont( const QFont& aFont, bool onlyFixed )
+void KFontChooser::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)
{
@@ -461,14 +461,14 @@ void KFontChooser::toggled_checkbox()
sizeOfFont->setEnabled( sizeCheckbox->isChecked() );
}
-void KFontChooser::family_chosen_slot(const QString& family)
+void KFontChooser::family_chosen_slot(const TQString& family)
{
- QFontDatabase dbase;
- QStringList styles = QStringList(dbase.styles(family));
+ TQFontDatabase dbase;
+ TQStringList styles = TQStringList(dbase.styles(family));
styleListBox->clear();
currentStyles.clear();
- for ( QStringList::Iterator it = styles.begin(); it != styles.end(); ++it ) {
- QString style = *it;
+ for ( TQStringList::Iterator it = styles.begin(); it != styles.end(); ++it ) {
+ TQString style = *it;
int pos = style.find("Plain");
if(pos >=0) style = style.replace(pos,5,i18n("Regular"));
pos = style.find("Normal");
@@ -486,17 +486,17 @@ void KFontChooser::family_chosen_slot(const QString& family)
}
styleListBox->blockSignals(true);
- QListBoxItem *item = styleListBox->findItem(selectedStyle);
+ TQListBoxItem *item = styleListBox->findItem(selectedStyle);
if (item)
styleListBox->setSelected(styleListBox->findItem(selectedStyle), true);
else
styleListBox->setSelected(0, true);
styleListBox->blockSignals(false);
- style_chosen_slot(QString::null);
+ style_chosen_slot(TQString::null);
}
-void KFontChooser::size_chosen_slot(const QString& size){
+void KFontChooser::size_chosen_slot(const TQString& size){
selectedSize=size.toInt();
sizeOfFont->setValue(selectedSize);
@@ -509,9 +509,9 @@ void KFontChooser::size_value_slot(int val) {
emit fontSelected(selFont);
}
-void KFontChooser::style_chosen_slot(const QString& style)
+void KFontChooser::style_chosen_slot(const TQString& style)
{
- QString currentStyle;
+ TQString currentStyle;
if (style.isEmpty())
currentStyle = styleListBox->currentText();
else
@@ -520,25 +520,25 @@ void KFontChooser::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.smoothSizes(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->findItem(TQString::number(selectedSize)), true);
sizeListBox->blockSignals(false);
sizeListBox->ensureCurrentVisible();
@@ -549,14 +549,14 @@ void KFontChooser::style_chosen_slot(const QString& style)
selectedStyle = style;
}
-void KFontChooser::displaySample(const QFont& font)
+void KFontChooser::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";
}
@@ -565,12 +565,12 @@ void KFontChooser::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 = 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;
@@ -600,7 +600,7 @@ void KFontChooser::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);
@@ -638,16 +638,16 @@ void KFontChooser::setupDisplay()
}
-void KFontChooser::getFontList( QStringList &list, uint fontListCriteria)
+void KFontChooser::getFontList( TQStringList &list, uint fontListCriteria)
{
- QFontDatabase dbase;
- QStringList lstSys(dbase.families());
+ TQFontDatabase dbase;
+ TQStringList lstSys(dbase.families());
// 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::getFontList( QStringList &list, uint fontListCriteria)
list = lstSys;
}
-void KFontChooser::addFont( QStringList &list, const char *xfont )
+void KFontChooser::addFont( TQStringList &list, const char *xfont )
{
const char *ptr = strchr( xfont, '-' );
if ( !ptr )
@@ -681,16 +681,16 @@ void KFontChooser::addFont( QStringList &list, const char *xfont )
if ( !ptr )
return;
- QString font = QString::fromLatin1(ptr + 1);
+ TQString font = TQString::fromLatin1(ptr + 1);
int pos;
if ( ( pos = font.find( '-' ) ) > 0 ) {
font.truncate( pos );
- if ( font.find( QString::fromLatin1("open look"), 0, false ) >= 0 )
+ if ( font.find( TQString::fromLatin1("open look"), 0, false ) >= 0 )
return;
- QStringList::Iterator it = list.begin();
+ TQStringList::Iterator it = list.begin();
for ( ; it != list.end(); ++it )
if ( *it == font )
@@ -701,7 +701,7 @@ void KFontChooser::addFont( QStringList &list, const char *xfont )
void KFontChooser::fillFamilyListBox(bool onlyFixedFonts)
{
- QStringList fontList;
+ TQStringList fontList;
getFontList(fontList, onlyFixedFonts?FixedWidthFonts:0);
familyListBox->clear();
familyListBox->insertStringList(fontList);
@@ -721,10 +721,10 @@ void KFontChooser::showXLFDArea(bool show)
///////////////////////////////////////////////////////////////////////////////
-KFontDialog::KFontDialog( QWidget *parent, const char* name,
+KFontDialog::KFontDialog( TQWidget *parent, const char* name,
bool onlyFixed, bool modal,
- const QStringList &fontList, bool makeFrame, bool diff,
- QButton::ToggleState *sizeIsRelativeState )
+ const TQStringList &fontList, bool makeFrame, bool diff,
+ TQButton::ToggleState *sizeIsRelativeState )
: KDialogBase( parent, name, modal, i18n("Select Font"), Ok|Cancel, Ok )
{
chooser = new KFontChooser( this, "fontChooser",
@@ -734,11 +734,11 @@ KFontDialog::KFontDialog( QWidget *parent, const char* name,
}
-int KFontDialog::getFontDiff( QFont &theFont, int &diffFlags, bool onlyFixed,
- QWidget *parent, bool makeFrame,
- QButton::ToggleState *sizeIsRelativeState )
+int KFontDialog::getFontDiff( TQFont &theFont, int &diffFlags, bool onlyFixed,
+ TQWidget *parent, bool makeFrame,
+ TQButton::ToggleState *sizeIsRelativeState )
{
- KFontDialog dlg( parent, "Font Selector", onlyFixed, true, QStringList(),
+ KFontDialog dlg( parent, "Font Selector", onlyFixed, true, TQStringList(),
makeFrame, true, sizeIsRelativeState );
dlg.setFont( theFont, onlyFixed );
@@ -753,11 +753,11 @@ int KFontDialog::getFontDiff( QFont &theFont, int &diffFlags, bool onlyFixed,
return result;
}
-int KFontDialog::getFont( QFont &theFont, bool onlyFixed,
- QWidget *parent, bool makeFrame,
- QButton::ToggleState *sizeIsRelativeState )
+int KFontDialog::getFont( TQFont &theFont, bool onlyFixed,
+ TQWidget *parent, bool makeFrame,
+ TQButton::ToggleState *sizeIsRelativeState )
{
- KFontDialog dlg( parent, "Font Selector", onlyFixed, true, QStringList(),
+ KFontDialog dlg( parent, "Font Selector", onlyFixed, true, TQStringList(),
makeFrame, false, sizeIsRelativeState );
dlg.setFont( theFont, onlyFixed );
@@ -772,13 +772,13 @@ int KFontDialog::getFont( QFont &theFont, bool onlyFixed,
}
-int KFontDialog::getFontAndText( QFont &theFont, QString &theString,
- bool onlyFixed, QWidget *parent,
+int KFontDialog::getFontAndText( TQFont &theFont, TQString &theString,
+ bool onlyFixed, TQWidget *parent,
bool makeFrame,
- QButton::ToggleState *sizeIsRelativeState )
+ TQButton::ToggleState *sizeIsRelativeState )
{
KFontDialog dlg( parent, "Font and Text Selector", onlyFixed, true,
- QStringList(), makeFrame, false, sizeIsRelativeState );
+ TQStringList(), makeFrame, false, sizeIsRelativeState );
dlg.setFont( theFont, onlyFixed );
int result = dlg.exec();