@@ -94,9 +94,28 @@ void TestQgsComposerTableV2::initTestCase()
94
94
" ogr" );
95
95
QgsMapLayerRegistry::instance ()->addMapLayer ( mVectorLayer );
96
96
97
- // create composition with composer map
98
97
mMapSettings .setLayers ( QStringList () << mVectorLayer ->id () );
99
98
mMapSettings .setCrsTransformEnabled ( false );
99
+
100
+ mReport = " <h1>Composer TableV2 Tests</h1>\n " ;
101
+ }
102
+
103
+ void TestQgsComposerTableV2::cleanupTestCase ()
104
+ {
105
+ QString myReportFile = QDir::tempPath () + QDir::separator () + " qgistest.html" ;
106
+ QFile myFile ( myReportFile );
107
+ if ( myFile.open ( QIODevice::WriteOnly | QIODevice::Append ) )
108
+ {
109
+ QTextStream myQTextStream ( &myFile );
110
+ myQTextStream << mReport ;
111
+ myFile.close ();
112
+ }
113
+ QgsApplication::exitQgis ();
114
+ }
115
+
116
+ void TestQgsComposerTableV2::init ()
117
+ {
118
+ // create composition with composer map
100
119
mComposition = new QgsComposition ( mMapSettings );
101
120
mComposition ->setPaperSize ( 297 , 210 ); // A4 portrait
102
121
@@ -118,31 +137,11 @@ void TestQgsComposerTableV2::initTestCase()
118
137
mComposerAttributeTable ->setContentFont ( QgsFontUtils::getStandardTestFont () );
119
138
mComposerAttributeTable ->setHeaderFont ( QgsFontUtils::getStandardTestFont () );
120
139
mComposerAttributeTable ->setBackgroundColor ( Qt::yellow );
121
-
122
- mReport = " <h1>Composer TableV2 Tests</h1>\n " ;
123
- }
124
-
125
- void TestQgsComposerTableV2::cleanupTestCase ()
126
- {
127
- delete mComposition ;
128
-
129
- QString myReportFile = QDir::tempPath () + QDir::separator () + " qgistest.html" ;
130
- QFile myFile ( myReportFile );
131
- if ( myFile.open ( QIODevice::WriteOnly | QIODevice::Append ) )
132
- {
133
- QTextStream myQTextStream ( &myFile );
134
- myQTextStream << mReport ;
135
- myFile.close ();
136
- }
137
- QgsApplication::exitQgis ();
138
- }
139
-
140
- void TestQgsComposerTableV2::init ()
141
- {
142
140
}
143
141
144
142
void TestQgsComposerTableV2::cleanup ()
145
143
{
144
+ delete mComposition ;
146
145
}
147
146
148
147
void TestQgsComposerTableV2::attributeTableHeadings ()
0 commit comments