qskinny/src/controls/QskListViewSkinlet.h

66 lines
1.8 KiB
C
Raw Normal View History

2017-07-21 18:21:34 +02:00
/******************************************************************************
* QSkinny - Copyright (C) 2016 Uwe Rathmann
2023-04-06 09:23:37 +02:00
* SPDX-License-Identifier: BSD-3-Clause
2017-07-21 18:21:34 +02:00
*****************************************************************************/
#ifndef QSK_LIST_VIEW_SKINLET_H
#define QSK_LIST_VIEW_SKINLET_H
#include "QskScrollViewSkinlet.h"
class QskListView;
class QMarginsF;
class QSizeF;
class QRectF;
class QSGTransformNode;
class QSK_EXPORT QskListViewSkinlet : public QskScrollViewSkinlet
{
Q_GADGET
using Inherited = QskScrollViewSkinlet;
2018-08-03 08:15:28 +02:00
public:
enum NodeRole
{
2023-10-15 15:43:29 +02:00
TextRole = Inherited::RoleCount,
GraphicRole,
RoleCount
};
2017-07-21 18:21:34 +02:00
Q_INVOKABLE QskListViewSkinlet( QskSkin* = nullptr );
2018-07-31 17:32:25 +02:00
~QskListViewSkinlet() override;
2017-07-21 18:21:34 +02:00
QSizeF sizeHint( const QskSkinnable*,
Qt::SizeHint, const QSizeF& ) const override;
2023-07-18 16:18:36 +02:00
QRectF sampleRect( const QskSkinnable*,
const QRectF&, QskAspect::Subcontrol, int index ) const override;
QskAspect::States sampleStates( const QskSkinnable*,
QskAspect::Subcontrol, int index ) const override;
2018-08-03 08:15:28 +02:00
protected:
2018-07-31 17:32:25 +02:00
QSGNode* updateContentsNode(
2017-07-21 18:21:34 +02:00
const QskScrollView*, QSGNode* ) const override;
2018-08-03 08:15:28 +02:00
private:
void updateForegroundNodes( const QskListView*, QSGNode* ) const;
void updateBackgroundNodes( const QskListView*, QSGNode* ) const;
2017-07-21 18:21:34 +02:00
2017-07-30 14:30:50 +02:00
void updateVisibleForegroundNodes(
const QskListView*, QSGNode*,
int rowMin, int rowMax, const QMarginsF& margin ) const;
2017-07-21 18:21:34 +02:00
QSGTransformNode* updateForegroundNode( const QskListView*,
QSGNode* parentNode, QSGTransformNode* cellNode,
int row, int col, const QSizeF& ) const;
QSGNode* updateCellNode( const QskListView*,
QSGNode*, const QRectF&, int row, int col ) const;
2017-07-21 18:21:34 +02:00
};
#endif