You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Tuesday, June 8th 2010, 4:18pm

QFileDialog crash

Hello,

Once in awhile, unpredictably, my program crashes (generates a Software Exception) when I click on a menu item that opens a QFileDialog. The QFileDialog is called almost immediately within the menu item slot:

Source code

1
2
3
4
5
6
7
8
9
10
void peMainWin::on_qactLoadPars_triggered()
{
   QString qsdir = my_get_directory_function();
   QString qsParFile = QFileDialog::getOpenFileName(this,
                                    	"Load parameter file",
                                    	qsdir,
                                    	"*.myext"
                                    	);
...
}


The stack trace below (see lines in red) indicates that the problem arises from the getOpenFileName() call. I've tried this using gibberish for qsdir, but the problem doesn't arise--it just opens to the home directory. So bad output from my_get_directory_function() doesn't seem like it's the problem. Does anyone know what could be going on? Thank you--

Matt

Stack trace in QtCreator (gcc on a Mac):

Quoted

0 __CFRunLoopCollectSources0 0 0x9192108e
1 __CFSetApplyFunction_block_invoke_1 0 0x9191f9c9
2 CFBasicHashApply 0 0x9190486a
3 CFSetApplyFunction 0 0x9191f991
4 __CFRunLoopDoSources0 0 0x9191dccf
5 __CFRunLoopRun 0 0x9191bc1f
6 CFRunLoopRunSpecific 0 0x9191b0f4
7 CFRunLoopRunInMode 0 0x9191af21
8 RunCurrentEventLoopInMode 0 0x9520c0fc
9 ReceiveNextEventCommon 0 0x9520beb1
10 _AcquireNextEvent 0 0x953941d4
11 _RunAppModalLoop 0 0x9538a337
12 RunAppModalLoopForWindow 0 0x9538a738
13 -[NSApplication _realDoModalLoop:peek:] 0 0x905af112
14 -[NSApplication runModalForWindow:] 0 0x905ae79d
15 -[NSSavePanel runModal] 0 0x90842379
16 -[NSNavOpenPanel run] 0 0x90a1c63b
17 _NSNavDialogRun 0 0x90a1e1ef
18 QFileDialogPrivate::_q_macRunNativeAppModalPanel 0 0x001d0d6f
19 QFileDialog::qt_metacall 0 0x006fc9fd
20 QMetaObject::activate 0 0x00ecc22a
21 QSingleShotTimer::timeout 0 0x00fb90e2
22 QSingleShotTimer::timerEvent 0 0x00fb917c
23 QObject::event 0 0x00fb2e28
24 QApplicationPrivate::notify_helper 0 0x001f3a6f
25 QApplication::notify 0 0x001f9d25
26 QCoreApplication::notifyInternal 0 0x00ec69c2
27 qt_sendSpontaneousEvent 0 0x001f3b8c
28 QEventDispatcherMacPrivate::activateTimer 0 0x001a0e11
29 __CFRunLoopRun 0 0x9191d76b
30 CFRunLoopRunSpecific 0 0x9191b0f4
31 CFRunLoopRunInMode 0 0x9191af21
32 RunCurrentEventLoopInMode 0 0x9520c0fc
33 ReceiveNextEventCommon 0 0x9520bded
34 ReceiveNextEvent 0 0x95394287
35 QEventDispatcherMac::processEvents 0 0x001a1359
36 QEventLoop::processEvents 0 0x00fa43a1
37 QEventLoop::exec 0 0x00fa45cd
38 QDialog::exec 0 0x006eaaac
39 QFileDialog::getOpenFileName 0 0x006ff3e5
40 peMainWin::on_qactLoadPars_triggered 0 0x00016989
41 peMainWin::qt_metacall 0 0x000e743d

42 QMetaObject::activate 0 0x00ecc22a
43 QAction::triggered 0 0x001ec1b4
44 QAction::activate 0 0x001ee46f
45 qt_mac_activate_action 0 0x001cd029
46 qt_mac_menu_event 0 0x001cd689
47 DispatchEventToHandlers 0 0x951df0a9
48 SendEventToEventTargetInternal 0 0x951de370
49 SendEventToEventTarget 0 0x95200b55
50 SendHICommandEvent 0 0x9522d147
51 SendMenuCommandWithContextAndModifiers 0 0x95251e40
52 SendMenuItemSelectedEvent 0 0x95251df5
53 FinishMenuSelection 0 0x95251cfa
54 MenuSelectCore 0 0x95221436
55 MenuSelect 0 0x953d399f
56 QApplicationPrivate::globalEventProcessor 0 0x0018c59a
57 DispatchEventToHandlers 0 0x951df0a9
58 SendEventToEventTargetInternal 0 0x951de370
59 SendEventToEventTarget 0 0x95200b55
60 ToolboxEventDispatcherHandler 0 0x952126db
61 DispatchEventToHandlers 0 0x951df4fa
62 SendEventToEventTargetInternal 0 0x951de370
63 SendEventToEventTarget 0 0x95200b55
64 QEventDispatcherMac::processEvents 0 0x001a1474
65 QEventLoop::processEvents 0 0x00fa43a1
66 QEventLoop::exec 0 0x00fa45cd
67 QCoreApplication::exec 0 0x00fa692e
68 main 0 0x0000823a