PDA

View Full Version : Unhandled Exception in QTableView->setModel(QSqlTableModel)



dougbroadwell
19th March 2009, 20:35
Windows, Qt Creator 1.0.0, Qt 4.5.0

I'm creating a little SQL input form. In the main window constructor, I create a QSqlTableModel and when I try to associate it with a QTableView created in QDesigner I get the runtime error:

Unhandled exception at 0x00f8a5be in Forecast1.exe: 0xC0000005: Access violation reading location 0x00000004

The arrow in the following code is where it is occurring.

3053

In running in the debugger traces it to the lines below, at (in qwidget.h line 144):

QWidgetPrivate *pd = parent->d_func();

is where it happens, when I step a message displayed is: ' stopped: "signal received" ' and the debugger will not go beyond the "Q_DECLARE_PRIVATE(QWidget)" line in the last section.

3052

Thanks,
Doug

P.S., let me know if it would be better to paste the code in here instead of having them as attachments.