how do i use an initializer list on a derived class? : I'm writing a `Qt` application where I have a derived class of `QDialog`. My derived class also uses a initializer list to for a couple of private members (that get set through the constructor). Now I am a bit confused even in terms of allowed syntax. I found this [post][1], tried to follow it in my little demo script and came up with the following:

    #include <QString>
    #include <QSettings>
    #include <QtWidgets/QWidget>
    #include <QtWidgets/QDialog>
    
    class foo {
        Q_OBJECT
        public:
            foo(QSettings* const set=nullptr, const QString s="", QWidget *parent=nullptr) :  QDialog{
            public:
                foo(QSettings* const set=nullptr, const QString s="", QWidget *parent): QDialog(parent){}
            };
            QString nme_get() {return name;}
            void qux(void);
            
        private:
             const QString name;
             QSettings * const settings; 
    };
    
    void foo::qux(void) {
        QSettings *test = settings;
        QString name = nme_get();
        test->beginGroup(name);
        /*
         * ...
        */
        test->endGroup();
    }
    
    
    int main (void) {
        QWidget *parent = nullptr;
        QSettings *sttngs = new QSettings(QSettings::NativeFormat,QSettings::UserScope,"GNU","scaper",nullptr
    );
        foo inst{sttngs, QString("quux"), parent};
        inst.qux();
            
        return 0;    
    }


which the compiler throws out with:

    foo.cpp: In constructor ‘foo::foo(QSettings*, QString, QWidget*)’:
    foo.cpp:10:91: error: type ‘QDialog’ is not a direct base of ‘foo’
             foo(QSettings* const set=nullptr, const QString s="", QWidget *parent=nullptr) :  QDialog{
                                                                                               ^
    foo.cpp:11:9: error: expected primary-expression before ‘public’
             public:
             ^
    foo.cpp:11:9: error: expected ‘}’ before ‘public’
    foo.cpp:10:9: error: uninitialized const member in ‘class QSettings* const’ [-fpermissive]
             foo(QSettings* const set=nullptr, const QString s="", QWidget *parent=nullptr) :  QDialog{
             ^
    foo.cpp:20:28: note: ‘QSettings* const foo::settings’ should be initialized
              QSettings * const settings; 
                                ^
    foo.cpp:11:9: error

  [1]: https://stackoverflow.com/questions/33092076/initializer-list-for-derived-class#33092161
