fix warnings when ToolButton has no parent

This commit is contained in:
Sebastian Kügler 2012-12-30 18:48:37 +01:00
parent 2c6d44eb23
commit 48e385a7c2

View File

@ -164,7 +164,7 @@ Item {
property QtObject margins: item.margins
property string shadowState: "shadow"
sourceComponent: {
if (label.text.length == 0 && button.width == button.height && button.parent.checkedButton === undefined && !flat) {
if (label.text.length == 0 && button.width == button.height && (button.parent && button.parent.checkedButton === undefined) && !flat) {
return roundButtonComponent
} else {
return buttonComponent