@@ -45,6 +45,8 @@ QgsComposerHtml::QgsComposerHtml( QgsComposition* c, bool createUndoCommands ):
4545{
4646 mHtmlUnitsToMM = htmlUnitsToMM ();
4747 mWebPage = new QWebPage ();
48+ mWebPage ->mainFrame ()->setScrollBarPolicy ( Qt::Horizontal, Qt::ScrollBarAlwaysOff );
49+ mWebPage ->mainFrame ()->setScrollBarPolicy ( Qt::Vertical, Qt::ScrollBarAlwaysOff );
4850 mWebPage ->setNetworkAccessManager ( QgsNetworkAccessManager::instance () );
4951 QObject::connect ( mWebPage , SIGNAL ( loadFinished ( bool ) ), this , SLOT ( frameLoaded ( bool ) ) );
5052 if ( mComposition )
@@ -181,6 +183,20 @@ void QgsComposerHtml::loadHtml()
181183 qApp->processEvents ();
182184 }
183185
186+ renderCachedImage ();
187+ recalculateFrameSizes ();
188+ // trigger a repaint
189+ emit contentsChanged ();
190+ }
191+
192+ void QgsComposerHtml::frameLoaded ( bool ok )
193+ {
194+ Q_UNUSED ( ok );
195+ mLoaded = true ;
196+ }
197+
198+ void QgsComposerHtml::recalculateFrameSizes ()
199+ {
184200 if ( frameCount () < 1 ) return ;
185201
186202 QSize contentsSize = mWebPage ->mainFrame ()->contentsSize ();
@@ -196,23 +212,10 @@ void QgsComposerHtml::loadHtml()
196212 contentsSize.setWidth ( maxFrameWidth * mHtmlUnitsToMM );
197213
198214 mWebPage ->setViewportSize ( contentsSize );
199- mWebPage ->mainFrame ()->setScrollBarPolicy ( Qt::Horizontal, Qt::ScrollBarAlwaysOff );
200- mWebPage ->mainFrame ()->setScrollBarPolicy ( Qt::Vertical, Qt::ScrollBarAlwaysOff );
201215 mSize .setWidth ( contentsSize.width () / mHtmlUnitsToMM );
202216 mSize .setHeight ( contentsSize.height () / mHtmlUnitsToMM );
203-
204- renderCachedImage ();
205-
206- recalculateFrameSizes ();
217+ QgsComposerMultiFrame::recalculateFrameSizes ();
207218 emit changed ();
208- // trigger a repaint
209- emit contentsChanged ();
210- }
211-
212- void QgsComposerHtml::frameLoaded ( bool ok )
213- {
214- Q_UNUSED ( ok );
215- mLoaded = true ;
216219}
217220
218221void QgsComposerHtml::renderCachedImage ()
0 commit comments