changer un pointeur QString en un type QString.
Bonjour
une question de debutant peut etre:
s'il vous plait comment changer un pointeur QString en un type QString.
Voila l'initialisation du pointeur :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
for( int i = 0; i < formatsCount; i ++ )
{
formats[ i ] = new QString[ 2 ];
}
//projections
for( int i = 0; i < projectionsCount; i ++ )
{
projections[ i ] = new QString[ 2 ];
}
#include "../inc/Dta.h"
Dans le Dta.h les données sont décrite comme suit :
formats[ 0 ][ 0 ] = "" ; formats[ 0 ][ 1 ] = "" ;
formats[ 1 ][ 0 ] = "ESRI Shapefile" ; formats[ 1 ][ 1 ] = "shp" ;
formats[ 2 ][ 0 ] = "MapInfo File" ; formats[ 2 ][ 1 ] = "tab" ;
formats[ 3 ][ 0 ] = "BNA" ; formats[ 3 ][ 1 ] = "bna" ;
formats[ 4 ][ 0 ] = "CSV" ; formats[ 4 ][ 1 ] = "csv" ;
formats[ 5 ][ 0 ] = "GML" ; formats[ 5 ][ 1 ] = "gml" ;
formats[ 6 ][ 0 ] = "KML" ; formats[ 6 ][ 1 ] = "kml" ; |
alors pour afficher dans un txtedit il faut que sa soit un QString et non pas pointeur sinon j'ai toujours une erreur de segmentation !!
Code:
txtFileSource->setText(formats[ 1 ][ 0 ]);
Merci