Skip to content
Permalink
Browse files

Further refactoring of composer html tests and fixes so that html ele…

…ments consume all horizontal space
  • Loading branch information
timlinux committed Sep 20, 2012
1 parent ad78d7b commit 8489bd17cd3296353d4f067b0a7518d438d55d25
@@ -57,9 +57,20 @@ void QgsComposerHtml::setUrl( const QUrl& url )
{
qApp->processEvents();
}
QSize contentsSize = mWebPage->mainFrame()->contentsSize();

if ( nFrames() < 1) return;
//QSize contentsSize = mWebPage->mainFrame()->contentsSize();

QRectF contentRect = this->mFrameItems.at(0)->boundingRect();
//there is going to be a little rounding error converting from float to int
QSize contentsSize = QSize( (int)(contentRect.width() * mHtmlUnitsToMM),
(int)(contentRect.height() * mHtmlUnitsToMM));
mWebPage->setViewportSize( contentsSize );

//suppress scroll bars always
mWebPage->mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);
mWebPage->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);

mSize.setWidth( contentsSize.width() / mHtmlUnitsToMM );
mSize.setHeight( contentsSize.height() / mHtmlUnitsToMM );
recalculateFrameSizes();
@@ -101,6 +101,7 @@ def testTableMultiFrame(self):
checker2 = QgsCompositionChecker()
myControlImage = self.controlImagePath(
"composerhtml_table_multiframe2.png")
print "Checking page 2"
myResult, myMessage = checker2.testComposition("Composer html table",
self.mComposition,
myControlImage,
@@ -115,6 +116,7 @@ def testTableMultiFrame(self):
self.mComposition,
myControlImage,
myPage)
print "Checking page 3"
assert myResult, myMessage

if __name__ == '__main__':
@@ -10,7 +10,7 @@
from qgis_interface import QgisInterface
import hashlib

QGISAPP = None # Static vainasafele used to hold hand to running QGis app
QGISAPP = None # Static variable used to hold hand to running QGis app
CANVAS = None
PARENT = None
IFACE = None

0 comments on commit 8489bd1

Please sign in to comment.
You can’t perform that action at this time.