[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Portability of KDE Applications
From:       Alexander Semke <alexander.semke () web ! de>
Date:       2019-08-22 16:37:06
Message-ID: 71206981.Wtgb4fQeK7 () linux-2rd5
[Download RAW message or body]

On Donnerstag, 22. August 2019 11:42:06 CEST Boudewijn Rempt wrote:
> On donderdag 22 augustus 2019 11:38:21 CEST Никита Сиргиенко 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 the
> > > end
> > > user.
> > 
> > Well, we also trying to target on Windows - this is also bring other
> > problems, but the application portability problems presents here too.
> 
> 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 
QStandardPath works with <APPDIR> or <APPDIR>/data. So, whereever you install 
your application on Windows you can always search and load files from 
QStandardPath::DataLocation. For example, for the windows installer of 
LabPlot+Cantor we put all the resources  like images, themes and color scheme 
definitions, icons etc. for LabPlot and all rc files and initialization 
scripts for Cantor (ca. 30MB in total) into the ./data folder. There is no 
need to compile all this stuf into the executable increasing the memory 
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 
know anything about /opt or any other "custom" folders. This should be 
actually a feature request for Qt to work also on Linux with paths relative to 
the current path of the executable.

The situation with plugins is similar. On windows you can put everything to 
.plugins/ relative to cantor.exe for example. On Linux Qt only searches in the 
"default library paths" and evaluates QT_PLUGIN_PATH in addition. But here at 
least you can specify your own paths via QCoreApplication::setLibraryPaths() 
in the code...

-- 
Alexander



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic