Thank you very much!!
But why the following codes don't work----
name = query.value(1).toString();
sex = query.value(2).toString();
age = query.value(3).toInt();
textEdit->append( name + '\t' + sex + '\t' +age);
Sorry to trouble you again.