c++ - How to specify the QFileDialog::getExistingDirectory() method? -


with method/command:

opencreatedirectory()  {       qstring directory = qfiledialog::getexistingdirectory(this,                         tr("choose or create directory"),                         "/home",                         qfiledialog::dontresolvesymlinks); } 

i can create new directory or choose existing one. there way disable possibility create new directory? also, there way disable possibility choose existing directory?

to more precise: when use method above, window pops in can create new directory or open existing directory. want limit method, can create new directory without being able open existing directory or in other case limit method, can open existing directory without being able create new directory.

you can prevent creation of new directory using these options:

qfiledialog::dontusenativedialog | qfiledialog::readonly  | qfiledialog::showdirsonly 

the options readonly doesn't have effect if use native dialogs, @ least on windows.


, disabling choice of existing directory, can't.
but either add name of directory created separate option, or check chosen directory not empty.


Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -