summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicswidget
diff options
context:
space:
mode:
authorAlexis Menard <alexis.menard@nokia.com>2009-05-28 15:24:53 (GMT)
committerAlexis Menard <alexis.menard@nokia.com>2009-05-28 15:26:48 (GMT)
commit4a82680736ace8abb46e6fb5e085e8622f154b2d (patch)
tree705f3a32a82f63182a579841d4cff9d0e7a9667f /tests/auto/qgraphicswidget
parent8e4300e2866fd28881853509df6ff054e13f841b (diff)
downloadQt-4a82680736ace8abb46e6fb5e085e8622f154b2d.zip
Qt-4a82680736ace8abb46e6fb5e085e8622f154b2d.tar.gz
Qt-4a82680736ace8abb46e6fb5e085e8622f154b2d.tar.bz2
Fix a ASSERT/Crash when adding two times the same QAction to a QGW.
We were adding two times in the QActionPrivate list the entry for the current QGraphicsWidget if the action was existing before. Task-number:KDE Reviewed-by:bnilsen BT:yes
Diffstat (limited to 'tests/auto/qgraphicswidget')
-rw-r--r--tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
index b85abd3..1917357 100644
--- a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
+++ b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
@@ -51,6 +51,7 @@
#include <qlineedit.h>
#include <qboxlayout.h>
#include <qaction.h>
+#include <qwidgetaction.h>
#include "../../shared/util.h"
@@ -147,6 +148,7 @@ private slots:
void setSizes();
void closePopupOnOutsideClick();
void defaultSize();
+ void shortcutsDeletion();
// Task fixes
void task236127_bspTreeIndexFails();
@@ -1782,6 +1784,20 @@ void tst_QGraphicsWidget::defaultSize()
}
+void tst_QGraphicsWidget::shortcutsDeletion()
+{
+ QGraphicsWidget *widget = new QGraphicsWidget;
+ QGraphicsWidget *widget2 = new QGraphicsWidget;
+ widget->setMinimumSize(40, 40);
+ QWidgetAction *del = new QWidgetAction(widget);
+ del->setIcon(QIcon("edit-delete"));
+ del->setShortcut(Qt::Key_Delete);
+ del->setShortcutContext(Qt::WidgetShortcut);
+ widget2->addAction(del);
+ widget2->addAction(del);
+ delete widget;
+}
+
class ProxyStyle : public QCommonStyle
{
public: