Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

C++ signal QML slot with QObject as parameter but sometimes QML receives null



  • Hi

    I am trying to send a QObject (kind off handle of a applicationwindow where i do my plots) via a c++ signal to QML slot. but sometimes instead of receiving the QObject of Applicationwindow it receives null. I use this to grabtoimage the plot and also to close the window.
    sometimes in works but somes it does not.

    Somewhat the QObject becomes null when the signal reaches the QML.

    qDebug()<<"SAVE Routine"<<_figures.at(ii).id<<"----fig_id"<<fig_id<<_figures.at(ii).handle;
    emit signal_save(_figures.at(ii).handle, full_path,"JABBA");
    qDebug()<<"SAVE Routine"<<_figures.at(ii).id<<"----fig_id"<<fig_id<<_figures.at(ii).handle;

    result when it works
    SAVE Routine 4 ----fig_id 4 QQuickApplicationWindow(0x5e0fca70)
    SAVE Routine 4 ----fig_id 4 QQuickApplicationWindow(0x5e0fca70)
    qml: ting tong jabba
    qml: QQuickApplicationWindow(0x5e0fca70)

    Result when it does not work
    SAVE Routine 3 ----fig_id 3 QQuickApplicationWindow(0x4a1a69f0)
    SAVE Routine 3 ----fig_id 3 QQuickApplicationWindow(0x4a1a69f0)
    qml: ting tong jabba
    qml: null C:/_Migrated_QT_GUI/build-rk2_gui-Desktop_Qt_5_11_2_MinGW_32bit-Debug/rk2_logs/log_20190220_132140/Jabba_Cal/Fig-3 ADC1 Calibration I-Channel.png JABBA
    done
    qml: null 2 3


Log in to reply