qskinny/playground/grids/GridGraphics.h

44 lines
1.4 KiB
C
Raw Normal View History

/******************************************************************************
* QSkinny - Copyright (C) 2016 Uwe Rathmann
* This file may be used under the terms of the 3-clause BSD License
*****************************************************************************/
#ifndef GRID_GRAPHICS_H
#define GRID_GRAPHICS_H
#include "GridAccessor.h"
#include <QGraphicsView>
class QGraphicsGridLayout;
class GridGraphics : public QGraphicsView, public GridAccessor
{
public:
GridGraphics( QWidget* parent = nullptr );
~GridGraphics() override;
void insert( const QByteArray& colorName,
int row, int column, int rowSpan, int columnSpan ) override;
void setSpacing( Qt::Orientations, int spacing ) override;
2019-07-23 18:35:51 +02:00
void setStretchFactor( int pos, Qt::Orientation, int stretch ) override;
void setSizeHint( int pos, Qt::Orientation, Qt::SizeHint, int hint ) override;
2019-07-23 18:35:51 +02:00
void setSizeHintAt( int index, Qt::Orientation, Qt::SizeHint, int hint ) override;
void setSizePolicyAt( int index, Qt::Orientation, int policy ) override;
void setAlignmentAt( int index, Qt::Alignment ) override;
void setRetainSizeWhenHiddenAt( int index, bool on ) override;
2019-07-25 18:39:50 +02:00
void setVisibleAt( int index, bool on ) override;
QSize preferredSize() const override;
protected:
void resizeEvent( QResizeEvent* ) override;
private:
QGraphicsGridLayout* m_layout;
};
#endif