vogel / injeqt Goto Github PK
View Code? Open in Web Editor NEWDependency injection framework for Qt
License: GNU Lesser General Public License v2.1
Dependency injection framework for Qt
License: GNU Lesser General Public License v2.1
If factories are configured in cycle (eg: to create f1 you need f2 factory, to create f2 you need f3 factory and to create f3 you need f1 factory) program can hang. Cycle detection must be added and new exception type must be created.
great work ! how can i build and use this in windows? can i use qml objects as dependency?
Not all are needed. If all creation of given object are guaranteed to be valid we don't need to validate.
It lacks exceptions from make_type helper methods
When new injector is used in plugin that gets loaded and unloaded during program runtime then at second load it can not find data from qt meta system - something is lost in the way.
Subinjector should be an injector that accept another injector as parent.
It could be impemented as a new constructor:
injector(std::vectorstd::unique_ptr modules, injector &parent);
The subinjector will have access to all of its parent injector objects + the new ones added in its modules.
Use case: plugin of an application or a part of it that use main applications services/classes/objects and adds a few of its own that should not/can not be visible from other parts of code (and from other plugins).
Hej!
Zacząłem pakietowanie kadu 2.0 dla Debiana jak i pochodnych, czyli trzeba zacząć od budowania zależności dla tej wersji i na starcie jest problem z injeqt. Kompilacja na maszynach nie 64 bitowych kończy się tak:
W tym momencie widzę, że kompiluje się poprawnie tylko na amd64, arm64, ppc64 i kfreebsd-amd64. Na pozostałych maszynach jest błąd jak wyżej dla i386.
Ze zwględu na brak czasu nie wymyśliłem jeszcze patcha na to, tak więc najpierw zgłaszam błąd.
Przepraszam ze tutaj, ale do forum musialbym sobie przypomniec haslo i login.
Jako że masz jakieś doświadczenie w programowaniu komunikatorów,
a ostatnio z kolegą znalazłem fajny komunikator,
który fajnie działa na Manjaro Linux czy Archu
https://ring.cx/en/news#join-the-ring-project-for-the-summer
ale rozwój tego komunikatora idzie strasznie wolno.
i mam pytanie, czy słyszałeś o takim komunikatorze i czy byłbys wstanie im odrobinę pomóc ?
Dlaczego ?
Co z nim nie tak ?
Build with Qt 5.11 broken, please replace qt5_use_modules
to fix it.
There should be a way to add a method to a class that is called after object is fully injected (after all injeqt-setter are called).
Proposed signature:
INJEQT_COMPLETED void any_name();
Currently all exceptions are implemented as internal and are not accessible to linking application.
Implement either by exposing exceptions or adding new ones and translate them in public apis.
I think it'll benefit the project & its usage if the include folder does not have headers like "type.h" or "module.h" in the main root, or maybe move it out from "include" to "include/injeqt" - and since injeqt is pretty unique name, there is almost no chance of clashes with other libs.
This method will took any QObject*, check it INJEQT_SETTER marked setters and call them with proper parameters.
When I build with -DCMAKE_BUILD_TYPE=Release, some tests fail.
Some not initialised variables perhaps?
maciek@liwardyna` /usr/local/portage/distfiles/injeqt-1.1.0/build $ ctest -VV --rerun-failed
UpdateCTestConfiguration from :/usr/local/portage/distfiles/injeqt-1.1.0/build/DartConfiguration.tcl
UpdateCTestConfiguration from :/usr/local/portage/distfiles/injeqt-1.1.0/build/DartConfiguration.tcl
Test project /usr/local/portage/distfiles/injeqt-1.1.0/build
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 1
Start 1: /action-method-test
1: Test command: /usr/local/portage/distfiles/injeqt-1.1.0/build/test/action-method-test
1: Test timeout computed to be: 9.99988e+06
1: ********* Start testing of action_method_test *********
1: Config: Using QtTest library 5.7.1, Qt 5.7.1 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 4.9.4)
1: PASS : action_method_test::initTestCase()
1: PASS : action_method_test::should_create_empty()
1: PASS : action_method_test::should_create_valid_from_tagged_action_method()
1: PASS : action_method_test::should_create_valid_from_tagged_action_slot()
1: PASS : action_method_test::should_invoke_have_results()
1: FAIL! : action_method_test::should_throw_when_empty_method() Exception not thrown
1: Loc: [/usr/local/portage/distfiles/injeqt-1.1.0/test/unit/expect.h(32)]
1: FAIL! : action_method_test::should_throw_when_arguments() Exception not thrown
1: Loc: [/usr/local/portage/distfiles/injeqt-1.1.0/test/unit/expect.h(32)]
1: FAIL! : action_method_test::should_throw_when_arguments() Exception not thrown
1: Loc: [/usr/local/portage/distfiles/injeqt-1.1.0/test/unit/expect.h(32)]
1: FAIL! : action_method_test::should_throw_when_invalid_tag() Exception not thrown
1: Loc: [/usr/local/portage/distfiles/injeqt-1.1.0/test/unit/expect.h(32)]
1: FAIL! : action_method_test::should_throw_when_no_tag() Exception not thrown
1: Loc: [/usr/local/portage/distfiles/injeqt-1.1.0/test/unit/expect.h(32)]
1: FAIL! : action_method_test::should_throw_when_signal() Exception not thrown
1: Loc: [/usr/local/portage/distfiles/injeqt-1.1.0/test/unit/expect.h(32)]
1: FAIL! : action_method_test::should_throw_when_signal() Exception not thrown
1: Loc: [/usr/local/portage/distfiles/injeqt-1.1.0/test/unit/expect.h(32)]
1: FAIL! : action_method_test::should_throw_when_constructor() Exception not thrown
1: Loc: [/usr/local/portage/distfiles/injeqt-1.1.0/test/unit/expect.h(32)]
1: PASS : action_method_test::cleanupTestCase()
1: Totals: 6 passed, 8 failed, 0 skipped, 0 blacklisted, 0ms
1: ********* Finished testing of action_method_test *********
1/3 Test #1: /action-method-test ..............***Failed 0.00 sec
test 21
Start 21: /resolve-dependencies-test
21: Test command: /usr/local/portage/distfiles/injeqt-1.1.0/build/test/resolve-dependencies-test
21: Test timeout computed to be: 9.99988e+06
21: ********* Start testing of resolve_dependencies_test *********
21: Config: Using QtTest library 5.7.1, Qt 5.7.1 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 4.9.4)
21: PASS : resolve_dependencies_test::initTestCase()
21: PASS : resolve_dependencies_test::should_resolve_no_dependencies_when_no_objects_available()
21: FAIL! : resolve_dependencies_test::should_resolve_all_dependencies() Compared values are not the same
21: Loc: [/usr/local/portage/distfiles/injeqt-1.1.0/test/unit/resolve-dependencies-test.cpp(141)]
21: FAIL! : resolve_dependencies_test::should_resolve_available_dependencies() Compared values are not the same
21: Loc: [/usr/local/portage/distfiles/injeqt-1.1.0/test/unit/resolve-dependencies-test.cpp(165)]
21: FAIL! : resolve_dependencies_test::should_resolve_available_dependencies_using_exact_matching() Compared values are not the same
21: Loc: [/usr/local/portage/distfiles/injeqt-1.1.0/test/unit/resolve-dependencies-test.cpp(193)]
21: FAIL! : resolve_dependencies_test::should_resolve_available_dependencies_using_exact_matching_not_using_subclass() Compared values are not the same
21: Loc: [/usr/local/portage/distfiles/injeqt-1.1.0/test/unit/resolve-dependencies-test.cpp(223)]
21: PASS : resolve_dependencies_test::should_resolve_available_dependencies_not_using_superclass()
21: PASS : resolve_dependencies_test::cleanupTestCase()
21: Totals: 4 passed, 4 failed, 0 skipped, 0 blacklisted, 0ms
21: ********* Finished testing of resolve_dependencies_test *********
2/3 Test #21: /resolve-dependencies-test .......***Failed 0.00 sec
test 22
Start 22: /setter-method-test
22: Test command: /usr/local/portage/distfiles/injeqt-1.1.0/build/test/setter-method-test
22: Test timeout computed to be: 9.99988e+06
22: ********* Start testing of setter_method_test *********
22: Config: Using QtTest library 5.7.1, Qt 5.7.1 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 4.9.4)
22: PASS : setter_method_test::initTestCase()
22: PASS : setter_method_test::should_create_empty()
22: PASS : setter_method_test::should_create_valid_from_tagged_setter_method()
22: PASS : setter_method_test::should_create_valid_from_tagged_setter_slot()
22: PASS : setter_method_test::should_invoke_have_results()
22: FAIL! : setter_method_test::should_throw_when_empty_method() Exception not thrown
22: Loc: [/usr/local/portage/distfiles/injeqt-1.1.0/test/unit/expect.h(32)]
22: FAIL! : setter_method_test::should_throw_when_multiple_arguments() Exception not thrown
22: Loc: [/usr/local/portage/distfiles/injeqt-1.1.0/test/unit/expect.h(32)]
22: FAIL! : setter_method_test::should_throw_when_invalid_tag() Exception not thrown
22: Loc: [/usr/local/portage/distfiles/injeqt-1.1.0/test/unit/expect.h(32)]
22: FAIL! : setter_method_test::should_throw_when_no_tag() Exception not thrown
22: Loc: [/usr/local/portage/distfiles/injeqt-1.1.0/test/unit/expect.h(32)]
22: FAIL! : setter_method_test::should_throw_when_signal() Exception not thrown
22: Loc: [/usr/local/portage/distfiles/injeqt-1.1.0/test/unit/expect.h(32)]
22: FAIL! : setter_method_test::should_throw_when_constructor() Exception not thrown
22: Loc: [/usr/local/portage/distfiles/injeqt-1.1.0/test/unit/expect.h(32)]
22: FAIL! : setter_method_test::should_throw_when_non_matching_parameters() Exception not thrown
22: Loc: [/usr/local/portage/distfiles/injeqt-1.1.0/test/unit/expect.h(32)]
22: PASS : setter_method_test::cleanupTestCase()
22: Totals: 6 passed, 7 failed, 0 skipped, 0 blacklisted, 0ms
22: ********* Finished testing of setter_method_test *********
3/3 Test #22: /setter-method-test ..............***Failed 0.00 sec
0% tests passed, 3 tests failed out of 3
Total Test time (real) = 0.01 sec
The following tests FAILED:
1 - /action-method-test (Failed)
21 - /resolve-dependencies-test (Failed)
22 - /setter-method-test (Failed)
Errors while running CTest
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.