summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-09-08 08:21:29 (GMT)
committerAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-09-09 15:18:07 (GMT)
commitc44402453593cbdf2eafa66f6ee23d17aacf44fd (patch)
tree6eb627350e64902bbbc0ecf52188f657a14520f1 /tests
parent486ff054b8b65c191df39748dfe59f9440a60578 (diff)
downloadQt-c44402453593cbdf2eafa66f6ee23d17aacf44fd.zip
Qt-c44402453593cbdf2eafa66f6ee23d17aacf44fd.tar.gz
Qt-c44402453593cbdf2eafa66f6ee23d17aacf44fd.tar.bz2
Remove ItemAutoDetectsFocusProxy from QGraphicsItem.
This change partially reverts f68fed388dcdba6ab6dad3af4933bcd3aa123cf8, which was an attempt at getting FocusRealms working. Turns out this approach is wrong. The flag behaves badly when reparenting, and the feature conflicts with plain old setting focus. Discussed with Aaron; this change was already reverted in the kinetic-declarativeui branch. Reviewed-by: TrustMe
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp71
1 files changed, 0 insertions, 71 deletions
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index b8061da..cefff80 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -164,7 +164,6 @@ public slots:
void init();
private slots:
- void explicitDeleteAutoFocusProxy();
void construction();
void constructionWithParent();
void destruction();
@@ -284,9 +283,7 @@ private slots:
void hitTestUntransformableItem();
void hitTestGraphicsEffectItem();
void focusProxy();
- void autoDetectFocusProxy();
void subFocus();
- void reverseCreateAutoFocusProxy();
void focusProxyDeletion();
void negativeZStacksBehindParent();
void setGraphicsEffect();
@@ -7551,31 +7548,6 @@ void tst_QGraphicsItem::focusProxy()
QCOMPARE(item3->focusProxy(), (QGraphicsItem *)0);
}
-void tst_QGraphicsItem::autoDetectFocusProxy()
-{
- QGraphicsScene scene;
- QGraphicsItem *item = scene.addRect(0, 0, 10, 10);
- item->setFlag(QGraphicsItem::ItemIsFocusable);
-
- QGraphicsItem *item2 = scene.addRect(0, 0, 10, 10);
- item2->setParentItem(item);
- item2->setFlag(QGraphicsItem::ItemIsFocusable);
-
- QGraphicsItem *item3 = scene.addRect(0, 0, 10, 10);
- item3->setParentItem(item2);
- item3->setFlag(QGraphicsItem::ItemIsFocusable);
-
- item->setFlag(QGraphicsItem::ItemAutoDetectsFocusProxy);
- QCOMPARE(item->focusProxy(), (QGraphicsItem *)0);
-
- item2->setFocus();
- QCOMPARE(item->focusProxy(), item2);
- item3->setFocus();
- QCOMPARE(item->focusProxy(), item3);
- item3->clearFocus();
- QCOMPARE(item->focusProxy(), item3);
-}
-
void tst_QGraphicsItem::subFocus()
{
// Construct a text item that's not part of a scene (yet)
@@ -7635,49 +7607,6 @@ void tst_QGraphicsItem::subFocus()
QVERIFY(text2->hasFocus());
}
-void tst_QGraphicsItem::reverseCreateAutoFocusProxy()
-{
- QGraphicsTextItem *text = new QGraphicsTextItem;
- text->setTextInteractionFlags(Qt::TextEditorInteraction);
- text->setFlag(QGraphicsItem::ItemAutoDetectsFocusProxy);
-
- QGraphicsTextItem *text2 = new QGraphicsTextItem;
- text2->setTextInteractionFlags(Qt::TextEditorInteraction);
- text2->setFocus();
- QVERIFY(!text2->hasFocus());
- QCOMPARE(text->focusProxy(), (QGraphicsItem *)0);
- text2->setParentItem(text);
- QCOMPARE(text->focusProxy(), (QGraphicsItem *)text2);
- QCOMPARE(text->focusItem(), (QGraphicsItem *)text2);
-
- QGraphicsScene scene;
- scene.addItem(text);
- QVERIFY(text2->hasFocus());
-}
-
-void tst_QGraphicsItem::explicitDeleteAutoFocusProxy()
-{
- QGraphicsTextItem *text = new QGraphicsTextItem;
- text->setTextInteractionFlags(Qt::TextEditorInteraction);
- text->setFlag(QGraphicsItem::ItemAutoDetectsFocusProxy);
-
- QGraphicsTextItem *text2 = new QGraphicsTextItem;
- text2->setTextInteractionFlags(Qt::TextEditorInteraction);
- text2->setFocus();
- QVERIFY(!text2->hasFocus());
- QCOMPARE(text->focusProxy(), (QGraphicsItem *)0);
- text2->setParentItem(text);
- QCOMPARE(text->focusProxy(), (QGraphicsItem *)text2);
- QCOMPARE(text->focusItem(), (QGraphicsItem *)text2);
-
- QGraphicsScene scene;
- scene.addItem(text);
- QVERIFY(text2->hasFocus());
-
- delete text2;
- QCOMPARE(text->focusProxy(), (QGraphicsItem *)0);
-}
-
void tst_QGraphicsItem::focusProxyDeletion()
{
QGraphicsRectItem *rect = new QGraphicsRectItem;