Trolltech Home | Qt4-preview-feedback Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt4-preview-feedback Archive, July 2007
Qt C++ Eclipse Integration pb with new C++ class wizard


Message 1 in thread

Hi,

I encountered an error when trying to create a new Qt-based class using the "new C++ class" wizard from the CDT (note: not the Qt Gui class wizard). Steps to reproduce (hopefully) :

open the new C++ class wizard, specify a class name, click "Add" to specify a base class, select QAbstractItemModel, the base class appears correctly in the table, then click "Finish". A dialog appears to confirm the addition of new files in the .pro file, but only the HEADERS section appears. After clicking ok an error message pops up in the C++ class wizard, and the class isn't generated. Only an incomplete .h file is created.

The error log entry is pasted below. Note that the wizard completes fine (including adding the new files to the .pro) if I don't specify the base class.

I use Eclipse 3.2.1 and CDT 3.1.1 on Windows XP 32bits.

Best regards,

Romain Pokrzywka 
Software Engineer, Qt Consultant, Qt Trainer
KDAB - KlarÃlvdalens Datakonsult AB
http://www.kdab.com

Nb: Error log details :

Stack trace :

java.lang.reflect.InvocationTargetException
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:350)
at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:851)
at org.eclipse.cdt.internal.ui.wizards.NewElementWizard.performFinish(NewElementWizard.java:106)
at org.eclipse.cdt.internal.ui.wizards.NewClassCreationWizard.performFinish(NewClassCreationWizard.java:66)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:680)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:355)
at org.eclipse.jface.dialogs.Dialog$3.widgetSelected(Dialog.java:660)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
at org.eclipse.jface.window.Window.open(Window.java:796)
at org.eclipse.ui.internal.actions.NewWizardShortcutAction.run(NewWizardShortcutAction.java:110)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
Caused by: java.lang.NullPointerException
at org.eclipse.cdt.internal.ui.wizards.classwizard.NewClassCodeGenerator.addIncludePaths(NewClassCodeGenerator.java:533)
at org.eclipse.cdt.internal.ui.wizards.classwizard.NewClassCodeGenerator.addBaseClassIncludes(NewClassCodeGenerator.java:430)
at org.eclipse.cdt.internal.ui.wizards.classwizard.NewClassCodeGenerator.constructHeaderFileContent(NewClassCodeGenerator.java:256)
at org.eclipse.cdt.internal.ui.wizards.classwizard.NewClassCodeGenerator.createClass(NewClassCodeGenerator.java:156)
at org.eclipse.cdt.ui.wizards.NewClassCreationWizardPage.createClass(NewClassCreationWizardPage.java:1854)
at org.eclipse.cdt.ui.wizards.NewClassCreationWizardPage.createClass(NewClassCreationWizardPage.java:1813)
at org.eclipse.cdt.internal.ui.wizards.NewClassCreationWizard.finishPage(NewClassCreationWizard.java:57)
at org.eclipse.cdt.internal.ui.wizards.NewElementWizard$2.run(NewElementWizard.java:99)
at org.eclipse.cdt.internal.core.model.BatchOperation.executeOperation(BatchOperation.java:34)
at org.eclipse.cdt.internal.core.model.CModelOperation.execute(CModelOperation.java:342)
at org.eclipse.cdt.internal.core.model.CModelOperation.run(CModelOperation.java:607)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1737)
at org.eclipse.cdt.core.model.CoreModel.run(CoreModel.java:1217)
at org.eclipse.cdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:63)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
Root exception:
java.lang.NullPointerException
at org.eclipse.cdt.internal.ui.wizards.classwizard.NewClassCodeGenerator.addIncludePaths(NewClassCodeGenerator.java:533)
at org.eclipse.cdt.internal.ui.wizards.classwizard.NewClassCodeGenerator.addBaseClassIncludes(NewClassCodeGenerator.java:430)
at org.eclipse.cdt.internal.ui.wizards.classwizard.NewClassCodeGenerator.constructHeaderFileContent(NewClassCodeGenerator.java:256)
at org.eclipse.cdt.internal.ui.wizards.classwizard.NewClassCodeGenerator.createClass(NewClassCodeGenerator.java:156)
at org.eclipse.cdt.ui.wizards.NewClassCreationWizardPage.createClass(NewClassCreationWizardPage.java:1854)
at org.eclipse.cdt.ui.wizards.NewClassCreationWizardPage.createClass(NewClassCreationWizardPage.java:1813)
at org.eclipse.cdt.internal.ui.wizards.NewClassCreationWizard.finishPage(NewClassCreationWizard.java:57)
at org.eclipse.cdt.internal.ui.wizards.NewElementWizard$2.run(NewElementWizard.java:99)
at org.eclipse.cdt.internal.core.model.BatchOperation.executeOperation(BatchOperation.java:34)
at org.eclipse.cdt.internal.core.model.CModelOperation.execute(CModelOperation.java:342)
at org.eclipse.cdt.internal.core.model.CModelOperation.run(CModelOperation.java:607)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1737)
at org.eclipse.cdt.core.model.CoreModel.run(CoreModel.java:1217)
at org.eclipse.cdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:63)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)


Session Info :

eclipse.buildId=M20060921-0945
java.version=1.6.0_01
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=sv_SE
Command-line arguments:  -os win32 -ws win32 -arch x86

To unsubscribe - send "unsubscribe" in the subject to qt4-preview-feedback-request@xxxxxxxxxxxxx


Message 2 in thread

Hi,

thanks for reporting that, we can reproduce the behavior (with a slightly different stacktrace).

Regards,
Alessandro

Romain Pokrzywka schrieb:
> Hi,
> 
> I encountered an error when trying to create a new Qt-based class using the "new C++ class" wizard from the CDT (note: not the Qt Gui class wizard). Steps to reproduce (hopefully) :
> 
> open the new C++ class wizard, specify a class name, click "Add" to specify a base class, select QAbstractItemModel, the base class appears correctly in the table, then click "Finish". A dialog appears to confirm the addition of new files in the .pro file, but only the HEADERS section appears. After clicking ok an error message pops up in the C++ class wizard, and the class isn't generated. Only an incomplete .h file is created.
> 
> The error log entry is pasted below. Note that the wizard completes fine (including adding the new files to the .pro) if I don't specify the base class.
> 
> I use Eclipse 3.2.1 and CDT 3.1.1 on Windows XP 32bits.
> 
> Best regards,
> 
> Romain Pokrzywka 
> Software Engineer, Qt Consultant, Qt Trainer
> KDAB - KlarÃlvdalens Datakonsult AB
> http://www.kdab.com
> 
> Nb: Error log details :
> 
> Stack trace :
> 
> java.lang.reflect.InvocationTargetException
> at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:350)
> at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:851)
> at org.eclipse.cdt.internal.ui.wizards.NewElementWizard.performFinish(NewElementWizard.java:106)
> at org.eclipse.cdt.internal.ui.wizards.NewClassCreationWizard.performFinish(NewClassCreationWizard.java:66)
> at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:680)
> at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:355)
> at org.eclipse.jface.dialogs.Dialog$3.widgetSelected(Dialog.java:660)
> at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
> at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
> at org.eclipse.jface.window.Window.open(Window.java:796)
> at org.eclipse.ui.internal.actions.NewWizardShortcutAction.run(NewWizardShortcutAction.java:110)
> at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)
> at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539)
> at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
> at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
> at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
> at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
> at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
> at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
> at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
> at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
> at org.eclipse.core.launcher.Main.run(Main.java:977)
> at org.eclipse.core.launcher.Main.main(Main.java:952)
> Caused by: java.lang.NullPointerException
> at org.eclipse.cdt.internal.ui.wizards.classwizard.NewClassCodeGenerator.addIncludePaths(NewClassCodeGenerator.java:533)
> at org.eclipse.cdt.internal.ui.wizards.classwizard.NewClassCodeGenerator.addBaseClassIncludes(NewClassCodeGenerator.java:430)
> at org.eclipse.cdt.internal.ui.wizards.classwizard.NewClassCodeGenerator.constructHeaderFileContent(NewClassCodeGenerator.java:256)
> at org.eclipse.cdt.internal.ui.wizards.classwizard.NewClassCodeGenerator.createClass(NewClassCodeGenerator.java:156)
> at org.eclipse.cdt.ui.wizards.NewClassCreationWizardPage.createClass(NewClassCreationWizardPage.java:1854)
> at org.eclipse.cdt.ui.wizards.NewClassCreationWizardPage.createClass(NewClassCreationWizardPage.java:1813)
> at org.eclipse.cdt.internal.ui.wizards.NewClassCreationWizard.finishPage(NewClassCreationWizard.java:57)
> at org.eclipse.cdt.internal.ui.wizards.NewElementWizard$2.run(NewElementWizard.java:99)
> at org.eclipse.cdt.internal.core.model.BatchOperation.executeOperation(BatchOperation.java:34)
> at org.eclipse.cdt.internal.core.model.CModelOperation.execute(CModelOperation.java:342)
> at org.eclipse.cdt.internal.core.model.CModelOperation.run(CModelOperation.java:607)
> at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1737)
> at org.eclipse.cdt.core.model.CoreModel.run(CoreModel.java:1217)
> at org.eclipse.cdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:63)
> at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
> Root exception:
> java.lang.NullPointerException
> at org.eclipse.cdt.internal.ui.wizards.classwizard.NewClassCodeGenerator.addIncludePaths(NewClassCodeGenerator.java:533)
> at org.eclipse.cdt.internal.ui.wizards.classwizard.NewClassCodeGenerator.addBaseClassIncludes(NewClassCodeGenerator.java:430)
> at org.eclipse.cdt.internal.ui.wizards.classwizard.NewClassCodeGenerator.constructHeaderFileContent(NewClassCodeGenerator.java:256)
> at org.eclipse.cdt.internal.ui.wizards.classwizard.NewClassCodeGenerator.createClass(NewClassCodeGenerator.java:156)
> at org.eclipse.cdt.ui.wizards.NewClassCreationWizardPage.createClass(NewClassCreationWizardPage.java:1854)
> at org.eclipse.cdt.ui.wizards.NewClassCreationWizardPage.createClass(NewClassCreationWizardPage.java:1813)
> at org.eclipse.cdt.internal.ui.wizards.NewClassCreationWizard.finishPage(NewClassCreationWizard.java:57)
> at org.eclipse.cdt.internal.ui.wizards.NewElementWizard$2.run(NewElementWizard.java:99)
> at org.eclipse.cdt.internal.core.model.BatchOperation.executeOperation(BatchOperation.java:34)
> at org.eclipse.cdt.internal.core.model.CModelOperation.execute(CModelOperation.java:342)
> at org.eclipse.cdt.internal.core.model.CModelOperation.run(CModelOperation.java:607)
> at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1737)
> at org.eclipse.cdt.core.model.CoreModel.run(CoreModel.java:1217)
> at org.eclipse.cdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:63)
> at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
> 
> 
> Session Info :
> 
> eclipse.buildId=M20060921-0945
> java.version=1.6.0_01
> java.vendor=Sun Microsystems Inc.
> BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=sv_SE
> Command-line arguments:  -os win32 -ws win32 -arch x86
> 
> To unsubscribe - send "unsubscribe" in the subject to qt4-preview-feedback-request@xxxxxxxxxxxxx
> 

To unsubscribe - send "unsubscribe" in the subject to qt4-preview-feedback-request@xxxxxxxxxxxxx