@@ -513,30 +513,30 @@ error *objectConnect(QObject_ *object, const char *signal, int signalLen, QQmlEn
513
513
514
514
QQmlContext_ *objectContext (QObject_ *object)
515
515
{
516
- return qmlContext (reinterpret_cast <QObject *>(object));
516
+ return qmlContext (static_cast <QObject *>(object));
517
517
}
518
518
519
519
int objectIsComponent (QObject_ *object)
520
520
{
521
- QObject *qobject = reinterpret_cast <QObject *>(object);
521
+ QObject *qobject = static_cast <QObject *>(object);
522
522
return dynamic_cast <QQmlComponent *>(qobject) ? 1 : 0 ;
523
523
}
524
524
525
525
int objectIsWindow (QObject_ *object)
526
526
{
527
- QObject *qobject = reinterpret_cast <QObject *>(object);
527
+ QObject *qobject = static_cast <QObject *>(object);
528
528
return dynamic_cast <QQuickWindow *>(qobject) ? 1 : 0 ;
529
529
}
530
530
531
531
int objectIsView (QObject_ *object)
532
532
{
533
- QObject *qobject = reinterpret_cast <QObject *>(object);
533
+ QObject *qobject = static_cast <QObject *>(object);
534
534
return dynamic_cast <QQuickView *>(qobject) ? 1 : 0 ;
535
535
}
536
536
537
537
error *objectGoAddr (QObject_ *object, GoAddr **addr)
538
538
{
539
- QObject *qobject = reinterpret_cast <QObject *>(object);
539
+ QObject *qobject = static_cast <QObject *>(object);
540
540
GoValue *goValue = dynamic_cast <GoValue *>(qobject);
541
541
if (goValue) {
542
542
*addr = goValue->addr ;
@@ -576,18 +576,12 @@ void goValueActivate(GoValue_ *value, GoTypeInfo *typeInfo, int addrOffset)
576
576
GoMemberInfo *fieldInfo = typeInfo->fields ;
577
577
for (int i = 0 ; i < typeInfo->fieldsLen ; i++) {
578
578
if (fieldInfo->addrOffset == addrOffset) {
579
- QObject *qvalue = reinterpret_cast <QObject *>(value);
580
- GoValue *goValue = dynamic_cast <GoValue *>(qvalue);
581
- if (goValue) {
582
- goValue->activate (fieldInfo->metaIndex );
583
- return ;
584
- }
585
- GoPaintedValue *goPaintedValue = dynamic_cast <GoPaintedValue *>(qvalue);
586
- if (goPaintedValue) {
587
- goPaintedValue->activate (fieldInfo->metaIndex );
588
- return ;
579
+ if (typeInfo->paint ) {
580
+ static_cast <GoPaintedValue *>(value)->activate (fieldInfo->metaIndex );
581
+ } else {
582
+ static_cast <GoValue *>(value)->activate (fieldInfo->metaIndex );
589
583
}
590
- panicf ( " invalid GoValue address " ) ;
584
+ return ;
591
585
}
592
586
fieldInfo++;
593
587
}
0 commit comments