小妹羞问:QT控制台程序如何输出中文字符

小妹羞问:QT控制台程序怎么输出中文字符?
比如下面的程序,在控制台输出全是乱码,怎么办好?
#include <iostream>
using namespace std;
#include  <stdlib.h>

struct TreeNode
{
  int data;
  TreeNode *leftchild,*rightchild;
  TreeNode(int x,TreeNode *rc=NULL,TreeNode *lc=NULL){data=x;leftchild=lc;rightchild=rc;}
};
class Tree
{
public:
Tree(int value=0,TreeNode *p=NULL){end=value;root=p;}
void outPut(TreeNode *p);
void Plant(TreeNode *p);
void Treetest();
private:
TreeNode *root;
int end;
};
void Tree::outPut(TreeNode *p)
{
if(p!=NULL)
{
if(p->leftchild!=NULL)
{outPut(p->leftchild);}
else
{
cout<<"左子树空"<<endl;
}
p->data++;
cout<<p->data<<endl;
       if(p->rightchild!=NULL)
{outPut(p->rightchild);}
else
{
cout<<"右子树空"<<endl;
}
  }
else
{
 cout<<"树空"<<endl;
}
}
void Tree::Plant(TreeNode *p)
{
  int item;
  cin>>item;
  if(item!=end)
  {
  p=new TreeNode(item);
  if(p!=NULL)
  {
   Plant(p->leftchild);
   Plant(p->rightchild);
  }
  else
  {
    cerr<<"存储分配错误!"<<endl;
exit(1);
  }
  }
  else
  {
    p=NULL;
  }
}
void Tree::Treetest()
{
   int i;
   cout<<"请输入指令:1.建立二叉树;2.对二叉树操作;3.退出;"<<endl;
   cin>>i;
   if(i==1)
   {
   Plant(root);
   }
   if(i==2)
   {
     outPut(root);
   }
   if(i==3)
   {
     exit(1);
   }
}
int main()
{
Tree t1;
int i=10;
while(i!=100)
{
t1.Treetest();
}
return 0;
}

------解决方案--------------------
你用的什么编译器,gcc?
这个语句跟Qt没关系,估计跟编译器有关
我用的vc编译的,显示的是中文
------解决方案--------------------
你的这个代码跟Qt完全没有关系,就是一个gcc编译中文输入输出的问题
看看这个应该可以解决
http://www.annhe.net/article-1407.html

建议一下,既然要用Qt,就全部使用Qt好了,Qt的输入输出很强大的,你整个拿一个标准C++的代码拿过来运行小妹羞问:QT控制台程序如何输出中文字符,对学习Qt不利的
------解决方案--------------------
=.=
跟Qt关系不大,这和你源文件编码格式和编译器有关系。

可以给你个建议把上面的程序改成Qt版本的, 哈哈。步骤如下~
1 是用qtcreator
2 如果是, 检查
工具--选项--文本编辑器--行为 选项卡下的File Encodings 中,default Encoding下拉选框里没有中文编码(gbk、gb2132或gb18030等)。我这里是system

3 在程序里
int main(xxxx)
{
 QApplication app(xxxx);