Skip to content
Permalink
Browse files
fix QgsComposerItem API
  • Loading branch information
jef-n committed Mar 12, 2012
1 parent 8acbea9 commit 5f771a6ffe0a3d0d133190a9af77e6c5c91a328a
Showing with 11 additions and 12 deletions.
  1. +2 −2 python/core/qgscomposeritem.sip
  2. +3 −3 src/app/composer/qgscomposeritemwidget.cpp
  3. +3 −4 src/core/composer/qgscomposeritem.h
  4. +3 −3 src/plugins/georeferencer/qgsgeorefplugingui.cpp
@@ -222,13 +222,13 @@ class QgsComposerItem: QObject, QGraphicsRectItem
* @param none
* @return void
* @note deprecated since 1.8 don't use!
* @see hasFrame
* @see setFrameEnabled
*/
void setFrame( bool drawFrame );
/** Set whether this item has a frame drawn around it or not.
* @param none
* @return void
* @note deprecated since 1.8
* @note introduced in 1.8
* @see hasFrame
*/
void setFrameEnabled( bool drawFrame );
@@ -130,11 +130,11 @@ void QgsComposerItemWidget::on_mFrameCheckBox_stateChanged( int state )
mItem->beginCommand( tr( "Item frame toggled" ) );
if ( state == Qt::Checked )
{
mItem->setFrame( true );
mItem->setFrameEnabled( true );
}
else
{
mItem->setFrame( false );
mItem->setFrameEnabled( false );
}
mItem->update();
mItem->endCommand();
@@ -155,7 +155,7 @@ void QgsComposerItemWidget::setValuesForGuiElements()
mOpacitySlider->setValue( mItem->brush().color().alpha() );
mOutlineWidthSpinBox->setValue( mItem->pen().widthF() );
mItemIdLineEdit->setText( mItem->id() );
if ( mItem->frame() )
if ( mItem->hasFrame() )
{
mFrameCheckBox->setCheckState( Qt::Checked );
}
@@ -167,22 +167,21 @@ class CORE_EXPORT QgsComposerItem: public QObject, public QGraphicsRectItem
/** Whether this item has a frame or not.
* @returns true if there is a frame around this item, otherwise false.
* @note introduced since 1.8
* @see hasFrame
*/
bool hasFrame() const {return mFrame;}
/** Set whether this item has a frame drawn around it or not.
* @returns void
* @note deprecated since 1.8 don't use!
* @see hasFrame
* @see setFrameEnabled
*/
Q_DECL_DEPRECATED void setFrame( bool drawFrame ) { setFrameEnabled( drawFrame );}
/** Set whether this item has a frame drawn around it or not.
* @param drawFrame draw frame
* @returns nothing
* @note deprecated since 1.8
* @note introduced in 1.8
* @see hasFrame
*/
Q_DECL_DEPRECATED void setFrameEnabled( bool drawFrame ) {mFrame = drawFrame;}
void setFrameEnabled( bool drawFrame ) {mFrame = drawFrame;}

/**Composite operations for item groups do nothing per default*/
virtual void addItem( QgsComposerItem* item ) { Q_UNUSED( item ); }
@@ -1494,7 +1494,7 @@ bool QgsGeorefPluginGui::writePDFReportFile( const QString& fileName, const QgsG
titleLabel->setText( rasterFi.fileName() );
composition->addItem( titleLabel );
titleLabel->setSceneRect( QRectF( leftMargin, 5, contentWidth, 8 ) );
titleLabel->setFrame( false );
titleLabel->setFrameEnabled( false );

//composer map
QgsRectangle canvasExtent = mCanvas->extent();
@@ -1549,7 +1549,7 @@ bool QgsGeorefPluginGui::writePDFReportFile( const QString& fileName, const QgsG
parameterLabel->adjustSizeToText();
composition->addItem( parameterLabel );
parameterLabel->setSceneRect( QRectF( leftMargin, composerMap->rect().bottom() + composerMap->transform().dy() + 5, contentWidth, 8 ) );
parameterLabel->setFrame( false );
parameterLabel->setFrameEnabled( false );

//calculate mean error
double meanError = 0;
@@ -1581,7 +1581,7 @@ bool QgsGeorefPluginGui::writePDFReportFile( const QString& fileName, const QgsG
residualLabel->setText( tr( "Residuals" ) );
composition->addItem( residualLabel );
residualLabel->setSceneRect( QRectF( leftMargin, previousItem->rect().bottom() + previousItem->transform().dy() + 5, contentWidth, 6 ) );
residualLabel->setFrame( false );
residualLabel->setFrameEnabled( false );

//residual plot
QgsResidualPlotItem* resPlotItem = new QgsResidualPlotItem( composition );

0 comments on commit 5f771a6

Please sign in to comment.