0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00
obs-studio/obs/source-list-widget.hpp
HomeWorld 88333b0f47 UI: Add SourceListWidget - QListWidget subclass
The default behavior of QListWidget is to allow double clicks of any
mouse button, but in certain situations/usage cases this can cause
undesirable results.  As an example: when double-clicking with the right
mouse button on an item in the sources list box, it will open up both
the properties window and the context menu.  Not pretty at all.

This subclass filters out double clicks for any mouse button other than
the left mouse button to fix this issue.
2015-01-05 03:38:18 -08:00

18 lines
285 B
C++

#pragma once
#include <QListWidget>
class QMouseEvent;
class SourceListWidget : public QListWidget {
Q_OBJECT
public:
inline SourceListWidget(QWidget *parent = nullptr)
: QListWidget(parent)
{
}
protected:
virtual void mouseDoubleClickEvent(QMouseEvent *event) override;
};