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  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QML LandmarkCategoryModel Element

The LandmarkCategoryModel element provides access to categories. More...

Inherits LandmarkAbstractModel

  • List of all members, including inherited members
  • Properties

    Detailed Description

    This element is part of the QtMobility.location 1.1 module.

    LandmarkCategoryModel provides a model of categories from the categories store. The contents of the model can be specified with landmark, and sorted via the LandmarkAbstractModel::sortBy and LandmarkAbstractModel::sortOrder properties. Whether the model is automatically updated when the store or landmark changes, can be controlled with LandmarkAbstractModel::autoUpdate property.

    There are two ways of accessing the category data: via model by using views and delegates, or alternatively via categories list property. Of the two, the model access is preferred. Direct list access (i.e. non-model) is not guaranteed to be in order set by sortBy and sortOrder.

    At the moment only data role provided by the model is category. Through that one can access any data provided by the LandmarkCategory element.

     LandmarkCategoryModel {
         id: landmarkCategoryModel
         autoUpdate: true
         onModelChanged: console.log("Category model changed, category count: " + count)
     }
    
     Coordinate {
         id: initCoordinate
         latitude: -27.5
         longitude: 153
     }
    
     Component {
         id: landmarkCategoryListDelegate
         Item {
             width: 200; height: 50
             Text {
                 color: "white"; font.bold: true; style: Text.Raised; styleColor: "black"
                 id: nameField; text: category.name
             }
         }
     }

    See also LandmarkAbstractModel, LandmarkModel, and QLandmarkManager.

    Property Documentation

    read-onlycategories : QDeclarativeListProperty

    This element holds the list of LandmarkCategory elements that the model currently has. Accessing categories by iterating over this list is not guaranteed to be in the order set by LandmarkAbstractModel::sortBy or LandmarkAbstractModel::sortOrder

     LandmarkCategoryModel {
         id: categoriesOfGivenLandmark
         autoUpdate: false
         onCategoriesChanged: {
             console.log("log: Categories count is: "+ count);
             for (var index = 0; index < categories.length; index++)  {
                 console.log("Index, name:" + index + " , " + categories[index].name);
             }
         }
     }

    This documentation was introduced in Qt Mobility Mobility 1.2.


    landmark : Landmark

    Landmark whose categories the model should represent. Note that the landmark needs to be from LandmarkModel because its internal category identifiers need to be set.

    This documentation was introduced in Qt Mobility Mobility 1.2.


    Publicité

    Best Of

    Actualités les plus lues

    Semaine
    Mois
    Année
    1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 94
    2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
    3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
    4. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 42
    5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
    6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
    7. 2017 : un quinquennat pour une nouvelle version du C++ ? Possible, selon Herb Sutter 8
    Page suivante

    Le Qt Labs au hasard

    Logo

    Utiliser OpenCL avec Qt

    Les Qt Labs sont les laboratoires des développeurs de Qt, où ils peuvent partager des impressions sur le framework, son utilisation, ce que pourrait être son futur. Lire l'article.

    Communauté

    Ressources

    Liens utiles

    Contact

    • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

    Qt dans le magazine

    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 qtmobility-1.2
    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