Details
Description
Could you add Q_ENUMS for:
enum ProcessState
enum ProcessError
enum ProcessChannel
enum ProcessChannelMode
enum ExitStatus
So that QMetaObject class can be used to convert valueToKey.
example:
void MainWindow::on_myProcess_stateChanged(QProcess::ProcessState state) { QProcess* proc = qobject_cast<QProcess*>(sender()); if (proc) { int enumIdx = proc->metaObject()->indexOfEnumerator("ProcessState"); QMetaEnum enumData = proc->metaObject()->enumerator(enumIdx); QString stateName = enumData.valueToKey(state); qDebug() << __FUNCTION__ << state << stateName; } }
I would expect to see something like:
on_myProcess_stateChanged 1 "Starting" on_myProcess_stateChanged 0 "NotRunning"
The benefit from this would be that I could have dynamic debug messages. As of today the switch-case with static values is the only option..
Attachments
For Gerrit Dashboard: QTBUG-10777 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
113696,4 | make the enums of QProcess known to the meta object system | dev | qt/qtbase | Status: MERGED | +2 | 0 |