Open
Conversation
SortFilterProxyModel is an awesome piece of code and we use it in several projects. This is the reason for this patch introducing shared library support. By doing so we: * Save memory by using shared library - at least RAM when running multiple applications using SortFilterProxyModel * Save build time: SortFilterProxyModel is build once for all To remain compatible with previous behaviour user can select what to do by cmake options: BUILD_OBJECT_LIB: (Default ON): Same as before: Add sources to your project and build obj-files that can be linked to your binary. It was taken care that projects behaves same as before (tested) - no need for develepers to make changes in their project. BUILD_SHARED_LIB: Build and install a shared library so that other projects can use it. This is the way packagers prefer deploying code. Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
Now that SortFilterProxyModel can be build standalone, Qt-Creator creates CMake.user.. files once it configures SortFilterProxyModel. User configurations are nothing to be added to repository (accidentally) so add an entry in .gitignore. Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
This does not cause any change to build but it adds the headers to the file list of IDEs like qt-creator gives developers much easier access. Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
… --as-needed There are build environments that link their binaries with --as-needed for good reasons [1]. This causes trouble here too: The application linking against SortFilterProxyModel has no reference to a symbol within SortFilterProxyModel so the library will simply be skipped and not loaded at runtime causing: | qrc:/qml/FaFilter.qml:2:1: module "SortFilterProxyModel" is not installed Linker with --as-needed behave similar as linking against static libraries and Qt documatation [2] warns explicitly not to use Q_COREAPP_STARTUP_FUNCTION when linking against static libraries. To get around a stateless class SortFilterProxyModel (luckily this name was not used yet) was created, that just contains the static method registerQml(). To avoid multile calls on environemts that do not link with --as-needed all register functions ensure to be called once only by a variable wasRegistered. In the following patch Readme.md will updated and will recommend highly to call SortFilterProxyModel::registerQml() - who knows which environment your application will be build in? [1] https://wiki.gentoo.org/wiki/Project:Quality_Assurance/As-needed [2] https://doc.qt.io/qt-5/qcoreapplication.html#Q_COREAPP_STARTUP_FUNCTION Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
Author
|
Ping? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SortFilterProxyModel is an awesome project. The only thing caused headaches to me should be fixed by this series.
Comments welcome