Review Request 123735: version of QmlObject with a static engine

Marco Martin notmart at gmail.com
Tue May 19 15:53:22 UTC 2015



> On May 19, 2015, 3:04 p.m., Vishesh Handa wrote:
> > src/kdeclarative/qmlobjectsharedengine.cpp, line 60
> > <https://git.reviewboard.kde.org/r/123735/diff/8/?file=370102#file370102line60>
> >
> >     I'm probably missing some parts of the picture. Could you please explain why this needs to be static?
> >     
> >     Also, you could just combine the QSharedPointer and the normal pointer.
> 
> Marco Martin wrote:
>     the whole point is to have a single instance per process...
>     or could be done differently, like with a Q_GLOBAL_STATIC...
> 
> Vishesh Handa wrote:
>     So does each applet construct its own `QmlObjectSharedEngine`?
>     
>     Maybe we can disable this class's constructor and just have a `static QQmlObjectSharedEngine* instance()` method? It'll make the semantics much clearer.

yes, it must have its own QmlObjectSharedEngine, it can't be a singleton by itself, because each applet must have a different root QQmlContext


- Marco


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/123735/#review80630
-----------------------------------------------------------


On May 18, 2015, 8 p.m., Marco Martin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/123735/
> -----------------------------------------------------------
> 
> (Updated May 18, 2015, 8 p.m.)
> 
> 
> Review request for KDE Frameworks and Plasma.
> 
> 
> Repository: kdeclarative
> 
> 
> Description
> -------
> 
> to make easier doing applications like plasma that use a lot of qml to have a single engine make a subclass of QmlObject called QmlObjectSharedEngine that has a single, static QQmlEngine
> 
> Adds a class called QuickViewSharedEngine that has the same behavior as QmlObjectSharedEngine(using it): static QQmlEngine, separed rootContexts() for each instance.
> This is used by desktopviews and panelviews to share their engine.
> 
> Unfortunately it may not be possible to get the applet configuration dialogs to use this, since they still need a separed engine in order to have a different controls style (qstyle based) than the stuff in the desktop/panel
> 
> 
> Diffs
> -----
> 
>   src/kdeclarative/CMakeLists.txt d73bff0 
>   src/kdeclarative/kdeclarative.cpp b3906e2 
>   src/kdeclarative/qmlobject.h f26b67d 
>   src/kdeclarative/qmlobject.cpp c483665 
>   src/kdeclarative/qmlobjectsharedengine.h PRE-CREATION 
>   src/kdeclarative/qmlobjectsharedengine.cpp PRE-CREATION 
>   src/quickaddons/CMakeLists.txt 777d07c 
>   src/quickaddons/quickviewsharedengine.h PRE-CREATION 
>   src/quickaddons/quickviewsharedengine.cpp PRE-CREATION 
> 
> Diff: https://git.reviewboard.kde.org/r/123735/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Marco Martin
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20150519/694f7c41/attachment.html>


More information about the Kde-frameworks-devel mailing list