mirror of
https://github.com/citra-emu/citra.git
synced 2024-12-18 09:40:05 +00:00
Merge pull request #3306 from lioncash/qt4
citra_qt: Drop Qt 5 version checks in code
This commit is contained in:
commit
4c3a4ab664
@ -1,12 +1,8 @@
|
|||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
|
||||||
// Required for screen DPI information
|
|
||||||
#include <QScreen>
|
#include <QScreen>
|
||||||
#include <QWindow>
|
#include <QWindow>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "citra_qt/bootmanager.h"
|
#include "citra_qt/bootmanager.h"
|
||||||
#include "common/microprofile.h"
|
#include "common/microprofile.h"
|
||||||
@ -121,15 +117,13 @@ GRenderWindow::~GRenderWindow() {
|
|||||||
|
|
||||||
void GRenderWindow::moveContext() {
|
void GRenderWindow::moveContext() {
|
||||||
DoneCurrent();
|
DoneCurrent();
|
||||||
// We need to move GL context to the swapping thread in Qt5
|
|
||||||
#if QT_VERSION > QT_VERSION_CHECK(5, 0, 0)
|
|
||||||
// If the thread started running, move the GL Context to the new thread. Otherwise, move it
|
// If the thread started running, move the GL Context to the new thread. Otherwise, move it
|
||||||
// back.
|
// back.
|
||||||
auto thread = (QThread::currentThread() == qApp->thread() && emu_thread != nullptr)
|
auto thread = (QThread::currentThread() == qApp->thread() && emu_thread != nullptr)
|
||||||
? emu_thread
|
? emu_thread
|
||||||
: qApp->thread();
|
: qApp->thread();
|
||||||
child->context()->moveToThread(thread);
|
child->context()->moveToThread(thread);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GRenderWindow::SwapBuffers() {
|
void GRenderWindow::SwapBuffers() {
|
||||||
@ -192,12 +186,8 @@ QByteArray GRenderWindow::saveGeometry() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
qreal GRenderWindow::windowPixelRatio() {
|
qreal GRenderWindow::windowPixelRatio() {
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
|
||||||
// windowHandle() might not be accessible until the window is displayed to screen.
|
// windowHandle() might not be accessible until the window is displayed to screen.
|
||||||
return windowHandle() ? windowHandle()->screen()->devicePixelRatio() : 1.0f;
|
return windowHandle() ? windowHandle()->screen()->devicePixelRatio() : 1.0f;
|
||||||
#else
|
|
||||||
return 1.0f;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GRenderWindow::closeEvent(QCloseEvent* event) {
|
void GRenderWindow::closeEvent(QCloseEvent* event) {
|
||||||
@ -301,9 +291,7 @@ void GRenderWindow::OnEmulationStopping() {
|
|||||||
void GRenderWindow::showEvent(QShowEvent* event) {
|
void GRenderWindow::showEvent(QShowEvent* event) {
|
||||||
QWidget::showEvent(event);
|
QWidget::showEvent(event);
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
|
||||||
// windowHandle() is not initialized until the Window is shown, so we connect it here.
|
// windowHandle() is not initialized until the Window is shown, so we connect it here.
|
||||||
connect(this->windowHandle(), SIGNAL(screenChanged(QScreen*)), this,
|
connect(this->windowHandle(), SIGNAL(screenChanged(QScreen*)), this,
|
||||||
SLOT(OnFramebufferSizeChanged()), Qt::UniqueConnection);
|
SLOT(OnFramebufferSizeChanged()), Qt::UniqueConnection);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
@ -192,12 +192,7 @@ GPUCommandListWidget::GPUCommandListWidget(QWidget* parent)
|
|||||||
list_widget->setFont(GetMonospaceFont());
|
list_widget->setFont(GetMonospaceFont());
|
||||||
list_widget->setRootIsDecorated(false);
|
list_widget->setRootIsDecorated(false);
|
||||||
list_widget->setUniformRowHeights(true);
|
list_widget->setUniformRowHeights(true);
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
|
||||||
list_widget->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
list_widget->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||||
#else
|
|
||||||
list_widget->header()->setResizeMode(QHeaderView::ResizeToContents);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
connect(list_widget->selectionModel(),
|
connect(list_widget->selectionModel(),
|
||||||
SIGNAL(currentChanged(const QModelIndex&, const QModelIndex&)), this,
|
SIGNAL(currentChanged(const QModelIndex&, const QModelIndex&)), this,
|
||||||
|
Loading…
Reference in New Issue
Block a user