@@ -46,7 +46,9 @@ class TestQgsComposerRotation: public QObject
46
46
void mapRotation (); // test if composer map mapRotation is functioning
47
47
void mapItemRotation (); // test if composer map item rotation is functioning
48
48
void oldMapRotationApi (); // test if old deprectated composer map rotation api is functioning
49
- void pictureRotation ();
49
+ void pictureRotation (); // test if picture pictureRotation is functioning
50
+ void pictureItemRotation (); // test if composer picture item rotation is functioning
51
+ void oldPictureRotationApi (); // test if old deprectated composer picture rotation api is functioning
50
52
51
53
private:
52
54
QgsComposition* mComposition ;
@@ -218,17 +220,42 @@ void TestQgsComposerRotation::oldMapRotationApi()
218
220
219
221
void TestQgsComposerRotation::pictureRotation ()
220
222
{
221
- // test map rotation
223
+ // test picture rotation
222
224
mComposition ->addComposerPicture ( mComposerPicture );
223
225
mComposerPicture ->setPictureRotation ( 45 );
224
- // mComposerPicture->setSceneRect( QRectF( 70, 70, 100, 100 ) );
225
226
226
- QgsCompositionChecker checker ( " composerrotation_maprotation " , mComposition );
227
+ QgsCompositionChecker checker ( " composerrotation_picturerotation " , mComposition );
227
228
QVERIFY ( checker.testComposition ( mReport ) );
228
229
229
230
mComposition ->removeItem ( mComposerPicture );
230
231
mComposerPicture ->setPictureRotation ( 0 );
231
232
}
232
233
234
+ void TestQgsComposerRotation::pictureItemRotation ()
235
+ {
236
+ // test picture item rotation
237
+ mComposition ->addComposerPicture ( mComposerPicture );
238
+ mComposerPicture ->setItemRotation ( 45 );
239
+
240
+ QgsCompositionChecker checker ( " composerrotation_pictureitemrotation" , mComposition );
241
+ QVERIFY ( checker.testComposition ( mReport ) );
242
+
243
+ mComposition ->removeItem ( mComposerPicture );
244
+ mComposerPicture ->setItemRotation ( 0 );
245
+ }
246
+
247
+ void TestQgsComposerRotation::oldPictureRotationApi ()
248
+ {
249
+ // test old style deprecated rotation api - remove test after 2.0 series
250
+ mComposition ->addComposerPicture ( mComposerPicture );
251
+ mComposerPicture ->setRotation ( 45 );
252
+
253
+ QgsCompositionChecker checker ( " composerrotation_picturerotation_oldapi" , mComposition );
254
+ QVERIFY ( checker.testComposition ( mReport ) );
255
+
256
+ mComposition ->removeItem ( mComposerPicture );
257
+ mComposerPicture ->setRotation ( 0 );
258
+ }
259
+
233
260
QTEST_MAIN ( TestQgsComposerRotation )
234
261
#include " moc_testqgscomposerrotation.cxx"
0 commit comments