Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

Qt Quick Organizer List View Example

Events List

This example shows how to write a simple Calendar Event List with the Organizer QML API

Motivation

This application was written to provide an example to developers of how to use the Qt Quick Organizer and Qt Versit APIs.

It provides an example of how to use the Qt Organizer and Versit libraries to:

  • select a backend for volatile memory or persistent storage
  • list the stored Calendar Events
  • add Events
  • edit Events
  • Remove Events
  • import Event lists as ICal® *

[*]iCal iCalendar is a standard (RFC 5545) for calendar data exchange

Use Case

Most people have a need to store Calendar reminders for various events ranging from weddings, hairdresser appointments, work meetings to reccuring football training every week. This sample application provides a simple Event List book that allows users to retrieve their Calendar Events and modify them, delete them or add new events using either volatile memory of the supported backend for the device in use.

Interface

The application is designed to work on desktop and mobile platforms with minimal differences in code between the platforms. The interface is organized into a QML List View, showing the Organizer Event List by default. Events can be added or deleted using the buttons at the bottom of the contact list. Selecting an event is simply done by clicking the mouse on the desired event, and using the save button to store it.

Here we see the OrganizerModel used with a QML List View to show some Events added by default.

When editing you click on the edit button and an Event Editor will be displayed showing the display label along with the start and end dates of the events.

Here start and end dates or label for the event can be modified. Notice that the boundaries have been set so that any character can be used in the label. However the date, month and the year are limited to integers which match those fields to give some kind of simple but sensible user interaction. When finished select either the cancel button or the save button and it returns to the list view showing all events. If cancel button is pressed nothing will change, or if saved the modifications to the event will be updated in this main list view.

Adding new events from the main list view is equally simple. Click on add new event button and the same editor will be displayed with NEW in the event title as follows.

Simply Edit this as with any other event, and cancel or save it. Cancelling will mean this new event will be lost, where saving will add the new event to the main list view along with all the other existing events.

Deleting events from the main list view is simply done by pressing the delete button and the currently highlighted event will be removed from the organizer list view and also the backend where this event is stored.

Known Issues

The example is not intended to be feature complete. Only a very limited subset of detail types are supported by the application. It exercises only a very small portion of the Qt Organizer QML API. It is intended to be very simple to show the API and allow the developers skilled in QML to utilise this interface to its full potential.

In particular:

  • The example only exercises the QML OrganizerModel API to save, edit and delete Events.
  • Everything is done with minimal external components or states to keep things simple and focused on how the API works.
  • Editing a Date/Time is in string format. In a real application would be a more advanced component on its own which would allow easy and simple user input with good error checking and error messages for the user.

Files:

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web