Home > Software engineering >  QFileDialog click the pop-up in QT
QFileDialog click the pop-up in QT

Time:01-26

The code is as follows:
QWidget * pd=new QWidget;
Pd - & gt; The setAttribute (Qt: : WA_QuitOnClose, 0);
Pd - & gt; SetWindowTitle (" Input File ");
QVBoxLayout * pv=new QVBoxLayout;
QPushButton * a=new QPushButton (" DATA ");
QObject: : connect (a, & amp; QPushButton: : clicked, pd, & amp; QWidget: : show);
Pd - & gt; SetLayout (pv);
QFileDialog * pf1=new QFileDialog;
QStringList s;
S & lt; <"Application/octet - stream"; All files//
S & lt; <"Text/plain";//plain text file
Pf1 - & gt; SetMimeTypeFilters (s);
Pf1 - & gt; SelectMimeTypeFilter (" text/plain ");//the filter text/palin is set to the default filters
Pv - & gt; AddWidget (pf1);

Click on the "DATA" button after the file dialog box, select file by clicking on the open, click on the "DATA" button will no longer to file dialog box, is this why?
I want to choose file, click on the "DATA" button can still continue to file dialog box, how to solve?
  • Related