diff --git a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp index 41888727c06..5b452a7a1b0 100644 --- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp @@ -2662,7 +2662,7 @@ void tst_QComboBox::noScrollbar() void tst_QComboBox::setItemDelegate() { QComboBox comboBox; - QStyledItemDelegate *itemDelegate = new QStyledItemDelegate; + QStyledItemDelegate *itemDelegate = new QStyledItemDelegate(&comboBox); comboBox.setItemDelegate(itemDelegate); // the cast is a workaround for the XLC and Metrowerks compilers QCOMPARE(static_cast(comboBox.itemDelegate()), itemDelegate); @@ -2671,7 +2671,7 @@ void tst_QComboBox::setItemDelegate() void tst_QComboBox::task253944_itemDelegateIsReset() { QComboBox comboBox; - QStyledItemDelegate *itemDelegate = new QStyledItemDelegate; + QStyledItemDelegate *itemDelegate = new QStyledItemDelegate(&comboBox); comboBox.setItemDelegate(itemDelegate); // the casts are workarounds for the XLC and Metrowerks compilers