PDA

View Full Version : Seq fault: QTableView + (QStyledItemDelegate subclass from Dll)



Delphi
8th July 2013, 13:32
Hi,

I am using a Subclass of QStyledItemDelegate named : EuroFormat. It is placed in a Library.
When using the EuroFormat in my window(for now located in "exe"). I am getting a segmentation fault when displaying the window.

What am i doing wrong? can QStyledItemDelegate not be in another library?

Added an example. A executable with Dll. 9275

Any help is appreciated, thanks.

Delphi
9th July 2013, 16:59
Some test show that the code works on Unix.

A test with Dr.memory (see below)
shows that it is the delegate, when the window gets painted.

Is this a bug in qt or? Has it something to do with my code?

Any help is appreciated, thanks.

Error #01: UNADDRESSABLE ACCESS: reading 0x00000000-0x00000004 4 byte(s)
# 0 Qt5Gui.dll!ZNK22QGuiApplicationPrivate15isWindowBl ockedEP7QWindowPS1_ +0x51b (0x61955ddb <Qt5Gui.dll+0x15ddb>)
# 1 Qt5Gui.dll!ZN15QGuiApplication4fontEv +0x17 (0x619577b8 <Qt5Gui.dll+0x177b8>)
# 2 Qt5Gui.dll!ZN5QFontC1Ev +0x18 (0x619d9bd9 <Qt5Gui.dll+0x99bd9>)
# 3 Qt5Widgets.dll!ZN12QStyleOptionC2Eii +0x4b (0x11351b0c <Qt5Widgets.dll+0x61b0c>)
# 4 Qt5Widgets.dll!ZN20QStyleOptionViewItemC1ERKS_ +0x26 (0x11646987 <Qt5Widgets.dll+0x356987>)
# 5 Qt5Widgets.dll!ZNK19QStyledItemDelegate5paintEP8QP ainterRK20QStyleOptionViewItemRK11QModelIndex+0x1f (0x1157ee40 <Qt5Widgets.dll+0x28ee40>)
# 6 Qt5Widgetsd.dll!QTableView::paintEvent() [itemviews/qtableview.cpp:1439]
# 7 Qt5Widgetsd.dll!QWidget::event() [kernel/qwidget.cpp:7986]
# 8 Qt5Widgetsd.dll!QFrame::event() [widgets/qframe.cpp:534]
# 9 Qt5Widgetsd.dll!QAbstractScrollArea::viewportEvent () [widgets/qabstractscrollarea.cpp:1163]
#10 Qt5Widgetsd.dll!QAbstractItemView::viewportEvent() [itemviews/qabstractitemview.cpp:1679]
#11 Qt5Widgetsd.dll!QAbstractScrollAreaPrivate::viewpo rtEvent() [../../include/QtWidgets/5.0.1/QtWidgets/private/../../../../../src/widgets/widgets/qabstractscrollarea_p.h:105]
Note: @0:00:12.324 in thread 464
Note: instruction: mov (%eax) -> %edx

Delphi
10th July 2013, 16:59
Hi,

I am still stuck on this problem. Can someone take a look on this problem?

Santosh Reddy
10th July 2013, 18:02
I don't have any problem in running the code on my Windows Vista + Qt 5.0.2 in both debug and release modes

Just an observation in main()


int main(int argc, char *argv[])
{
QApplication a(argc, argv);

QTableView view;
QStandardItemModel model(1,1);
model.setData(model.index(0,0),10);
view.setModel(&model);
view.show();
QAbstractItemDelegate* del = new EuroFormat;

view.setItemDelegateForColumn(0, del);

return a.exec();
delete del; //<<<<<<< any statements after return will not be executed.
}

Delphi
11th July 2013, 12:05
I'm working on a Windows 7 + Qt 5.0.1. Same thing applies with a Win Xp client. I don't have Vista client to test on.

I can assume that the problem is fixed in qt 5.0.2?
I will upgrade my machine to 5.0.2, and try.

Thanks for testing

Delphi
12th July 2013, 08:40
I have the code running on Windows 7 + Qt 5.1.0.