QGIS API Documentation
2.18.21-Las Palmas (9fba24a)
|
Abstract base class for composer items with the ability to distribute the content to several frames (QgsComposerFrame items). More...
#include <qgscomposermultiframe.h>
Public Types | |
enum | ResizeMode { UseExistingFrames = 0, ExtendToNextPage, RepeatOnEveryPage, RepeatUntilFinished } |
Specifies the behaviour for creating new frames to fit the multiframe's content. More... | |
Public Types inherited from QgsComposerObject | |
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, MapLayers, MapStylePreset, 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 | |
void | recalculateFrameRects () |
Forces a recalculation of all the associated frame's scene rectangles. More... | |
virtual void | recalculateFrameSizes () |
Recalculates the portion of the multiframe item which is shown in each of it's component frames. More... | |
void | update () |
Forces a redraw of all child frames. More... | |
Public Slots inherited from QgsComposerObject | |
virtual void | refreshDataDefinedProperty (const DataDefinedProperty property=AllProperties, const QgsExpressionContext *context=nullptr) |
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 | changed () |
Emitted when the properties of a multi frame have changed, and the GUI item widget must be updated. More... | |
void | contentsChanged () |
Emitted when the contents of the multi frame have changed and the frames must be redrawn. More... | |
Signals inherited from QgsComposerObject | |
void | itemChanged () |
Emitted when the item changes. More... | |
Public Member Functions | |
QgsComposerMultiFrame (QgsComposition *c, bool createUndoCommands) | |
Construct a new multiframe item. More... | |
virtual | ~QgsComposerMultiFrame () |
bool | _readXML (const QDomElement &itemElem, const QDomDocument &doc, bool ignoreFrames=false) |
Restores state information about base multiframe object from a DOM element. More... | |
bool | _writeXML (QDomElement &elem, QDomDocument &doc, bool ignoreFrames=false) const |
Stores state information about base multiframe object in DOM element. More... | |
virtual void | addFrame (QgsComposerFrame *frame, bool recalcFrameSizes=true)=0 |
Adds a frame to the multiframe. More... | |
QgsComposition * | composition () |
Returns the parent composition for the multiframe. More... | |
QgsComposerFrame * | createNewFrame (QgsComposerFrame *currentFrame, QPointF pos, QSizeF size) |
Creates a new frame and adds it to the multi frame and composition. More... | |
bool | createUndoCommands () const |
Returns whether undo commands should be created for interactions with the multiframe. More... | |
void | deleteFrames () |
Removes and deletes all child frames. More... | |
virtual QString | displayName () const |
Get multiframe display name. More... | |
virtual double | findNearbyPageBreak (double yPos) |
Finds the optimal position to break a frame at. More... | |
virtual QSizeF | fixedFrameSize (const int frameIndex=-1) const |
Returns the fixed size for a frame, if desired. More... | |
QgsComposerFrame * | frame (int i) const |
Returns a child frame from the multiframe. More... | |
int | frameCount () const |
Returns the number of frames associated with this multiframe. More... | |
int | frameIndex (QgsComposerFrame *frame) const |
Returns the index of a frame within the multiframe. More... | |
virtual QSizeF | minFrameSize (const int frameIndex=-1) const |
Returns the minimum size for a frames, if desired. More... | |
virtual bool | readXML (const QDomElement &itemElem, const QDomDocument &doc, bool ignoreFrames=false)=0 |
Reads multiframe state information from a DOM element. More... | |
void | removeFrame (int i, const bool removeEmptyPages=false) |
Removes a frame from the multiframe. More... | |
virtual Q_DECL_DEPRECATED void | render (QPainter *p, const QRectF &renderExtent) |
Renders a portion of the multiframe's content into a painter. More... | |
virtual void | render (QPainter *painter, const QRectF &renderExtent, const int frameIndex) |
Renders a portion of the multiframe's content into a painter. More... | |
ResizeMode | resizeMode () const |
Returns the resize mode for the multiframe. More... | |
void | setCreateUndoCommands (bool enabled) |
Sets whether undo commands should be created for interactions with the multiframe. More... | |
void | setResizeMode (ResizeMode mode) |
Sets the resize mode for the multiframe, and recalculates frame sizes to match. More... | |
virtual QSizeF | totalSize () const =0 |
Returns the total size of the multiframe's content. More... | |
virtual bool | writeXML (QDomElement &elem, QDomDocument &doc, bool ignoreFrames=false) const =0 |
Stores state information about multiframe in DOM element. More... | |
Public Member Functions inherited from QgsComposerObject | |
QgsComposerObject (QgsComposition *composition) | |
Constructor. More... | |
virtual | ~QgsComposerObject () |
const QgsComposition * | composition () const |
Returns the composition the item is attached to. More... | |
QgsComposition * | composition () |
virtual QgsExpressionContext * | createExpressionContext () const |
Creates an expression context relating to the objects' current state. More... | |
QStringList | customProperties () const |
Return list of keys stored in custom properties for the object. More... | |
QVariant | customProperty (const QString &key, const QVariant &defaultValue=QVariant()) const |
Read a custom property from the object. More... | |
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 | removeCustomProperty (const QString &key) |
Remove a custom property from the object. More... | |
void | setCustomProperty (const QString &key, const QVariant &value) |
Set a custom property for the object. 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 Slots | |
void | handleFrameRemoval (QgsComposerItem *item) |
Called before a frame is going to be removed. More... | |
void | handlePageChange () |
Adapts to changed number of composition pages if resize type is RepeatOnEveryPage. More... | |
Protected Attributes | |
bool | mCreateUndoCommands |
True: creates QgsMultiFrameCommands on internal changes (e.g. More... | |
QList< QgsComposerFrame * > | mFrameItems |
ResizeMode | mResizeMode |
Protected Attributes inherited from QgsComposerObject | |
QgsComposition * | mComposition |
QgsObjectCustomProperties | mCustomProperties |
Custom properties for object. More... | |
QMap< QgsComposerObject::DataDefinedProperty, QString > | mDataDefinedNames |
Map of data defined properties for the item to string name to use when exporting item to xml. More... | |
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) |
Protected Member Functions inherited from QgsComposerObject | |
bool | dataDefinedEvaluate (const QgsComposerObject::DataDefinedProperty property, QVariant &expressionValue, const QgsExpressionContext &context=QgsExpressionContext()) const |
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) |
Static Protected Member Functions inherited from QObject | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
Properties inherited from QObject | |
objectName | |
Abstract base class for composer items with the ability to distribute the content to several frames (QgsComposerFrame items).
Definition at line 39 of file qgscomposermultiframe.h.
Specifies the behaviour for creating new frames to fit the multiframe's content.
Definition at line 47 of file qgscomposermultiframe.h.
QgsComposerMultiFrame::QgsComposerMultiFrame | ( | QgsComposition * | c, |
bool | createUndoCommands | ||
) |
Construct a new multiframe item.
c | parent composition |
createUndoCommands |
Definition at line 21 of file qgscomposermultiframe.cpp.
|
virtual |
Definition at line 39 of file qgscomposermultiframe.cpp.
bool QgsComposerMultiFrame::_readXML | ( | const QDomElement & | itemElem, |
const QDomDocument & | doc, | ||
bool | ignoreFrames = false |
||
) |
Restores state information about base multiframe object from a DOM element.
Implementations of readXML should call this method.
itemElem | is DOM element |
doc | is the DOM document |
ignoreFrames | set to false to avoid reading state information about child frames from DOM |
Definition at line 374 of file qgscomposermultiframe.cpp.
bool QgsComposerMultiFrame::_writeXML | ( | QDomElement & | elem, |
QDomDocument & | doc, | ||
bool | ignoreFrames = false |
||
) | const |
Stores state information about base multiframe object in DOM element.
Implementations of writeXML should call this method.
elem | is DOM element |
doc | is the DOM document |
ignoreFrames | set to false to avoid writing state information about child frames into DOM |
Definition at line 359 of file qgscomposermultiframe.cpp.
|
pure virtual |
Adds a frame to the multiframe.
frame | frame to add |
recalcFrameSizes | set to true to force recalculation of all existing frame sizes |
Implemented in QgsComposerHtml, QgsComposerTextTableV2, and QgsComposerAttributeTableV2.
|
signal |
Emitted when the properties of a multi frame have changed, and the GUI item widget must be updated.
|
inline |
Returns the parent composition for the multiframe.
Definition at line 188 of file qgscomposermultiframe.h.
|
signal |
Emitted when the contents of the multi frame have changed and the frames must be redrawn.
QgsComposerFrame * QgsComposerMultiFrame::createNewFrame | ( | QgsComposerFrame * | currentFrame, |
QPointF | pos, | ||
QSizeF | size | ||
) |
Creates a new frame and adds it to the multi frame and composition.
currentFrame | an existing QgsComposerFrame from which to copy the size and general frame properties (eg frame style, background, rendering settings). |
pos | position of top-left corner of the new frame |
size | size of the new frame |
Definition at line 199 of file qgscomposermultiframe.cpp.
|
inline |
Returns whether undo commands should be created for interactions with the multiframe.
Definition at line 194 of file qgscomposermultiframe.h.
void QgsComposerMultiFrame::deleteFrames | ( | ) |
Removes and deletes all child frames.
Definition at line 330 of file qgscomposermultiframe.cpp.
|
virtual |
Get multiframe display name.
Reimplemented in QgsComposerHtml, and QgsComposerAttributeTableV2.
Definition at line 225 of file qgscomposermultiframe.cpp.
|
inlinevirtual |
Finds the optimal position to break a frame at.
yPos | maximum vertical position for break |
Reimplemented in QgsComposerHtml.
Definition at line 121 of file qgscomposermultiframe.h.
|
inlinevirtual |
Returns the fixed size for a frame, if desired.
If the fixed frame size changes, the sizes of all frames can be recalculated by calling recalculateFrameRects().
frameIndex | frame number |
Reimplemented in QgsComposerTableV2.
Definition at line 79 of file qgscomposermultiframe.h.
QgsComposerFrame * QgsComposerMultiFrame::frame | ( | int | i | ) | const |
Returns a child frame from the multiframe.
i | index of frame |
Definition at line 345 of file qgscomposermultiframe.cpp.
|
inline |
Returns the number of frames associated with this multiframe.
Definition at line 205 of file qgscomposermultiframe.h.
int QgsComposerMultiFrame::frameIndex | ( | QgsComposerFrame * | frame | ) | const |
Returns the index of a frame within the multiframe.
frame | frame to find index of |
Definition at line 354 of file qgscomposermultiframe.cpp.
|
protectedslot |
Called before a frame is going to be removed.
Updates frame list and recalculates content of remaining frames.
Definition at line 230 of file qgscomposermultiframe.cpp.
|
protectedslot |
Adapts to changed number of composition pages if resize type is RepeatOnEveryPage.
Definition at line 257 of file qgscomposermultiframe.cpp.
|
inlinevirtual |
Returns the minimum size for a frames, if desired.
If the minimum size changes, the sizes of all frames can be recalculated by calling recalculateFrameRects().
frameIndex | frame number |
Reimplemented in QgsComposerTableV2.
Definition at line 91 of file qgscomposermultiframe.h.
|
pure virtual |
Reads multiframe state information from a DOM element.
Implementations of readXML should also call the _readXML method to restore general multiframe properties.
itemElem | is DOM element |
doc | is the DOM document |
ignoreFrames | set to false to avoid read state information about child frames from DOM |
Implemented in QgsComposerTableV2, QgsComposerHtml, and QgsComposerAttributeTableV2.
|
slot |
Forces a recalculation of all the associated frame's scene rectangles.
This method is useful for multiframes which implement a minFrameSize() or fixedFrameSize() method.
Definition at line 184 of file qgscomposermultiframe.cpp.
|
virtualslot |
Recalculates the portion of the multiframe item which is shown in each of it's component frames.
If the resize mode is set to anything but UseExistingFrames then this may cause new frames to be added or frames to be removed, in order to fit the current size of the multiframe's content.
Definition at line 70 of file qgscomposermultiframe.cpp.
void QgsComposerMultiFrame::removeFrame | ( | int | i, |
const bool | removeEmptyPages = false |
||
) |
Removes a frame from the multiframe.
This method automatically removes the frame from the composition.
i | index of frame to remove |
removeEmptyPages | set to true to remove pages which are empty after the frame is removed |
Definition at line 298 of file qgscomposermultiframe.cpp.
Renders a portion of the multiframe's content into a painter.
p | destination painter |
renderExtent | visible extent of content to render into the painter. |
Definition at line 44 of file qgscomposermultiframe.cpp.
|
virtual |
Renders a portion of the multiframe's content into a painter.
painter | destination painter |
renderExtent | visible extent of content to render into the painter. |
frameIndex | frame number for content |
Reimplemented in QgsComposerTableV2, and QgsComposerHtml.
Definition at line 51 of file qgscomposermultiframe.cpp.
|
inline |
Returns the resize mode for the multiframe.
Definition at line 147 of file qgscomposermultiframe.h.
|
inline |
Sets whether undo commands should be created for interactions with the multiframe.
enabled | set to true if undo commands should be created |
Definition at line 200 of file qgscomposermultiframe.h.
void QgsComposerMultiFrame::setResizeMode | ( | ResizeMode | mode | ) |
Sets the resize mode for the multiframe, and recalculates frame sizes to match.
mode | resize mode |
Definition at line 60 of file qgscomposermultiframe.cpp.
|
pure virtual |
Returns the total size of the multiframe's content.
Implemented in QgsComposerTableV2, and QgsComposerHtml.
|
slot |
Forces a redraw of all child frames.
Definition at line 322 of file qgscomposermultiframe.cpp.
|
pure virtual |
Stores state information about multiframe in DOM element.
Implementations of writeXML should also call the _writeXML method to save general multiframe properties.
elem | is DOM element |
doc | is the DOM document |
ignoreFrames | set to false to avoid writing state information about child frames into DOM |
Implemented in QgsComposerTableV2, QgsComposerHtml, and QgsComposerAttributeTableV2.
|
protected |
True: creates QgsMultiFrameCommands on internal changes (e.g.
changing frames )
Definition at line 281 of file qgscomposermultiframe.h.
|
protected |
Definition at line 276 of file qgscomposermultiframe.h.
|
protected |
Definition at line 278 of file qgscomposermultiframe.h.