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 MapMouseArea Element

The MapMouseArea item enables simple mouse handling. More...

  • List of all members, including inherited members
  • Properties

    Signals

    Detailed Description

    A MapMouseArea is an invisible item that is typically used in conjunction with a visible map object or map item in order to provide mouse handling. By effectively acting as a proxy, the logic for mouse handling can be contained within a MapMouseArea item.

    The enabled property is used to enable and disable mouse handling for the proxied item. When disabled, the mouse area becomes transparent to mouse events.

    The pressed read-only property indicates whether or not the user is holding down a mouse button over the mouse area. This property is often used in bindings between properties in a user interface.

    Information about the mouse position and button clicks are provided via signals for which event handler properties are defined. The most commonly used involved handling mouse presses and clicks: onClicked, onDoubleClicked, onPressed and onReleased.

    MapMouseArea items only report mouse clicks and not changes to the position of the mouse cursor.

    See also MapMouseEvent.

    Property Documentation

    acceptedButtons : Qt::MouseButtons

    This property holds the mouse buttons that the mouse area reacts to.

    The available buttons are:

    • Qt.LeftButton
    • Qt.RightButton
    • Qt.MiddleButton

    To accept more than one button the flags can be combined with the "|" (or) operator:

     MapMouseArea { acceptedButtons: Qt.LeftButton | Qt.RightButton }

    The default value is Qt.LeftButton.

    This documentation was introduced in Qt Mobility Mobility 1.2.


    enabled : bool

    This property holds whether the item accepts mouse events.

    By default, this property is true.

    This documentation was introduced in Qt Mobility Mobility 1.2.


    read-onlymouseX : qreal

    read-onlymouseY : qreal

    These properties hold the screen coordinates of the mouse cursor.

    These properties will only be valid while a button is pressed, and will remain valid as long as the button is held down even if the mouse is moved outside the area.

    The screen coordinates are relative to the MouseArea.

    This documentation was introduced in Qt Mobility Mobility 1.2.


    read-onlypressed : bool

    This property holds whether the mouse area is currently pressed.

    This documentation was introduced in Qt Mobility Mobility 1.2.


    read-onlypressedButton : MouseButton

    This property holds the mouse button currently pressed.

    It is one of:

    • Qt.LeftButton
    • Qt.RightButton
    • Qt.MiddleButton

    This documentation was introduced in Qt Mobility Mobility 1.2.

    See also acceptedButtons.


    Signal Documentation

    MapMouseArea::onClicked ( MapMouseEvent mouse )

    This handler is called when there is a click. A click is defined as a press followed by a release, both inside the MapMouseArea (pressing, moving outside the MapMouseArea, and then moving back inside and releasing is also considered a click).

    The mouse parameter provides information about the click, including the x and y position of the release of the click.

    The accepted property of the MapMouseEvent parameter is ignored in this handler.

    This documentation was introduced in Qt Mobility Mobility 1.2.


    MapMouseArea::onDoubleClicked ( MapMouseEvent mouse )

    This handler is called when there is a double-click (a press followed by a release followed by a press).

    The mouse parameter provides information about the click, including the x and y position of the release of the click.

    If the accepted property of the mouse parameter is set to false in the handler, the onPressed/onReleased/onClicked handlers will be called for the second click; otherwise they are suppressed. The accepted property defaults to true.

    This documentation was introduced in Qt Mobility Mobility 1.2.


    MapMouseArea::onPressed ( MapMouseEvent mouse )

    This handler is called when there is a press.

    The mouse parameter provides information about the press, including the x and y position and which button was pressed.

    The accepted property of the MapMouseEvent parameter determines whether this MapMouseArea will handle the press and all future mouse events until release. The default is to accept the event and not allow other MapMouseArea beneath this one to handle the event. If accepted is set to false, no further events will be sent to this MapMouseArea until the button is next pressed.

    This documentation was introduced in Qt Mobility Mobility 1.2.


    MapMouseArea::onReleased ( MapMouseEvent mouse )

    This handler is called when there is a release. The mouse parameter provides information about the click, including the x and y position of the release of the click.

    The accepted property of the MapMouseEvent parameter is ignored in this handler.

    This documentation was introduced in Qt Mobility Mobility 1.2.


    Publicité

    Best Of

    Actualités les plus lues

    Semaine
    Mois
    Année
    1. Microsoft ouvre aux autres compilateurs C++ AMP, la spécification pour la conception d'applications parallèles C++ utilisant le GPU 22
    2. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 38
    3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
    4. RIM : « 13 % des développeurs ont gagné plus de 100 000 $ sur l'AppWord », Qt et open-source au menu du BlackBerry DevCon Europe 0
    5. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
    6. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
    7. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
    Page suivante

    Le Qt Quarterly au hasard

    Logo

    Le repérage des paires de parenthèses avec QSyntaxHighlighter

    Qt Quarterly est la revue trimestrielle proposée par Nokia et à destination des développeurs Qt. Ces articles d'une grande qualité technique sont rédigés par des experts Qt. 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