1/*
2 This file is part of the KDE libraries
3 SPDX-FileCopyrightText: 2010 Teo Mrnjavac <teo@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.1-or-later
6*/
7
8#include "kaboutapplicationlistview_p.h"
9
10#include <QScrollBar>
11
12namespace KDEPrivate
13{
14KAboutApplicationListView::KAboutApplicationListView(QWidget *parent)
15 : QListView(parent)
16{
17 setVerticalScrollMode(ScrollPerPixel);
18 setFrameShape(QFrame::NoFrame);
19
20 QPalette p = palette();
21 QColor c = p.color(cr: QPalette::Base);
22 c.setAlpha(0);
23 p.setColor(acr: QPalette::Base, acolor: c);
24 setBackgroundRole(QPalette::Base);
25 setPalette(p);
26 setSelectionMode(NoSelection);
27 setEditTriggers(NoEditTriggers);
28}
29
30void KAboutApplicationListView::wheelEvent(QWheelEvent *e)
31{
32 // HACK: Workaround for Qt bug 7232: Smooth scrolling (scroll per pixel) in ItemViews
33 // does not work as expected.
34 verticalScrollBar()->setSingleStep(3);
35 QListView::wheelEvent(e);
36}
37
38} // namespace KDEPrivate
39
40#include "moc_kaboutapplicationlistview_p.cpp"
41

source code of kxmlgui/src/kaboutapplicationlistview_p.cpp