[Qt-interest] QContextMenuEvent Conflict

Michele Ciampichetti cia.michele at gmail.com
Tue Apr 26 18:32:34 CEST 2011


Good afternoon to every body.
I'm a newbie of QT programming but I like it!! I'm developing a simple
application, and I found a situation that I don't understand, I hope you
could help me.
I try with documentation, and various QT forum but, no way :(

I develop a control basing on *Frozen column* example: I build an
Hierarchical QTreeview (HGrid), so when I expand an item of outer QTreeView,
I obtain an inner one (so the column of two object may be different).I
customize these component and all work fine but... I found a problem using
QContextMenuEvent.

I put this HGrid in my main window, and I want create different context menu
depending where I ask them, on the outher or on the inner QTreeView. All
work fine for the Outer, but for the inner, many time create errors and stop
execution, especially in release mode but not in debugging mode (in
debugging mode it work better).

I try to use *setContextMenuPolicy(Qt::NoContexMenu)* on the inner
QTreeView, but no way. I need to obtain a flexible method so I could build a
plugin from my HGrid class without create any fixed contextmenu, for this
reason I use *Qt::DefaultContextMenu* and the *virtual bool ContextMenuEvent
*.

Now I don't know how debug this situation, and if is the better way to do
what I need.

I attach the code of my class, and the errors returned. I'm using Microsoft
Windows XP and QT 4.7 mingw SDK

*Error 1) ASSERT failure in QMutexLocker: "QMutex pointer is misaligned",
file ..\..\include/QtCore/../../src/corelib/thread/qmutex.h, line 100 *
Error 2) *Starting
C:\TestQT\Hgrid\Hierarchical\hierarchical-build-desktop\debug\hierarchical.exe...
... exited with code -1073741819 *(no documentation about this error number)

I look forward to hearing from you soon!!

Many thanks

Michele
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110426/22a28518/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hgrid.cpp
Type: text/x-c++src
Size: 18452 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110426/22a28518/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hgrid.h
Type: text/x-chdr
Size: 4580 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110426/22a28518/attachment-0001.bin 


More information about the Qt-interest-old mailing list