From 50005e0703fe9d6827875f4b2f870895e4033d0e Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Mon, 10 Aug 2015 23:04:39 -0700 Subject: [PATCH] Qt: More cleanup --- src/platform/qt/LoadSaveState.cpp | 2 +- src/platform/qt/SavestateButton.cpp | 2 +- src/platform/qt/Window.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/platform/qt/LoadSaveState.cpp b/src/platform/qt/LoadSaveState.cpp index 054dd13b4..c14f7ccd7 100644 --- a/src/platform/qt/LoadSaveState.cpp +++ b/src/platform/qt/LoadSaveState.cpp @@ -26,6 +26,7 @@ LoadSaveState::LoadSaveState(GameController* controller, QWidget* parent) , m_currentFocus(controller->stateSlot() - 1) , m_mode(LoadSave::LOAD) { + setAttribute(Qt::WA_TranslucentBackground); m_ui.setupUi(this); m_slots[0] = m_ui.state1; @@ -208,6 +209,5 @@ void LoadSaveState::showEvent(QShowEvent* event) { void LoadSaveState::paintEvent(QPaintEvent*) { QPainter painter(this); QRect full(QPoint(), size()); - painter.drawPixmap(full, m_currentImage); painter.fillRect(full, QColor(0, 0, 0, 128)); } diff --git a/src/platform/qt/SavestateButton.cpp b/src/platform/qt/SavestateButton.cpp index c9f6560b0..d99ac34f6 100644 --- a/src/platform/qt/SavestateButton.cpp +++ b/src/platform/qt/SavestateButton.cpp @@ -13,7 +13,7 @@ using namespace QGBA; SavestateButton::SavestateButton(QWidget* parent) : QAbstractButton(parent) { - // Nothing to do + setAttribute(Qt::WA_TranslucentBackground); } void SavestateButton::paintEvent(QPaintEvent*) { diff --git a/src/platform/qt/Window.cpp b/src/platform/qt/Window.cpp index ca73470b1..ccec27219 100644 --- a/src/platform/qt/Window.cpp +++ b/src/platform/qt/Window.cpp @@ -685,7 +685,7 @@ void Window::openStateWindow(LoadSave ls) { connect(this, SIGNAL(shutdown()), m_stateWindow, SLOT(close())); connect(m_controller, SIGNAL(gameStopped(GBAThread*)), m_stateWindow, SLOT(close())); connect(m_stateWindow, &LoadSaveState::closed, [this]() { - m_screenWidget->layout()->removeWidget(m_stateWindow); + detachWidget(m_stateWindow); m_stateWindow = nullptr; QMetaObject::invokeMethod(this, "setFocus", Qt::QueuedConnection); });