20 #include <QCoreApplication>
26 mWebPage( 0 ), mLoaded( false ), mHtmlUnitsToMM( 1.0 )
30 QObject::connect(
mWebPage, SIGNAL( loadFinished(
bool ) ),
this, SLOT(
frameLoaded(
bool ) ) );
58 qApp->processEvents();
63 QSize contentsSize =
mWebPage->mainFrame()->contentsSize();
65 mWebPage->setViewportSize( contentsSize );
66 mWebPage->mainFrame()->setScrollBarPolicy( Qt::Horizontal, Qt::ScrollBarAlwaysOff );
67 mWebPage->mainFrame()->setScrollBarPolicy( Qt::Vertical, Qt::ScrollBarAlwaysOff );
118 if ( recalcFrameSizes )
126 QDomElement htmlElem = doc.createElement(
"ComposerHtml" );
127 htmlElem.setAttribute(
"url",
mUrl.toString() );
128 bool state =
_writeXML( htmlElem, doc, ignoreFrames );
129 elem.appendChild( htmlElem );
138 if ( !
_readXML( itemElem, doc, ignoreFrames ) )
144 QString urlString = itemElem.attribute(
"url" );
145 if ( !urlString.isEmpty() )
147 setUrl( QUrl( urlString ) );
void recalculateFrameSizes()
void frameLoaded(bool ok)
A item that forms part of a map composition.
QgsComposition * mComposition
bool _readXML(const QDomElement &itemElem, const QDomDocument &doc, bool ignoreFrames=false)
int printResolution() const
Abstract base class for composer entries with the ability to distribute the content to several frames...
QList< QgsComposerFrame * > mFrameItems
bool _writeXML(QDomElement &elem, QDomDocument &doc, bool ignoreFrames=false) const
int frameCount() const
Return the number of frames associated with this multiframeset.
Graphics scene for map printing.
Frame for html, table, text which can be divided onto several frames.
void deleteFrames()
Removes and deletes all frames from mComposition.
bool writeXML(QDomElement &elem, QDomDocument &doc, bool ignoreFrames=false) const
void addFrame(QgsComposerFrame *frame, bool recalcFrameSizes=true)
void addComposerHtmlFrame(QgsComposerHtml *html, QgsComposerFrame *frame)
Adds composer html frame and advices composer to create a widget for it (through signal) ...
void setUrl(const QUrl &url)
void render(QPainter *p, const QRectF &renderExtent)
void handleFrameRemoval(QgsComposerItem *item)
Called before a frame is going to be removed (update frame list)
bool readXML(const QDomElement &itemElem, const QDomDocument &doc, bool ignoreFrames=false)