23 mResizeMode( UseExistingFrames ),
24 mCreateUndoCommands( createUndoCommands ),
25 mIsRecalculatingSize( false )
31 QgsComposerMultiFrame::QgsComposerMultiFrame()
33 , mResizeMode( UseExistingFrames )
34 , mCreateUndoCommands( false )
35 , mIsRecalculatingSize( false )
48 Q_UNUSED( renderExtent );
53 Q_UNUSED( frameIndex );
56 render( painter, renderExtent );
78 double totalHeight = size.
height();
80 if ( totalHeight < 1 )
86 double currentHeight = 0;
95 bool removingPages =
true;
119 currentY += currentHeight;
146 double frameHeight = 0;
170 currentY += frameHeight;
176 currentY += contentHeight;
179 currentItem = newFrame;
195 ( *frameIt )->setSceneRect(
QRectF(( *frameIt )->scenePos().x(), ( *frameIt )->scenePos().y(),
196 ( *frameIt )->rect().width(), ( *frameIt )->rect().height() ) );
228 return tr(
"<frame>" );
292 lastFrame = newFrame;
309 mIsRecalculatingSize =
true;
310 int pageNumber = frameItem->
page();
318 mIsRecalculatingSize =
false;
328 ( *frameIt )->update();
370 ( *frameIt )->writeXML( elem, doc );
385 for (
int i = 0; i < frameList.
size(); ++i )
389 newFrame->
readXML( frameElem, doc );
virtual void recalculateFrameSizes()
Recalculates the portion of the multiframe item which is shown in each of it's component frames...
QDomNodeList elementsByTagName(const QString &tagname) const
virtual bool writeXML(QDomElement &elem, QDomDocument &doc) const
Stores item state in DOM element.
A base class for objects which belong to a map composition.
virtual ~QgsComposerMultiFrame()
QString attribute(const QString &name, const QString &defValue) const
void setHideBackgroundIfEmpty(const bool hideBackgroundIfEmpty)
Sets whether the background and frame border should be hidden if this frame is empty.
Qt::PenJoinStyle frameJoinStyle() const
Returns the join style used for drawing the item's frame.
virtual QString displayName() const
Get multiframe display name.
virtual double findNearbyPageBreak(double yPos)
Finds the optimal position to break a frame at.
const T & at(int i) const
A item that forms part of a map composition.
#define Q_NOWARN_DEPRECATED_PUSH
ResizeMode resizeMode() const
Returns the resize mode for the multiframe.
virtual void setFrameEnabled(const bool drawFrame)
Set whether this item has a frame drawn around it or not.
virtual QSizeF totalSize() const =0
Returns the total size of the multiframe's content.
QColor backgroundColor() const
Gets the background color for this item.
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
double spaceBetweenPages() const
Returns the vertical space between pages in a composer view.
QString tr(const char *sourceText, const char *disambiguation, int n)
void setBlendMode(const QPainter::CompositionMode blendMode)
Sets the item's composition blending mode.
int numPages() const
Returns the number of pages in the composition.
void update(const QRectF &rect)
double frameOutlineWidth() const
Returns the frame's outline width.
int indexOf(const T &value, int from) const
QDomElement toElement() const
bool _readXML(const QDomElement &itemElem, const QDomDocument &doc, bool ignoreFrames=false)
Restores state information about base multiframe object from a DOM element.
void setNumPages(const int pages)
Sets the number of pages for the composition.
int count(const T &value) const
void recalculateFrameRects()
Forces a recalculation of all the associated frame's scene rectangles.
QgsComposerMultiFrame(QgsComposition *c, bool createUndoCommands)
Construct a new multiframe item.
void setFrameJoinStyle(const Qt::PenJoinStyle style)
Sets join style used when drawing the item's frame.
virtual void addFrame(QgsComposerFrame *frame, bool recalcFrameSizes=true)=0
Adds a frame to the multiframe.
int transparency() const
Returns the item's transparency.
void setAttribute(const QString &name, const QString &value)
int toInt(bool *ok, int base) const
QgsComposerFrame * createNewFrame(QgsComposerFrame *currentFrame, QPointF pos, QSizeF size)
Creates a new frame and adds it to the multi frame and composition.
virtual void setFrameOutlineColor(const QColor &color)
Sets frame outline color.
QList< QgsComposerFrame * > mFrameItems
void removeFrame(int i, const bool removeEmptyPages=false)
Removes a frame from the multiframe.
bool _writeXML(QDomElement &elem, QDomDocument &doc, bool ignoreFrames=false) const
Stores state information about base multiframe object in DOM element.
void removeComposerItem(QgsComposerItem *item, const bool createCommand=true, const bool removeGroupItems=true)
Remove item from the graphics scene.
bool hideBackgroundIfEmpty() const
Returns whether the background and frame border should be hidden if this frame is empty...
void setBackgroundEnabled(const bool drawBackground)
Set whether this item has a Background drawn around it or not.
bool pageIsEmpty(const int page) const
Returns whether a page is empty, ie, it contains no items except for the background paper item...
Graphics scene for map printing.
void handlePageChange()
Adapts to changed number of composition pages if resize type is RepeatOnEveryPage.
Frame item for a composer multiframe item.
QColor frameOutlineColor() const
Returns the frame's outline color.
virtual void setFrameOutlineWidth(const double outlineWidth)
Sets frame outline width.
#define Q_NOWARN_DEPRECATED_POP
QgsComposition * mComposition
void deleteFrames()
Removes and deletes all child frames.
void setBackgroundColor(const QColor &backgroundColor)
Sets the background color for this item.
QPainter::CompositionMode blendMode() const
Returns the item's composition blending mode.
virtual bool readXML(const QDomElement &itemElem, const QDomDocument &doc)
Sets item state from DOM element.
bool hasFrame() const
Whether this item has a frame or not.
void setResizeMode(ResizeMode mode)
Sets the resize mode for the multiframe, and recalculates frame sizes to match.
virtual Q_DECL_DEPRECATED void render(QPainter *p, const QRectF &renderExtent)
Renders a portion of the multiframe's content into a painter.
double paperHeight() const
Height of paper item.
bool hasBackground() const
Whether this item has a Background or not.
int page() const
Gets the page the item is currently on.
int frameIndex(QgsComposerFrame *frame) const
Returns the index of a frame within the multiframe.
QgsComposerFrame * frame(int i) const
Returns a child frame from the multiframe.
void update()
Forces a redraw of all child frames.
void setContentSection(const QRectF §ion)
Sets the visible part of the multiframe's content which is visible within this frame (relative to the...
bool readXML(const QDomElement &itemElem, const QDomDocument &doc) override
Sets item state from DOM element.
const_iterator constEnd() const
const_iterator constBegin() const
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void addMultiFrame(QgsComposerMultiFrame *multiFrame)
Adds multiframe.
void handleFrameRemoval(QgsComposerItem *item)
Called before a frame is going to be removed.
void setTransparency(const int transparency)
Sets the item's transparency.
void changed()
Emitted when the properties of a multi frame have changed, and the GUI item widget must be updated...
QDomNode at(int index) const