Skip to content

Commit 5f771a6

Browse files
committed
fix QgsComposerItem API
1 parent 8acbea9 commit 5f771a6

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

python/core/qgscomposeritem.sip

+2-2
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,13 @@ class QgsComposerItem: QObject, QGraphicsRectItem
222222
* @param none
223223
* @return void
224224
* @note deprecated since 1.8 don't use!
225-
* @see hasFrame
225+
* @see setFrameEnabled
226226
*/
227227
void setFrame( bool drawFrame );
228228
/** Set whether this item has a frame drawn around it or not.
229229
* @param none
230230
* @return void
231-
* @note deprecated since 1.8
231+
* @note introduced in 1.8
232232
* @see hasFrame
233233
*/
234234
void setFrameEnabled( bool drawFrame );

src/app/composer/qgscomposeritemwidget.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,11 @@ void QgsComposerItemWidget::on_mFrameCheckBox_stateChanged( int state )
130130
mItem->beginCommand( tr( "Item frame toggled" ) );
131131
if ( state == Qt::Checked )
132132
{
133-
mItem->setFrame( true );
133+
mItem->setFrameEnabled( true );
134134
}
135135
else
136136
{
137-
mItem->setFrame( false );
137+
mItem->setFrameEnabled( false );
138138
}
139139
mItem->update();
140140
mItem->endCommand();
@@ -155,7 +155,7 @@ void QgsComposerItemWidget::setValuesForGuiElements()
155155
mOpacitySlider->setValue( mItem->brush().color().alpha() );
156156
mOutlineWidthSpinBox->setValue( mItem->pen().widthF() );
157157
mItemIdLineEdit->setText( mItem->id() );
158-
if ( mItem->frame() )
158+
if ( mItem->hasFrame() )
159159
{
160160
mFrameCheckBox->setCheckState( Qt::Checked );
161161
}

src/core/composer/qgscomposeritem.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -167,22 +167,21 @@ class CORE_EXPORT QgsComposerItem: public QObject, public QGraphicsRectItem
167167
/** Whether this item has a frame or not.
168168
* @returns true if there is a frame around this item, otherwise false.
169169
* @note introduced since 1.8
170-
* @see hasFrame
171170
*/
172171
bool hasFrame() const {return mFrame;}
173172
/** Set whether this item has a frame drawn around it or not.
174173
* @returns void
175174
* @note deprecated since 1.8 don't use!
176-
* @see hasFrame
175+
* @see setFrameEnabled
177176
*/
178177
Q_DECL_DEPRECATED void setFrame( bool drawFrame ) { setFrameEnabled( drawFrame );}
179178
/** Set whether this item has a frame drawn around it or not.
180179
* @param drawFrame draw frame
181180
* @returns nothing
182-
* @note deprecated since 1.8
181+
* @note introduced in 1.8
183182
* @see hasFrame
184183
*/
185-
Q_DECL_DEPRECATED void setFrameEnabled( bool drawFrame ) {mFrame = drawFrame;}
184+
void setFrameEnabled( bool drawFrame ) {mFrame = drawFrame;}
186185

187186
/**Composite operations for item groups do nothing per default*/
188187
virtual void addItem( QgsComposerItem* item ) { Q_UNUSED( item ); }

src/plugins/georeferencer/qgsgeorefplugingui.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1494,7 +1494,7 @@ bool QgsGeorefPluginGui::writePDFReportFile( const QString& fileName, const QgsG
14941494
titleLabel->setText( rasterFi.fileName() );
14951495
composition->addItem( titleLabel );
14961496
titleLabel->setSceneRect( QRectF( leftMargin, 5, contentWidth, 8 ) );
1497-
titleLabel->setFrame( false );
1497+
titleLabel->setFrameEnabled( false );
14981498

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

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

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

0 commit comments

Comments
 (0)