Hi,
I want for Qt widgets list all signals with parameters. For this I use :
for(int i=0; i<line->metaObject()->methodCount(); i++)
{
qDebug() << meta.signature() << meta.parameterTypes() << meta.parameterNames();
}
QLineEdit *line = new QLineEdit;
for(int i=0; i<line->metaObject()->methodCount(); i++)
{
QMetaMethod meta = line->metaObject()->method( i );
if( meta.methodType() == QMetaMethod::Signal )
qDebug() << meta.signature() << meta.parameterTypes() << meta.parameterNames();
}
To copy to clipboard, switch view to plain text mode
The result of the example above is :
destroyed
(QObject*) ("QObject*") ("") destroyed() () ()
customContextMenuRequested
(QPoint) ("QPoint") ("pos") textChanged
(QString) ("QString") ("") textEdited
(QString) ("QString") ("") cursorPositionChanged(int,int) ("int", "int") ("", "")
returnPressed() () ()
editingFinished() () ()
selectionChanged() () ()
lostFocus() () ()
destroyed(QObject*) ("QObject*") ("")
destroyed() () ()
customContextMenuRequested(QPoint) ("QPoint") ("pos")
textChanged(QString) ("QString") ("")
textEdited(QString) ("QString") ("")
cursorPositionChanged(int,int) ("int", "int") ("", "")
returnPressed() () ()
editingFinished() () ()
selectionChanged() () ()
lostFocus() () ()
To copy to clipboard, switch view to plain text mode
The problem is for textChanged, textEdited etc. Indeed the type parameters is present but not the names whereas for customContextMenuRequested the name "pos" is present.
Then why for certain signals the names are present and for others not ?
I would like to have all the names !
Thanks
Bookmarks