Fix for the button size calculation in qmessagebox.cpp

Actually use the calculated size for needed space instead of just
ignoring the return value.

Task-number: QTBUG-16315

Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
(cherry picked from commit 0792215fa8d227617a2080af9f12fd7f486b87d6)
Change-Id: I0792215fa8d227617a2080af9f12fd7f486b87d6
This commit is contained in:
Mikko Knuutila 2011-11-14 10:18:21 +01:00 committed by Qt by Nokia
parent a2ece6e626
commit 33f66acb36

View File

@ -153,7 +153,7 @@ public:
expandedTo(QApplication::globalStrut()); expandedTo(QApplication::globalStrut());
opt.text = label(HideLabel); opt.text = label(HideLabel);
sz = fm.size(Qt::TextShowMnemonic, opt.text); sz = fm.size(Qt::TextShowMnemonic, opt.text);
ret.expandedTo(style()->sizeFromContents(QStyle::CT_PushButton, &opt, sz, this). ret = ret.expandedTo(style()->sizeFromContents(QStyle::CT_PushButton, &opt, sz, this).
expandedTo(QApplication::globalStrut())); expandedTo(QApplication::globalStrut()));
return ret; return ret;
} }