mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 13:31:27 +12:00
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.
This commit is contained in:
parent
4a4f537ee8
commit
c245637c38
3 changed files with 12 additions and 1 deletions
|
@ -4,6 +4,15 @@
|
||||||
#include <QStyleOption>
|
#include <QStyleOption>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
|
||||||
|
flow_widget_item::flow_widget_item(QWidget* parent) : QWidget(parent)
|
||||||
|
{
|
||||||
|
setAttribute(Qt::WA_Hover); // We need to enable the hover attribute to ensure that hover events are handled.
|
||||||
|
}
|
||||||
|
|
||||||
|
flow_widget_item::~flow_widget_item()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void flow_widget_item::polish_style()
|
void flow_widget_item::polish_style()
|
||||||
{
|
{
|
||||||
style()->unpolish(this);
|
style()->unpolish(this);
|
||||||
|
|
|
@ -25,7 +25,8 @@ class flow_widget_item : public QWidget
|
||||||
Q_PROPERTY(bool selected MEMBER selected) // Stylesheet workaround for descendants with parent pseudo state
|
Q_PROPERTY(bool selected MEMBER selected) // Stylesheet workaround for descendants with parent pseudo state
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using QWidget::QWidget;
|
flow_widget_item(QWidget* parent);
|
||||||
|
virtual ~flow_widget_item();
|
||||||
|
|
||||||
virtual void polish_style();
|
virtual void polish_style();
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ game_list_grid_item::game_list_grid_item(QWidget* parent, game_info game, const
|
||||||
: flow_widget_item(parent), movie_item_base(), m_game(std::move(game))
|
: flow_widget_item(parent), movie_item_base(), m_game(std::move(game))
|
||||||
{
|
{
|
||||||
setObjectName("game_list_grid_item");
|
setObjectName("game_list_grid_item");
|
||||||
|
setAttribute(Qt::WA_Hover); // We need to enable the hover attribute to ensure that hover events are handled.
|
||||||
|
|
||||||
cb_on_first_visibility = [this]()
|
cb_on_first_visibility = [this]()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue