Details
-
Type:
Bug
-
Status: Closed
-
Priority:
P1: Critical
-
Resolution: Out of scope
-
Affects Version/s: 4.6.2
-
Fix Version/s: 4.7.0
-
Component/s: (Inactive) Porting from Qt 3 to Qt 4
-
Labels:None
-
Environment:Linux (openSUSE 11.1)
Qt 4.6.2
GCC 4.3.2
Description
Although the documentation for Q3Action::addTo(QWidget*) states
addTo() returns true if the action was added successfully and false otherwise. (If w is not a Q3ToolBar or Q3PopupMenu the action will not be added and false will be returned.)
calling addTo() with a QMenu returns true, but later in the Q3Action destructor, a crash occurs.
Here is a simple example which crashes upon closing.
main.cpp
#include <QtGui/QApplication> #include <QtGui/QMainWindow> #include <QtCore/QDebug> #include <QtGui/QMenu> #include <QtGui/QMenuBar> #include <Qt3Support/Q3Action> int main(int argc, char *argv[]) { QApplication a(argc, argv); QMainWindow w; QMenu *testMenu = w.menuBar()->addMenu("Test"); Q3Action *action3 = new Q3Action(&w); action3->setText("A Q3Action"); qDebug() << "adding Q3Action to QMenu:" << action3->addTo(testMenu); w.show(); return a.exec(); }