I use this, but the application crashed:
QMap<QString,
QToolButton *>
*currentButtons
= const_cast<QMap<QString,
QToolButton *>
*>
(tabs.
value(ui
->tabWidget
->currentIndex
()));
currentButtons->insert(path, btn); //This line is where the error lie
QMap<QString, QToolButton *> *currentButtons = const_cast<QMap<QString, QToolButton *>*>(tabs.value(ui->tabWidget->currentIndex()));
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??
Bookmarks