Fix -Wcast-qual warnings

qwidget.cpp:12864:70: error: cast from type ‘const QWidget*’ to type ‘void*’ casts away qualifiers [-Werror=cast-qual]

Change-Id: I7de033f80b0e4431b7f1ffff13f956cb26108af7
Reviewed-by: Martin Smith <martin.smith@digia.com>
This commit is contained in:
Thiago Macieira 2015-08-11 00:09:46 -07:00
parent 01d0b1d6e3
commit 6d8c7a61f5
4 changed files with 4 additions and 4 deletions

View File

@ -698,7 +698,7 @@ Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QScreen *screen)
{ {
const QDebugStateSaver saver(debug); const QDebugStateSaver saver(debug);
debug.nospace(); debug.nospace();
debug << "QScreen(" << (void *)screen; debug << "QScreen(" << (const void *)screen;
if (screen) { if (screen) {
debug << ", name=" << screen->name(); debug << ", name=" << screen->name();
if (debug.verbosity() > 2) { if (debug.verbosity() > 2) {

View File

@ -2508,7 +2508,7 @@ QDebug operator<<(QDebug debug, const QWindow *window)
QDebugStateSaver saver(debug); QDebugStateSaver saver(debug);
debug.nospace(); debug.nospace();
if (window) { if (window) {
debug << window->metaObject()->className() << '(' << (void *)window; debug << window->metaObject()->className() << '(' << (const void *)window;
if (!window->objectName().isEmpty()) if (!window->objectName().isEmpty())
debug << ", name=" << window->objectName(); debug << ", name=" << window->objectName();
if (debug.verbosity() > 2) { if (debug.verbosity() > 2) {

View File

@ -2030,7 +2030,7 @@ QString FunctionNode::signature(bool values) const
PropertyNode::FunctionRole PropertyNode::role(const FunctionNode* fn) const PropertyNode::FunctionRole PropertyNode::role(const FunctionNode* fn) const
{ {
for (int i=0; i<4; i++) { for (int i=0; i<4; i++) {
if (functions_[i].contains((Node*)fn)) if (functions_[i].contains(const_cast<FunctionNode*>(fn)))
return (FunctionRole) i; return (FunctionRole) i;
} }
return Notifier; return Notifier;

View File

@ -12861,7 +12861,7 @@ QDebug operator<<(QDebug debug, const QWidget *widget)
const QDebugStateSaver saver(debug); const QDebugStateSaver saver(debug);
debug.nospace(); debug.nospace();
if (widget) { if (widget) {
debug << widget->metaObject()->className() << '(' << (void *)widget; debug << widget->metaObject()->className() << '(' << (const void *)widget;
if (!widget->objectName().isEmpty()) if (!widget->objectName().isEmpty())
debug << ", name=" << widget->objectName(); debug << ", name=" << widget->objectName();
if (debug.verbosity() > 2) { if (debug.verbosity() > 2) {