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  · 

QGeoMapTextObject Class Reference

The QGeoMapTextObject class is a QGeoMapObject used to draw text on a map. More...

 #include <QGeoMapTextObject>

Inherits QGeoMapObject.

Properties

Public Functions

QGeoMapTextObject ()
QGeoMapTextObject ( const QGeoCoordinate & coordinate, const QString & text = QString(), const QFont & font = QFont(), const QPoint & offset = QPoint(), Qt::Alignment alignment = Qt::AlignCenter )
~QGeoMapTextObject ()
Qt::Alignment alignment () const
QBrush brush () const
QGeoCoordinate coordinate () const
QFont font () const
QPoint offset () const
QPen pen () const
void setAlignment ( Qt::Alignment alignment )
void setBrush ( const QBrush & brush )
void setCoordinate ( const QGeoCoordinate & coordinate )
void setFont ( const QFont & font )
void setOffset ( const QPoint & offset )
void setPen ( const QPen & pen )
void setText ( const QString & text )
QString text () const

Reimplemented Public Functions

virtual QGeoMapObject::Type type () const

Signals

void alignmentChanged ( Qt::Alignment alignment )
void brushChanged ( const QBrush & brush )
void coordinateChanged ( const QGeoCoordinate & coordinate )
void fontChanged ( const QFont & font )
void offsetChanged ( const QPoint & offset )
void penChanged ( const QPen & pen )
void textChanged ( const QString & text )

Additional Inherited Members

  • 1 public slot inherited from QObject
  • 1 public variable inherited from QObject
  • 4 static public members inherited from QObject
  • 7 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

The QGeoMapTextObject class is a QGeoMapObject used to draw text on a map.

The text is drawn at a given coordinate on the map.

The text object is drawn such that the rendered size of the text object is independent of the zoom level of the map.

Property Documentation

alignment : Qt::Alignment

This property holds this property holds the alignment options used to align the text when drawing this text object.

The default value of this property will align the text so that it is centered both horizontally and vertically around the point that is QGeoMapTextObject::offset pixels away from the position of QGeoMapTextObject::coordinate on the screen.

The alignment does not take the width of QGeoMapTextObject::pen into consideration.

Access functions:

Qt::Alignment alignment () const
void setAlignment ( Qt::Alignment alignment )

Notifier signal:

void alignmentChanged ( Qt::Alignment alignment )

brush : QBrush

This property holds this property holds the brush that will be used to draw this object.

The brush is used to fill in the glyphs of the text.

The outline around the perimeter of the glyphs is drawn using the QGeoMapTextObject::pen property.

Access functions:

QBrush brush () const
void setBrush ( const QBrush & brush )

Notifier signal:

void brushChanged ( const QBrush & brush )

coordinate : QGeoCoordinate

This property holds this property holds the coordinate at which this text object will be rendered.

The default value of this property is an invalid coordinate. While the value of this property is invalid the text object will not be displayed.

If QGeoMapTextObject::offset and QGeoMapTextObject::alignment are not set the text will be drawn so that it is centered both horizontally and vertically around the position of QGeoMapTextObject::coordinate on the screen.

Access functions:

QGeoCoordinate coordinate () const
void setCoordinate ( const QGeoCoordinate & coordinate )

Notifier signal:

void coordinateChanged ( const QGeoCoordinate & coordinate )

font : QFont

This property holds this property holds the font that will be used to render the text for this text object.

The default value of this property is the application's default font.

It is not necessary to account for the zoom level of the map, since text objects are scaled such that they appear to be independent of the zoom level.

Access functions:

QFont font () const
void setFont ( const QFont & font )

Notifier signal:

void fontChanged ( const QFont & font )

offset : QPoint

This property holds this property holds the offset in pixels from the screen position of QGeoMapTextObject::coordinate at which the text will be rendered when drawing this text object.

The default value of this property is QPoint(0,0).

Access functions:

QPoint offset () const
void setOffset ( const QPoint & offset )

Notifier signal:

void offsetChanged ( const QPoint & offset )

pen : QPen

This property holds this property holds the pen that will be used to draw this object.

The pen is used to draw an outline around the text. The text itself is filled using the QGeoMapTextObject::brush property.

The pen will be treated as a cosmetic pen, which means that the width of the pen will be independent of the zoom level of the map.

Access functions:

QPen pen () const
void setPen ( const QPen & pen )

Notifier signal:

void penChanged ( const QPen & pen )

text : QString

This property holds this property holds the text that will be displayed by this text object.

The default value of this property is an empty string.

Access functions:

QString text () const
void setText ( const QString & text )

Notifier signal:

void textChanged ( const QString & text )

Member Function Documentation

QGeoMapTextObject::QGeoMapTextObject ()

Constructs a new text object.

QGeoMapTextObject::QGeoMapTextObject ( const QGeoCoordinate & coordinate, const QString & text = QString(), const QFont & font = QFont(), const QPoint & offset = QPoint(), Qt::Alignment alignment = Qt::AlignCenter )

Constructs a new text object which will display the text text with font font at the coordinate coordinate on the map.

The text will be displayed at an on-screen offset from the coordinate of offset pixels, and will be aligned according to alignment.

QGeoMapTextObject::~QGeoMapTextObject ()

Destroys this text object.

void QGeoMapTextObject::alignmentChanged ( Qt::Alignment alignment ) [signal]

This signal is emitted when the alignment of this text object has changed.

The new value is alignment.

void QGeoMapTextObject::brushChanged ( const QBrush & brush ) [signal]

This signal is emitted when the brush used to fill the inside of the letters for this text object has changed.

The new value is brush.

void QGeoMapTextObject::coordinateChanged ( const QGeoCoordinate & coordinate ) [signal]

This signal is emitted when the coordinate at which this text object will be drawn has changed.

The new value is coordinate.

void QGeoMapTextObject::fontChanged ( const QFont & font ) [signal]

This signal is emitted when the font use to draw this text object has changed.

The new value is font.

void QGeoMapTextObject::offsetChanged ( const QPoint & offset ) [signal]

This signal is emitted when the on screen offset from the coordinate at which this text object will be drawn has changed.

The new value is offset.

void QGeoMapTextObject::penChanged ( const QPen & pen ) [signal]

This signal is emitted when the pen used to draw the outline of the letters for this text object has changed.

The new value is pen.

void QGeoMapTextObject::textChanged ( const QString & text ) [signal]

This signal is emitted when the text to be drawn by this text object has changed.

The new value is text.

QGeoMapObject::Type QGeoMapTextObject::type () const [virtual]

Reimplemented from QGeoMapObject::type().

X

Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.

[0]; s.parentNode.insertBefore(ga, s); })();
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 6
Page suivante

Le blog Digia au hasard

Logo

Déploiement d'applications Qt Commercial sur les tablettes Windows 8

Le blog Digia est l'endroit privilégié pour la communication sur l'édition commerciale de Qt, où des réponses publiques sont apportées aux questions les plus posées au support. 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.1
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