Specifies how the description balloon for a KmlNode is drawn. More...
| Header | #include <Kml |
| Since | Esri |
| Inherits | Esri |
Public Functions
| Kml | |
| virtual | ~ |
| QColor | background |
| bool | is |
| void | set |
| void | set |
| void | set |
| void | set |
| QString | text() const |
| QColor | text |
Detailed Description
Controls the balloon's text, background color, text color, and visibility. Corresponds to a <BalloonStyle> in a KML document.
Member Function Documentation
KmlBalloonStyle::KmlBalloonStyle (const QString &text, const QColor &backgroundColor , const QColor &textColor , bool visible, QObject *parent = nullptr)
Creates a KML balloon style with specified text, background color, text color, and visibility.
- text The text template used to format balloon content.
- backgroundColor The background color for the balloon. Default is white.
- textColor The text color for the balloon. Default is black.
- visible Specifies whether the balloon should be visible. Default is
true. - parent The optional parent object.
[override virtual noexcept] KmlBalloonStyle::~KmlBalloonStyle ()
Destructor.
QColor KmlBalloonStyle::backgroundColor () const
Returns the background color for the balloon. Default is white.
See also setBackgroundColor().
bool KmlBalloonStyle::isVisible () const
Returns whether the balloon should be visible. Default is true.
void KmlBalloonStyle::setBackgroundColor (const QColor &backgroundColor )
Sets the balloon background color to backgroundColor.
See also backgroundColor().
void KmlBalloonStyle::setText (const QString &text)
Sets the balloon text template to text.
See also text().
void KmlBalloonStyle::setTextColor (const QColor &textColor )
Sets the balloon text color to textColor.
See also textColor().
void KmlBalloonStyle::setVisible (bool visible)
Sets whether the balloon is visible.
See also isVisible().
QString KmlBalloonStyle::text() const
Returns the text, with optional template placeholders, to display in the balloon.
Balloon style text can be an explicit hardcoded string, or it can include placeholders to be substituted with values from the node. Valid placeholders include:
$[name]: The KmlNode::name.$[description]: The KmlNode::description.$[id]: The KmlNode::kmlNodeId.$[address]: The KmlNode::address.$[snippet]: The KmlNode::snippet.
Additionally, extended data display names and values from KmlNode::extendedSchemaData and KmlNode::extendedNonSchemaData can be substituted by using the following placeholders:
$[\<schemaName\>/\<fieldName\>/displayName]: The display name of a field in a schema.$[\<schemaName\>/\<fieldName\>]: The value of a field in a schema.$[\<fieldName\>/displayName]: The display name of a field not in a schema.$[\<fieldName\>]: The value of a field not in a schema.
If the text property is empty, KmlNode::balloonContent uses a default template of "<b>$[name]</b><br/>$[description]", while still honoring the specified colors and visibility. Text can also include raw HTML content enclosed in a CDATA section.
See also setText().
QColor KmlBalloonStyle::textColor () const
Returns the text color for the balloon. Default is black.
See also setTextColor().