I am trying to identify the "sender" of Qt "connect" function.
the
int i = RXobject->senderSignalIndex();
seems a good way to accomplish my task, but...
I get the "protected" member and do not know how to proceed...
Please ignore irrelevant code , this is "under construction"
and I am asking C++ question , nothing to do with Qt.
void MainWindow_Bluetooth::processMenu(int index_submenu, int index_mainmenu)
{
#ifdef LAMBDA
text = "TASK DEBUG connect... "; text += Q_FUNC_INFO;
text += QString::number(__LINE__);
text += " main loop index_main ";
text += QString::number(index_mainmenu);
text += " embeded loop index_sub ";
text += QString::number(index_submenu);
text += " main loop class passed index ";
text += QString::number(index);
qDebug() << text;
#endif
{ QString text;
QObject *RXobject = sender();
RXobject->dumpObjectInfo();
QObjectList children = RXobject->children();
int i = RXobject->senderSignalIndex();
text = Q_FUNC_INFO;
qDebug() << text;
/mnt/A_BT_DEC10/BT__PROGRAMS/A_JAN11/A_BT_LIBRARY/terminal_Bluetooth/mainwindow_Bluetooth_copy.cpp:3890: error: 'senderSignalIndex' is a protected member of 'QObject'
mainwindow_Bluetooth_copy.cpp:3890:19: error: 'senderSignalIndex' is a protected member of 'QObject'
int i = RXobject->senderSignalIndex();
^
/home/nov25-1/Qt/5.15.2/gcc_64/include/QtCore/qobject.h:435:9: note: can only access this member on an object of type 'MainWindow_Bluetooth'
int senderSignalIndex() const;
^
What I have tried:
Ask Mrs Google to provide example of "sender(*) " usage... no luck