Help - Search - Members - Calendar
Full Version: Qt/embedded 2.3.10 And Font Handling In Apps
OESF Forums > Distros, Development, and Model Specific Forums > Everything Development > OpenZaurus/Opie/Qtopia
Hrw
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)
- 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
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<int> sizes = fontDB.pointSizes(Font->currentText());
   for(QValueList<int>::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
--- 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;
Mickeyl
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!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.