Skip to content

Commit 25e31f3

Browse files
committed
COMP: Update setupGenerator.cpp and generated wrapper to use const_cast<char*> in polymorphichandler function
That should fix the following warning: "deprecated cast from constant string to char*"
1 parent 7e5a9e3 commit 25e31f3

File tree

3 files changed

+84
-84
lines changed

3 files changed

+84
-84
lines changed

generated_cpp/com_trolltech_qt_core/com_trolltech_qt_core_init.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,27 @@ static void* polymorphichandler_QEvent(const void *ptr, char **class_name)
88
Q_ASSERT(ptr != 0);
99
QEvent *object = (QEvent *)ptr;
1010
if (object->type() == QEvent::None) {
11-
*class_name = "QEvent";
11+
*class_name = const_cast<char*>("QEvent");
1212
return (QEvent*)object;
1313
}
1414
if (object->type() == QEvent::ChildAdded || object->type() == QEvent::ChildPolished || object->type() == QEvent::ChildRemoved) {
15-
*class_name = "QChildEvent";
15+
*class_name = const_cast<char*>("QChildEvent");
1616
return (QChildEvent*)object;
1717
}
1818
if (object->type() == QEvent::StateMachineWrapped) {
19-
*class_name = "QStateMachine_WrappedEvent";
19+
*class_name = const_cast<char*>("QStateMachine_WrappedEvent");
2020
return (QStateMachine::WrappedEvent*)object;
2121
}
2222
if (object->type() == QEvent::StateMachineSignal) {
23-
*class_name = "QStateMachine_SignalEvent";
23+
*class_name = const_cast<char*>("QStateMachine_SignalEvent");
2424
return (QStateMachine::SignalEvent*)object;
2525
}
2626
if (object->type() == QEvent::Timer) {
27-
*class_name = "QTimerEvent";
27+
*class_name = const_cast<char*>("QTimerEvent");
2828
return (QTimerEvent*)object;
2929
}
3030
if (object->type() == QEvent::DynamicPropertyChange) {
31-
*class_name = "QDynamicPropertyChangeEvent";
31+
*class_name = const_cast<char*>("QDynamicPropertyChangeEvent");
3232
return (QDynamicPropertyChangeEvent*)object;
3333
}
3434
return NULL;

0 commit comments

Comments
 (0)