Skip to content

Commit c245637

Browse files
committed
Qt: force hover event handling for flow widget items
Fixes hover movies for stylesheets that didn't have a game grid item style set for the hover state.
1 parent 4a4f537 commit c245637

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

rpcs3/rpcs3qt/flow_widget_item.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
#include <QStyleOption>
55
#include <QPainter>
66

7+
flow_widget_item::flow_widget_item(QWidget* parent) : QWidget(parent)
8+
{
9+
setAttribute(Qt::WA_Hover); // We need to enable the hover attribute to ensure that hover events are handled.
10+
}
11+
12+
flow_widget_item::~flow_widget_item()
13+
{
14+
}
15+
716
void flow_widget_item::polish_style()
817
{
918
style()->unpolish(this);

rpcs3/rpcs3qt/flow_widget_item.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ class flow_widget_item : public QWidget
2525
Q_PROPERTY(bool selected MEMBER selected) // Stylesheet workaround for descendants with parent pseudo state
2626

2727
public:
28-
using QWidget::QWidget;
28+
flow_widget_item(QWidget* parent);
29+
virtual ~flow_widget_item();
2930

3031
virtual void polish_style();
3132

rpcs3/rpcs3qt/game_list_grid_item.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ game_list_grid_item::game_list_grid_item(QWidget* parent, game_info game, const
77
: flow_widget_item(parent), movie_item_base(), m_game(std::move(game))
88
{
99
setObjectName("game_list_grid_item");
10+
setAttribute(Qt::WA_Hover); // We need to enable the hover attribute to ensure that hover events are handled.
1011

1112
cb_on_first_visibility = [this]()
1213
{

0 commit comments

Comments
 (0)