X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/e348bc58267b3dc06f2fc044f9e5ce5a5dfcd087..edced8460b:/src/kitemviews/private/kitemlistviewlayouter.h diff --git a/src/kitemviews/private/kitemlistviewlayouter.h b/src/kitemviews/private/kitemlistviewlayouter.h index 5ca73e1ad..d5dc6dae1 100644 --- a/src/kitemviews/private/kitemlistviewlayouter.h +++ b/src/kitemviews/private/kitemlistviewlayouter.h @@ -1,31 +1,19 @@ -/*************************************************************************** - * Copyright (C) 2011 by Peter Penz * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - ***************************************************************************/ +/* + * SPDX-FileCopyrightText: 2011 Peter Penz + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ #ifndef KITEMLISTVIEWLAYOUTER_H #define KITEMLISTVIEWLAYOUTER_H -#include +#include "dolphin_export.h" #include #include #include #include +#include class KItemModelBase; class KItemListSizeHintResolver; @@ -44,13 +32,13 @@ class KItemListSizeHintResolver; * changing properties of the layouter is not expensive, only the * first read of a property can get expensive. */ -class LIBDOLPHINPRIVATE_EXPORT KItemListViewLayouter : public QObject +class DOLPHIN_EXPORT KItemListViewLayouter : public QObject { Q_OBJECT public: - KItemListViewLayouter(QObject* parent = 0); - virtual ~KItemListViewLayouter(); + explicit KItemListViewLayouter(KItemListSizeHintResolver* sizeHintResolver, QObject* parent = nullptr); + ~KItemListViewLayouter() override; void setScrollOrientation(Qt::Orientation orientation); Qt::Orientation scrollOrientation() const; @@ -102,9 +90,6 @@ public: void setModel(const KItemModelBase* model); const KItemModelBase* model() const; - void setSizeHintResolver(const KItemListSizeHintResolver* sizeHintResolver); - const KItemListSizeHintResolver* sizeHintResolver() const; - /** * @return The first (at least partly) visible index. -1 is returned * if the item count is 0. @@ -204,7 +189,7 @@ private: QSizeF m_itemMargin; qreal m_headerHeight; const KItemModelBase* m_model; - const KItemListSizeHintResolver* m_sizeHintResolver; + KItemListSizeHintResolver* m_sizeHintResolver; qreal m_scrollOffset; qreal m_maximumScrollOffset; @@ -219,6 +204,9 @@ private: qreal m_xPosInc; int m_columnCount; + QVector m_rowOffsets; + QVector m_columnOffsets; + // Stores all item indexes that are the first item of a group. // Assures fast access for KItemListViewLayouter::isFirstGroupItem(). QSet m_groupItemIndexes; @@ -226,11 +214,10 @@ private: qreal m_groupHeaderMargin; struct ItemInfo { - QRectF rect; int column; int row; }; - QList m_itemInfos; + QVector m_itemInfos; friend class KItemListControllerTest; };