SIGSEGV when trying to open a file using QFileDialog::getOpenFileName
-
Hi,
I am facing a fatal problem with QFileDialog::getOpenFileName(). I want to open and read a text file but whenever I call the function the program crashes.
Within a QML file (which is not the main window) I have a QML item and a button, which when clicked it calls a function that has the following line :
QString fileName = QFileDialog::getOpenFileName(this, tr("Open Text file"), "", tr("Text Files (*.txt )"));
whenever the program gets to this line, it crashes and in debugger mode i get the SIGSEGV signal message....any ideas why this might be happening?
It seems like this problem happened to a few people but there is no mention of the solution anywhere on Google :(
Thanks for your help
-
Hi jsulm
Im working on Linux...I just fixed it using the help found in https://forum.qt.io/topic/80130/sigsegv-after-adding-qfiledialog-getopenfilename-to-the-program/7
I used Q_NULLPTR as suggested and that worked for me :D -
@AB_TrP said in SIGSEGV when trying to open a file using QFileDialog::getOpenFileName:
that worked for me :D
great you found a solution. So please don't forget to mark your post as solved.
-
@Pablo-J-Rogina thank your for reminding me :)