TabToolbar
TabToolbar copied to clipboard
Dual Screen Crash
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.