diff options
Diffstat (limited to 'src/selectionmode/singleclickselectionproxystyle.h')
| -rw-r--r-- | src/selectionmode/singleclickselectionproxystyle.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/selectionmode/singleclickselectionproxystyle.h b/src/selectionmode/singleclickselectionproxystyle.h new file mode 100644 index 000000000..9c185a85a --- /dev/null +++ b/src/selectionmode/singleclickselectionproxystyle.h @@ -0,0 +1,29 @@ +/* + This file is part of the KDE project + SPDX-FileCopyrightText: 2020 Felix Ernst <[email protected]> + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#ifndef SINGLECLICKSELECTIONPROXYSTYLE_H +#define SINGLECLICKSELECTIONPROXYSTYLE_H + +#include <QProxyStyle> + +/** + * @todo write docs + */ +class SingleClickSelectionProxyStyle : public QProxyStyle +{ +public: + inline int styleHint(StyleHint hint, const QStyleOption *option = nullptr, + const QWidget *widget = nullptr, QStyleHintReturn *returnData = nullptr) const override + { + if (hint == QStyle::SH_ItemView_ActivateItemOnSingleClick) { + return 0; + } + return QProxyStyle::styleHint(hint, option, widget, returnData); + } +}; + +#endif // SINGLECLICKSELECTIONPROXYSTYLE_H |
