#ifndef MULTITYPEFILESAVEDIALOG_H #define MULTITYPEFILESAVEDIALOG_H #include #include #include class MultitypeFileSaveDialog : public QFileDialog { Q_OBJECT public: struct TypeDescription { QString description; QString extension; QVariant data; }; explicit MultitypeFileSaveDialog(QWidget *parent = nullptr, const QString &caption = QString(), const QString &directory = QString()); void setTypes(const QVector types, bool useDetection = true); TypeDescription selectedType() const; protected: void done(int r) override; private: void onFilterSelected(const QString &filter); QVector::const_iterator findType(const QString &description) const; QVector types; bool hasTypeDetection; }; #endif // MULTITYPEFILESAVEDIALOG_H