summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar N00byKing2018-01-17 23:19:41 +0100
committerGravatar bunnei2018-01-17 17:19:41 -0500
commitb17763e3d4e37caa994fd2ca531a4f48abb5ebac (patch)
tree9c84378459fd4b6f2e62bf7709d8f9a409355564 /src
parentMerge pull request #77 from gdkchan/no_relocs (diff)
downloadyuzu-b17763e3d4e37caa994fd2ca531a4f48abb5ebac.tar.gz
yuzu-b17763e3d4e37caa994fd2ca531a4f48abb5ebac.tar.xz
yuzu-b17763e3d4e37caa994fd2ca531a4f48abb5ebac.zip
Implement Pull #3306 from citra: citra_qt: Drop Qt 5 version checks in code (#41)
* Update bootmanager.cpp * This *should* fix the clang error
Diffstat (limited to 'src')
-rw-r--r--src/yuzu/bootmanager.cpp14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp
index 843ac6ad7..61d678c9b 100644
--- a/src/yuzu/bootmanager.cpp
+++ b/src/yuzu/bootmanager.cpp
@@ -1,12 +1,8 @@
1#include <QApplication> 1#include <QApplication>
2#include <QHBoxLayout> 2#include <QHBoxLayout>
3#include <QKeyEvent> 3#include <QKeyEvent>
4
5#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
6// Required for screen DPI information
7#include <QScreen> 4#include <QScreen>
8#include <QWindow> 5#include <QWindow>
9#endif
10 6
11#include "common/microprofile.h" 7#include "common/microprofile.h"
12#include "common/scm_rev.h" 8#include "common/scm_rev.h"
@@ -120,15 +116,13 @@ GRenderWindow::~GRenderWindow() {
120 116
121void GRenderWindow::moveContext() { 117void GRenderWindow::moveContext() {
122 DoneCurrent(); 118 DoneCurrent();
123// We need to move GL context to the swapping thread in Qt5 119
124#if QT_VERSION > QT_VERSION_CHECK(5, 0, 0)
125 // If the thread started running, move the GL Context to the new thread. Otherwise, move it 120 // If the thread started running, move the GL Context to the new thread. Otherwise, move it
126 // back. 121 // back.
127 auto thread = (QThread::currentThread() == qApp->thread() && emu_thread != nullptr) 122 auto thread = (QThread::currentThread() == qApp->thread() && emu_thread != nullptr)
128 ? emu_thread 123 ? emu_thread
129 : qApp->thread(); 124 : qApp->thread();
130 child->context()->moveToThread(thread); 125 child->context()->moveToThread(thread);
131#endif
132} 126}
133 127
134void GRenderWindow::SwapBuffers() { 128void GRenderWindow::SwapBuffers() {
@@ -191,12 +185,8 @@ QByteArray GRenderWindow::saveGeometry() {
191} 185}
192 186
193qreal GRenderWindow::windowPixelRatio() { 187qreal GRenderWindow::windowPixelRatio() {
194#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
195 // windowHandle() might not be accessible until the window is displayed to screen. 188 // windowHandle() might not be accessible until the window is displayed to screen.
196 return windowHandle() ? windowHandle()->screen()->devicePixelRatio() : 1.0f; 189 return windowHandle() ? windowHandle()->screen()->devicePixelRatio() : 1.0f;
197#else
198 return 1.0f;
199#endif
200} 190}
201 191
202void GRenderWindow::closeEvent(QCloseEvent* event) { 192void GRenderWindow::closeEvent(QCloseEvent* event) {
@@ -299,9 +289,7 @@ void GRenderWindow::OnEmulationStopping() {
299void GRenderWindow::showEvent(QShowEvent* event) { 289void GRenderWindow::showEvent(QShowEvent* event) {
300 QWidget::showEvent(event); 290 QWidget::showEvent(event);
301 291
302#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
303 // windowHandle() is not initialized until the Window is shown, so we connect it here. 292 // windowHandle() is not initialized until the Window is shown, so we connect it here.
304 connect(this->windowHandle(), SIGNAL(screenChanged(QScreen*)), this, 293 connect(this->windowHandle(), SIGNAL(screenChanged(QScreen*)), this,
305 SLOT(OnFramebufferSizeChanged()), Qt::UniqueConnection); 294 SLOT(OnFramebufferSizeChanged()), Qt::UniqueConnection);
306#endif
307} 295}