From kde-pim Fri Jul 26 12:39:23 2013 From: Mark Date: Fri, 26 Jul 2013 12:39:23 +0000 To: kde-pim Subject: [Kde-pim] Brainstrom - editing calendar events through QML? Message-Id: X-MARC-Message: https://marc.info/?l=kde-pim&m=137484240630364 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 = .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@kde.org https://mail.kde.org/mailman/listinfo/kde-pim KDE PIM home page at http://pim.kde.org/