File indexing completed on 2024-04-28 04:41:52
0001 /*************************************************************************** 0002 * Copyright (C) 2019 by Emmanuel Lepage Vallee * 0003 * Author : Emmanuel Lepage Vallee <emmanuel.lepage@kde.org> * 0004 * * 0005 * This program is free software; you can redistribute it and/or modify * 0006 * it under the terms of the GNU General Public License as published by * 0007 * the Free Software Foundation; either version 3 of the License, or * 0008 * (at your option) any later version. * 0009 * * 0010 * This program is distributed in the hope that it will be useful, * 0011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 0013 * GNU General Public License for more details. * 0014 * * 0015 * You should have received a copy of the GNU General Public License * 0016 * along with this program. If not, see <http://www.gnu.org/licenses/>. * 0017 **************************************************************************/ 0018 #ifndef SIZEHINTVIEW_H 0019 #define SIZEHINTVIEW_H 0020 0021 #include <KQuickItemViews/singlemodelviewbase.h> 0022 0023 // KQuickItemViews 0024 class SizeHintViewPrivate; 0025 0026 /** 0027 * This view uses the Qt::SizeHintRole for both the size and position of an 0028 * index delegate instance. It assumes the model (or proxy) has all the logic 0029 * to handle this. 0030 * 0031 * It can also be used as a base for more complex models with their own built-in 0032 * proxy. In some case it can be preferable over implementing a GeometryAdapter. 0033 * For example if the proxy already exists or has tightly coupled interaction 0034 * with more roles (or filters). 0035 */ 0036 class Q_DECL_EXPORT SizeHintView : public SingleModelViewBase //TODO use ViewBase 0037 { 0038 Q_OBJECT 0039 friend class SizeHintViewItem; 0040 public: 0041 explicit SizeHintView(QQuickItem* parent = nullptr); 0042 virtual ~SizeHintView(); 0043 0044 private: 0045 SizeHintViewPrivate* d_ptr; 0046 Q_DECLARE_PRIVATE(SizeHintView) 0047 }; 0048 0049 #endif