23 , mHidePageIfEmpty( false )
24 , mHideBackgroundIfEmpty( false )
31 connect( mf, SIGNAL( contentsChanged() ),
this, SLOT(
repaint() ) );
35 setSceneRect( QRectF( pos().x(), pos().y(), rect().width(), rect().height() ) );
39 QgsComposerFrame::QgsComposerFrame()
42 , mHidePageIfEmpty( false )
43 , mHideBackgroundIfEmpty( false )
55 QDomElement frameElem = doc.createElement(
"ComposerFrame" );
56 frameElem.setAttribute(
"sectionX", QString::number( mSection.x() ) );
57 frameElem.setAttribute(
"sectionY", QString::number( mSection.y() ) );
58 frameElem.setAttribute(
"sectionWidth", QString::number( mSection.width() ) );
59 frameElem.setAttribute(
"sectionHeight", QString::number( mSection.height() ) );
60 frameElem.setAttribute(
"hidePageIfEmpty", mHidePageIfEmpty );
61 frameElem.setAttribute(
"hideBackgroundIfEmpty", mHideBackgroundIfEmpty );
62 elem.appendChild( frameElem );
69 double x = itemElem.attribute(
"sectionX" ).toDouble();
70 double y = itemElem.attribute(
"sectionY" ).toDouble();
71 double width = itemElem.attribute(
"sectionWidth" ).toDouble();
72 double height = itemElem.attribute(
"sectionHeight" ).toDouble();
73 mSection = QRectF( x, y, width, height );
74 mHidePageIfEmpty = itemElem.attribute(
"hidePageIfEmpty",
"0" ).toInt();
75 mHideBackgroundIfEmpty = itemElem.attribute(
"hideBackgroundIfEmpty",
"0" ).toInt();
76 QDomElement composerItem = itemElem.firstChildElement(
"ComposerItem" );
77 if ( composerItem.isNull() )
81 return _readXML( composerItem, doc );
91 if ( hideBackgroundIfEmpty == mHideBackgroundIfEmpty )
107 double multiFrameHeight = mMultiFrame->
totalSize().height();
108 if ( multiFrameHeight <= mSection.top() )
130 return tr(
"<frame>" );
135 QRectF fixedRect = rectangle;
140 int frameIndex = mMultiFrame->
frameIndex(
this );
143 if ( fixedSize.width() > 0 )
145 fixedRect.setWidth( fixedSize.width() );
147 if ( fixedSize.height() > 0 )
149 fixedRect.setHeight( fixedSize.height() );
153 QSizeF minSize = mMultiFrame->
minFrameSize( frameIndex );
154 fixedRect.setWidth( qMax( minSize.width(), fixedRect.width() ) );
155 fixedRect.setHeight( qMax( minSize.height(), fixedRect.height() ) );
163 Q_UNUSED( itemStyle );
177 if ( !empty || !mHideBackgroundIfEmpty )
184 int frameIndex = mMultiFrame->
frameIndex(
this );
185 mMultiFrame->
render( painter, mSection, frameIndex );
188 if ( !empty || !mHideBackgroundIfEmpty )