On 8/8/11 7:50 AM, "ext [email protected]"
<[email protected]> wrote:

>Hi,
>
>In qt-components we have 2 plugins: basic widgets and extras.
>
>Application uses basic widgets -> one plugin is created.
>Application uses basic widgets and extras -> 2 basic widget plugins
>created and one extras.
>
>The fact that extras plugin creates basic widget plugin is pretty bad and
>we would like to avoid it. How can we get only one instance of a plugin?
>
>Br,
>Sergiy


Qt maintains a list of already initialized declarative plugins (based on
the plugin URI) and prevents the same plugin from being loaded twice.
However, the Qt Components plugin supports several variations on the
import statement, to Qt these will appear as separate plugins: com.meego,
com.nokia.meego and Qt.labs.components.native

As the extras plugin uses "import com.meego 1.0", by using the exact same
import statement in the apps the plugin should only be loaded once. If you
want to solve this problem on the plugin side, you could in the
QDeclarativeExtensionPlugin interface methods of your plugin
implementation mark them as visited and on subsequent visits skip the
implementation, or create a private singleton object that does the actual
initialization.

Regards,
Tomas

_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-qml

Reply via email to