author | llornkcor <llornkcor> | 2002-11-10 03:13:39 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-11-10 03:13:39 (UTC) |
commit | ea3334042e9625c0f67c9a7293a482849f60e4e2 (patch) (unidiff) | |
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 | |||
@@ -20,12 +20,14 @@ | |||
20 | **********************************************************************/ | 20 | **********************************************************************/ |
21 | 21 | ||
22 | #include "mainwindow.h" | 22 | #include "mainwindow.h" |
23 | #include <qpe/fileselector.h> | 23 | #include <qpe/fileselector.h> |
24 | #include <qpe/applnk.h> | 24 | #include <qpe/applnk.h> |
25 | #include <qpe/resource.h> | 25 | #include <qpe/resource.h> |
26 | #include <qpe/fontdatabase.h> | ||
27 | |||
26 | //#include "qspellchecker.h" | 28 | //#include "qspellchecker.h" |
27 | #include "qtextedit.h" | 29 | #include "qtextedit.h" |
28 | #include <qaction.h> | 30 | #include <qaction.h> |
29 | #include <qtoolbar.h> | 31 | #include <qtoolbar.h> |
30 | #include <qtoolbutton.h> | 32 | #include <qtoolbutton.h> |
31 | #include <qtabwidget.h> | 33 | #include <qtabwidget.h> |
@@ -205,17 +207,19 @@ void MainWindow::setupActions() | |||
205 | 207 | ||
206 | tbFont = new QToolBar( this ); | 208 | tbFont = new QToolBar( this ); |
207 | tbFont->setLabel( "Font Actions" ); | 209 | tbFont->setLabel( "Font Actions" ); |
208 | tbFont->setHorizontalStretchable(TRUE); | 210 | tbFont->setHorizontalStretchable(TRUE); |
209 | 211 | ||
210 | comboFont = new QComboBox( FALSE, tbFont ); | 212 | comboFont = new QComboBox( FALSE, tbFont ); |
211 | QFontDatabase db; | 213 | FontDatabase db; |
214 | QStringList f= db.families(); | ||
212 | comboFont->insertStringList( db.families() ); | 215 | comboFont->insertStringList( db.families() ); |
213 | connect( comboFont, SIGNAL( activated( const QString & ) ), | 216 | connect( comboFont, SIGNAL( activated( const QString & ) ), |
214 | this, SLOT( textFamily( const QString & ) ) ); | 217 | this, SLOT( textFamily( const QString & ) ) ); |
215 | comboFont->setCurrentItem( comboFont->listBox()->index( comboFont->listBox()->findItem( QApplication::font().family() ) ) ); | 218 | comboFont->setCurrentItem( comboFont->listBox()->index( comboFont->listBox()->findItem( QApplication::font().family() ) ) ); |
219 | comboFont->setMaximumWidth(90); | ||
216 | 220 | ||
217 | comboSize = new QComboBox( TRUE, tbFont ); | 221 | comboSize = new QComboBox( TRUE, tbFont ); |
218 | QValueList<int> sizes = db.standardSizes(); | 222 | QValueList<int> sizes = db.standardSizes(); |
219 | QValueList<int>::Iterator it = sizes.begin(); | 223 | QValueList<int>::Iterator it = sizes.begin(); |
220 | for ( ; it != sizes.end(); ++it ) | 224 | for ( ; it != sizes.end(); ++it ) |
221 | comboSize->insertItem( QString::number( *it ) ); | 225 | comboSize->insertItem( QString::number( *it ) ); |
@@ -274,13 +278,13 @@ void MainWindow::doConnections( Qt3::QTextEdit *e ) | |||
274 | this, SLOT( alignmentChanged( int ) ) ); | 278 | this, SLOT( alignmentChanged( int ) ) ); |
275 | } | 279 | } |
276 | 280 | ||
277 | void MainWindow::updateFontSizeCombo( const QFont &f ) | 281 | void MainWindow::updateFontSizeCombo( const QFont &f ) |
278 | { | 282 | { |
279 | comboSize->clear(); | 283 | comboSize->clear(); |
280 | QFontDatabase fdb; | 284 | FontDatabase fdb; |
281 | QValueList<int> sizes = fdb.pointSizes( f.family() ); | 285 | QValueList<int> sizes = fdb.pointSizes( f.family() ); |
282 | QValueList<int>::Iterator it = sizes.begin(); | 286 | QValueList<int>::Iterator it = sizes.begin(); |
283 | for ( ; it != sizes.end(); ++it ) | 287 | for ( ; it != sizes.end(); ++it ) |
284 | comboSize->insertItem( QString::number( *it ) ); | 288 | comboSize->insertItem( QString::number( *it ) ); |
285 | } | 289 | } |
286 | 290 | ||