MeeGo 1.2 Harmattan Developer Documentation Develop for the Nokia N9

QML MapText Element

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

This element was introduced in Mobility 1.2.

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.

This property group was introduced in Mobility 1.2.


coordinate : Coordinate

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

This property group was introduced in Mobility 1.2.


font.bold : bool

Sets whether the font weight is bold.

This property group was introduced in Mobility 1.2.


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 }

This property group was introduced in Mobility 1.2.


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.

This property group was introduced in Mobility 1.2.


font.italic : bool

Sets whether the font has an italic style.

This property group was introduced in Mobility 1.2.


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.

This property group was introduced in Mobility 1.2.


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.

This property group was introduced in Mobility 1.2.


font.pointSize : real

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

This property group was introduced in Mobility 1.2.


font.strikeout : bool

Sets whether the font has a strikeout style.

This property group was introduced in Mobility 1.2.


font.underline : bool

Sets whether the text is underlined.

This property group was introduced in Mobility 1.2.


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 }

This property group was introduced in Mobility 1.2.


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.

This property group was introduced in Mobility 1.2.


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.

This property group was introduced in Mobility 1.2.


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.

This property group was introduced in Mobility 1.2.


text : string

This property holds the text to display.

The default value is an empty string.

This property group was introduced in Mobility 1.2.


visible : bool

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

This property group was introduced in Mobility 1.2.


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.

This property group was introduced in Mobility 1.2.