FreeCAD/FreeCAD

Preference Packs have no control over QT Search Paths

Offen

#11.043 geöffnet am 14.10.2023

 (6 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C++ (5.550 Forks)batch import
Good first issueHelp wantedTopic: StylesheetsType: Feature

Repository-Metriken

Stars
 (30.913 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 24T 7h) (217 gemergte PRs in 30 T)

Beschreibung

Is there an existing issue for this?

  • I have searched the existing issues

Problem description

Some places in FreeCAD relies on QDir search path feature (https://doc.qt.io/qt-6/qdir.html#setSearchPaths). Currently registering directories to search paths is done in the constructor of Gui::PreferencePack but added paths are hardcoded and preference pack authors have no control over them. Search paths associated with preference pack should be defined in the metadata file, solution must be backwards compatible with older packages that do not specify that values explicitly.

As mentioned in https://github.com/FreeCAD/FreeCAD/pull/11039 we can do something like:

<searchpath prefix="qss" path="." />
<searchpath prefix="overlay" path="./overlay" />

Where . means the root of preference pack. To keep backwards compatibility we can specify implicit defaults:

qss: .
css: .
overlay: ./overlay

That can be changed using explicit <searchpath /> declaration. We should also allow declaring more than one <searchpath /> for given prefix. I don't know if there is some valid use case for that, but I don't see any reason to forbid that either.

Full version info

0.22 dev

Subproject(s) affected?

Core

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Contributor Guide