Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window crash when installing Arabic translator (RightToLeft) #9

Open
MCA4213 opened this issue Apr 30, 2020 · 0 comments
Open

Window crash when installing Arabic translator (RightToLeft) #9

MCA4213 opened this issue Apr 30, 2020 · 0 comments

Comments

@MCA4213
Copy link

MCA4213 commented Apr 30, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant