TabToolbar icon indicating copy to clipboard operation
TabToolbar copied to clipboard

Window crash when installing Arabic translator (RightToLeft)

Open MCA4213 opened this issue 4 years ago • 0 comments

Hello, my application crash when I install the translator (in Arabic, layout rightToLeft) before creating the toolbar. it crash on : group->AddAction(QToolButton::DelayedPopup, ui.actionAddImage);

After digging in the code I found a null screen has been returned in GetScaleFactor . removing the else, by changing the function as follow has fix the problem:

float GetScaleFactor( const QWidget& widget)
{
    auto scrNumber = QApplication::desktop()->screenNumber(&widget);
    auto screens = QGuiApplication::screens();
    QScreen* scr = screens.at(scrNumber);
    const float defaultDpi = 96.0f;
    return scr->logicalDotsPerInchY() / defaultDpi;
}

I am running on Qt 5.14, MSVC 2019 on Windows 10.

MCA4213 avatar Apr 30 '20 17:04 MCA4213