OESF Portables Forum

Everything Else => Zaurus - Everything Development => Distros, Development, and Model Specific Forums => Archived Forums => OpenZaurus/Opie/Qtopia => Topic started by: Hrw on February 23, 2005, 08:49:23 am

Title: Qt/embedded 2.3.10 And Font Handling In Apps
Post by: Hrw on February 23, 2005, 08:49:23 am
OpenZaurus 3.5.3 and other OpenEmbedded derived distros will ship Qt/Embedded 2.3.10 which has font handling changed a bit. To me more precise it have font size changed.

OPIE was fixed by their developers, I fixed some apps which I use on my Zaurus:
- Portabase 1.9 (patch submitted: http://sourceforge.net/tracker/index.php?f...05&atid=508376) (http://sourceforge.net/tracker/index.php?func=detail&aid=1122007&group_id=64705&atid=508376))
- IQNotes 2.0.2 (will send patch later)

Change is easy - with SharpROM Qt/E to get fontsize application do it like that (patched code from IQNotes):
Code: [Select]
void PreferencesD::updateSizes()
{
    QFontDatabase fontDB;
    int currentSize = -1;
#if defined(DEBUG) || QT_VERSION >= 239
    int f = 1;
#else
    int f = 10;
#endif

    if (Font->currentText().lower() == currentFont.family().lower())
        currentSize = currentFont.pointSize();

    FontSize->clear();
    QValueList sizes = fontDB.pointSizes(Font->currentText());
    for(QValueList::Iterator it = sizes.begin(); it != sizes.end(); it++)
    {
        FontSize->insertItem(QString::number(*it/f));
        if (currentSize != -1 && (int)((*it)/f) == currentSize)
            FontSize->setCurrentItem(FontSize->count() - 1);
    }
}

As you see with Qt/E 2.3.9 or newer application can use fontsize directly - does not have to divide it by 10 to get proper size.

If you can - then please fix it in your applications.

Portabase 1.9 fix:
Code: [Select]
--- portabase/preferences.cpp.orig      2005-02-13 22:48:10 +0100
+++ portabase/preferences.cpp   2005-02-13 22:48:06 +0100
@@ -154,7 +154,7 @@
 {
     QWidget *appearanceTab = new QWidget(tabs);
     QVBoxLayout *layout = new QVBoxLayout(appearanceTab);
-#if defined(Q_WS_QWS)
+#if defined(Q_WS_QWS) && QT_VERSION <= 239
     sizeFactor = 10;
 #else
     sizeFactor = 1;
Title: Qt/embedded 2.3.10 And Font Handling In Apps
Post by: Mickeyl on February 23, 2005, 08:52:24 am
Thanks for the pointer, hrw.

Since all future OE-built distributions (familiar linux, OpenZaurus, OpenSIMpad, and more) will ship their Opie images based on Qt/Embedded 2.3.10, I'd like to encourage all 3rd party developers wanting to make their apps run on Opie to catch up with these recent developments in Qt/Embedded!