bitwiseworks / qt5-os2

Port of Qt software development framework version 5 to OS/2
Other
18 stars 2 forks source link

Port Qt SVG module #4

Closed dmik closed 4 years ago

dmik commented 4 years ago

This module brings support for SVG graphics. SVG is used pretty often to construct UIs so many apps depend on it. It should be easy as there should be no platform-dependent code at all. So it's scheduled before Qt WebEngine.

dmik commented 4 years ago

The module builds on OS/2 w/o any problems. You need to run the updated init-repository-os2.sh and then the usual configure and then make and you get QtSvg.dll in qtbase/lib.

It works pretty well too (I tried all SVG examples). There are, however, a few auto test failures:

********* Start testing of tst_QSvgPlugin *********
Config: Using QtTest library 5.13.0, Qt 5.13.0 (i386-little_endian-ilp32 shared (dynamic) debug build; by GCC 4.9.2)
PASS   : tst_QSvgPlugin::initTestCase()
PASS   : tst_QSvgPlugin::checkSize(square)
PASS   : tst_QSvgPlugin::checkSize(square_size)
PASS   : tst_QSvgPlugin::checkSize(square_size_viewbox)
PASS   : tst_QSvgPlugin::checkSize(square_viewbox)
PASS   : tst_QSvgPlugin::checkSize(tall)
PASS   : tst_QSvgPlugin::checkSize(tall_size)
PASS   : tst_QSvgPlugin::checkSize(tall_size_viewbox)
PASS   : tst_QSvgPlugin::checkSize(tall_viewbox)
PASS   : tst_QSvgPlugin::checkSize(wide)
PASS   : tst_QSvgPlugin::checkSize(wide_size)
PASS   : tst_QSvgPlugin::checkSize(wide_size_viewbox)
PASS   : tst_QSvgPlugin::checkSize(wide_viewbox)
FAIL!  : tst_QSvgPlugin::checkImageInclude() Compared values are not the same
   Actual   (logMessages.at(3))                                                                 : "Could not create image from /"~/Network/novator_D/notExisting.svg/""
   Expected (QString("Could not create image from /"%1notExisting.svg/"").arg(QDir::rootPath())): "Could not create image from /"~/Network/novator_C/notExisting.svg/""
   Loc: [~/Network/novator_D/Coding/qt5/qt5/qtsvg/tests/auto/qsvgplugin/tst_qsvgplugin.cpp(138)]
PASS   : tst_QSvgPlugin::cleanupTestCase()
Totals: 14 passed, 1 failed, 0 skipped, 0 blacklisted, 168ms
********* Finished testing of tst_QSvgPlugin *********

and

********* Start testing of tst_QIcon_Svg *********
Config: Using QtTest library 5.13.0, Qt 5.13.0 (i386-little_endian-ilp32 shared (dynamic) debug build; by GCC 4.9.2)
PASS   : tst_QIcon_Svg::initTestCase()
FAIL!  : tst_QIcon_Svg::svgActualSize() Compared values are not the same
   Actual   (icon.actualSize(QSize(16, 14))): QSize(14x14)
   Expected (QSize(16, 2))                  : QSize(16x2)
   Loc: [~/Network/novator_D/Coding/qt5/qt5/qtsvg/tests/auto/qicon_svg/tst_qicon_svg.cpp(77)]
FAIL!  : tst_QIcon_Svg::svg() 'icon3.pixmap(57).toImage() == icon1.pixmap(57).toImage()' returned FALSE. ()
   Loc: [~/Network/novator_D/Coding/qt5/qt5/qtsvg/tests/auto/qicon_svg/tst_qicon_svg.cpp(109)]
QDEBUG : tst_QIcon_Svg::availableSizes() [46538-1:23:25:48.202] tst_QIcon_Svg::availableSizes:131: (QSize(595, 841))
FAIL!  : tst_QIcon_Svg::availableSizes() 'availableSizes.isEmpty()' returned FALSE. ()
   Loc: [~/Network/novator_D/Coding/qt5/qt5/qtsvg/tests/auto/qicon_svg/tst_qicon_svg.cpp(132)]
FAIL!  : tst_QIcon_Svg::isNull() 'icon.isNull()' returned FALSE. ()
   Loc: [~/Network/novator_D/Coding/qt5/qt5/qtsvg/tests/auto/qicon_svg/tst_qicon_svg.cpp(150)]
PASS   : tst_QIcon_Svg::sizeInPercent()
PASS   : tst_QIcon_Svg::cleanupTestCase()
Totals: 3 passed, 4 failed, 0 skipped, 0 blacklisted, 224ms
********* Finished testing of tst_QIcon_Svg *********
dmik commented 4 years ago

I've fixed both problems. The first one is a unixism (that worked on dos-like only when tests started from boot drive — this is apparently what Qt QA does on Windows). The second one is because the icon format DLL was too long and could not be loaded.

Unfortunately, to fix both problems, we need to change Qt SVG sources which means we will have to maintain a separate repository for it instead of using the official Qt one.

dmik commented 4 years ago

With the above commits, all SVG tests work fine on OS/2 (even the cmake test). Case closed.

Note that you should manually run git checkout master (and git pull) in your checked out qtsvg repository in order to pick up latest changes not recorded in the super-repository yet.