![]() Registered Member ![]()
|
I have used the plugActionList in my app before but a new implementation gives me a wrong result
the very first time the menu are empty and greyed out as designed and createGUI() is run, after adding the first report the gui shows "report1" in the dynamic menu, adding the second menu gives me "report1 report1 report2" underneath each other in the menu. The for loop contains only 2 item in the second time it runs. Help is enormously appreciated. |
![]() Administrator ![]()
|
What exactly are you trying to achieve?
This problem occurs because: either m_reportPrintPlugList and m_reportPrintPlugList aren't cleared. or m_reportCloseMenu and m_reportPrintMenu aren't emptied. Are you trying to create submenus containing the plugged actions? Or are you trying to create items which are seamlessly inserted into the menu?
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
bcooksley,
I guess a bit of both. I have a menubar item "Report" and under it come two items "close" and "print" which on their turn can have actions "report1, report2, ...." that change to the QTabWidget where this report is shown. Indeed my problem was related to the fact that I didn't destroy the objects the qlist items pointed to and didn't cleared the qlist. So added a cleanup routine and my code looks like this now. I also do a cleanup in the destructor of the Report object. The problem now is that it sometimes crashes when closing a report ( not reproducable..yet ). Anyone can see the problem right away? or do I need to use valgrind again. The close action also uses initialiseSubMenu , since the removal of a report implies a change in submenu items. This is the gdb output:
|
![]() Administrator ![]()
|
I believe in this case using pluggable menus isn't needed, except for possibly the first time, unless you create it before createGUI() is called.
Either way, the likely cause for this crash is unplugging it after the items have been destroyed. Try unplugging it first.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
Indeed the first time it's created it's before createGUI() has run. The crash hasn't occured any more, because I'm unplugging first before destroying the qlists.
|
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]