Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix QgsComposerItem API
  • Loading branch information
jef-n committed Mar 12, 2012
1 parent 8acbea9 commit 5f771a6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions python/core/qgscomposeritem.sip
Expand Up @@ -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 );
Expand Down
6 changes: 3 additions & 3 deletions src/app/composer/qgscomposeritemwidget.cpp
Expand Up @@ -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();
Expand All @@ -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 );
}
Expand Down
7 changes: 3 additions & 4 deletions src/core/composer/qgscomposeritem.h
Expand Up @@ -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 ); }
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/georeferencer/qgsgeorefplugingui.cpp
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 );
Expand Down

0 comments on commit 5f771a6

Please sign in to comment.