From kde-devel Thu Aug 22 16:37:06 2019 From: Alexander Semke Date: Thu, 22 Aug 2019 16:37:06 +0000 To: kde-devel Subject: Re: Portability of KDE Applications Message-Id: <71206981.Wtgb4fQeK7 () linux-2rd5> X-MARC-Message: https://marc.info/?l=kde-devel&m=156649185023202 On Donnerstag, 22. August 2019 11:42:06 CEST Boudewijn Rempt wrote: > On donderdag 22 augustus 2019 11:38:21 CEST =D0=9D=D0=B8=D0=BA=D0=B8=D1= =82=D0=B0 =D0=A1=D0=B8=D1=80=D0=B3=D0=B8=D0=B5=D0=BD=D0=BA=D0=BE wrote: > > > Are you only targeting Linux, or also other operating systems? For > > > Linux, > > > appimage probably is the best solution since it is the simplest for t= he > > > end > > > user. > >=20 > > Well, we also trying to target on Windows - this is also bring other > > problems, but the application portability problems presents here too. >=20 > The qrc method helps quite a bit on Windows. For the rest, we assemble our > deliverable using windeployqt which takes care of all the environment > variables needed for Qt, and for our own plugins, we have special code so > that gets found relative to the exe; same for resources we cannot package > in a qrc file. I'd say the situation with such resources is better on Windows because Qt's= =20 QStandardPath works with or /data. So, whereever you insta= ll=20 your application on Windows you can always search and load files from=20 QStandardPath::DataLocation. For example, for the windows installer of=20 LabPlot+Cantor we put all the resources like images, themes and color sche= me=20 definitions, icons etc. for LabPlot and all rc files and initialization=20 scripts for Cantor (ca. 30MB in total) into the ./data folder. There is no= =20 need to compile all this stuf into the executable increasing the memory=20 footprint and slowing down the application start time. Similar for MacOS. On Linux this won't work if you install in /opt since QStandardPath doesn't= =20 know anything about /opt or any other "custom" folders. This should be=20 actually a feature request for Qt to work also on Linux with paths relative= to=20 the current path of the executable. The situation with plugins is similar. On windows you can put everything to= =20 =2Eplugins/ relative to cantor.exe for example. On Linux Qt only searches i= n the=20 "default library paths" and evaluates QT_PLUGIN_PATH in addition. But here = at=20 least you can specify your own paths via QCoreApplication::setLibraryPaths(= )=20 in the code... =2D-=20 Alexander