24.04.2012, 15:58, "Sujan Dasmahapatra" <s...@lmwindpower.com>: > I have my mainwindow which is QMainWindow the parent of all my other classes. > I am type casting upwards from 5 levels down using reinterpret_cast, to > access the mainwindow to display message using statusBar(), but when type > casting it's not giving error but when accessing mainwindow->statusBar() it's > crashing.
1. Don't use reinterpret_cast. Use qobject_cast, dynamic_cast, or (if you are absolutely sure what you are doing) static_cast 2. In this case use qobject_cast and check if returned value in each invocation is non-zero. Zero means that you guess about pointer type is wrong. -- Regards, Konstantin _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest