From kde-commits Thu May 31 20:44:31 2018 From: Ralf Habacker Date: Thu, 31 May 2018 20:44:31 +0000 To: kde-commits Subject: [kmymoney/4.8] kmymoney/widgets: Fix 'when using the "amount entry widget" in the ledger view, it ha Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=152779948312828 Git commit 6a221524755177087fb1dcd110af1bc5f592f61a by Ralf Habacker. Committed on 31/05/2018 at 20:44. Pushed by habacker into branch '4.8'. Fix 'when using the "amount entry widget" in the ledger view, it hangs off = the screen' BUG:283784 FIXED-IN:4.8.3 M +16 -1 kmymoney/widgets/kmymoneyedit.cpp https://commits.kde.org/kmymoney/6a221524755177087fb1dcd110af1bc5f592f61a diff --git a/kmymoney/widgets/kmymoneyedit.cpp b/kmymoney/widgets/kmymoneye= dit.cpp index ac79db71..61eebc42 100644 --- a/kmymoney/widgets/kmymoneyedit.cpp +++ b/kmymoney/widgets/kmymoneyedit.cpp @@ -206,6 +206,21 @@ static const uchar resetButtonImage[] =3D { 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82 }; = +/** + * Force geometry update of a hidden widget, + * see https://stackoverflow.com/a/3996525 for details + * + * @parem widget widget to force update + */ +void forceUpdate(QWidget *widget) +{ + widget->setAttribute(Qt::WA_DontShowOnScreen); + widget->show(); + widget->updateGeometry(); + widget->hide(); + widget->setAttribute(Qt::WA_DontShowOnScreen, false); +} + void kMyMoneyEdit::init() { allowEmpty =3D false; @@ -225,7 +240,7 @@ void kMyMoneyEdit::init() m_calculatorFrame->setLineWidth(3); = m_calculator =3D new kMyMoneyCalculator(m_calculatorFrame); - m_calculatorFrame->hide(); + forceUpdate(m_calculatorFrame); = m_calcButton =3D new KPushButton(KIcon("accessories-calculator"), QStrin= g(""), this); m_calcButton->setFocusProxy(m_edit);