D14513: Add QML Extensions API

Anmol Gautam noreply at phabricator.kde.org
Sat Aug 11 21:06:59 BST 2018


anmolgautam added inline comments.

INLINE COMMENTS

> drosca wrote in qmli18n.cpp:26
> Something like `setlocale(QLocale::system().name())`
> 
> Yes, contextProperty is fine if it works.

This can be similar to qsTr in Qt source, something like - 
engine->globalObject().setProperty("i18n", engine->evaluate("function(string) { return i18n.i18n(string) }"));
Here i18n is the context property (QObject corresponding to QmlI18n).
But It has problems -

1. i18n as contextProperty object
2. It must be added to the engine at time of its creation i.e. remove singleton of i18n from QmlPlugins and move i18n to engine global object when the engine is created in QmlPluginLoader.

Should I change I18n so that i18n adds to global namespace or leave it now? Or is there some better solution

REPOSITORY
  R875 Falkon

REVISION DETAIL
  https://phabricator.kde.org/D14513

To: anmolgautam, drosca
Cc: falkon, herrold, anmolgautam, SGOrava, iodelay, spoorun, ptabis, navarromorales, cochise, clivej, ach
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/falkon/attachments/20180811/20abb782/attachment.html>


More information about the Falkon mailing list