QtMobility Reference Documentation

Contents

QML MapText Element

The MapText element displays text on a map. More...

  • List of all members, including inherited members
  • Properties

    Detailed Description

    The string text will be drawn offset.x and offset.y pixels away from the on-screen position of coordinate.

    The text will be rendered with font font and color color, and will be aligned according to horizontalAlignment and verticalAlignment.

    If text is empty or coordinate is invalid nothing will be displayed.

    An example of text item:

                 MapText {
                     color: "blue"
                     coordinate: landmark.coordinate
                     text: landmark.name
                     font.pointSize: 8
                 }

    The MapText element is part of the QtMobility.location 1.2 module.

    Property Documentation

    color : color

    This property holds the color used to draw the text.

    The default value is black.


    coordinate : Coordinate

    This property holds the coordinate at which to anchor the text.


    font.bold : bool

    Sets whether the font weight is bold.


    font.capitalization : enumeration

    Sets the capitalization for the text.

    • Font.MixedCase - This is the normal text rendering option where no capitalization change is applied.
    • Font.AllUppercase - This alters the text to be rendered in all uppercase type.
    • Font.AllLowercase - This alters the text to be rendered in all lowercase type.
    • Font.SmallCaps - This alters the text to be rendered in small-caps type.
    • Font.Capitalize - This alters the text to be rendered with the first character of each word as an uppercase character.
     MapText { text: "Hello"; font.capitalization: Font.AllLowercase }

    font.family : string

    Sets the family name of the font.

    The family name is case insensitive and may optionally include a foundry name, e.g. "Helvetica [Cronyx]". If the family is available from more than one foundry and the foundry isn't specified, an arbitrary foundry is chosen. If the family isn't available a family will be set using the font matching algorithm.


    font.italic : bool

    Sets whether the font has an italic style.


    font.letterSpacing : real

    Sets the letter spacing for the font.

    Letter spacing changes the default spacing between individual letters in the font. A positive value increases the letter spacing by the corresponding pixels; a negative value decreases the spacing.


    font.pixelSize : int

    Sets the font size in pixels.

    Using this function makes the font device dependent. Use pointSize to set the size of the font in a device independent manner.


    font.pointSize : real

    Sets the font size in points. The point size must be greater than zero.


    font.strikeout : bool

    Sets whether the font has a strikeout style.


    font.underline : bool

    Sets whether the text is underlined.


    font.weight : enumeration

    Sets the font's weight.

    The weight can be one of:

    • Font.Light
    • Font.Normal - the default
    • Font.DemiBold
    • Font.Bold
    • Font.Black
     MapText { text: "Hello"; font.weight: Font.DemiBold }

    font.wordSpacing : real

    Sets the word spacing for the font.

    Word spacing changes the default spacing between individual words. A positive value increases the word spacing by a corresponding amount of pixels, while a negative value decreases the inter-word spacing accordingly.


    horizontalAlignment : enumeration

    verticalAlignment : enumeration

    Sets the horizontal and vertical alignment of the text.

    The alignment is relative to the point offset.x and offset.y pixels away from the on-screen position of coordinate.

    The valid values for horizontalAlignment are MapText.AlignLeft, MapText.AlignRight and MapText.AlignHCenter. The valid values for verticalAlignment are MapText.AlignTop, MapText.AlignBottom and MapText.AlignVCenter.

    The default values are MapText.AlignHCenter and MapText.AlignVCenter respectively.


    offset.x : int

    offset.y : int

    These properties hold the offset from the on-screen position of coordinate at which the text should be displayed.

    They both default to 0.


    selected : bool

    This property holds a boolean corresponding to whether or not the text is selected.


    text : string

    This property holds the text to display.

    The default value is an empty string.


    visible : bool

    This property holds a boolean corresponding to whether or not the text is visible.


    z : int

    This property holds the z-value of the text.

    Map objects are drawn in z-value order, and objects with the same z-value will be drawn in insertion order.