qt: Compatibility improvements

* Patch to build with Qt 5.11 and later by jriwanek
* Attempt to fix viewport on hardware renderers
This commit is contained in:
Cacodemon345
2022-02-11 13:49:45 +06:00
parent 15bc29aef8
commit bfebbd05d3
5 changed files with 12 additions and 9 deletions

View File

@@ -76,7 +76,11 @@ void SoftwareRenderer::onPaint(QPaintDevice* device) {
QPainter painter(device);
painter.setRenderHint(QPainter::SmoothPixmapTransform, video_filter_method > 0 ? true : false);
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
painter.fillRect(0, 0, device->width(), device->height(), QColorConstants::Black);
#else
painter.fillRect(0,0, device->width(), device->height(), Qt::black);
#endif
painter.setCompositionMode(QPainter::CompositionMode_Plus);
painter.drawImage(destination, *images[cur_image], source);
}