author | llornkcor <llornkcor> | 2002-11-10 03:13:39 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-11-10 03:13:39 (UTC) |
commit | ea3334042e9625c0f67c9a7293a482849f60e4e2 (patch) (side-by-side diff) | |
tree | d9c36920818ed681a4a80d3e7af14524e66fa942 | |
parent | 7601c75b529d9ff205403a32206b9431845cfc91 (diff) | |
download | opie-ea3334042e9625c0f67c9a7293a482849f60e4e2.zip opie-ea3334042e9625c0f67c9a7293a482849f60e4e2.tar.gz opie-ea3334042e9625c0f67c9a7293a482849f60e4e2.tar.bz2 |
use opie's FontDatabase so to be able to use freetype
-rw-r--r-- | noncore/apps/opie-write/mainwindow.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/noncore/apps/opie-write/mainwindow.cpp b/noncore/apps/opie-write/mainwindow.cpp index ed95e83..bcafd16 100644 --- a/noncore/apps/opie-write/mainwindow.cpp +++ b/noncore/apps/opie-write/mainwindow.cpp @@ -14,24 +14,26 @@ ** email sales@trolltech.com for information about Qtopia License ** Agreements. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "mainwindow.h" #include <qpe/fileselector.h> #include <qpe/applnk.h> #include <qpe/resource.h> +#include <qpe/fontdatabase.h> + //#include "qspellchecker.h" #include "qtextedit.h" #include <qaction.h> #include <qtoolbar.h> #include <qtoolbutton.h> #include <qtabwidget.h> #include <qapplication.h> #include <qfontdatabase.h> #include <qcombobox.h> #include <qlineedit.h> #include <qfileinfo.h> #include <qfile.h> @@ -199,29 +201,31 @@ void MainWindow::setupActions() a->addTo( edit ); a = new QAction( tr( "Paste" ), Resource::loadPixmap("paste"), QString::null, 0, this, "editPaste" ); connect( a, SIGNAL( activated() ), this, SLOT( editPaste() ) ); a->addTo( tbEdit ); a->addTo( edit ); tbFont = new QToolBar( this ); tbFont->setLabel( "Font Actions" ); tbFont->setHorizontalStretchable(TRUE); comboFont = new QComboBox( FALSE, tbFont ); - QFontDatabase db; + FontDatabase db; + QStringList f= db.families(); comboFont->insertStringList( db.families() ); connect( comboFont, SIGNAL( activated( const QString & ) ), this, SLOT( textFamily( const QString & ) ) ); comboFont->setCurrentItem( comboFont->listBox()->index( comboFont->listBox()->findItem( QApplication::font().family() ) ) ); + comboFont->setMaximumWidth(90); comboSize = new QComboBox( TRUE, tbFont ); QValueList<int> sizes = db.standardSizes(); QValueList<int>::Iterator it = sizes.begin(); for ( ; it != sizes.end(); ++it ) comboSize->insertItem( QString::number( *it ) ); connect( comboSize, SIGNAL( activated( const QString & ) ), this, SLOT( textSize( const QString & ) ) ); comboSize->lineEdit()->setText( QString::number( QApplication::font().pointSize() ) ); comboSize->setFixedWidth( 38 ); tbStyle = new QToolBar( this ); @@ -268,25 +272,25 @@ void MainWindow::doConnections( Qt3::QTextEdit *e ) { connect( e, SIGNAL( currentFontChanged( const QFont & ) ), this, SLOT( fontChanged( const QFont & ) ) ); connect( e, SIGNAL( currentColorChanged( const QColor & ) ), this, SLOT( colorChanged( const QColor & ) ) ); connect( e, SIGNAL( currentAlignmentChanged( int ) ), this, SLOT( alignmentChanged( int ) ) ); } void MainWindow::updateFontSizeCombo( const QFont &f ) { comboSize->clear(); - QFontDatabase fdb; + FontDatabase fdb; QValueList<int> sizes = fdb.pointSizes( f.family() ); QValueList<int>::Iterator it = sizes.begin(); for ( ; it != sizes.end(); ++it ) comboSize->insertItem( QString::number( *it ) ); } void MainWindow::editUndo() { if ( !currentEditor() ) return; currentEditor()->undo(); } |