QWidgetAction: add test for defaultWidget() being deleted before action
... even though the documentation states that the action takes ownership of the widget. Change-Id: Ie5520fbda295a5a2774ff8b82165070e9d49e310 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
parent
3fe44ddb9d
commit
a6bd2da2ab
@ -74,6 +74,18 @@ void tst_QWidgetAction::cleanup()
|
||||
|
||||
void tst_QWidgetAction::defaultWidget()
|
||||
{
|
||||
// check that QWidgetAction deals with the widget being deleted before itself:
|
||||
{
|
||||
QToolBar tb1;
|
||||
|
||||
QComboBox combo(&tb1);
|
||||
|
||||
auto action = new QWidgetAction(&tb1);
|
||||
action->setDefaultWidget(&combo);
|
||||
|
||||
tb1.addAction(action);
|
||||
}
|
||||
// check that QWidgetAction takes ownership of the widget:
|
||||
{
|
||||
QToolBar tb1;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user