diff options
author | David Faure <david.faure@kdab.com> | 2014-06-06 13:53:58 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-06-11 23:06:01 +0200 |
commit | a6d7e09e89a73b3706aabbf2d08586f238348c7c (patch) | |
tree | c43de1165cf9d362ac5469180413803ec5da8412 /tests/auto/widgets/kernel/qwidget | |
parent | 11aaff3a57afe7a8ff37bfa83cc545cc04c38649 (diff) |
QWidget: fix documentation for isEnabledTo(0)
It is NOT always the same as isEnabled().
Added a unittest to prove it.
Change-Id: I7717126835923e8c091249bfcdf81767c44fb5f7
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'tests/auto/widgets/kernel/qwidget')
-rw-r--r-- | tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index 34936fa5b8..eac8ab2236 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -1210,6 +1210,12 @@ void tst_QWidget::isEnabledTo() QVERIFY( !childWidget->isEnabledTo( testWidget ) ); QVERIFY( grandChildWidget->isEnabledTo( childWidget ) ); QVERIFY( !grandChildWidget->isEnabledTo( testWidget ) ); + + QMainWindow* childDialog = new QMainWindow(testWidget); + testWidget->setEnabled(false); + QVERIFY(!childDialog->isEnabled()); + QVERIFY(childDialog->isEnabledTo(0)); + testWidget->setEnabled(true); } void tst_QWidget::visible() |