Thanx a lot! I see what's wrong. There's a label in the project:

Qt Code:
  1. void MainWindow::on_treeWidget_itemSelectionChanged()
  2. {
  3. ui->label->setText( ui->treeWidget->currentItem()->text(0) );
  4. }
To copy to clipboard, switch view to plain text mode 

it just show the name of which is selected. When nothing is available it crashes.

Then I tried this and failed again:

Qt Code:
  1. void MainWindow::on_treeWidget_itemSelectionChanged()
  2. {
  3. if(ui->treeWidget->topLevelItemCount()>0)
  4. ui->label->setText( ui->treeWidget->currentItem()->text(0) );
  5. }
To copy to clipboard, switch view to plain text mode 

I think when the treeWidget is empty all the members of it are unavailabe. But just how to keep it away from crashing if I still want to use this label?