I am just trying to debug the crash with the qt submenu and keyboards with the 
help of Trolltech, who cannot (yet) reproduce the crash, though.
Just to exclude some weirdness on my system, can some of you who also see the 
crash try to reproduce it with the attached example app?

You have to compile it with
g++ -o qtest -I $QTDIR/include -L $QTDIR/lib main.cpp -lqt-mt
(probably you need to "export QTDIR=/path/to/qt" before).

I can reproduce the crash with the example on any except the second item of 
the menu. E.g. "Alt+M--Alt+b--Right Arrow" crashes, while 
"Alt+M--Alt+u--Right Arrow" does not.

Thanks,
Juergen

(BTW: I suspect that this happens only with qt3.1.2. Are there qt-3.1.2 users 
who do not see this? And does the crash depend on whether qt-mt is used or 
not?)

#include <qapplication.h>
#include <qmainwindow.h>
#include <qmenubar.h>
#include <qpopupmenu.h>


class MyMainWidget : public QMainWindow
{
    //Q_OBJECT
public:
    MyMainWidget(QWidget *parent = 0, const char *name = 0)
        : QMainWindow(parent, name)
    {
	for (int i=0; i<5; ++i) {
	    QPopupMenu *pop = new QPopupMenu(menuBar());
	    menuBar()->insertItem(QString("Menu%1").arg(i+1).insert(i, '&'), pop);
	    for (int j=0; j<8; ++j) {
		QPopupMenu *subpop = new QPopupMenu(pop);
		pop->insertItem(QString("SubMenu%1").arg(j+1).insert(j, '&'), subpop);
		for (int k=0; k<5; ++k) {
		    subpop->insertItem(QString("Item%1").arg(k+1).insert(k, '&'));
		}
	    }
	}
    }
};


int main(int argc, char **argv)
{
    QApplication a(argc, argv);
    MyMainWidget w;
    w.show();
    a.setMainWidget(&w);
    return a.exec();
}

Reply via email to