Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash in TimerModel when application is built without RTTI #20

Merged
merged 1 commit into from
Aug 6, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions plugins/timertop/timermodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static TimerModel *s_timerModel = 0;

static QTimer *timer_from_callback(QObject *caller, int method_index)
{
QTimer * const timer = dynamic_cast<QTimer*>(caller);
QTimer * const timer = qobject_cast<QTimer*>(caller);
if (timer) {
QMetaMethod method = timer->metaObject()->method(method_index);
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Expand Down Expand Up @@ -307,8 +307,7 @@ bool TimerModel::eventFilter(QObject *watched, QEvent *event)
{
if (event->type() == QEvent::Timer) {

QTimerEvent * const timerEvent = dynamic_cast<QTimerEvent*>(event);
Q_ASSERT(timerEvent);
QTimerEvent * const timerEvent = static_cast<QTimerEvent*>(event);

// If there is a QTimer associated with this timer ID, don't handle it here, it will be handled
// by the signal hooks for QTimer::timeout()
Expand Down