PDA

View Full Version : no compile error, but error on run with QMenu QAction



sincnarf
2nd October 2007, 04:02
This is another no compile error problem... I am trying to execute the following lines...


resizeRawMenu = rawMenu->addMenu(tr("&Resize"));
resizeRawMenu->addAction(resize_25_RawAct);

resizeRawMenu is declared as a QMenu

rawMenu is is declared as a QMenu

and resize_25_RawAct is initialized as

resize_25_RawAct = new QAction(tr("Resize 25"), this);

These are the only things I can get from gdb.


Program received signal SIGSEGV, Segmentation fault.
0x00bedb9f in ZN4QCss10StyleSheetC1Ev ()
(gdb) backtrace
#0 0x00bedb9f in ZN4QCss10StyleSheetC1Ev ()
#1 0x0054bac0 in ZN7QWidget12insertActionEP7QActionS1_ ()
#2 0x0054bc8e in ZN7QWidget9addActionEP7QAction ()
#3 0x004090ad in ?? ()
#4 0x016e78e8 in ?? ()
#5 0x7c91056d in ntdll!RtlFreeThreadActivationContextStack () from C:\WINDOWS\system32\ntdll.dll
#6 0x00470426 in Z33qt_plugin_instance_pnp_basictoolsv ()
#7 0x0040d12a in ?? ()
#8 0x0022f9b0 in ?? ()
#9 0x0022f9b0 in ?? ()
#10 0x0022f900 in ?? ()
#11 0x10171d61 in ZN26QTextCodecFactoryInterfaceD1Ev () from C:\Qt\4.3.1\bin\QtCore4.dll
#12 0x004031d6 in ?? ()
#13 0x0022f9b0 in ?? ()
#14 0x0022fe30 in ?? ()
#15 0x003d4ca0 in ?? ()
#16 0x00040301 in ?? ()
#17 0x7c96d8a8 in ntdll!RtlpNtMakeTemporaryKey () from C:\WINDOWS\system32\ntdll.dll
#18 0xffffffff in ?? ()
#19 0x7c96d886 in ntdll!RtlpNtMakeTemporaryKey () from C:\WINDOWS\system32\ntdll.dll
#20 0x7c949d18 in ntdll!RtlInsertElementGenericTableAvl () from C:\WINDOWS\system32\ntdll.dll
#21 0x003d0000 in ?? ()
#22 0x50000161 in ?? ()
#23 0x7c91b686 in wcsncat () from C:\WINDOWS\system32\ntdll.dll
#24 0x00000000 in ?? ()

marcel
2nd October 2007, 08:09
Do you create resize_25_RawAct before or after adding it to the menu?

sincnarf
3rd October 2007, 09:03
I initialize it before

jpn
3rd October 2007, 09:15
The backtrace could be more helpful if the application was compiled in debug mode.

raxetul
4th May 2011, 12:05
I 've the same Issue with Qt 4.7.2 that calling exec function of the menu terminates the application. I'm also using style sheets.