|
QGIS API Documentation
2.10.1-Pisa
|
A base class for objects which belong to a map composition. More...
#include <qgscomposerobject.h>

Public Types | |
| enum | DataDefinedProperty { NoProperty = 0, AllProperties, TestProperty, PresetPaperSize, PaperWidth, PaperHeight, NumPages, PaperOrientation, PageNumber, PositionX, PositionY, ItemWidth, ItemHeight, ItemRotation, Transparency, BlendMode, ExcludeFromExports, MapRotation, MapScale, MapXMin, MapYMin, MapXMax, MapYMax, MapAtlasMargin, PictureSource, SourceUrl } |
| Data defined properties for different item types. More... | |
| enum | PropertyValueType { EvaluatedValue = 0, OriginalValue } |
| Specifies whether the value returned by a function should be the original, user set value, or the current evaluated value for the property. More... | |
Public Slots | |
| virtual void | refreshDataDefinedProperty (const DataDefinedProperty property=AllProperties) |
| Refreshes a data defined property for the item by reevaluating the property's value and redrawing the item with this new value. More... | |
| virtual void | repaint () |
| Triggers a redraw for the item. More... | |
Signals | |
| void | itemChanged () |
| Emitted when the item changes. More... | |
Public Member Functions | |
| QgsComposerObject (QgsComposition *composition) | |
| Constructor. More... | |
| virtual | ~QgsComposerObject () |
| const QgsComposition * | composition () const |
| Returns the composition the item is attached to. More... | |
| QgsComposition * | composition () |
| QgsDataDefined * | dataDefinedProperty (const DataDefinedProperty property) const |
| Returns a reference to the data defined settings for one of the item's data defined properties. More... | |
| virtual bool | readXML (const QDomElement &itemElem, const QDomDocument &doc) |
| Sets item state from DOM element. More... | |
| void | setDataDefinedProperty (const DataDefinedProperty property, const bool active, const bool useExpression, const QString &expression, const QString &field) |
| Sets parameters for a data defined property for the item. More... | |
| virtual bool | writeXML (QDomElement &elem, QDomDocument &doc) const |
| Stores item state in DOM element. More... | |
Public Member Functions inherited from QObject | |
| QObject (QObject *parent) | |
| QObject (QObject *parent, const char *name) | |
| virtual | ~QObject () |
| bool | blockSignals (bool block) |
| QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
| const QObjectList & | children () const |
| const char * | className () const |
| bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
| void | deleteLater () |
| void | destroyed (QObject *obj) |
| bool | disconnect (const QObject *receiver, const char *method) |
| bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
| void | dumpObjectInfo () |
| void | dumpObjectTree () |
| QList< QByteArray > | dynamicPropertyNames () const |
| virtual bool | event (QEvent *e) |
| virtual bool | eventFilter (QObject *watched, QEvent *event) |
| T | findChild (const QString &name) const |
| QList< T > | findChildren (const QRegExp ®Exp) const |
| QList< T > | findChildren (const QString &name) const |
| bool | inherits (const char *className) const |
| void | insertChild (QObject *object) |
| void | installEventFilter (QObject *filterObj) |
| bool | isA (const char *className) const |
| bool | isWidgetType () const |
| void | killTimer (int id) |
| virtual const QMetaObject * | metaObject () const |
| void | moveToThread (QThread *targetThread) |
| const char * | name () const |
| const char * | name (const char *defaultName) const |
| QString | objectName () const |
| QObject * | parent () const |
| QVariant | property (const char *name) const |
| void | removeChild (QObject *object) |
| void | removeEventFilter (QObject *obj) |
| void | setName (const char *name) |
| void | setObjectName (const QString &name) |
| void | setParent (QObject *parent) |
| bool | setProperty (const char *name, const QVariant &value) |
| bool | signalsBlocked () const |
| int | startTimer (int interval) |
| QThread * | thread () const |
Protected Member Functions | |
| bool | dataDefinedEvaluate (const QgsComposerObject::DataDefinedProperty property, QVariant &expressionValue) |
| Evaluate a data defined property and return the calculated value. More... | |
Protected Member Functions inherited from QObject | |
| bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
| virtual void | childEvent (QChildEvent *event) |
| virtual void | connectNotify (const char *signal) |
| virtual void | customEvent (QEvent *event) |
| virtual void | disconnectNotify (const char *signal) |
| int | receivers (const char *signal) const |
| QObject * | sender () const |
| int | senderSignalIndex () const |
| virtual void | timerEvent (QTimerEvent *event) |
Protected Attributes | |
| QgsComposition * | mComposition |
| QMap < QgsComposerObject::DataDefinedProperty, QString > | mDataDefinedNames |
| Map of data defined properties for the item to string name to use when exporting item to xml. More... | |
Friends | |
| class | TestQgsComposerObject |
Additional Inherited Members | |
Static Public Member Functions inherited from QObject | |
| bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
| bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
| bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
| bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
| QString | tr (const char *sourceText, const char *disambiguation, int n) |
| QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
Static Protected Member Functions inherited from QObject | |
| QByteArray | normalizeSignalSlot (const char *signalSlot) |
Properties inherited from QObject | |
| objectName | |
A base class for objects which belong to a map composition.
Definition at line 33 of file qgscomposerobject.h.
Data defined properties for different item types.
Definition at line 40 of file qgscomposerobject.h.
Specifies whether the value returned by a function should be the original, user set value, or the current evaluated value for the property.
This may differ if a property has a data defined expression active.
| Enumerator | |
|---|---|
| EvaluatedValue |
return the current evaluated value for the property |
| OriginalValue |
return the original, user set value |
Definition at line 79 of file qgscomposerobject.h.
| QgsComposerObject::QgsComposerObject | ( | QgsComposition * | composition | ) |
Constructor.
| composition | parent composition |
Definition at line 31 of file qgscomposerobject.cpp.
|
virtual |
Definition at line 56 of file qgscomposerobject.cpp.
|
inline |
Returns the composition the item is attached to.
Definition at line 94 of file qgscomposerobject.h.
|
inline |
Definition at line 95 of file qgscomposerobject.h.
|
protected |
Evaluate a data defined property and return the calculated value.
| property | data defined property to evaluate |
| expressionValue | QVariant for storing the evaluated value |
Definition at line 148 of file qgscomposerobject.cpp.
| QgsDataDefined * QgsComposerObject::dataDefinedProperty | ( | const DataDefinedProperty | property | ) | const |
Returns a reference to the data defined settings for one of the item's data defined properties.
| property | data defined property to return |
Definition at line 88 of file qgscomposerobject.cpp.
|
signal |
Emitted when the item changes.
Signifies that the item widgets must update the gui elements.
|
virtual |
Sets item state from DOM element.
| itemElem | is DOM node corresponding to item tag |
| doc | is DOM document |
Reimplemented in QgsComposerScaleBar, QgsComposerMap, QgsComposerMapGrid, QgsComposerArrow, QgsComposerLegend, QgsComposerMapOverview, QgsComposerLabel, QgsComposerPicture, QgsComposerAttributeTable, QgsPaperItem, QgsComposerItemGroup, QgsComposerMapItem, QgsComposerShape, QgsComposerTextTable, QgsComposerFrame, and QgsComposerTable.
Definition at line 74 of file qgscomposerobject.cpp.
|
virtualslot |
Refreshes a data defined property for the item by reevaluating the property's value and redrawing the item with this new value.
| property | data defined property to refresh. If property is set to QgsComposerItem::AllProperties then all data defined properties for the item will be refreshed. |
Definition at line 141 of file qgscomposerobject.cpp.
|
virtualslot |
Triggers a redraw for the item.
Definition at line 136 of file qgscomposerobject.cpp.
| void QgsComposerObject::setDataDefinedProperty | ( | const DataDefinedProperty | property, |
| const bool | active, | ||
| const bool | useExpression, | ||
| const QString & | expression, | ||
| const QString & | field | ||
| ) |
Sets parameters for a data defined property for the item.
| property | data defined property to set |
| active | true if data defined property is active, false if it is disabled |
| useExpression | true if the expression should be used |
| expression | expression for data defined property |
| field | field name if the data defined property should take its value from a field |
Definition at line 107 of file qgscomposerobject.cpp.
|
virtual |
Stores item state in DOM element.
| elem | is DOM element corresponding to item tag |
| doc | is the DOM document |
Reimplemented in QgsComposerScaleBar, QgsComposerMap, QgsComposerMapGrid, QgsComposerArrow, QgsComposerLegend, QgsComposerMapOverview, QgsComposerLabel, QgsComposerPicture, QgsComposerAttributeTable, QgsPaperItem, QgsComposerFrame, QgsComposerTable, QgsComposerItemGroup, QgsComposerShape, QgsComposerMapItem, and QgsComposerTextTable.
Definition at line 61 of file qgscomposerobject.cpp.
|
friend |
Definition at line 171 of file qgscomposerobject.h.
|
protected |
Definition at line 141 of file qgscomposerobject.h.
|
protected |
Map of data defined properties for the item to string name to use when exporting item to xml.
Definition at line 144 of file qgscomposerobject.h.
1.8.6