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

Dual Screen Crash #12

Open
haknkayaa opened this issue Aug 6, 2021 · 0 comments
Open

Dual Screen Crash #12

haknkayaa opened this issue Aug 6, 2021 · 0 comments

Comments

@haknkayaa
Copy link

Hi, I have a TabToolbar that works fine when using a single screen. But when I open the project with a dual screen attached to my computer, it crashes.

I found that the crash happens in this function when opened with debug mode. (StyleTools.cpp)

float GetScaleFactor(const QWidget& widget)
{
#if (QT_VERSION <= QT_VERSION_CHECK(5, 10, 0))
    auto scrNumber = QApplication::desktop()->screenNumber(widget.mapToGlobal(QPoint(0,0)));
    auto screens = QGuiApplication::screens();
    QScreen* scr = screens.at(scrNumber);
#else
    QScreen* scr = QGuiApplication::screenAt(widget.mapToGlobal(QPoint(0,0)));
#endif
    const float defaultDpi = 96.0f;
    return scr->logicalDotsPerInchY() / defaultDpi;
}

By the way, my screens have different resolutions.

1st screen: 1920x1080 (16.9)
2nd screen: 2560x1440 (16:9)

Anyone have any ideas about the problem? Thanks.

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