Reputation: 6171
While studying the Plug & Paint Example, I read
By convention, we use a "Java package name" syntax to identify interfaces. If we later change the interfaces, we must use a different string to identify the new interface; otherwise, the application might crash.
How should I take the "...otherwise, the application might crash." statement?
Does it mean I should expect an application to crash if both, Q_DECLARE_INTERFACE() and Q_PLUGIN_METADATA(), identification strings are different?
Upvotes: 2
Views: 1894
Reputation: 4085
I think might means - it will not crash as long as (if changed) new implementation is 'binary' compatible with an old implmentation. So if you extend plugin class with new functionality and your old code relays on the same interface ID it will get a pointer to new implementation, which will be casted to old declaration (which might be compiled to the old code).
So it might work in cases mentioned there https://community.kde.org/Policies/Binary_Compatibility_Issues_With_C%2B%2B
However, I would agree with Qt that changes in the plugin interface should lead to version change in IID, so you are sure you keep you main code and plugins consistent.
Upvotes: 1