qskinny/src/controls/QskListViewSkinlet.h

61 lines
1.7 KiB
C
Raw Normal View History

2017-07-21 18:21:34 +02:00
/******************************************************************************
* QSkinny - Copyright (C) 2016 Uwe Rathmann
* This file may be used under the terms of the QSkinny License, Version 1.0
*****************************************************************************/
#ifndef QSK_LIST_VIEW_SKINLET_H
#define QSK_LIST_VIEW_SKINLET_H
#include "QskScrollViewSkinlet.h"
class QskListView;
class QskListViewNode;
class QskTextNode;
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:
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;
2018-08-03 08:15:28 +02:00
protected:
2017-07-21 18:21:34 +02:00
enum NodeRole
{
TextRole,
GraphicRole
};
2018-07-31 17:32:25 +02:00
QSGNode* updateContentsNode(
2017-07-21 18:21:34 +02:00
const QskScrollView*, QSGNode* ) const override;
virtual QSGNode* updateCellNode( const QskListView*,
QSGNode*, const QRectF&, int row, int col ) const;
2018-08-03 08:15:28 +02:00
private:
2017-07-21 18:21:34 +02:00
void updateForegroundNodes( const QskListView*, QskListViewNode* ) const;
void updateBackgroundNodes( const QskListView*, QskListViewNode* ) const;
2017-07-30 14:30:50 +02:00
void updateVisibleForegroundNodes(
2017-07-21 18:21:34 +02:00
const QskListView*, QskListViewNode*,
int rowMin, int rowMax, int colMin, int colMax,
const QMarginsF& margin, bool forward ) const;
QSGTransformNode* updateForegroundNode( const QskListView*,
QSGNode* parentNode, QSGTransformNode* cellNode,
int row, int col, const QSizeF&, bool forward ) const;
};
#endif