diff options
-rw-r--r-- | src/gui/widgets/qtabwidget.cpp | 2 | ||||
-rw-r--r-- | tests/auto/qtabwidget/tst_qtabwidget.cpp | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/gui/widgets/qtabwidget.cpp b/src/gui/widgets/qtabwidget.cpp index 047a905..4a61935 100644 --- a/src/gui/widgets/qtabwidget.cpp +++ b/src/gui/widgets/qtabwidget.cpp @@ -542,6 +542,8 @@ void QTabWidget::setTabEnabled(int index, bool enable) { Q_D(QTabWidget); d->tabs->setTabEnabled(index, enable); + if (QWidget *widget = d->stack->widget(index)) + widget->setEnabled(enable); } /*! diff --git a/tests/auto/qtabwidget/tst_qtabwidget.cpp b/tests/auto/qtabwidget/tst_qtabwidget.cpp index 4491fb3..504579f 100644 --- a/tests/auto/qtabwidget/tst_qtabwidget.cpp +++ b/tests/auto/qtabwidget/tst_qtabwidget.cpp @@ -259,11 +259,14 @@ void tst_QTabWidget::tabEnabled() int index = addPage(); tw->setTabEnabled(index, true); - QVERIFY(tw->isTabEnabled(index) == true); + QVERIFY(tw->isTabEnabled(index)); + QVERIFY(tw->widget(index)->isEnabled()); tw->setTabEnabled(index, false); - QVERIFY(tw->isTabEnabled(index) == false); + QVERIFY(!tw->isTabEnabled(index)); + QVERIFY(!tw->widget(index)->isEnabled()); tw->setTabEnabled(index, true); - QVERIFY(tw->isTabEnabled(index) == true); + QVERIFY(tw->isTabEnabled(index)); + QVERIFY(tw->widget(index)->isEnabled()); removePage(index); } |