[Kde-pim] Brainstrom - editing calendar events through QML?

Mark markg85 at gmail.com
Fri Jul 26 13:39:23 BST 2013


Hi PIM folks,

Lately I've been working quite a lot on the calendar stuff to get it
in a working shape that people can actually use.

Showing basic calendar events (as in only events! not todos and
journal) are already working quite well so i'm thinking of the next
step there. The next step would be to edit a calendar event.

Thus far i can think of a few different approaches to do this, but i
don't know which one would be seen as the most neat one or even if you
folks have a different solution.

== Option 1: mass Q_PROPERTY adding to Incidence class ==
The easiest approach is probably to add Q_PROPERTY to the Incidence
class for all property's that the user should be able to change. In
QML you would then have a function available to get the incidence

var incidence = <obj>.getIncidence() // gets the calendar incidence

And then you can simply read and set the property's as you want:

incidence.summary = "a new summary"
incidence.dtStart = ...
... you get the point

The biggest downside to this entire option is that Incidence doesn't
seem to inherit from QObject. I don't know if it's a n issue or even
possible to add QObject inheritence?

== Option 2: Incidence wrapper for QObject ==
If option 1 isn't possible due to QObject then it's not very difficult
to create an Incidence wrapper that inherits from QObject. The rest
can be the same as option 1.

== Option 3: QML Incidence component ==
With option 1 and 2 we are already close to an actual QML Element,
it's just not exposed as such. Perhaps exposing it as a QML element is
better? It will be more readable on the QML side and can probably be
used in the future for making a new incidence as well. For clarity,
you would then have a component like:
Incidence {
    summary: ".."
    description: "..."
    dtStart: "...."
    ...
}

Which one would you suggest me to implement? Or is there another
option that is even better?

Looking forward for your feedback.

Kind regards,
Mark
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list