I use this, but the application crashed:
Qt Code:
  1. QMap<QString, QToolButton *> *currentButtons = const_cast<QMap<QString, QToolButton *>*>(tabs.value(ui->tabWidget->currentIndex()));
  2. currentButtons->insert(path, btn); //This line is where the error lie
To copy to clipboard, switch view to plain text mode 

I am really puzzled.
Did I fail to const_cast the const into non-cosnt so that I cannot insert a value into a const variable??