chooseFile (Windows)

chooseFile(path)

This function automates a native file selection dialog. It assumes that a dialog was opened (or is about to open) and then automatically selects the file path specified by path. An empty string can be used to emulate that the file dialog is cancelled.

The function will wait for a dialog to open for at most 3 seconds. If no dialog is opened within 3 seconds, or if the specified path name is too long, an exception is raised.

The duration for which the function will wait for a dialog to open is configurable in the etc\winwrapper.ini configuration file. The setting Native File Dialog Script Call Timeout (ms) can be adjusted to a different threshold.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners.
The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.
Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.

Search Results