File indexing completed on 2024-09-01 13:31:29
0001 /* 0002 This file is part of the KDE libraries 0003 SPDX-FileCopyrightText: 2010 Teo Mrnjavac <teo@kde.org> 0004 0005 SPDX-License-Identifier: LGPL-2.1-or-later 0006 */ 0007 0008 #include "kaboutapplicationlistview_p.h" 0009 0010 #include <QScrollBar> 0011 0012 namespace KDEPrivate 0013 { 0014 KAboutApplicationListView::KAboutApplicationListView(QWidget *parent) 0015 : QListView(parent) 0016 { 0017 setVerticalScrollMode(ScrollPerPixel); 0018 setFrameShape(QFrame::NoFrame); 0019 0020 QPalette p = palette(); 0021 QColor c = p.color(QPalette::Base); 0022 c.setAlpha(0); 0023 p.setColor(QPalette::Base, c); 0024 setBackgroundRole(QPalette::Base); 0025 setPalette(p); 0026 setSelectionMode(NoSelection); 0027 setEditTriggers(NoEditTriggers); 0028 } 0029 0030 void KAboutApplicationListView::wheelEvent(QWheelEvent *e) 0031 { 0032 // HACK: Workaround for Qt bug 7232: Smooth scrolling (scroll per pixel) in ItemViews 0033 // does not work as expected. 0034 verticalScrollBar()->setSingleStep(3); 0035 QListView::wheelEvent(e); 0036 } 0037 0038 } // namespace KDEPrivate 0039 0040 #include "moc_kaboutapplicationlistview_p.cpp"