D8421: Port the dict applet to KF5 and QtQuick 2

David Faure noreply at phabricator.kde.org
Fri Oct 27 20:59:52 UTC 2017


dfaure marked an inline comment as done.
dfaure added inline comments.

INLINE COMMENTS

> broulik wrote in main.qml:4
> Unused?

Ah, yes. That was for "formFactor" as in https://techbase.kde.org/Development/Tutorials/Plasma5/QML2/GettingStarted#Minimum_size
(which I had to fix so the syntax would parse).

But I'm not sure if I need to handle form factors in this applet, and if so, how...

> davidedmundson wrote in main.qml:20
> then use font metrics...http://doc.qt.io/qt-5/qml-qtquick-fontmetrics.html
> 
> or in this Plasmoid case use Units.gridUnit * 40
> 
> which is gonna be basically the same.

Oh, cool, FontMetrics didn't exist in my first QML attempts.

But yeah if plasmoids should fit a grid, I'll use the grid then.

> broulik wrote in main.qml:33
> Does this need a `Layout.fillWidth: true` and `Layout.fillHeight: true`? The `TextField` probably also needs `Layout.fillWidth`?

`Layout.fillHeight: true` led to a 1-pixel-high webview, not good.

`Layout.fillWidth: true` is good, it means I don't duplicate the width anymore.

OK, and doing that in the TextField makes the applet resize to the user's wishes, I see. Thanks.

> davidedmundson wrote in main.qml:37
> it's a bit rubbish, but:
> 
> zoom: Units.devicePixelRatio
> 
> should sort out DPI.
> (not tested)

`zoomFactor: units.devicePixelRatio`
helped indeed, thanks.

> davidedmundson wrote in metadata.desktop:119
> no it doesn't

Indeed. One day it should, though, I'd like the user to be able to choose which dict to use. Do I have to write a config dialog in QML, though? If so, any example I can use for that?
Or can it use widgets?

> davidedmundson wrote in dict_object.h:2
> Plasma core provides a dataengine QML exposer.
> https://api.kde.org/frameworks/plasma-framework/html/classPlasma_1_1DataSource.html
> 
> Is there a reason we made a specialised QML wrapper? 
> (not that I object to this)

Ah, I didn't know.
But I'd rather have as much logic as possible in C++, rather than in JS.
The whole thing about listing dicts, and allowing the user to choose one (or more?), storing that in KConfig, and then using that for querying... I'm not sure but I think using DataSource directly wouldn't make this easy, I would still need a QObject at least for the KConfig part, and it would mean interfacing that with DataSource in JS code...

REPOSITORY
  R114 Plasma Addons

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

To: dfaure, #plasma
Cc: broulik, davidedmundson, plasma-devel, #plasma, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20171027/403bb75a/attachment.html>


More information about the Plasma-devel mailing list