Created
August 18, 2017 16:15
-
-
Save peteristhegreat/f45ca8e562c2ba5e3ad6388d8d784682 to your computer and use it in GitHub Desktop.
QObject dumpObjectTree alternative
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// m_widget->dumpObjectInfo(); | |
// m_widget->dumpObjectTree(); | |
QList <QWidget *> objDmp = m_widget->findChildren<QWidget *>(); | |
foreach (QWidget * w, objDmp) | |
{ | |
qDebug() << w->objectName() << w->metaObject()->className();//w->staticMetaObject.className(); | |
} | |
// List all the form elements that the user might be interacting with | |
QList <QPushButton *> buttons = m_widget->findChildren<QPushButton*>(); | |
foreach(QPushButton * b, buttons) | |
qDebug() << b->objectName() << b->isVisible() << b->isEnabled() << b->text(); | |
QList <QLineEdit *> lineEdits = m_widget->findChildren<QLineEdit*>(); | |
foreach(QLineEdit * le, lineEdits) | |
qDebug() << le->objectName() << le->isVisible() << le->isEnabled() << le->text(); | |
QList <QComboBox *> comboBoxes = m_widget->findChildren<QComboBox*>(); | |
foreach(QComboBox * cb, comboBoxes) | |
qDebug() << cb->objectName() << cb->isVisible() << cb->isEnabled() << cb->currentText(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment