mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Issue #46: Program does not launch/freezes on Windows 10/Windows Server 2022 (x64)
This commit is contained in:
@@ -2028,6 +2028,20 @@ void PDFProgramController::resetSettings()
|
||||
}
|
||||
}
|
||||
|
||||
void PDFProgramController::checkHardwareOpenGLAvailability()
|
||||
{
|
||||
if (m_settings->getRendererEngine() == pdf::RendererEngine::OpenGL &&
|
||||
!pdf::PDFRendererInfo::isHardwareAccelerationSupported())
|
||||
{
|
||||
pdf::PDFRendererInfo::Info info = pdf::PDFRendererInfo::getHardwareAccelerationSupportedInfo();
|
||||
QMessageBox::warning(m_mainWindow, tr("Warning"),
|
||||
tr("Hardware acceleration is not supported on this device. "
|
||||
"OpenGL version at least 3.2 is required. Software rendering is used instead. "
|
||||
"Available OpenGL is %1 using %2. You can turn off hardware acceleration "
|
||||
"in 'Tools' menu using 'Options' item to stop displaying this message.").arg(info.version, info.renderer));
|
||||
}
|
||||
}
|
||||
|
||||
void PDFProgramController::onActionOptionsTriggered()
|
||||
{
|
||||
PDFViewerSettingsDialog::OtherSettings otherSettings;
|
||||
|
@@ -276,6 +276,8 @@ public:
|
||||
void writeSettings();
|
||||
void resetSettings();
|
||||
|
||||
void checkHardwareOpenGLAvailability();
|
||||
|
||||
void performPrint();
|
||||
void performSave();
|
||||
void performSaveAs();
|
||||
|
@@ -523,6 +523,7 @@ void PDFViewerMainWindow::showEvent(QShowEvent* event)
|
||||
{
|
||||
QMainWindow::showEvent(event);
|
||||
m_progressTaskbarIndicator->setWindow(windowHandle());
|
||||
QTimer::singleShot(0, this, [this] { m_programController->checkHardwareOpenGLAvailability(); });
|
||||
}
|
||||
|
||||
void PDFViewerMainWindow::dragEnterEvent(QDragEnterEvent* event)
|
||||
|
@@ -412,8 +412,9 @@ void PDFViewerMainWindowLite::closeEvent(QCloseEvent* event)
|
||||
|
||||
void PDFViewerMainWindowLite::showEvent(QShowEvent* event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
QMainWindow::showEvent(event);
|
||||
m_progressTaskbarIndicator->setWindow(windowHandle());
|
||||
QTimer::singleShot(0, this, [this] { m_programController->checkHardwareOpenGLAvailability(); });
|
||||
}
|
||||
|
||||
void PDFViewerMainWindowLite::dragEnterEvent(QDragEnterEvent* event)
|
||||
|
Reference in New Issue
Block a user