QFileDialog::getOpenFileName is a static function provided by Qt to show a dialog for opening a file. If a file is selected, this function return the path of the file.
Questions tagged [getopenfilename]
96 questions
2
votes
2 answers
Is there a workaround for the character limit on the Windows API function GetOpenFileName() when OFN_ALLOWMULTISELECT?
According to the MSDN documentation, the function GetOpenFileName() has no character limit with option OFN_ALLOWMULTISELECT when compiled for Unicode with Windows 2000 and greater. However, on Windows XP x64 SP2, I'm finding that the 32k ANSI limit…

Michael Repucci
- 1,633
- 2
- 19
- 35
2
votes
1 answer
OPENFILENAME dialog returns Asian letters instead of file path
I'm trying to create a function that gets a filepath from the OPENFILENAME dialog. My code looks something like this.
wstring src;
bool open()
{
const string title = "Select a File";
wchar_t filename[MAX_PATH];
OPENFILENAMEA ofn;
…

qwarten
- 105
- 2
- 6
2
votes
1 answer
Win32 GetOpenFileName prevents app from exiting
I'm using Win32 with C++ to make an app that can load the contents of files through a dialog with the GetOpenFileName function. Everything works fine, except when I close the main window and the app quits and prints this to the console:
The thread…

dotminic
- 1,135
- 2
- 14
- 28
2
votes
1 answer
PyQt QFileDialog getOpenFileName not working from command line (windows)
I'm trying to make a gui (Qt Designer) to import an excel file and display the data in the gui.
The script works fine when I run it from within my IDE (Spyder), but if I run it from the command window or by opening the python file from windows…

Tomaquet
- 71
- 2
- 12
2
votes
1 answer
Error message when clicking Exit or Cancel in "Application.GetOpenFilename"
I'm importing a specific sheet in a workbook into the current workbook that I'm working with. Import works fine consecutively by deleting the current sheet before importing again. There is one small thing that needs to be fixed. When I cancel or…

Saud
- 480
- 1
- 9
- 26
2
votes
1 answer
Vlookup Syntax and user input issues
I'm trying to create a macro that compares two user in-putted worksheets then moves the differences to different sheets depending on why its different.
The code first asks for input of the newest data and opens that sheet. Then it asks for the…

user3886081
- 23
- 3
2
votes
0 answers
PyPlot show() really slow after calling PyQt4.QFileDialog.getOpenFileNames()
For an analysis application I'm trying to:
Get a list of filenames from the user using PyQt4 QFileDialog
Extract some data from each file
Plot the aggregated data using pyplot
However, getting the filenames this way causes pyplot.show() to take a…

user3434957
- 21
- 2
2
votes
1 answer
How to use resource for Windows API custom dialog template?
I am trying to use a custom template on an OPENFILENAME struct in C++, and cannot figure out what exactly I am doing wrong. Here is what I have so far:
#include
#include
#include "resource.h"
void main() {
HWND hwnd =…

phillythompson
- 111
- 1
- 7
2
votes
3 answers
GetOpenFileName() kills my background open streams :(
Its a little strange. Ok so I am working with OGRE game engine which has a "SceneManager" class which keeps some files streams open in background. If i use those streams just BEFORE using GetOpenFileName() those streams work fine, but if I try to…

Jitin Sameer
- 33
- 4
2
votes
1 answer
Inno Setup OpenFile dialog on a file that is in use
I'm working on an Inno Setup installer that uses the GetOpenFileName function to bring up an open file dialog for the user to browse for and select a database file. The database will be running when the user selects the file but the installer is…

user1704321
- 43
- 3
2
votes
1 answer
GetOpenFileName lpstrInitialDir (directory)... not working for URL (SharePoint)
I bring up a GetOpenFileName dialog, enter a URL to a SharePoint sever, and it lets me browse that server using the Web Client Service (WebDAV mini-redirector). I am trying to get the initial directory to come up as that URL, but it seems to ignore…

Steve
- 1,065
- 15
- 34
1
vote
2 answers
fstream .open() Win32
I am trying to figure out this and its bugging me for a long now.
when i type:
inFile.open("C:\Users\Mark\Desktop\text.txt", ios::in | ios:: binary);
it works just fine.
But when i do something like this.
string garbage = "\\";
…

Marko
- 49
- 1
- 6
1
vote
2 answers
android - prompt user for path/filename
I want to ask user to select a file to open from external storage and receive it's path. Preferably I'd like to avoid excesive coding and use some standard method (well known, system-provided intent or similar).
Said file is to be SpatiaLite db file…

Lewy
- 13
- 3
1
vote
1 answer
Bug with Parenthesis in QFileDialog
Here some code where opens default windows dialog and user can select file which name starts with prefixName and ends with ".log"
void doSomething(QString prefixName) {
auto result = QFileDialog::getOpenFileName(this, tr("Open log file"), path,…

pharos
- 11
- 3
1
vote
1 answer
PyQt5: keep selection order with QFileDialog.getOpenFileNames
I am writing a GUI where the user is asked to select multiple files to open. For this purpose I use QFileDialog. I need to keep track of the order in which the user selected the files, is it possible?
I have the following:
filepath, _ =…

crazydecibel
- 95
- 9