Get children of QFileDialog derived class
Unsolved
General and Desktop
-
Hi
I have derived a class from QFileDialog -class PrintFileDialog : public QFileDialog { public: PrintFileDialog(QWidget *parent); ~PrintFileDialog(); void func(); }; #include "PrintFileDialog.h" PrintFileDialog::PrintFileDialog(QWidget *parent) { } PrintFileDialog::~PrintFileDialog() { } void PrintFileDialog::func() { QList<QObject*> widgets = this->children(); int a; a = 10; }
When func() is called the widgets list is empty.
What is the correct way to do thisThanks
-
Internal objects will not be created unless you call show or exec. Here you are calling in constructor. Hence you don't see the children.