-
Notifications
You must be signed in to change notification settings - Fork 39
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
Use nullptr #221
Use nullptr #221
Conversation
src/misc.cpp
Outdated
@@ -782,7 +782,7 @@ void SearchBox::event_cursor_moved(QMouseEvent *e) { move(e->x(), e->y()); } | |||
|
|||
void SearchBox::event_xbutton_clicked() | |||
{ | |||
QKeyEvent ke(QEvent::KeyPress, Qt::Key_Escape, 0); // temp.. | |||
QKeyEvent ke(QEvent::KeyPress, Qt::Key_Escape, nullptr); // temp.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't Qt::NoModifier
better here, instead of nullptr
? The c-tor is:
QKeyEvent(QEvent::Type type, int key, Qt::KeyboardModifiers modifiers, const QString &text = QString(), bool autorep = false, ushort count = 1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course.
And there's some more mistakes.
Will update it and ping you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And there's some more mistakes.
I didn't find any.
Will update it and ping you.
OK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was tricked by the variable name: size
.... turns out that it's a pointer.
My first pass was right. Updating.
Drop 0 and NULL. It improves type safety and resolves ambiguous situations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GTM
Drop 0 and NULL. It improves type safety and resolves ambiguous situations.